aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/platform/qquickplatformdialog.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-15 19:57:09 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-08-15 19:10:32 +0000
commit0c76501617fda1e0ffa87334d3892f97e9d7d192 (patch)
tree17a144965445822d4cf504244cb088e931a7eed1 /src/imports/platform/qquickplatformdialog.cpp
parentf8542bd1332224fe30ad2aea1388647933838cab (diff)
Platform: offload widget fallback creation to qwidgetplatform_p.h
Change-Id: If51b359fa44a539c236e1a070e69451c75e190f7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/platform/qquickplatformdialog.cpp')
-rw-r--r--src/imports/platform/qquickplatformdialog.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/imports/platform/qquickplatformdialog.cpp b/src/imports/platform/qquickplatformdialog.cpp
index 6a772940..dee4335d 100644
--- a/src/imports/platform/qquickplatformdialog.cpp
+++ b/src/imports/platform/qquickplatformdialog.cpp
@@ -41,12 +41,7 @@
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickwindow.h>
-#ifdef QT_WIDGETS_LIB
-#include "widgets/qwidgetplatformcolordialog_p.h"
-#include "widgets/qwidgetplatformfiledialog_p.h"
-#include "widgets/qwidgetplatformfontdialog_p.h"
-#include "widgets/qwidgetplatformmessagedialog_p.h"
-#endif
+#include "widgets/qwidgetplatform_p.h"
QT_BEGIN_NAMESPACE
@@ -346,31 +341,6 @@ void QQuickPlatformDialog::componentComplete()
setParentWindow(findParentWindow());
}
-static QPlatformDialogHelper *createWidgetDialog(QPlatformTheme::DialogType type, QObject *parent)
-{
- QPlatformDialogHelper *dialog = nullptr;
-#ifdef QT_WIDGETS_LIB
- switch (type) {
- case QPlatformTheme::ColorDialog:
- dialog = new QWidgetPlatformColorDialog(parent);
- break;
- case QPlatformTheme::FileDialog:
- dialog = new QWidgetPlatformFileDialog(parent);
- break;
- case QPlatformTheme::FontDialog:
- dialog = new QWidgetPlatformFontDialog(parent);
- break;
- case QPlatformTheme::MessageDialog:
- dialog = new QWidgetPlatformMessageDialog(parent);
- break;
- default:
- Q_UNREACHABLE();
- break;
- }
-#endif
- return dialog;
-}
-
static const char *qmlTypeName(const QObject *object)
{
return object->metaObject()->className() + qstrlen("QQuickPlatform");
@@ -382,7 +352,7 @@ bool QQuickPlatformDialog::create()
if (useNativeDialog())
m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformDialogHelper(m_type);
if (!m_handle)
- m_handle = createWidgetDialog(m_type, this);
+ m_handle = QWidgetPlatform::createDialog(m_type, this);
qCDebug(qtLabsPlatformDialogs) << qmlTypeName(this) << "->" << m_handle;
if (m_handle) {
onCreate(m_handle);