Changeset a5be8eb2c8 in tspsg
- Timestamp:
- Jan 11, 2010, 8:52:16 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 64f288c0f8
- Parents:
- a2e64d518a
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/settingsdialog.cpp
ra2e64d518a ra5be8eb2c8 35 35 setupUi(this); 36 36 // Laying out elements 37 layoutCitiesLimit = new QHBoxLayout();37 /* layoutCitiesLimit = new QHBoxLayout(); 38 38 layoutCitiesLimit->setMargin(0); 39 39 layoutCitiesLimit->setSpacing(0); … … 42 42 layoutCitiesLimit->addWidget(spinCitiesLimit); 43 43 layoutCitiesLimit->addStretch(); 44 44 */ 45 45 buttonBox->button(QDialogButtonBox::Save)->setIcon(QIcon(":/images/icons/button_ok.png")); 46 46 buttonBox->button(QDialogButtonBox::Save)->setStatusTip(trUtf8("Save new preferences")); … … 52 52 #ifdef Q_OS_WINCE 53 53 // Layout helper elements 54 QVBoxLayout *vbox1, *vbox2; 55 QHBoxLayout *hbox1, *hbox2; 56 57 labelRandMin->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); 58 labelRandMax->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); 59 60 groupRandomSettings->layout()->addWidget(cbFractionalRandom); 61 groupRandomSettings->layout()->setSpacing(2); 62 63 // Top part (with white bg) 64 vbox2 = new QVBoxLayout(bgWhite); 65 vbox2->setSpacing(2); 66 vbox2->addWidget(groupRandomSettings); 67 vbox2->addWidget(groupOutputSettings); 68 vbox2->addStretch(); 69 // vbox2->addWidget(cbFractionalRandom); 70 vbox2->addWidget(cbShowMatrix); 71 vbox2->addLayout(layoutCitiesLimit); 72 vbox2->addWidget(cbScrollToEnd); 73 vbox2->addWidget(cbAutosize); 74 vbox2->addWidget(cbUseNativeDialogs); 75 76 // Output settings group 77 hbox1 = new QHBoxLayout(groupOutputSettings); 78 hbox1->addWidget(buttonFont); 79 hbox1->addWidget(buttonColor); 54 QVBoxLayout *vbox1; 55 QHBoxLayout *hbox1; 56 57 bgWhite->layout()->setMargin(0); 80 58 81 59 // Bottom part (with grey bg) 82 hbox 2= new QHBoxLayout(bgGrey);83 hbox 2->setMargin(6);84 hbox 2->setSpacing(6);85 hbox 2->addWidget(buttonHelp);86 hbox 2->addStretch();87 hbox 2->addWidget(buttonBox);60 hbox1 = new QHBoxLayout(bgGrey); 61 hbox1->setMargin(6); 62 hbox1->setSpacing(6); 63 hbox1->addWidget(buttonHelp); 64 hbox1->addStretch(); 65 hbox1->addWidget(buttonBox); 88 66 89 67 // Central layout … … 96 74 #else 97 75 // Layout helper elements 98 QVBoxLayout *vbox1, *vbox2 , *vbox3;99 QHBoxLayout *hbox1, *hbox2 , *hbox3;76 QVBoxLayout *vbox1, *vbox2; 77 QHBoxLayout *hbox1, *hbox2; 100 78 101 79 cbSaveState = new QCheckBox(bgWhite); … … 142 120 hbox1->addWidget(bgWhite); 143 121 144 // Output settings group 145 vbox3 = new QVBoxLayout(groupOutputSettings); 146 vbox3->addWidget(buttonFont); 147 vbox3->addWidget(buttonColor); 148 149 // Random and Output settings groups 150 hbox2 = new QHBoxLayout(); 151 hbox2->addWidget(groupRandomSettings); 152 hbox2->addWidget(groupOutputSettings); 153 hbox2->addStretch(); 154 155 // Top right part (with white bg) 156 vbox2 = new QVBoxLayout(bgWhite); 157 // vbox2->addStretch(); 158 vbox2->addLayout(hbox2); 159 vbox2->addWidget(cbFractionalRandom); 160 vbox2->addWidget(cbShowMatrix); 161 vbox2->addLayout(layoutCitiesLimit); 162 vbox2->addWidget(cbScrollToEnd); 163 vbox2->addWidget(cbAutosize); 164 vbox2->addWidget(cbUseNativeDialogs); 165 vbox2->addWidget(cbSaveState); 166 vbox2->addStretch(); 122 vbox1 = static_cast<QVBoxLayout *>(tabGeneral->layout()); 123 vbox1->insertWidget(vbox2->indexOf(cbUseNativeDialogs) + 1, cbSaveState); 167 124 168 125 // Bottom part (with grey bg) 169 hbox 3= new QHBoxLayout(bgGrey);170 hbox 3->setMargin(6);171 hbox 3->setSpacing(6);172 hbox 3->addWidget(buttonHelp);173 hbox 3->addWidget(labelHint);174 hbox 3->addWidget(buttonBox);126 hbox2 = new QHBoxLayout(bgGrey); 127 hbox2->setMargin(6); 128 hbox2->setSpacing(6); 129 hbox2->addWidget(buttonHelp); 130 hbox2->addWidget(labelHint); 131 hbox2->addWidget(buttonBox); 175 132 176 133 // Central layout 177 vbox1 = new QVBoxLayout(this); 178 vbox1->setMargin(0); 179 vbox1->setSpacing(0); 180 vbox1->addLayout(hbox1); 181 vbox1->addWidget(lineHorizontal); 182 vbox1->addWidget(bgGrey); 183 #endif // Q_OS_WINCE 134 vbox2 = new QVBoxLayout(this); 135 vbox2->setMargin(0); 136 vbox2->setSpacing(0); 137 vbox2->addLayout(hbox1); 138 vbox2->addWidget(lineHorizontal); 139 vbox2->addWidget(bgGrey); 140 #endif // Q_OS_WINCE 141 184 142 connect(spinRandMin,SIGNAL(valueChanged(int)),this,SLOT(spinRandMinValueChanged(int))); 185 143 connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked())); -
ui/settingsdialog.ui
ra2e64d518a ra5be8eb2c8 152 152 <bool>true</bool> 153 153 </property> 154 <widget class="QGroupBox" name="groupRandomSettings"> 155 <property name="title"> 156 <string>Random values:</string> 157 </property> 158 <layout class="QVBoxLayout"> 159 <item> 160 <layout class="QHBoxLayout" name="_2"> 161 <item> 162 <widget class="QLabel" name="labelRandMin"> 163 <property name="text"> 164 <string>&Minimal:</string> 165 </property> 166 <property name="buddy"> 167 <cstring>spinRandMin</cstring> 168 </property> 169 </widget> 170 </item> 171 <item> 172 <widget class="QSpinBox" name="spinRandMin"> 173 <property name="sizePolicy"> 174 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 175 <horstretch>0</horstretch> 176 <verstretch>0</verstretch> 177 </sizepolicy> 178 </property> 179 <property name="cursor"> 180 <cursorShape>PointingHandCursor</cursorShape> 181 </property> 182 <property name="statusTip"> 183 <string>Minimum for random number generation</string> 184 </property> 185 </widget> 186 </item> 187 </layout> 188 </item> 189 <item> 190 <layout class="QHBoxLayout" name="_3"> 191 <item> 192 <widget class="QLabel" name="labelRandMax"> 193 <property name="text"> 194 <string>Ma&ximal:</string> 195 </property> 196 <property name="buddy"> 197 <cstring>spinRandMax</cstring> 198 </property> 199 </widget> 200 </item> 201 <item> 202 <widget class="QSpinBox" name="spinRandMax"> 203 <property name="sizePolicy"> 204 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 205 <horstretch>0</horstretch> 206 <verstretch>0</verstretch> 207 </sizepolicy> 208 </property> 209 <property name="cursor"> 210 <cursorShape>PointingHandCursor</cursorShape> 211 </property> 212 <property name="statusTip"> 213 <string>Maximum for random number generation</string> 214 </property> 215 </widget> 216 </item> 217 </layout> 218 </item> 219 </layout> 220 </widget> 221 <widget class="QGroupBox" name="groupOutputSettings"> 222 <property name="title"> 223 <string>Output settings:</string> 224 </property> 225 <widget class="QPushButton" name="buttonFont"> 226 <property name="cursor"> 227 <cursorShape>PointingHandCursor</cursorShape> 228 </property> 229 <property name="statusTip"> 230 <string>Font face for printing</string> 231 </property> 232 <property name="text"> 233 <string>&Font...</string> 234 </property> 235 <property name="icon"> 236 <iconset resource="../resources/tspsg.qrc"> 237 <normaloff>:/images/icons/fonts.png</normaloff>:/images/icons/fonts.png</iconset> 238 </property> 239 </widget> 240 <widget class="QPushButton" name="buttonColor"> 241 <property name="cursor"> 242 <cursorShape>PointingHandCursor</cursorShape> 243 </property> 244 <property name="statusTip"> 245 <string>Font color for printing</string> 246 </property> 247 <property name="text"> 248 <string>&Color...</string> 249 </property> 250 <property name="icon"> 251 <iconset resource="../resources/tspsg.qrc"> 252 <normaloff>:/images/icons/color_line.png</normaloff>:/images/icons/color_line.png</iconset> 253 </property> 254 </widget> 255 </widget> 256 <widget class="QCheckBox" name="cbAutosize"> 257 <property name="cursor"> 258 <cursorShape>PointingHandCursor</cursorShape> 259 </property> 260 <property name="statusTip"> 261 <string>Automatically resize rows and columns to their contents</string> 262 </property> 263 <property name="text"> 264 <string>Autosize of rows and columns</string> 265 </property> 266 </widget> 267 <widget class="QCheckBox" name="cbShowMatrix"> 268 <property name="cursor"> 269 <cursorShape>PointingHandCursor</cursorShape> 270 </property> 271 <property name="statusTip"> 272 <string>Show solution steps' matrices for every solution step</string> 273 </property> 274 <property name="text"> 275 <string>Show solution steps' matrices</string> 276 </property> 277 </widget> 278 <widget class="QCheckBox" name="cbCitiesLimit"> 279 <property name="cursor"> 280 <cursorShape>PointingHandCursor</cursorShape> 281 </property> 282 <property name="statusTip"> 283 <string>Show or hide solution steps' matrices based on number of cities in the task</string> 284 </property> 285 <property name="text"> 286 <string>Only when <=</string> 287 </property> 288 </widget> 289 <widget class="QSpinBox" name="spinCitiesLimit"> 290 <property name="statusTip"> 291 <string>Maximum number of cities to show solution steps' matrices</string> 292 </property> 293 <property name="suffix"> 294 <string comment="Don't forget a space at the beginning!"> cities</string> 295 </property> 296 <property name="minimum"> 297 <number>1</number> 298 </property> 299 </widget> 300 <widget class="QCheckBox" name="cbFractionalRandom"> 301 <property name="cursor"> 302 <cursorShape>PointingHandCursor</cursorShape> 303 </property> 304 <property name="statusTip"> 305 <string>Generate fractional random values with the accuracy of 2 decimal places</string> 306 </property> 307 <property name="text"> 308 <string>Fractional random values</string> 309 </property> 310 </widget> 311 <widget class="QCheckBox" name="cbScrollToEnd"> 312 <property name="cursor"> 313 <cursorShape>PointingHandCursor</cursorShape> 314 </property> 315 <property name="statusTip"> 316 <string>Scroll to the end of solution output after solving</string> 317 </property> 318 <property name="text"> 319 <string>Scroll to solution end</string> 320 </property> 321 </widget> 322 <widget class="QCheckBox" name="cbUseNativeDialogs"> 323 <property name="cursor"> 324 <cursorShape>PointingHandCursor</cursorShape> 325 </property> 326 <property name="statusTip"> 327 <string>Use native File Open and File Save dialogs (uncheck to use Qt's File Dialogs)</string> 328 </property> 329 <property name="text"> 330 <string>Use native file dialogs</string> 331 </property> 332 </widget> 154 <layout class="QVBoxLayout" name="verticalLayout_3"> 155 <item> 156 <widget class="QTabWidget" name="tabWidget"> 157 <property name="currentIndex"> 158 <number>0</number> 159 </property> 160 <widget class="QWidget" name="tabGeneral"> 161 <attribute name="title"> 162 <string>General</string> 163 </attribute> 164 <attribute name="toolTip"> 165 <string>General TSPSG settings</string> 166 </attribute> 167 <layout class="QVBoxLayout" name="verticalLayout_2"> 168 <item> 169 <widget class="QCheckBox" name="cbAutosize"> 170 <property name="cursor"> 171 <cursorShape>PointingHandCursor</cursorShape> 172 </property> 173 <property name="statusTip"> 174 <string>Automatically resize rows and columns to their contents</string> 175 </property> 176 <property name="text"> 177 <string>Autosize of rows and columns</string> 178 </property> 179 </widget> 180 </item> 181 <item> 182 <widget class="QCheckBox" name="cbUseNativeDialogs"> 183 <property name="cursor"> 184 <cursorShape>PointingHandCursor</cursorShape> 185 </property> 186 <property name="statusTip"> 187 <string>Use native File Open and File Save dialogs (uncheck to use Qt's Dialogs)</string> 188 </property> 189 <property name="text"> 190 <string>Use native file dialogs</string> 191 </property> 192 </widget> 193 </item> 194 <item> 195 <spacer name="verticalSpacer_2"> 196 <property name="orientation"> 197 <enum>Qt::Vertical</enum> 198 </property> 199 <property name="sizeHint" stdset="0"> 200 <size> 201 <width>0</width> 202 <height>0</height> 203 </size> 204 </property> 205 </spacer> 206 </item> 207 </layout> 208 </widget> 209 <widget class="QWidget" name="tabRandom"> 210 <attribute name="title"> 211 <string>Random</string> 212 </attribute> 213 <attribute name="toolTip"> 214 <string>Random number generation settings</string> 215 </attribute> 216 <layout class="QVBoxLayout" name="verticalLayout_4"> 217 <item> 218 <layout class="QHBoxLayout" name="horizontalLayout_2"> 219 <item> 220 <layout class="QFormLayout" name="formLayout"> 221 <item row="0" column="0"> 222 <widget class="QLabel" name="labelRandMin"> 223 <property name="text"> 224 <string>&Minimal:</string> 225 </property> 226 <property name="buddy"> 227 <cstring>spinRandMin</cstring> 228 </property> 229 </widget> 230 </item> 231 <item row="0" column="1"> 232 <widget class="QSpinBox" name="spinRandMin"> 233 <property name="cursor"> 234 <cursorShape>PointingHandCursor</cursorShape> 235 </property> 236 <property name="statusTip"> 237 <string>Minimum for random number generation</string> 238 </property> 239 </widget> 240 </item> 241 <item row="1" column="0"> 242 <widget class="QLabel" name="labelRandMax"> 243 <property name="text"> 244 <string>Ma&ximal:</string> 245 </property> 246 <property name="buddy"> 247 <cstring>spinRandMax</cstring> 248 </property> 249 </widget> 250 </item> 251 <item row="1" column="1"> 252 <widget class="QSpinBox" name="spinRandMax"> 253 <property name="cursor"> 254 <cursorShape>PointingHandCursor</cursorShape> 255 </property> 256 <property name="statusTip"> 257 <string>Maximum for random number generation</string> 258 </property> 259 </widget> 260 </item> 261 </layout> 262 </item> 263 <item> 264 <spacer name="horizontalSpacer_5"> 265 <property name="orientation"> 266 <enum>Qt::Horizontal</enum> 267 </property> 268 <property name="sizeHint" stdset="0"> 269 <size> 270 <width>10</width> 271 <height>0</height> 272 </size> 273 </property> 274 </spacer> 275 </item> 276 </layout> 277 </item> 278 <item> 279 <widget class="QCheckBox" name="cbFractionalRandom"> 280 <property name="cursor"> 281 <cursorShape>PointingHandCursor</cursorShape> 282 </property> 283 <property name="statusTip"> 284 <string>Generate fractional random values with the accuracy of 2 decimal places</string> 285 </property> 286 <property name="text"> 287 <string>Fractional random values</string> 288 </property> 289 </widget> 290 </item> 291 <item> 292 <spacer name="verticalSpacer_3"> 293 <property name="orientation"> 294 <enum>Qt::Vertical</enum> 295 </property> 296 <property name="sizeHint" stdset="0"> 297 <size> 298 <width>0</width> 299 <height>25</height> 300 </size> 301 </property> 302 </spacer> 303 </item> 304 </layout> 305 </widget> 306 <widget class="QWidget" name="tabOutput"> 307 <attribute name="title"> 308 <string>Output</string> 309 </attribute> 310 <attribute name="toolTip"> 311 <string>Solution output settings</string> 312 </attribute> 313 <layout class="QVBoxLayout" name="verticalLayout"> 314 <item> 315 <widget class="QCheckBox" name="cbShowMatrix"> 316 <property name="cursor"> 317 <cursorShape>PointingHandCursor</cursorShape> 318 </property> 319 <property name="statusTip"> 320 <string>Show solution steps' matrices for every solution step</string> 321 </property> 322 <property name="text"> 323 <string>Show solution steps' matrices</string> 324 </property> 325 </widget> 326 </item> 327 <item> 328 <layout class="QHBoxLayout" name="layoutCititesLimit"> 329 <property name="spacing"> 330 <number>0</number> 331 </property> 332 <item> 333 <spacer name="horizontalSpacer_3"> 334 <property name="orientation"> 335 <enum>Qt::Horizontal</enum> 336 </property> 337 <property name="sizeType"> 338 <enum>QSizePolicy::Fixed</enum> 339 </property> 340 <property name="sizeHint" stdset="0"> 341 <size> 342 <width>10</width> 343 <height>0</height> 344 </size> 345 </property> 346 </spacer> 347 </item> 348 <item> 349 <widget class="QCheckBox" name="cbCitiesLimit"> 350 <property name="cursor"> 351 <cursorShape>PointingHandCursor</cursorShape> 352 </property> 353 <property name="statusTip"> 354 <string>Show or hide solution steps' matrices based on number of cities in the task</string> 355 </property> 356 <property name="text"> 357 <string>Only when <=</string> 358 </property> 359 </widget> 360 </item> 361 <item> 362 <widget class="QSpinBox" name="spinCitiesLimit"> 363 <property name="statusTip"> 364 <string>Maximum number of cities to show solution steps' matrices</string> 365 </property> 366 <property name="suffix"> 367 <string comment="Don't forget a space at the beginning!"> cities</string> 368 </property> 369 <property name="minimum"> 370 <number>1</number> 371 </property> 372 </widget> 373 </item> 374 <item> 375 <spacer name="horizontalSpacer_4"> 376 <property name="orientation"> 377 <enum>Qt::Horizontal</enum> 378 </property> 379 <property name="sizeHint" stdset="0"> 380 <size> 381 <width>0</width> 382 <height>0</height> 383 </size> 384 </property> 385 </spacer> 386 </item> 387 </layout> 388 </item> 389 <item> 390 <widget class="QCheckBox" name="cbScrollToEnd"> 391 <property name="cursor"> 392 <cursorShape>PointingHandCursor</cursorShape> 393 </property> 394 <property name="statusTip"> 395 <string>Scroll to the end of solution output after solving</string> 396 </property> 397 <property name="text"> 398 <string>Scroll to solution end</string> 399 </property> 400 </widget> 401 </item> 402 <item> 403 <layout class="QHBoxLayout" name="horizontalLayout"> 404 <item> 405 <widget class="QPushButton" name="buttonFont"> 406 <property name="cursor"> 407 <cursorShape>PointingHandCursor</cursorShape> 408 </property> 409 <property name="statusTip"> 410 <string>Font face for solution output</string> 411 </property> 412 <property name="text"> 413 <string>&Font...</string> 414 </property> 415 <property name="icon"> 416 <iconset resource="../resources/tspsg.qrc"> 417 <normaloff>:/images/icons/fonts.png</normaloff>:/images/icons/fonts.png</iconset> 418 </property> 419 </widget> 420 </item> 421 <item> 422 <widget class="QPushButton" name="buttonColor"> 423 <property name="cursor"> 424 <cursorShape>PointingHandCursor</cursorShape> 425 </property> 426 <property name="statusTip"> 427 <string>Font color for solution output</string> 428 </property> 429 <property name="text"> 430 <string>&Color...</string> 431 </property> 432 <property name="icon"> 433 <iconset resource="../resources/tspsg.qrc"> 434 <normaloff>:/images/icons/color_line.png</normaloff>:/images/icons/color_line.png</iconset> 435 </property> 436 </widget> 437 </item> 438 <item> 439 <spacer name="horizontalSpacer_2"> 440 <property name="orientation"> 441 <enum>Qt::Horizontal</enum> 442 </property> 443 <property name="sizeHint" stdset="0"> 444 <size> 445 <width>0</width> 446 <height>0</height> 447 </size> 448 </property> 449 </spacer> 450 </item> 451 </layout> 452 </item> 453 <item> 454 <spacer name="verticalSpacer"> 455 <property name="orientation"> 456 <enum>Qt::Vertical</enum> 457 </property> 458 <property name="sizeHint" stdset="0"> 459 <size> 460 <width>0</width> 461 <height>0</height> 462 </size> 463 </property> 464 </spacer> 465 </item> 466 </layout> 467 </widget> 468 </widget> 469 </item> 470 </layout> 333 471 </widget> 334 472 </widget>
Note: See TracChangeset
for help on using the changeset viewer.