diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
commit | 4159ee840549df11287294f0928e90f35f3e06ff (patch) | |
tree | 4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /examples/widgets | |
parent | 59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff) | |
parent | c8c39ecc37c156ac2677de09a26548dfc274b564 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
config.tests/unix/ptrsize.test
configure
src/corelib/global/qnamespace.h
src/network/socket/qabstractsocket.cpp
tests/auto/other/networkselftest/networkselftest.pro
Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/desktop/systray/doc/src/systray.qdoc | 6 | ||||
-rw-r--r-- | examples/widgets/desktop/systray/window.cpp | 5 | ||||
-rw-r--r-- | examples/widgets/painting/shared/arthurstyle.cpp | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc index 074012b6a7..fa2dbb2721 100644 --- a/examples/widgets/desktop/systray/doc/src/systray.qdoc +++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc @@ -173,7 +173,11 @@ We have reimplemented the QWidget::closeEvent() event handler to receive widget close events, showing the above message to the - users when they are closing the editor window. + users when they are closing the editor window. On OS X we need to + avoid showing the message and accepting the close event when the + user really intends to quit the application, that is, when the + user has triggered "Quit" in the menu bar or pressed the Command+Q + shortcut. In addition to the functions and slots discussed above, we have also implemented several convenience functions to simplify the diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index 931e443de7..d499f498af 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -102,6 +102,11 @@ void Window::setVisible(bool visible) //! [2] void Window::closeEvent(QCloseEvent *event) { +#ifdef Q_OS_OSX + if (!event->spontaneous() || !isVisible()) { + return; + } +#endif if (trayIcon->isVisible()) { QMessageBox::information(this, tr("Systray"), tr("The program will keep running in the " diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp index d246336c5d..f03c05881d 100644 --- a/examples/widgets/painting/shared/arthurstyle.cpp +++ b/examples/widgets/painting/shared/arthurstyle.cpp @@ -156,8 +156,8 @@ void ArthurStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op break; case PE_FrameGroupBox: - if (const QStyleOptionFrameV2 *group - = qstyleoption_cast<const QStyleOptionFrameV2 *>(option)) { + if (const QStyleOptionFrame *group + = qstyleoption_cast<const QStyleOptionFrame *>(option)) { const QRect &r = group->rect; painter->save(); |