summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-11-09 12:59:38 +0100
committerLiang Qi <liang.qi@qt.io>2018-11-12 13:01:05 +0000
commit79ed504f10ba49b19fe9122ae3de4cf652130320 (patch)
tree6bcf7699baccbdc7089b6900a478e7e72e93d110
parent49bbc9df99e1927b6e377054add05599587f88d3 (diff)
Manual dialogs test: Add option to turn off the printer panel
On Linux, the printer panel impacts the application startup time,which can be annoying when testing other dialogs. Change-Id: Id13446047cf50765951a6bb5182ee50cae983457 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-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;