summaryrefslogtreecommitdiffstats
path: root/tests/manual/dialogs/main.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-13 01:00:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-13 01:00:13 +0100
commit0441d959ff87431ab432ce0c30bbb857a631742e (patch)
tree25c6c4293f74e39b9d4cf45b15957f233cffa9c5 /tests/manual/dialogs/main.cpp
parentae0dd3201bc13b81c62752bb04e42362c78bfe16 (diff)
parent8c685b765bf4ceba3c4cf8fdd9c9d680f338b7a9 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'tests/manual/dialogs/main.cpp')
-rw-r--r--tests/manual/dialogs/main.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/manual/dialogs/main.cpp b/tests/manual/dialogs/main.cpp
index 83089e684c..fc4adebcc0 100644
--- a/tests/manual/dialogs/main.cpp
+++ b/tests/manual/dialogs/main.cpp
@@ -44,6 +44,8 @@
#include <QAction>
#include <QKeySequence>
+static bool optNoPrinter = false;
+
// Test for dialogs, allowing to play with all dialog options for implementing native dialogs.
// Compiles with Qt 4.8 and Qt 5.
@@ -109,7 +111,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
tabWidget->addTab(new WizardPanel, tr("QWizard"));
tabWidget->addTab(new MessageBoxPanel, tr("QMessageBox"));
#ifndef QT_NO_PRINTER
- tabWidget->addTab(new PrintDialogPanel, tr("QPrintDialog"));
+ if (!optNoPrinter)
+ tabWidget->addTab(new PrintDialogPanel, tr("QPrintDialog"));
#endif
setCentralWidget(tabWidget);
}
@@ -123,14 +126,16 @@ void MainWindow::aboutDialog()
int main(int argc, char *argv[])
{
-#if QT_VERSION >= 0x050700
for (int a = 1; a < argc; ++a) {
if (!qstrcmp(argv[a], "-n")) {
qDebug("AA_DontUseNativeDialogs");
+#if QT_VERSION >= 0x050700
QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
+#endif
+ } else if (!qstrcmp(argv[a], "-p")) {
+ optNoPrinter = true; // Avoid startup slowdown by printer code
}
}
-#endif // Qt 5
QApplication a(argc, argv);
MainWindow w;