summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qprintpreviewdialog.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-22 12:56:21 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-01-22 12:59:50 (GMT)
commitc8f4319b3a2ddacacd3bca67861a41e22dd1ada0 (patch)
treeb00e7f0eee4fc024cb4cfdc50a62098b7353064a /src/gui/dialogs/qprintpreviewdialog.cpp
parentcbfe5019e135b85df37b3f38f79bef4dbe397cf6 (diff)
downloadQt-c8f4319b3a2ddacacd3bca67861a41e22dd1ada0.zip
Qt-c8f4319b3a2ddacacd3bca67861a41e22dd1ada0.tar.gz
Qt-c8f4319b3a2ddacacd3bca67861a41e22dd1ada0.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
Diffstat (limited to 'src/gui/dialogs/qprintpreviewdialog.cpp')
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp10
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);