diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2014-01-13 15:01:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-15 21:35:29 +0100 |
commit | 6f5850dd4f6c4cc253c48f41f59130aee5415591 (patch) | |
tree | 9f92f25e0e297cdc51e5dd8aed3b942413e6c917 /src/webengine/ui_delegates_manager.h | |
parent | e46886912858e9b233fb099bb211e288dd7d57b5 (diff) |
JS dialogs in QtQuick
Refactor JavaScriptDialogManagerQt to support a Qt Quick dialogs
friendly approach.
Qt Quick dialogs are still missing a prompt, so we use a "handmade"
one. This should be solved before 5.3 though.
Change-Id: I965df66837b2e81d6e4618a8da1167a37661c26e
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/webengine/ui_delegates_manager.h')
-rw-r--r-- | src/webengine/ui_delegates_manager.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/webengine/ui_delegates_manager.h b/src/webengine/ui_delegates_manager.h index 65f994b93..eeece895c 100644 --- a/src/webengine/ui_delegates_manager.h +++ b/src/webengine/ui_delegates_manager.h @@ -47,14 +47,18 @@ #include <QExplicitlySharedDataPointer> #include <QPoint> -#include <QPointer> #include <QQmlComponent> +#include <QScopedPointer> +#include <QSharedPointer> #include <QUrl> #define FOR_EACH_COMPONENT_TYPE(F, SEPARATOR) \ F(Menu, menu) SEPARATOR \ F(MenuItem, menuItem) SEPARATOR \ - F(MenuSeparator, menuSeparator) SEPARATOR + F(MenuSeparator, menuSeparator) SEPARATOR \ + F(AlertDialog, alertDialog) SEPARATOR \ + F(ConfirmDialog, confirmDialog) SEPARATOR \ + F(PromptDialog, promptDialog) SEPARATOR #define COMMA_SEPARATOR , #define SEMICOLON_SEPARATOR ; @@ -63,6 +67,7 @@ #define MEMBER_DECLARATION(TYPE, COMPONENT) \ QScopedPointer<QQmlComponent> COMPONENT##Component +class JavaScriptDialogController; QT_BEGIN_NAMESPACE class QObject; class QQmlContext; @@ -106,7 +111,9 @@ class UIDelegatesManager { public: enum ComponentType { + Invalid = -1, FOR_EACH_COMPONENT_TYPE(ENUM_DECLARATION, COMMA_SEPARATOR) + ComponentTypeCount }; UIDelegatesManager(QQuickWebEngineView *); @@ -115,6 +122,7 @@ public: void addMenuSeparator(QObject *menu); QObject *addMenu(QObject *parentMenu, const QString &title, const QPoint &pos = QPoint()); QQmlContext *creationContextForComponent(QQmlComponent *); + void showDialog(QSharedPointer<JavaScriptDialogController>); private: bool ensureComponentLoaded(ComponentType); |