From 79ed504f10ba49b19fe9122ae3de4cf652130320 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Nov 2018 12:59:38 +0100 Subject: 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 --- tests/manual/dialogs/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/manual') 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 #include +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; -- cgit v1.2.3