Changeset 56 in tspsg-svn for trunk/src/settingsdialog.cpp
- Timestamp:
- Aug 21, 2009, 2:28:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/settingsdialog.cpp
r42 r56 28 28 { 29 29 setupUi(this); 30 // Laying out elements 31 #ifdef Q_OS_WINCE 32 // Layout helper elements 33 QVBoxLayout *vbox1, *vbox2; 34 QHBoxLayout *hbox1, *hbox2; 35 QSpacerItem *spacer; 36 37 labelRandMin->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); 38 labelRandMax->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); 39 40 // Top part (with white bg) 41 vbox2 = new QVBoxLayout(bgWhite); 42 vbox2->addWidget(groupRandomSettings); 43 vbox2->addWidget(groupOutputSettings); 44 spacer = new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding); 45 vbox2->addItem(spacer); 46 47 // Output settings group 48 hbox1 = new QHBoxLayout(groupOutputSettings); 49 hbox1->addWidget(buttonFont); 50 hbox1->addWidget(buttonColor); 51 52 // Bottom part (with grey bg) 53 hbox2 = new QHBoxLayout(bgGrey); 54 hbox2->setMargin(6); 55 hbox2->setSpacing(6); 56 hbox2->addWidget(buttonHelp); 57 spacer = new QSpacerItem(0,0,QSizePolicy::Expanding); 58 hbox2->addItem(spacer); 59 hbox2->addWidget(buttonOK); 60 hbox2->addWidget(buttonCancel); 61 62 // Central layout 63 vbox1 = new QVBoxLayout(this); 64 vbox1->setMargin(0); 65 vbox1->setSpacing(0); 66 vbox1->addWidget(bgWhite); 67 vbox1->addWidget(lineHorizontal); 68 vbox1->addWidget(bgGrey); 69 #else 70 // Layout helper elements 71 QVBoxLayout *vbox1, *vbox2, *vbox3; 72 QHBoxLayout *hbox1, *hbox2, *hbox3; 73 QSpacerItem *spacer; 74 75 cbSaveState = new QCheckBox(bgWhite); 76 cbSaveState->setObjectName("cbSaveState"); 77 #ifndef QT_NO_STATUSTIP 78 cbSaveState->setStatusTip(trUtf8("Restore main window state and position on application restart")); 79 #endif // QT_NO_STATUSTIP 80 cbSaveState->setText(trUtf8("Save main window state and position")); 81 cbSaveState->setCursor(QCursor(Qt::PointingHandCursor)); 82 83 imgIcon = new QLabel(this); 84 imgIcon->setObjectName("imgIcon"); 85 imgIcon->setFrameShape(QFrame::StyledPanel); 86 imgIcon->setLineWidth(0); 87 imgIcon->setPixmap(QPixmap(QString::fromUtf8(":/images/icons/preferences_system.png"))); 88 imgIcon->setStyleSheet("background-color: #0080C0;"); 89 imgIcon->setAlignment(Qt::AlignCenter); 90 91 labelHint = new QLabel(bgGrey); 92 labelHint->setObjectName("labelHint"); 93 labelHint->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); 94 labelHint->setMinimumSize(QSize(175,28)); 95 labelHint->setMaximumSize(QSize(0xFFFFFF,28)); 96 labelHint->setTextFormat(Qt::PlainText); 97 // labelHint->setAlignment(Qt::AlignLeft | Qt::AlignTop); 98 labelHint->setWordWrap(true); 99 #ifndef QT_NO_STATUSTIP 100 labelHint->setStatusTip(trUtf8("Hover mouse pointer over dialog elements to get additional help")); 101 #endif // QT_NO_STATUSTIP 102 103 lineVertical = new QFrame(this); 104 lineVertical->setObjectName("lineVertical"); 105 lineVertical->setFrameShadow(QFrame::Plain); 106 lineVertical->setFrameShape(QFrame::VLine); 107 lineVertical->setLineWidth(2); 108 109 // Top line 110 hbox1 = new QHBoxLayout(); 111 hbox1->addWidget(imgIcon); 112 hbox1->addWidget(lineVertical); 113 hbox1->addWidget(bgWhite); 114 115 // Output settings group 116 vbox3 = new QVBoxLayout(groupOutputSettings); 117 vbox3->addWidget(buttonFont); 118 vbox3->addWidget(buttonColor); 119 120 // Random and Output settings groups 121 hbox2 = new QHBoxLayout(); 122 hbox2->addWidget(groupRandomSettings); 123 hbox2->addWidget(groupOutputSettings); 124 spacer = new QSpacerItem(0,0,QSizePolicy::Expanding); 125 hbox2->addItem(spacer); 126 127 // Top right part (with white bg) 128 vbox2 = new QVBoxLayout(bgWhite); 129 spacer = new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding); 130 vbox2->addItem(spacer); 131 vbox2->addLayout(hbox2); 132 vbox2->addWidget(cbSaveState); 133 spacer = new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding); 134 vbox2->addItem(spacer); 135 136 // Bottom part (with grey bg) 137 hbox3 = new QHBoxLayout(bgGrey); 138 hbox3->setMargin(6); 139 hbox3->setSpacing(6); 140 hbox3->addWidget(buttonHelp); 141 hbox3->addWidget(labelHint); 142 hbox3->addWidget(buttonOK); 143 hbox3->addWidget(buttonCancel); 144 145 // Central layout 146 vbox1 = new QVBoxLayout(this); 147 vbox1->setMargin(0); 148 vbox1->setSpacing(0); 149 vbox1->addLayout(hbox1); 150 vbox1->addWidget(lineHorizontal); 151 vbox1->addWidget(bgGrey); 152 #endif // Q_OS_WINCE 30 153 connect(buttonOK,SIGNAL(clicked()),this,SLOT(accept())); 31 154 connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject()));
Note: See TracChangeset
for help on using the changeset viewer.