Changeset 769 for trunk/examples/widgets
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/examples/widgets/softkeys/softkeys.cpp
r651 r769 71 71 toggleButton->setCheckable(true); 72 72 73 modeButton = new QPushButton(tr("Loop SK window type"), this); 74 modeButton->setContextMenuPolicy(Qt::NoContextMenu); 75 76 modeLabel = new QLabel(tr("Normal maximized"), this); 77 modeLabel->setContextMenuPolicy(Qt::NoContextMenu); 78 73 79 pushButton = new QPushButton(tr("File Dialog"), this); 74 80 pushButton->setContextMenuPolicy(Qt::NoContextMenu); … … 88 94 layout->addWidget(pushButton, 2, 1); 89 95 layout->addWidget(comboBox, 3, 0, 1, 2); 96 layout->addWidget(modeButton, 4, 0, 1, 2); 97 layout->addWidget(modeLabel, 5, 0, 1, 2); 90 98 central->setLayout(layout); 91 99 … … 98 106 connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication())); 99 107 connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys())); 108 connect(modeButton, SIGNAL(clicked()), this, SLOT(setMode())); 100 109 pushButton->setFocus(); 101 110 } … … 134 143 } 135 144 145 void MainWindow::setMode() 146 { 147 if(isMaximized()) { 148 showFullScreen(); 149 modeLabel->setText(tr("Normal Fullscreen")); 150 } else { 151 Qt::WindowFlags flags = windowFlags(); 152 if(flags & Qt::WindowSoftkeysRespondHint) { 153 flags |= Qt::WindowSoftkeysVisibleHint; 154 flags &= ~Qt::WindowSoftkeysRespondHint; 155 setWindowFlags(flags); // Hides visible window 156 showFullScreen(); 157 modeLabel->setText(tr("Fullscreen with softkeys")); 158 } else if(flags & Qt::WindowSoftkeysVisibleHint) { 159 flags &= ~Qt::WindowSoftkeysVisibleHint; 160 flags &= ~Qt::WindowSoftkeysRespondHint; 161 setWindowFlags(flags); // Hides visible window 162 showMaximized(); 163 modeLabel->setText(tr("Normal Maximized")); 164 } else { 165 flags &= ~Qt::WindowSoftkeysVisibleHint; 166 flags |= Qt::WindowSoftkeysRespondHint; 167 setWindowFlags(flags); // Hides visible window 168 showFullScreen(); 169 modeLabel->setText(tr("Fullscreen with SK respond")); 170 } 171 } 172 } 173 136 174 void MainWindow::exitApplication() 137 175 { -
trunk/examples/widgets/softkeys/softkeys.h
r651 r769 58 58 void cancelPressed(); 59 59 void setCustomSoftKeys(); 60 void setMode(); 60 61 public: 61 62 MainWindow(QWidget *parent = 0); … … 64 65 QGridLayout *layout; 65 66 QWidget *central; 66 QTextEdit *textEditor;67 QTextEdit *textEditor; 67 68 QLabel *infoLabel; 68 QPushButton* toggleButton; 69 QPushButton* pushButton; 70 QMenu* fileMenu; 71 QAction* addSoftKeysAct; 72 QAction* exit; 73 QAction* ok; 74 QAction* cancel; 69 QPushButton *toggleButton; 70 QPushButton *pushButton; 71 QPushButton *modeButton; 72 QLabel *modeLabel; 73 QMenu *fileMenu; 74 QAction *addSoftKeysAct; 75 QAction *exit; 76 QAction *ok; 77 QAction *cancel; 75 78 }; 76 79 -
trunk/examples/widgets/stylesheet/mainwindow.ui
r561 r769 197 197 <item row="1" column="2" colspan="2" > 198 198 <widget class="QRadioButton" name="femaleRadioButton" > 199 <property name=" styleSheet">199 <property name="toolTip"> 200 200 <string>Check this if you are female</string> 201 201 </property> -
trunk/examples/widgets/wiggly/dialog.cpp
r651 r769 57 57 setLayout(layout); 58 58 59 #ifdef QT_SOFTKEYS_ENABLED 60 QAction *exitAction = new QAction(tr("Exit"), this); 61 exitAction->setSoftKeyRole(QAction::NegativeSoftKey); 62 connect (exitAction, SIGNAL(triggered()),this, SLOT(close())); 63 addAction (exitAction); 64 65 Qt::WindowFlags flags = windowFlags(); 66 flags |= Qt::WindowSoftkeysVisibleHint; 67 setWindowFlags(flags); 68 #endif 69 59 70 connect(lineEdit, SIGNAL(textChanged(QString)), 60 71 wigglyWidget, SLOT(setText(QString))); -
trunk/examples/widgets/windowflags/controllerwindow.cpp
r651 r769 59 59 bottomLayout->addWidget(quitButton); 60 60 61 Q VBoxLayout *mainLayout = new QVBoxLayout;61 QHBoxLayout *mainLayout = new QHBoxLayout; 62 62 mainLayout->addWidget(typeGroupBox); 63 63 mainLayout->addWidget(hintsGroupBox);
Note:
See TracChangeset
for help on using the changeset viewer.