Changeset 769 for trunk/examples/widgets/softkeys/softkeys.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 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 {
Note:
See TracChangeset
for help on using the changeset viewer.