summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-15 14:27:56 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-17 10:20:28 +0000
commit56ad625f7843bb66bef2a0ef9b5c97d354fbdb25 (patch)
tree9d721fc805877d45bce30e44fdb691d6aee21f21 /src/widgets/dialogs
parent9baf824e4df5e9bc58b4fa1dc86e9a2e0d396ebb (diff)
Add attribute Qt::AA_DontUseNativeDialogs.
The attribute can be set to suppress native dialogs for example for testing purposes. Task-number: QTBUG-51074 Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp7
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp7
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp7
3 files changed, 12 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 47f2e76faf..9f86bea0ca 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1909,10 +1909,11 @@ bool QColorDialogPrivate::canBeNativeDialog() const
Q_Q(const QColorDialog);
if (nativeDialogInUse)
return true;
- if (q->testAttribute(Qt::WA_DontShowOnScreen))
- return false;
- if (q->options() & QColorDialog::DontUseNativeDialog)
+ if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
+ || q->testAttribute(Qt::WA_DontShowOnScreen)
+ || (q->options() & QColorDialog::DontUseNativeDialog)) {
return false;
+ }
QLatin1String staticName(QColorDialog::staticMetaObject.className());
QLatin1String dynamicName(q->metaObject()->className());
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 288922d740..ca2b0c0889 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -704,10 +704,11 @@ bool QFileDialogPrivate::canBeNativeDialog() const
Q_Q(const QFileDialog);
if (nativeDialogInUse)
return true;
- if (q->testAttribute(Qt::WA_DontShowOnScreen))
- return false;
- if (q->options() & QFileDialog::DontUseNativeDialog)
+ if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
+ || q->testAttribute(Qt::WA_DontShowOnScreen)
+ || (q->options() & QFileDialog::DontUseNativeDialog)) {
return false;
+ }
QLatin1String staticName(QFileDialog::staticMetaObject.className());
QLatin1String dynamicName(q->metaObject()->className());
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 7dbcf15b73..a0525f6fbd 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -1043,10 +1043,11 @@ bool QFontDialogPrivate::canBeNativeDialog() const
Q_Q(const QFontDialog);
if (nativeDialogInUse)
return true;
- if (q->testAttribute(Qt::WA_DontShowOnScreen))
- return false;
- if (options->options() & QFontDialog::DontUseNativeDialog)
+ if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
+ || q->testAttribute(Qt::WA_DontShowOnScreen)
+ || (options->options() & QFontDialog::DontUseNativeDialog)) {
return false;
+ }
QLatin1String staticName(QFontDialog::staticMetaObject.className());
QLatin1String dynamicName(q->metaObject()->className());