summaryrefslogtreecommitdiffstats
path: root/examples/dialogs/sipdialog/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dialogs/sipdialog/dialog.cpp')
-rw-r--r--examples/dialogs/sipdialog/dialog.cpp13
1 files changed, 6 insertions, 7 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]