diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-01-22 12:56:21 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-01-27 15:30:24 (GMT) |
commit | c8d6b751955d2857385a44aafd1ecade8d4d3c4e (patch) | |
tree | a865ba17a0f038687ac16805d892493c0fb677c5 | |
parent | 98e2e1d674669bdfb773ddc8b8281eeb935a14e1 (diff) | |
download | Qt-c8d6b751955d2857385a44aafd1ecade8d4d3c4e.zip Qt-c8d6b751955d2857385a44aafd1ecade8d4d3c4e.tar.gz Qt-c8d6b751955d2857385a44aafd1ecade8d4d3c4e.tar.bz2 |
Re-added the Close button in QPrintPreviewDialog for Mac/Carbon.
Modal Mac/Carbon dialogs do not have the close, minimize and resize
window title buttons enabled, which makes it very hard to close modal
dialogs.
Task-number: QTBUG-7481
Reviewed-by: Kim
-rw-r--r-- | src/gui/dialogs/qprintpreviewdialog.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index 42be780..6723b53 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -207,6 +207,9 @@ public: QActionGroup *printerGroup; QAction *printAction; QAction *pageSetupAction; +#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) + QAction *closeAction; +#endif QPointer<QObject> receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; @@ -287,6 +290,9 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer) toolbar->addSeparator(); toolbar->addAction(pageSetupAction); toolbar->addAction(printAction); +#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) + toolbar->addAction(closeAction); +#endif // Cannot use the actions' triggered signal here, since it doesn't autorepeat QToolButton *zoomInButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomInAction)); @@ -406,6 +412,10 @@ void QPrintPreviewDialogPrivate::setupActions() qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup")); QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print())); QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup())); +#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) + closeAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Close")); + QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(reject())); +#endif // Initial state: fitPageAction->setChecked(true); |