- Timestamp:
- Nov 12, 2007, 4:42:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
r595 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLQtExportDialog.cc,v 1. 2 2007/11/08 17:00:51 lgarnier Exp $27 // $Id: G4OpenGLQtExportDialog.cc,v 1.3 2007/11/09 15:03:21 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 54 54 : QDialog( parent ) 55 55 { 56 #if QT_VERSION < 0x040000 57 setCaption( tr( " Export options" )); 58 #else 56 59 setWindowTitle( tr( " Export options" )); 60 #endif 57 61 originalWidth = aWidth; 58 62 originalHeight = aHeight; … … 66 70 67 71 // global layout 72 #if QT_VERSION < 0x040000 73 QVBoxLayout* globalVLayout = new QVBoxLayout(this); 74 #else 68 75 QVBoxLayout* globalVLayout = new QVBoxLayout(); 76 #endif 69 77 70 78 … … 73 81 74 82 QGroupBox *imageGroupBox = new QGroupBox(tr("Image quality")); 83 #if QT_VERSION < 0x040000 84 QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout(imageGroupBox); 85 #else 75 86 QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout; 76 87 #endif 77 88 QWidget *sliderBox = new QWidget; 89 90 #if QT_VERSION < 0x040000 91 QHBoxLayout *hSlider = new QHBoxLayout(sliderBox); 92 #else 78 93 QHBoxLayout *hSlider = new QHBoxLayout; 94 #endif 95 79 96 // qualityLabel = new QLabel( tr( "Image quality" ) ); 80 97 // imageGroupBoxLayout->addWidget(qualityLabel); 81 qualitySlider= new QSlider(Qt::Horizontal); 98 qualitySlider= new QSlider(Qt::Horizontal,0); 99 #if QT_VERSION < 0x040000 100 qualitySlider->setMinValue(0); 101 qualitySlider->setMaxValue(100); 102 qualitySlider->setTickmarks(QSlider::Below); 103 #else 82 104 qualitySlider->setMinimum(0); 83 105 qualitySlider->setMaximum(100); 84 106 qualitySlider->setTickPosition(QSlider::TicksBelow); 107 #endif 85 108 qualitySlider->setValue(60); 86 hSlider->addWidget(new QLabel("low" ));109 hSlider->addWidget(new QLabel("low",0)); 87 110 hSlider->addWidget(qualitySlider); 88 hSlider->addWidget(new QLabel("Maximum")); 111 hSlider->addWidget(new QLabel("Maximum",0)); 112 #if QT_VERSION >= 0x040000 89 113 sliderBox->setLayout(hSlider); 114 #endif 90 115 imageGroupBoxLayout->addWidget(sliderBox); 91 116 117 #if QT_VERSION >= 0x040000 92 118 imageGroupBox->setLayout(imageGroupBoxLayout); 119 #endif 93 120 globalVLayout->addWidget(imageGroupBox); 94 121 } … … 96 123 if(nomFich.endsWith(".eps")) { 97 124 QGroupBox *EPSGroupBox = new QGroupBox(tr("EPS options")); 125 126 #if QT_VERSION < 0x040000 127 QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout(EPSGroupBox); 128 #else 98 129 QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout; 130 #endif 99 131 100 132 // transparencyEPS = new QCheckBox( "transparencyEPS" ); … … 102 134 // transparencyEPS->setChecked( true ); 103 135 104 colorButton = new QRadioButton("Color" );105 BWButton = new QRadioButton("Grayscale" );136 colorButton = new QRadioButton("Color",0); 137 BWButton = new QRadioButton("Grayscale",0); 106 138 colorButton->setChecked( true ); 107 139 BWButton->setChecked( false ); … … 111 143 EPSGroupBoxLayout->addWidget(colorButton); 112 144 EPSGroupBoxLayout->addWidget(BWButton); 145 #if QT_VERSION >= 0x040000 113 146 EPSGroupBox->setLayout(EPSGroupBoxLayout); 147 #endif 114 148 globalVLayout->addWidget(EPSGroupBox); 115 149 … … 123 157 124 158 QGroupBox *transparencyGroupBox = new QGroupBox(tr("Transparency")); 159 #if QT_VERSION < 0x040000 160 QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout(transparencyGroupBox); 161 #else 125 162 QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout; 126 127 boxTransparency = new QCheckBox("Save transparency"); 163 #endif 164 165 boxTransparency = new QCheckBox("Save transparency",0); 128 166 boxTransparency->setChecked( false ); 129 167 // boxTransparency->setEnabled(false); 130 168 131 169 transparencyGroupBoxLayout->addWidget(boxTransparency); 170 #if QT_VERSION >= 0x040000 132 171 transparencyGroupBox->setLayout(transparencyGroupBoxLayout); 172 #endif 133 173 globalVLayout->addWidget(transparencyGroupBox); 134 174 … … 137 177 // size box 138 178 QGroupBox *sizeGroupBox = new QGroupBox(tr("Size")); 179 QWidget* modifyAndRatioWidget = new QWidget; 180 181 #if QT_VERSION < 0x040000 182 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout(modifyAndRatioWidget); 183 QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout(sizeGroupBox); 184 #else 185 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout; 139 186 QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout; 140 141 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout; 142 QWidget* modifyAndRatioWidget = new QWidget; 187 #endif 143 188 144 189 // original button 145 original = new QRadioButton("Original" );190 original = new QRadioButton("Original",0); 146 191 original->setChecked( true ); 147 192 sizeGroupBoxLayout->addWidget(original); 148 193 149 194 // modify and ratio 150 modify = new QRadioButton("Modify" );195 modify = new QRadioButton("Modify",0); 151 196 modify->setChecked( false ); 152 197 153 ratioCheckBox = new QCheckBox( "Keep ratio" );198 ratioCheckBox = new QCheckBox( "Keep ratio",0 ); 154 199 ratioCheckBox->setChecked( true ); 155 200 156 201 modifyAndRatioLayout->addWidget(modify); 157 202 modifyAndRatioLayout->addWidget(ratioCheckBox); 203 #if QT_VERSION >= 0x040000 158 204 modifyAndRatioWidget->setLayout(modifyAndRatioLayout); 205 #endif 159 206 sizeGroupBoxLayout->addWidget(modifyAndRatioWidget); 160 ratioCheckBox->setVisible(modify->isChecked()); 207 if (modify->isChecked()) { 208 ratioCheckBox->show(); 209 } else { 210 ratioCheckBox->hide(); 211 } 161 212 162 213 connect( original, SIGNAL( clicked(bool) ), this, SLOT( changeSizeBox(true)) ); … … 164 215 165 216 // height 217 heightWidget = new QWidget; 218 219 #if QT_VERSION < 0x040000 220 QHBoxLayout *heightLineLayout = new QHBoxLayout(heightWidget); 221 #else 166 222 QHBoxLayout *heightLineLayout = new QHBoxLayout; 167 heightWidget = new QWidget; 223 #endif 224 168 225 QString tmp; 169 226 170 heightLineLayout->addWidget(new QLabel("Height" ));171 height = new QLineEdit(tmp.setNum(originalHeight) );227 heightLineLayout->addWidget(new QLabel("Height",0)); 228 height = new QLineEdit(tmp.setNum(originalHeight),0); 172 229 height->setMaxLength(5); 173 230 heightLineLayout->addWidget(height); 231 #if QT_VERSION >= 0x040000 174 232 heightWidget->setLayout(heightLineLayout); 233 #endif 175 234 sizeGroupBoxLayout->addWidget(heightWidget); 176 235 connect( height, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textHeightChanged(const QString &) ) ); … … 178 237 179 238 // width 239 widthWidget = new QWidget; 240 241 #if QT_VERSION < 0x040000 242 QHBoxLayout *widthLineLayout = new QHBoxLayout(widthWidget); 243 #else 180 244 QHBoxLayout *widthLineLayout = new QHBoxLayout; 181 widthWidget = new QWidget; 182 183 widthLineLayout->addWidget(new QLabel("Width " ));184 width = new QLineEdit(tmp.setNum(originalWidth) );245 #endif 246 247 widthLineLayout->addWidget(new QLabel("Width ",0)); 248 width = new QLineEdit(tmp.setNum(originalWidth),0); 185 249 width->setMaxLength(5); 186 250 widthLineLayout->addWidget(width); 251 #if QT_VERSION >= 0x040000 187 252 widthWidget->setLayout(widthLineLayout); 253 #endif 188 254 sizeGroupBoxLayout->addWidget(widthWidget); 189 255 connect( width, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textWidthChanged(const QString &) ) ); 190 256 257 #if QT_VERSION >= 0x040000 191 258 sizeGroupBox->setLayout(sizeGroupBoxLayout); 259 #endif 192 260 globalVLayout->addWidget(sizeGroupBox); 193 261 194 heightWidget-> setVisible(false);195 widthWidget-> setVisible(false);262 heightWidget->hide(); 263 widthWidget->hide(); 196 264 197 265 // button ok/cancel box 198 266 199 267 QGroupBox *buttonGroupBox = new QGroupBox(); 268 269 #if QT_VERSION < 0x040000 270 QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout(buttonGroupBox); 271 #else 200 272 QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout; 201 202 buttonOk = new QPushButton( tr( "&OK" ) ); 273 #endif 274 275 buttonOk = new QPushButton( tr( "&OK" ),0 ); 203 276 buttonOk->setAutoDefault( TRUE ); 204 277 buttonOk->setDefault( TRUE ); 205 278 buttonGroupBoxLayout->addWidget(buttonOk); 206 279 207 buttonCancel = new QPushButton( tr( "&Cancel" ) );280 buttonCancel = new QPushButton( tr( "&Cancel" ),0 ); 208 281 buttonCancel->setAutoDefault( TRUE ); 209 282 buttonGroupBoxLayout->addWidget(buttonCancel); 210 283 284 #if QT_VERSION >= 0x040000 211 285 buttonGroupBox->setLayout(buttonGroupBoxLayout); 286 #endif 212 287 globalVLayout->addWidget(buttonGroupBox); 213 288 214 289 290 #if QT_VERSION >= 0x040000 215 291 setLayout(globalVLayout); 292 #endif 216 293 217 294 // signals and slots connections … … 264 341 } 265 342 if ( original->isChecked()) { 266 heightWidget-> setVisible(false);267 widthWidget-> setVisible(false);268 ratioCheckBox-> setVisible(false);343 heightWidget->hide(); 344 widthWidget->hide(); 345 ratioCheckBox->hide(); 269 346 } else { 270 heightWidget->s etVisible(true);271 widthWidget->s etVisible(true);272 ratioCheckBox->s etVisible(true);347 heightWidget->show(); 348 widthWidget->show(); 349 ratioCheckBox->show(); 273 350 } 274 351 }
Note: See TracChangeset
for help on using the changeset viewer.