summaryrefslogtreecommitdiffstats
path: root/src/dialogs/plugin.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-02-07 16:29:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-15 21:52:47 +0100
commitccb088a6beaff01419ec9325dbd19040f279b6ea (patch)
treeae1753ab02284a1fd69b30d6086a40b9faf6fc91 /src/dialogs/plugin.cpp
parentf212322a6ecb237d5fb53e56c6dafffb87e45f09 (diff)
QtQuick.Dialogs: added Dialog: wrapper for arbitrary content
It provides only a button box, so the application developer can supply the rest of the dialog contents. This is useful for various kinds of dialogs that prompt the user for input. [ChangeLog][QtQuickDialogs][Dialog] Dialog is a new wrapper component for dialogs with standard buttons and custom content items. Change-Id: I0434bed5f504820dc0a668cb993a94980f99852a Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/dialogs/plugin.cpp')
-rw-r--r--src/dialogs/plugin.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dialogs/plugin.cpp b/src/dialogs/plugin.cpp
index 4e4c641e0..7c8c6bea0 100644
--- a/src/dialogs/plugin.cpp
+++ b/src/dialogs/plugin.cpp
@@ -54,6 +54,7 @@
#include "qquickfontdialog_p.h"
#include "qquickabstractfontdialog_p.h"
#include "qquickplatformfontdialog_p.h"
+#include "qquickdialog_p.h"
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
@@ -162,6 +163,19 @@ public:
else
#endif
registerWidgetOrQmlImplementation<QQuickFontDialog>(widgetsDir, qmlDir, "FontDialog", uri, hasTopLevelWindows, 1, 1);
+
+ // Dialog
+ {
+ // @uri QtQuick.Dialogs.AbstractDialog
+ qmlRegisterType<QQuickDialog>(uri, 1, 2, "AbstractDialog"); // implementation wrapper
+ QUrl dialogQmlPath = m_useResources ?
+ QUrl("qrc:/QtQuick/Dialogs/DefaultDialogWrapper.qml") :
+ QUrl::fromLocalFile(qmlDir.filePath("DefaultDialogWrapper.qml"));
+#ifdef DEBUG_REGISTRATION
+ qDebug() << " registering DefaultDialogWrapper.qml as Dialog; success?" <<
+#endif
+ qmlRegisterType(dialogQmlPath, uri, 1, 2, "Dialog");
+ }
}
protected: