summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-05-28 12:57:20 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-05-28 15:17:09 (GMT)
commit89029a54cb3adfb54736a6aafaea9ec535407592 (patch)
treeefc09d34681cee26acafaedc6b54591c9f048736
parent09ae2f274b417bab4abee8900c5ad0a8f01d65b1 (diff)
downloadQt-89029a54cb3adfb54736a6aafaea9ec535407592.zip
Qt-89029a54cb3adfb54736a6aafaea9ec535407592.tar.gz
Qt-89029a54cb3adfb54736a6aafaea9ec535407592.tar.bz2
cosmetic changes to examples/dialogs/sipdialog
main function has a return value now. On the HTC this example didn't work, because this stupid thing sends two resize events, if the SIP is opened (and only one if it is closed). Reviewed-by: mauricek
-rw-r--r--examples/dialogs/sipdialog/dialog.cpp13
-rw-r--r--examples/dialogs/sipdialog/main.cpp2
2 files changed, 7 insertions, 8 deletions
diff --git a/examples/dialogs/sipdialog/dialog.cpp b/examples/dialogs/sipdialog/dialog.cpp
index 9f1b9ad..653b518 100644
--- a/examples/dialogs/sipdialog/dialog.cpp
+++ b/examples/dialogs/sipdialog/dialog.cpp
@@ -90,7 +90,7 @@ Dialog::Dialog()
//! [Dialog constructor part4]
//! [Dialog constructor part5]
- connect(button, SIGNAL(pressed()),
+ connect(button, SIGNAL(clicked()),
qApp, SLOT(closeAllWindows()));
connect(QApplication::desktop(), SIGNAL(workAreaResized(int)),
this, SLOT(desktopResized(int)));
@@ -111,14 +111,13 @@ void Dialog::reactToSIP()
{
QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
- if (desktopGeometry.width() == availableGeometry.width()) {
- if (desktopGeometry.height() > availableGeometry.height()) {
+ if (desktopGeometry != availableGeometry) {
+ if (windowState() | Qt::WindowMaximized)
setWindowState(windowState() & ~Qt::WindowMaximized);
- setGeometry(availableGeometry);
- } else {
- setWindowState(windowState() | Qt::WindowMaximized);
- }
+
+ setGeometry(availableGeometry);
}
+
desktopGeometry = availableGeometry;
}
//! [reactToSIP() function]
diff --git a/examples/dialogs/sipdialog/main.cpp b/examples/dialogs/sipdialog/main.cpp
index 5fcbfd8..fec6de2 100644
--- a/examples/dialogs/sipdialog/main.cpp
+++ b/examples/dialogs/sipdialog/main.cpp
@@ -48,6 +48,6 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
- dialog.exec();
+ return dialog.exec();
}
//! [main() function]