diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2016-06-13 13:29:51 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2016-08-31 09:11:47 +0000 |
commit | 3cbe59e29a2702a2c184be10845b9bdd342c24d0 (patch) | |
tree | ef3b6555857028147b9b57948a15e18626e213da /src/webengine/ui_delegates_manager.cpp | |
parent | 4f3425c0d17f5f53deba78ccf6d357c1c83529f0 (diff) |
Add dialog requests to qml api
Introduce qml APIs to support custom dialogs:
* http and proxy authentication
* javascript dialogs
* file pickers
* color pickers
* form validation messages
[ChangeLog][QtWebEngine][QML] Added ability to provide custom dialogs
for HTTP and proxy authentication, JavaScript alerts, file and color
picking, and form validation messages.
Task-number: QTBUG-51190
Change-Id: I559ca59264750feb36ba7d3dba0bf0647509306d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/webengine/ui_delegates_manager.cpp')
-rw-r--r-- | src/webengine/ui_delegates_manager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 608ce2ab3..4ca4ba98c 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -445,7 +445,7 @@ void UIDelegatesManager::showDialog(QSharedPointer<AuthenticationDialogControlle QMetaObject::invokeMethod(authenticationDialog, "open"); } -void UIDelegatesManager::showFilePicker(FilePickerController *controller) +void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> controller) { if (!ensureComponentLoaded(FilePicker)) @@ -475,16 +475,14 @@ void UIDelegatesManager::showFilePicker(FilePickerController *controller) Q_UNREACHABLE(); } - controller->setParent(filePicker); - QQmlProperty filesPickedSignal(filePicker, QStringLiteral("onFilesSelected")); CHECK_QML_SIGNAL_PROPERTY(filesPickedSignal, filePickerComponent->url()); QQmlProperty rejectSignal(filePicker, QStringLiteral("onRejected")); CHECK_QML_SIGNAL_PROPERTY(rejectSignal, filePickerComponent->url()); static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)"); - QObject::connect(filePicker, filesPickedSignal.method(), controller, controller->metaObject()->method(acceptedIndex)); + QObject::connect(filePicker, filesPickedSignal.method(), controller.data(), controller->metaObject()->method(acceptedIndex)); static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()"); - QObject::connect(filePicker, rejectSignal.method(), controller, controller->metaObject()->method(rejectedIndex)); + QObject::connect(filePicker, rejectSignal.method(), controller.data(), controller->metaObject()->method(rejectedIndex)); // delete when done. static int deleteLaterIndex = filePicker->metaObject()->indexOfSlot("deleteLater()"); |