From a060012ecef7ecc60f5518b6718136b22a10dc6b Mon Sep 17 00:00:00 2001 From: Balazs Egedi Date: Wed, 16 Jun 2021 14:55:18 +0200 Subject: Remove Quick Controls 1 UIDelegates and introduce UIDelegates test - Renamed Controls2Delegates to ControlsDelegates - Removed option to use Quick Controls 1 delegates - Added test to check if controls are shown Task-number: QTBUG-93666 Change-Id: Iccca948615309285db7fc57d14fb1cdcdef28051 Reviewed-by: Qt CI Bot Reviewed-by: Peter Varga (cherry picked from commit 4fe808a8c0ecd143199781e9644a46e4b1b90653) Reviewed-by: Allan Sandfeld Jensen --- src/webenginequick/CMakeLists.txt | 2 +- src/webenginequick/api/qquickwebengineview.cpp | 23 +--- src/webenginequick/api/qquickwebengineview_p_p.h | 1 - src/webenginequick/ui/AlertDialog.qml | 61 +++++++++- src/webenginequick/ui/AuthenticationDialog.qml | 63 ++++++----- src/webenginequick/ui/CMakeLists.txt | 38 +++++++ src/webenginequick/ui/ColorDialog.qml | 9 ++ src/webenginequick/ui/ConfirmDialog.qml | 75 ++++++++++++- src/webenginequick/ui/FilePicker.qml | 8 ++ src/webenginequick/ui/Menu.qml | 7 +- src/webenginequick/ui/MenuItem.qml | 6 +- src/webenginequick/ui/MenuSeparator.qml | 5 +- src/webenginequick/ui/PromptDialog.qml | 70 +++++++----- src/webenginequick/ui/ToolTip.qml | 57 +--------- src/webenginequick/ui/TouchHandle.qml | 2 +- src/webenginequick/ui/TouchSelectionMenu.qml | 4 +- src/webenginequick/ui/information.png | Bin 0 -> 254 bytes src/webenginequick/ui/qmldir | 8 -- src/webenginequick/ui/question.png | Bin 0 -> 257 bytes src/webenginequick/ui/ui.pro | 6 +- src/webenginequick/ui2/AlertDialog.qml | 98 ---------------- src/webenginequick/ui2/AuthenticationDialog.qml | 135 ----------------------- src/webenginequick/ui2/CMakeLists.txt | 36 ------ src/webenginequick/ui2/ConfirmDialog.qml | 111 ------------------- src/webenginequick/ui2/Menu.qml | 57 ---------- src/webenginequick/ui2/MenuItem.qml | 43 -------- src/webenginequick/ui2/MenuSeparator.qml | 42 ------- src/webenginequick/ui2/PromptDialog.qml | 114 ------------------- src/webenginequick/ui2/ToolTip.qml | 45 -------- src/webenginequick/ui2/information.png | Bin 254 -> 0 bytes src/webenginequick/ui2/question.png | Bin 257 -> 0 bytes src/webenginequick/ui2/ui2.pro | 18 --- src/webenginequick/ui_delegates_manager.cpp | 18 +-- src/webenginequick/webenginequick.pro | 3 +- 34 files changed, 290 insertions(+), 875 deletions(-) create mode 100644 src/webenginequick/ui/CMakeLists.txt create mode 100644 src/webenginequick/ui/information.png delete mode 100644 src/webenginequick/ui/qmldir create mode 100644 src/webenginequick/ui/question.png delete mode 100644 src/webenginequick/ui2/AlertDialog.qml delete mode 100644 src/webenginequick/ui2/AuthenticationDialog.qml delete mode 100644 src/webenginequick/ui2/CMakeLists.txt delete mode 100644 src/webenginequick/ui2/ConfirmDialog.qml delete mode 100644 src/webenginequick/ui2/Menu.qml delete mode 100644 src/webenginequick/ui2/MenuItem.qml delete mode 100644 src/webenginequick/ui2/MenuSeparator.qml delete mode 100644 src/webenginequick/ui2/PromptDialog.qml delete mode 100644 src/webenginequick/ui2/ToolTip.qml delete mode 100644 src/webenginequick/ui2/information.png delete mode 100644 src/webenginequick/ui2/question.png delete mode 100644 src/webenginequick/ui2/ui2.pro (limited to 'src') diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt index 03ea7d8b5..c99632764 100644 --- a/src/webenginequick/CMakeLists.txt +++ b/src/webenginequick/CMakeLists.txt @@ -7,7 +7,7 @@ get_configure_mode(configureMode) if(QT_FEATURE_webenginequick_testsupport) add_subdirectory(testsupport) endif() -add_subdirectory(ui2) +add_subdirectory(ui) qt_internal_add_qml_module(WebEngineQuick ${configureMode} diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index 10d37dfc2..3791d9c6b 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -146,32 +146,11 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate() , m_isBeingAdopted(false) , m_backgroundColor(Qt::white) , m_zoomFactor(1.0) - , m_ui2Enabled(false) , m_profileInitialized(false) , m_contextMenuRequest(nullptr) { memset(actions, 0, sizeof(actions)); - QString platform = qApp->platformName().toLower(); - if (platform == QLatin1String("eglfs")) - m_ui2Enabled = true; - - const QByteArray dialogSet = qgetenv("QTWEBENGINE_DIALOG_SET"); - - if (!dialogSet.isEmpty()) { - if (dialogSet == QByteArrayLiteral("QtQuickControls2")) { - m_ui2Enabled = true; - } else if (dialogSet == QByteArrayLiteral("QtQuickControls1") - && m_ui2Enabled) { - m_ui2Enabled = false; - qWarning("QTWEBENGINE_DIALOG_SET=QtQuickControls1 forces use of Qt Quick Controls 1 " - "on an eglfs backend. This can crash your application!"); - } else { - qWarning("Ignoring QTWEBENGINE_DIALOG_SET environment variable set to %s. Accepted " - "values are \"QtQuickControls1\" and \"QtQuickControls2\"", dialogSet.data()); - } - } - #ifndef QT_NO_ACCESSIBILITY QAccessible::installFactory(&webAccessibleFactory); #endif // QT_NO_ACCESSIBILITY @@ -222,7 +201,7 @@ UIDelegatesManager *QQuickWebEngineViewPrivate::ui() { Q_Q(QQuickWebEngineView); if (m_uIDelegatesManager.isNull()) - m_uIDelegatesManager.reset(m_ui2Enabled ? new UI2DelegatesManager(q) : new UIDelegatesManager(q)); + m_uIDelegatesManager.reset(new UI2DelegatesManager(q)); return m_uIDelegatesManager.data(); } diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h index 9dfaedfdd..73c828cab 100644 --- a/src/webenginequick/api/qquickwebengineview_p_p.h +++ b/src/webenginequick/api/qquickwebengineview_p_p.h @@ -225,7 +225,6 @@ private: QScopedPointer m_uIDelegatesManager; QColor m_backgroundColor; qreal m_zoomFactor; - bool m_ui2Enabled; bool m_profileInitialized; QWebEngineContextMenuRequest *m_contextMenuRequest; LoadVisuallyCommittedState m_loadVisuallyCommittedState = NotCommitted; diff --git a/src/webenginequick/ui/AlertDialog.qml b/src/webenginequick/ui/AlertDialog.qml index 07f2d7df5..a806ec306 100644 --- a/src/webenginequick/ui/AlertDialog.qml +++ b/src/webenginequick/ui/AlertDialog.qml @@ -37,8 +37,63 @@ ** ****************************************************************************/ -import QtQuick.Dialogs 1.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -MessageDialog { - icon: StandardIcon.Information +Dialog { + property alias text: message.text + property bool handled: false + signal accepted() + signal rejected() + title: qsTr("Alert Dialog") + modal: false + anchors.centerIn: parent + objectName: "alertDialog" + + //handle the case where users simply closes the dialog + onVisibleChanged: { + if (visible == false && handled == false) { + handled = true; + rejected(); + } else { + handled = false; + } + } + + function acceptDialog() { + accepted(); + handled = true; + close(); + } + + ColumnLayout { + id: rootLayout + anchors.fill: parent + anchors.margins: 4 + property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins + property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins + property int doubleMargins: anchors.margins * 2 + SystemPalette { id: palette; colorGroup: SystemPalette.Active } + RowLayout { + Layout.alignment: Qt.AlignRight + spacing: 8 + Image { + source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/information.png" + } + Label { + id: message + Layout.fillWidth: true + color: palette.windowText + } + } + Item { + Layout.fillHeight: true + } + Button { + Layout.alignment: Qt.AlignHCenter + text: qsTr("OK") + onClicked: acceptDialog() + } + } } diff --git a/src/webenginequick/ui/AuthenticationDialog.qml b/src/webenginequick/ui/AuthenticationDialog.qml index a7eedd14d..1c865010a 100644 --- a/src/webenginequick/ui/AuthenticationDialog.qml +++ b/src/webenginequick/ui/AuthenticationDialog.qml @@ -37,35 +37,39 @@ ** ****************************************************************************/ -// FIXME: authentication missing in Qt Quick Dialogs atm. Make our own for now. -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.0 -import QtQuick.Window 2.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -Window { - signal accepted(string user, string password) - signal rejected +Dialog { property alias text: message.text - + property bool handled: false + signal accepted(string user, string password) + signal rejected() title: qsTr("Authentication Required") - flags: Qt.Dialog - modality: Qt.WindowModal + modal: false + anchors.centerIn: parent + objectName: "authenticationDialog" - width: minimumWidth - height: minimumHeight - minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins - minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins - - SystemPalette { id: palette; colorGroup: SystemPalette.Active } - color: palette.window - - function open() { - show(); + //handle the case where users simply closes the dialog + onVisibleChanged: { + if (visible == false && handled == false) { + handled = true; + rejected(); + } else { + handled = false; + } } function acceptDialog() { accepted(userField.text, passwordField.text); + handled = true; + close(); + } + + function rejectDialog() { + rejected(); + handled = true; close(); } @@ -73,8 +77,13 @@ Window { id: rootLayout anchors.fill: parent anchors.margins: 4 + property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins + property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins + property int doubleMargins: anchors.margins * 2 - Text { + + SystemPalette { id: palette; colorGroup: SystemPalette.Active } + Label { id: message color: palette.windowText } @@ -115,15 +124,11 @@ Window { spacing: 8 Button { id: cancelButton - text: qsTr("&Cancel") - onClicked: { - rejected(); - close(); - } + text: qsTr("Cancel") + onClicked: rejectDialog() } Button { - text: qsTr("&Log In") - isDefault: true + text: qsTr("Log In") onClicked: acceptDialog() } } diff --git a/src/webenginequick/ui/CMakeLists.txt b/src/webenginequick/ui/CMakeLists.txt new file mode 100644 index 000000000..232f77fa4 --- /dev/null +++ b/src/webenginequick/ui/CMakeLists.txt @@ -0,0 +1,38 @@ +set(qml_files + "AlertDialog.qml" + "AuthenticationDialog.qml" + "ColorDialog.qml" + "ConfirmDialog.qml" + "FilePicker.qml" + "Menu.qml" + "MenuItem.qml" + "MenuSeparator.qml" + "PromptDialog.qml" + "ToolTip.qml" +) + +set(resource_files + "information.png" + "question.png" +) + +qt_internal_add_qml_module(WebEngineQuickDelegatesQml + URI "QtWebEngine.ControlsDelegates" + VERSION "${PROJECT_VERSION}" + QML_FILES ${qml_files} + PAST_MAJOR_VERSIONS 1 + NO_SYNC_QT + PLUGIN_TARGET qtwebenginequickdelegatesplugin + DEPENDENCIES QtQuickControls2 +) + +qt_internal_add_resource(qtwebenginequickdelegatesplugin "qtwebenginequickdelegatesplugin" + PREFIX + "/qt-project.org/imports/QtWebEngine/ControlsDelegates" + FILES + ${resource_files} +) + +make_install_only(WebEngineQuickDelegatesQml) +make_install_only(qtwebenginequickdelegatesplugin) + diff --git a/src/webenginequick/ui/ColorDialog.qml b/src/webenginequick/ui/ColorDialog.qml index b74fd2cd7..1e8df43a5 100644 --- a/src/webenginequick/ui/ColorDialog.qml +++ b/src/webenginequick/ui/ColorDialog.qml @@ -37,6 +37,7 @@ ** ****************************************************************************/ +/* import QtQuick.Dialogs 1.2 ColorDialog { @@ -48,3 +49,11 @@ ColorDialog { selectedColor(colorDialog.currentColor); } } +*/ + +import QtQuick.Controls + +Dialog { + objectName: "colorDialog" + // TODO +} diff --git a/src/webenginequick/ui/ConfirmDialog.qml b/src/webenginequick/ui/ConfirmDialog.qml index aab4db04a..0ce7a97f2 100644 --- a/src/webenginequick/ui/ConfirmDialog.qml +++ b/src/webenginequick/ui/ConfirmDialog.qml @@ -37,9 +37,76 @@ ** ****************************************************************************/ -import QtQuick.Dialogs 1.1 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -MessageDialog { - icon: StandardIcon.Question - standardButtons: StandardButton.Ok | StandardButton.Cancel +Dialog { + property alias text: message.text + property bool handled: false + signal accepted() + signal rejected() + title: qsTr("Confirm Dialog") + modal: false + anchors.centerIn: parent + objectName: "confirmDialog" + + //handle the case where users simply closes the dialog + onVisibleChanged: { + if (visible == false && handled == false) { + handled = true; + rejected(); + } else { + handled = false; + } + } + + function acceptDialog() { + accepted(); + handled = true; + close(); + } + + function rejectDialog() { + rejected(); + handled = true; + close(); + } + + ColumnLayout { + id: rootLayout + anchors.fill: parent + anchors.margins: 4 + property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins + property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins + property int doubleMargins: anchors.margins * 2 + SystemPalette { id: palette; colorGroup: SystemPalette.Active } + RowLayout { + Layout.alignment: Qt.AlignRight + spacing: 8 + Image { + source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/question.png" + } + Text { + id: message + Layout.fillWidth: true + color: palette.windowText + } + } + Item { + Layout.fillHeight: true + } + RowLayout { + Layout.alignment: Qt.AlignRight + spacing: 8 + Button { + text: qsTr("OK") + onClicked: acceptDialog() + } + Button { + text: qsTr("Cancel") + onClicked: rejectDialog() + } + } + } } diff --git a/src/webenginequick/ui/FilePicker.qml b/src/webenginequick/ui/FilePicker.qml index e6af977ba..e6c4e2598 100644 --- a/src/webenginequick/ui/FilePicker.qml +++ b/src/webenginequick/ui/FilePicker.qml @@ -37,6 +37,7 @@ ** ****************************************************************************/ +/* import QtQuick.Dialogs 1.1 FileDialog { @@ -47,3 +48,10 @@ FileDialog { filesSelected(fileUrls); } } +*/ + +import QtQuick.Controls + +Dialog { + // TODO +} diff --git a/src/webenginequick/ui/Menu.qml b/src/webenginequick/ui/Menu.qml index 36efa7680..b6d799d02 100644 --- a/src/webenginequick/ui/Menu.qml +++ b/src/webenginequick/ui/Menu.qml @@ -37,12 +37,13 @@ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Controls 1.4 as Controls +import QtQuick +import QtQuick.Controls -Controls.Menu { +Menu { id: menu signal done() + objectName: "menu" // Use private API for now onAboutToHide: doneTimer.start() diff --git a/src/webenginequick/ui/MenuItem.qml b/src/webenginequick/ui/MenuItem.qml index e61f4c230..b4e06ccc2 100644 --- a/src/webenginequick/ui/MenuItem.qml +++ b/src/webenginequick/ui/MenuItem.qml @@ -37,8 +37,8 @@ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Controls 1.4 as Controls +import QtQuick +import QtQuick.Controls -Controls.MenuItem { } +MenuItem { } diff --git a/src/webenginequick/ui/MenuSeparator.qml b/src/webenginequick/ui/MenuSeparator.qml index 8427865cb..3d73adf5e 100644 --- a/src/webenginequick/ui/MenuSeparator.qml +++ b/src/webenginequick/ui/MenuSeparator.qml @@ -37,7 +37,6 @@ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Controls 1.4 as Controls +import QtQuick -Controls.MenuSeparator { } +Item { id: dummy } diff --git a/src/webenginequick/ui/PromptDialog.qml b/src/webenginequick/ui/PromptDialog.qml index c4dcd6b98..81b9812ad 100644 --- a/src/webenginequick/ui/PromptDialog.qml +++ b/src/webenginequick/ui/PromptDialog.qml @@ -37,62 +37,78 @@ ** ****************************************************************************/ -// FIXME: prompt missing in Qt Quick Dialogs atm. Make our own for now. -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.0 -import QtQuick 2.5 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -ApplicationWindow { - signal input(string text) - signal accepted - signal rejected +Dialog { property alias text: message.text property alias prompt: field.text + property bool handled: false + signal input(string text) + signal accepted() + signal rejected() + title: qsTr("Prompt Dialog") + modal: false + anchors.centerIn: parent + objectName: "promptDialog" - width: 350 - height: 100 - flags: Qt.Dialog + //handle the case where users simply closes the dialog + onVisibleChanged: { + if (visible == false && handled == false) { + handled = true; + rejected(); + } else { + handled = false; + } + } - onClosing: { - rejected(); + function acceptDialog() { + input(field.text); + accepted(); + handled = true; + close(); } - function open() { - show(); + function rejectDialog() { + rejected(); + handled = true; + close(); } ColumnLayout { + id: rootLayout anchors.fill: parent anchors.margins: 4 + property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins + property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins + property int doubleMargins: anchors.margins * 2 + SystemPalette { id: palette; colorGroup: SystemPalette.Active } Text { id: message Layout.fillWidth: true + color: palette.windowText } TextField { id:field + focus: true Layout.fillWidth: true + onAccepted: acceptDialog() + } + Item { + Layout.fillHeight: true } RowLayout { Layout.alignment: Qt.AlignRight spacing: 8 Button { text: qsTr("OK") - onClicked: { - input(field.text); - accepted(); - close(); - destroy(); - } + onClicked: acceptDialog() } Button { text: qsTr("Cancel") - onClicked: { - rejected(); - close(); - destroy(); - } + onClicked: rejectDialog() } } } - } diff --git a/src/webenginequick/ui/ToolTip.qml b/src/webenginequick/ui/ToolTip.qml index 2bfe9eaf5..8800bb1f8 100644 --- a/src/webenginequick/ui/ToolTip.qml +++ b/src/webenginequick/ui/ToolTip.qml @@ -37,57 +37,10 @@ ** ****************************************************************************/ -import QtQuick 2.5 +import QtQuick.Controls -Item { - id: toolTipContainer - z: 9999 - width: content.width - height: content.height - visible: false - - property alias text: toolTip.text - property int delayTimerInterval: 500 - property int hideTimerInterval: 10000 - property int toolTipMaxWidth: 400 - - Timer { - id: delayTimer - interval: delayTimerInterval - onTriggered: { - toolTipContainer.visible = true - hideTimer.start() - } - } - - Timer { - id: hideTimer - interval: hideTimerInterval - onTriggered: toolTipContainer.visible = false - } - - Rectangle { - id: content - color: "#f8eabf" - border.color: "black" - anchors.centerIn: parent - width: toolTip.contentWidth + 10 - height: toolTip.contentHeight + 10 - radius: 3 - - Text { - id: toolTip - anchors {fill: parent; margins: 5} - wrapMode: Text.Wrap - width: Math.min(toolTipMaxWidth, (toolTip.text.length +1) * 8) - } - } - - function open() { - delayTimer.start(); - } - - function hide() { - hideTimer.start(); - } +ToolTip { + delay: 1000 + timeout: 1500 + objectName: "toolTip" } diff --git a/src/webenginequick/ui/TouchHandle.qml b/src/webenginequick/ui/TouchHandle.qml index 76a93829e..1c7490c88 100644 --- a/src/webenginequick/ui/TouchHandle.qml +++ b/src/webenginequick/ui/TouchHandle.qml @@ -37,6 +37,6 @@ ** ****************************************************************************/ -import QtQuick 2.5 +import QtQuick Image { } diff --git a/src/webenginequick/ui/TouchSelectionMenu.qml b/src/webenginequick/ui/TouchSelectionMenu.qml index 7cf16b554..4bb803271 100644 --- a/src/webenginequick/ui/TouchSelectionMenu.qml +++ b/src/webenginequick/ui/TouchSelectionMenu.qml @@ -37,8 +37,8 @@ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Layouts 1.3 +import QtQuick +import QtQuick.Layouts Rectangle { id: menu diff --git a/src/webenginequick/ui/information.png b/src/webenginequick/ui/information.png new file mode 100644 index 000000000..0a2eb87d1 Binary files /dev/null and b/src/webenginequick/ui/information.png differ diff --git a/src/webenginequick/ui/qmldir b/src/webenginequick/ui/qmldir deleted file mode 100644 index e23b972be..000000000 --- a/src/webenginequick/ui/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -module QtWebEngine.Controls1Delegates -AlertDialog 1.0 AlertDialog.qml -ConfirmDialog 1.0 ConfirmDialog.qml -FilePicker 1.0 FilePicker.qml -PromptDialog 1.0 PromptDialog.qml -Menu 1.0 Menu.qml -MenuItem 1.0 MenuItem.qml -MenuSeparator 1.0 MenuSeparator.qml diff --git a/src/webenginequick/ui/question.png b/src/webenginequick/ui/question.png new file mode 100644 index 000000000..2dd92fd79 Binary files /dev/null and b/src/webenginequick/ui/question.png differ diff --git a/src/webenginequick/ui/ui.pro b/src/webenginequick/ui/ui.pro index 69f754e0c..01754666a 100644 --- a/src/webenginequick/ui/ui.pro +++ b/src/webenginequick/ui/ui.pro @@ -1,4 +1,4 @@ -TARGETPATH = QtWebEngine/Controls1Delegates +TARGETPATH = QtWebEngine/ControlsDelegates QML_FILES += \ # Authentication Dialog @@ -14,7 +14,7 @@ QML_FILES += \ MenuItem.qml \ MenuSeparator.qml \ ToolTip.qml \ - TouchHandle.qml \ - TouchSelectionMenu.qml + information.png \ + question.png load(qml_module) diff --git a/src/webenginequick/ui2/AlertDialog.qml b/src/webenginequick/ui2/AlertDialog.qml deleted file mode 100644 index 58398b577..000000000 --- a/src/webenginequick/ui2/AlertDialog.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -Dialog { - property alias text: message.text - property bool handled: false - signal accepted() - signal rejected() - title: qsTr("Alert Dialog") - modal: false - anchors.centerIn: parent - - //handle the case where users simply closes the dialog - onVisibleChanged: { - if (visible == false && handled == false) { - handled = true; - rejected(); - } else { - handled = false; - } - } - - function acceptDialog() { - accepted(); - handled = true; - close(); - } - - ColumnLayout { - id: rootLayout - anchors.fill: parent - anchors.margins: 4 - property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins - property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins - property int doubleMargins: anchors.margins * 2 - SystemPalette { id: palette; colorGroup: SystemPalette.Active } - RowLayout { - Layout.alignment: Qt.AlignRight - spacing: 8 - Image { - source: "qrc:/qt-project.org/imports/QtWebEngine/Controls2Delegates/information.png" - } - Label { - id: message - Layout.fillWidth: true - color: palette.windowText - } - } - Item { - Layout.fillHeight: true - } - Button { - Layout.alignment: Qt.AlignHCenter - text: qsTr("OK") - onClicked: acceptDialog() - } - } -} diff --git a/src/webenginequick/ui2/AuthenticationDialog.qml b/src/webenginequick/ui2/AuthenticationDialog.qml deleted file mode 100644 index 0fa61091a..000000000 --- a/src/webenginequick/ui2/AuthenticationDialog.qml +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -Dialog { - property alias text: message.text - property bool handled: false - signal accepted(string user, string password) - signal rejected() - title: qsTr("Authentication Required") - modal: false - anchors.centerIn: parent - - //handle the case where users simply closes the dialog - onVisibleChanged: { - if (visible == false && handled == false) { - handled = true; - rejected(); - } else { - handled = false; - } - } - - function acceptDialog() { - accepted(userField.text, passwordField.text); - handled = true; - close(); - } - - function rejectDialog() { - rejected(); - handled = true; - close(); - } - - ColumnLayout { - id: rootLayout - anchors.fill: parent - anchors.margins: 4 - property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins - property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins - - property int doubleMargins: anchors.margins * 2 - - SystemPalette { id: palette; colorGroup: SystemPalette.Active } - Label { - id: message - color: palette.windowText - } - GridLayout { - columns: 2 - Label { - text: qsTr("Username:") - color: palette.windowText - } - TextField { - id: userField - focus: true - Layout.fillWidth: true - onAccepted: { - if (userField.text && passwordField.text) - acceptDialog(); - } - } - Label { - text: qsTr("Password:") - color: palette.windowText - } - TextField { - id: passwordField - Layout.fillWidth: true - echoMode: TextInput.Password - onAccepted: { - if (userField.text && passwordField.text) - acceptDialog(); - } - } - } - Item { - Layout.fillHeight: true - } - RowLayout { - Layout.alignment: Qt.AlignRight - spacing: 8 - Button { - id: cancelButton - text: qsTr("Cancel") - onClicked: rejectDialog() - } - Button { - text: qsTr("Log In") - onClicked: acceptDialog() - } - } - } -} diff --git a/src/webenginequick/ui2/CMakeLists.txt b/src/webenginequick/ui2/CMakeLists.txt deleted file mode 100644 index b2ca73027..000000000 --- a/src/webenginequick/ui2/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -set(qml_files - "AlertDialog.qml" - "AuthenticationDialog.qml" - "ConfirmDialog.qml" - "Menu.qml" - "MenuItem.qml" - "MenuSeparator.qml" - "PromptDialog.qml" - "ToolTip.qml" -) - -set(resource_files - "information.png" - "question.png" -) - -qt_internal_add_qml_module(WebEngineQuickDelegatesQml - URI "QtWebEngine.Controls2Delegates" - VERSION "${PROJECT_VERSION}" - QML_FILES ${qml_files} - PAST_MAJOR_VERSIONS 1 - NO_SYNC_QT - PLUGIN_TARGET qtwebenginequickdelegatesplugin - DEPENDENCIES QtQuickControls2 -) - -qt_internal_add_resource(qtwebenginequickdelegatesplugin "qtwebenginequickdelegatesplugin" - PREFIX - "/qt-project.org/imports/QtWebEngine/Controls2Delegates" - FILES - ${resource_files} -) - -make_install_only(WebEngineQuickDelegatesQml) -make_install_only(qtwebenginequickdelegatesplugin) - diff --git a/src/webenginequick/ui2/ConfirmDialog.qml b/src/webenginequick/ui2/ConfirmDialog.qml deleted file mode 100644 index 8e91feffc..000000000 --- a/src/webenginequick/ui2/ConfirmDialog.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -Dialog { - property alias text: message.text - property bool handled: false - signal accepted() - signal rejected() - title: qsTr("Alert Dialog") - modal: false - anchors.centerIn: parent - - //handle the case where users simply closes the dialog - onVisibleChanged: { - if (visible == false && handled == false) { - handled = true; - rejected(); - } else { - handled = false; - } - } - - function acceptDialog() { - accepted(); - handled = true; - close(); - } - - function rejectDialog() { - rejected(); - handled = true; - close(); - } - - ColumnLayout { - id: rootLayout - anchors.fill: parent - anchors.margins: 4 - property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins - property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins - property int doubleMargins: anchors.margins * 2 - SystemPalette { id: palette; colorGroup: SystemPalette.Active } - RowLayout { - Layout.alignment: Qt.AlignRight - spacing: 8 - Image { - source: "qrc:/qt-project.org/imports/QtWebEngine/Controls2Delegates/question.png" - } - Text { - id: message - Layout.fillWidth: true - color: palette.windowText - } - } - Item { - Layout.fillHeight: true - } - RowLayout { - Layout.alignment: Qt.AlignRight - spacing: 8 - Button { - text: qsTr("OK") - onClicked: acceptDialog() - } - Button { - text: qsTr("Cancel") - onClicked: rejectDialog() - } - } - } -} diff --git a/src/webenginequick/ui2/Menu.qml b/src/webenginequick/ui2/Menu.qml deleted file mode 100644 index c34028b0a..000000000 --- a/src/webenginequick/ui2/Menu.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick -import QtQuick.Controls - -Menu { - id: menu - signal done() - - // Use private API for now - onAboutToHide: doneTimer.start() - - // WORKAROUND On Mac the Menu may be destroyed before the MenuItem - // is actually triggered (see qtbase commit 08cc9b9991ae9ab51) - Timer { - id: doneTimer - interval: 100 - onTriggered: menu.done() - } -} diff --git a/src/webenginequick/ui2/MenuItem.qml b/src/webenginequick/ui2/MenuItem.qml deleted file mode 100644 index fb01e0aec..000000000 --- a/src/webenginequick/ui2/MenuItem.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick.Controls - -MenuItem { } - diff --git a/src/webenginequick/ui2/MenuSeparator.qml b/src/webenginequick/ui2/MenuSeparator.qml deleted file mode 100644 index 3d73adf5e..000000000 --- a/src/webenginequick/ui2/MenuSeparator.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick - -Item { id: dummy } diff --git a/src/webenginequick/ui2/PromptDialog.qml b/src/webenginequick/ui2/PromptDialog.qml deleted file mode 100644 index 3c9596cec..000000000 --- a/src/webenginequick/ui2/PromptDialog.qml +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -Dialog { - property alias text: message.text - property alias prompt: field.text - property bool handled: false - signal input(string text) - signal accepted() - signal rejected() - title: qsTr("Prompt Dialog") - modal: false - anchors.centerIn: parent - - //handle the case where users simply closes the dialog - onVisibleChanged: { - if (visible == false && handled == false) { - handled = true; - rejected(); - } else { - handled = false; - } - } - - function acceptDialog() { - input(field.text); - accepted(); - handled = true; - close(); - } - - function rejectDialog() { - rejected(); - handled = true; - close(); - } - - ColumnLayout { - id: rootLayout - anchors.fill: parent - anchors.margins: 4 - property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins - property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins - property int doubleMargins: anchors.margins * 2 - SystemPalette { id: palette; colorGroup: SystemPalette.Active } - Text { - id: message - Layout.fillWidth: true - color: palette.windowText - } - TextField { - id:field - focus: true - Layout.fillWidth: true - onAccepted: acceptDialog() - } - Item { - Layout.fillHeight: true - } - RowLayout { - Layout.alignment: Qt.AlignRight - spacing: 8 - Button { - text: qsTr("OK") - onClicked: acceptDialog() - } - Button { - text: qsTr("Cancel") - onClicked: rejectDialog() - } - } - } - -} diff --git a/src/webenginequick/ui2/ToolTip.qml b/src/webenginequick/ui2/ToolTip.qml deleted file mode 100644 index 7fb8145b4..000000000 --- a/src/webenginequick/ui2/ToolTip.qml +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick.Controls - -ToolTip { - delay: 1000 - timeout: 1500 -} diff --git a/src/webenginequick/ui2/information.png b/src/webenginequick/ui2/information.png deleted file mode 100644 index 0a2eb87d1..000000000 Binary files a/src/webenginequick/ui2/information.png and /dev/null differ diff --git a/src/webenginequick/ui2/question.png b/src/webenginequick/ui2/question.png deleted file mode 100644 index 2dd92fd79..000000000 Binary files a/src/webenginequick/ui2/question.png and /dev/null differ diff --git a/src/webenginequick/ui2/ui2.pro b/src/webenginequick/ui2/ui2.pro deleted file mode 100644 index 4628d40b5..000000000 --- a/src/webenginequick/ui2/ui2.pro +++ /dev/null @@ -1,18 +0,0 @@ -TARGETPATH = QtWebEngine/Controls2Delegates - -QML_FILES += \ - # Authentication Dialog - AuthenticationDialog.qml \ - # JS Dialogs - AlertDialog.qml \ - ConfirmDialog.qml \ - PromptDialog.qml \ - # Menus. Based on Qt Quick Controls - Menu.qml \ - MenuItem.qml \ - MenuSeparator.qml \ - ToolTip.qml \ - information.png \ - question.png - -load(qml_module) diff --git a/src/webenginequick/ui_delegates_manager.cpp b/src/webenginequick/ui_delegates_manager.cpp index 756b3429e..02f0f124f 100644 --- a/src/webenginequick/ui_delegates_manager.cpp +++ b/src/webenginequick/ui_delegates_manager.cpp @@ -658,22 +658,16 @@ bool UI2DelegatesManager::initializeImportDirs(QStringList &dirs, QQmlEngine *en { const QStringList paths = engine->importPathList(); for (const QString &path : paths) { - QString controls2ImportPath = path % QLatin1String("/QtWebEngine/Controls2Delegates/"); - QString controls1ImportPath = path % QLatin1String("/QtWebEngine/Controls1Delegates/"); + QString controlsImportPath = path % QLatin1String("/QtWebEngine/ControlsDelegates/"); // resource paths have to be tested using the ":/" prefix - if (controls2ImportPath.startsWith(QLatin1String("qrc:/"))) { - controls2ImportPath.remove(0, 3); - controls1ImportPath.remove(0, 3); + if (controlsImportPath.startsWith(QLatin1String("qrc:/"))) { + controlsImportPath.remove(0, 3); } - QFileInfo fi2(controls2ImportPath); - if (fi2.exists()) - dirs << fi2.absolutePath(); - - QFileInfo fi1(controls1ImportPath); - if (fi1.exists()) - dirs << fi1.absolutePath(); + QFileInfo fi(controlsImportPath); + if (fi.exists()) + dirs << fi.absolutePath(); } return !dirs.isEmpty(); } diff --git a/src/webenginequick/webenginequick.pro b/src/webenginequick/webenginequick.pro index fe27ee089..17b3bd0fa 100644 --- a/src/webenginequick/webenginequick.pro +++ b/src/webenginequick/webenginequick.pro @@ -14,6 +14,5 @@ qtConfig(webenginequick-testsupport) { } qtConfig(webenginequick-ui-delegates) { - SUBDIRS += ui \ - ui2 + SUBDIRS += ui } -- cgit v1.2.3