From 2e0048afd1283e5995ec26a1d31643dc32e8d97a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jens.bache-wiig@digia.com> Date: Thu, 7 Feb 2013 18:47:37 +0100 Subject: [PATCH] Introduce private plugin Change-Id: I4beedc773df5b9b207554b55e86aa1439cb4d06e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> --- examples/gallery/main.qml | 1 + src/{qtdesktop => }/private/BasicButton.qml | 8 +- .../private/ButtonBehavior.qml | 0 src/{qtdesktop => }/private/FocusFrame.qml | 2 +- .../private/ModalPopupBehavior.qml | 0 .../private/PageSlideTransition.qml | 0 src/{qtdesktop => }/private/PageStack.js | 0 .../private/ScrollAreaHelper.qml | 1 + src/{qtdesktop => }/private/ScrollBar.qml | 1 + src/{qtdesktop => }/private/Splitter.qml | 0 src/{qtdesktop => }/private/TabBar.qml | 0 src/private/private.pro | 45 ++++++ .../privateplugin.json} | 0 src/private/qmldir | 8 + src/private/qprivateplugin.cpp | 68 +++++++++ src/private/qprivateplugin_p.h | 60 ++++++++ .../qquickcomponentsprivate.cpp | 0 .../qquickcomponentsprivate_p.h | 0 src/{qtdesktop => private}/qrangemodel.cpp | 0 src/{qtdesktop => private}/qrangemodel_p.h | 0 src/{qtdesktop => private}/qrangemodel_p_p.h | 0 src/{qtdesktop => private}/qstyleitem.cpp | 0 src/{qtdesktop => private}/qstyleitem_p.h | 0 src/{qtdesktop => private}/qtsplitterbase.cpp | 0 src/{qtdesktop => private}/qtsplitterbase_p.h | 0 src/{qtdesktop => private}/qwheelarea.cpp | 0 src/{qtdesktop => private}/qwheelarea_p.h | 0 src/qtdesktop/ApplicationWindow.qml | 1 + src/qtdesktop/Button.qml | 2 +- src/qtdesktop/CheckBox.qml | 2 +- src/qtdesktop/ComboBox.qml | 4 +- src/qtdesktop/PageStack.qml | 4 +- src/qtdesktop/ScrollArea.qml | 6 +- src/qtdesktop/Slider.qml | 1 + src/qtdesktop/SplitterColumn.qml | 2 +- src/qtdesktop/SplitterRow.qml | 2 +- src/qtdesktop/TabFrame.qml | 2 +- src/qtdesktop/TableView.qml | 2 +- src/qtdesktop/TextArea.qml | 2 +- src/qtdesktop/ToolBar.qml | 1 + src/qtdesktop/ToolButton.qml | 2 +- .../{qstyleplugin.cpp => plugin.cpp} | 25 +--- src/qtdesktop/plugin.json | 1 + src/qtdesktop/{styleplugin.pri => plugin.pri} | 19 +-- .../{qstyleplugin_p.h => plugin_p.h} | 2 +- src/qtdesktop/private/ButtonGroup.js | 141 ------------------ src/qtdesktop/qmldir | 2 +- src/qtdesktop/qtdesktop.pro | 21 +-- src/src.pro | 2 +- src/styles/Desktop/ButtonStyle.qml | 1 + src/styles/Desktop/CheckBoxStyle.qml | 1 + src/styles/Desktop/ComboBoxStyle.qml | 1 + src/styles/Desktop/GroupBoxStyle.qml | 1 + src/styles/Desktop/MenuBarItemStyle.qml | 1 + src/styles/Desktop/MenuBarStyle.qml | 1 + src/styles/Desktop/MenuFrameStyle.qml | 1 + src/styles/Desktop/MenuItemStyle.qml | 1 + src/styles/Desktop/ProgressBarStyle.qml | 1 + src/styles/Desktop/RadioButtonStyle.qml | 1 + src/styles/Desktop/ScrollAreaStyle.qml | 1 + src/styles/Desktop/ScrollBarStyle.qml | 1 + src/styles/Desktop/SliderStyle.qml | 1 + src/styles/Desktop/SpinBoxStyle.qml | 1 + src/styles/Desktop/TabFrameStyle.qml | 1 + src/styles/Desktop/TextFieldStyle.qml | 1 + src/styles/Desktop/ToolBarStyle.qml | 1 + src/styles/Desktop/ToolButtonStyle.qml | 1 + .../qtdesktop/data/rangemodel/rangemodel.qml | 2 +- tests/auto/qtdesktop/data/tst_shortcuts.qml | 2 +- 69 files changed, 240 insertions(+), 222 deletions(-) rename src/{qtdesktop => }/private/BasicButton.qml (93%) rename src/{qtdesktop => }/private/ButtonBehavior.qml (100%) rename src/{qtdesktop => }/private/FocusFrame.qml (98%) rename src/{qtdesktop => }/private/ModalPopupBehavior.qml (100%) rename src/{qtdesktop => }/private/PageSlideTransition.qml (100%) rename src/{qtdesktop => }/private/PageStack.js (100%) rename src/{qtdesktop => }/private/ScrollAreaHelper.qml (99%) rename src/{qtdesktop => }/private/ScrollBar.qml (99%) rename src/{qtdesktop => }/private/Splitter.qml (100%) rename src/{qtdesktop => }/private/TabBar.qml (100%) create mode 100644 src/private/private.pro rename src/{qtdesktop/styleplugin.json => private/privateplugin.json} (100%) create mode 100644 src/private/qmldir create mode 100644 src/private/qprivateplugin.cpp create mode 100644 src/private/qprivateplugin_p.h rename src/{qtdesktop => private}/qquickcomponentsprivate.cpp (100%) rename src/{qtdesktop => private}/qquickcomponentsprivate_p.h (100%) rename src/{qtdesktop => private}/qrangemodel.cpp (100%) rename src/{qtdesktop => private}/qrangemodel_p.h (100%) rename src/{qtdesktop => private}/qrangemodel_p_p.h (100%) rename src/{qtdesktop => private}/qstyleitem.cpp (100%) rename src/{qtdesktop => private}/qstyleitem_p.h (100%) rename src/{qtdesktop => private}/qtsplitterbase.cpp (100%) rename src/{qtdesktop => private}/qtsplitterbase_p.h (100%) rename src/{qtdesktop => private}/qwheelarea.cpp (100%) rename src/{qtdesktop => private}/qwheelarea_p.h (100%) rename src/qtdesktop/{qstyleplugin.cpp => plugin.cpp} (85%) create mode 100644 src/qtdesktop/plugin.json rename src/qtdesktop/{styleplugin.pri => plugin.pri} (55%) rename src/qtdesktop/{qstyleplugin_p.h => plugin_p.h} (97%) delete mode 100644 src/qtdesktop/private/ButtonGroup.js diff --git a/examples/gallery/main.qml b/examples/gallery/main.qml index 2760e066f..6ac0af862 100644 --- a/examples/gallery/main.qml +++ b/examples/gallery/main.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 import "content" ApplicationWindow { diff --git a/src/qtdesktop/private/BasicButton.qml b/src/private/BasicButton.qml similarity index 93% rename from src/qtdesktop/private/BasicButton.qml rename to src/private/BasicButton.qml index 1e5838312..c4a5bbe71 100644 --- a/src/qtdesktop/private/BasicButton.qml +++ b/src/private/BasicButton.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtDesktop 1.0 as Internal +import QtDesktop.Private 1.0 Item { id: button @@ -95,14 +95,14 @@ Item { id: behavior anchors.fill: parent onClicked: button.clicked() - onExited: Internal.PrivateHelper.hideToolTip() - onCanceled: Internal.PrivateHelper.hideToolTip() + onExited: PrivateHelper.hideToolTip() + onCanceled: PrivateHelper.hideToolTip() onPressed: if (activeFocusOnPress) button.forceActiveFocus() Timer { interval: 1000 running: containsMouse && !pressed && tooltip.length - onTriggered: Internal.PrivateHelper.showToolTip(behavior, Qt.point(behavior.mouseX, behavior.mouseY), tooltip) + onTriggered: PrivateHelper.showToolTip(behavior, Qt.point(behavior.mouseX, behavior.mouseY), tooltip) } } diff --git a/src/qtdesktop/private/ButtonBehavior.qml b/src/private/ButtonBehavior.qml similarity index 100% rename from src/qtdesktop/private/ButtonBehavior.qml rename to src/private/ButtonBehavior.qml diff --git a/src/qtdesktop/private/FocusFrame.qml b/src/private/FocusFrame.qml similarity index 98% rename from src/qtdesktop/private/FocusFrame.qml rename to src/private/FocusFrame.qml index 9eb0870a6..6f943cd53 100644 --- a/src/qtdesktop/private/FocusFrame.qml +++ b/src/private/FocusFrame.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { z: 2 diff --git a/src/qtdesktop/private/ModalPopupBehavior.qml b/src/private/ModalPopupBehavior.qml similarity index 100% rename from src/qtdesktop/private/ModalPopupBehavior.qml rename to src/private/ModalPopupBehavior.qml diff --git a/src/qtdesktop/private/PageSlideTransition.qml b/src/private/PageSlideTransition.qml similarity index 100% rename from src/qtdesktop/private/PageSlideTransition.qml rename to src/private/PageSlideTransition.qml diff --git a/src/qtdesktop/private/PageStack.js b/src/private/PageStack.js similarity index 100% rename from src/qtdesktop/private/PageStack.js rename to src/private/PageStack.js diff --git a/src/qtdesktop/private/ScrollAreaHelper.qml b/src/private/ScrollAreaHelper.qml similarity index 99% rename from src/qtdesktop/private/ScrollAreaHelper.qml rename to src/private/ScrollAreaHelper.qml index df9d537cd..086ec60ec 100644 --- a/src/qtdesktop/private/ScrollAreaHelper.qml +++ b/src/private/ScrollAreaHelper.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 Item { id: wheelarea diff --git a/src/qtdesktop/private/ScrollBar.qml b/src/private/ScrollBar.qml similarity index 99% rename from src/qtdesktop/private/ScrollBar.qml rename to src/private/ScrollBar.qml index 924944727..3b3be4d4b 100644 --- a/src/qtdesktop/private/ScrollBar.qml +++ b/src/private/ScrollBar.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 import "../Styles/Settings.js" as Settings Item { diff --git a/src/qtdesktop/private/Splitter.qml b/src/private/Splitter.qml similarity index 100% rename from src/qtdesktop/private/Splitter.qml rename to src/private/Splitter.qml diff --git a/src/qtdesktop/private/TabBar.qml b/src/private/TabBar.qml similarity index 100% rename from src/qtdesktop/private/TabBar.qml rename to src/private/TabBar.qml diff --git a/src/private/private.pro b/src/private/private.pro new file mode 100644 index 000000000..b0a8fa4ff --- /dev/null +++ b/src/private/private.pro @@ -0,0 +1,45 @@ +CXX_MODULE = qml +TARGET = privateplugin +TARGETPATH = QtDesktop/Private + +QT += qml quick widgets gui-private core-private + +HEADERS += \ + $$PWD/qquickcomponentsprivate_p.h \ + $$PWD/qprivateplugin_p.h\ + $$PWD/qrangemodel_p.h \ + $$PWD/qrangemodel_p_p.h \ + $$PWD/qwheelarea_p.h \ + $$PWD/qstyleitem_p.h \ + $$PWD/qtsplitterbase_p.h + +SOURCES += \ + $$PWD/qquickcomponentsprivate.cpp \ + $$PWD/qprivateplugin.cpp\ + $$PWD/qstyleitem.cpp \ + $$PWD/qrangemodel.cpp\ + $$PWD/qwheelarea.cpp \ + $$PWD/qtsplitterbase.cpp + +OTHER_FILES += \ + $$PWD/privateplugin.json + +# private qml files +QML_FILES += \ + TabBar.qml \ + BasicButton.qml \ + ButtonBehavior.qml \ + ModalPopupBehavior.qml \ + PageSlideTransition.qml \ + PageStack.js \ + ScrollAreaHelper.qml \ + Splitter.qml \ + ScrollBar.qml \ + FocusFrame.qml + +mac { + LIBS += -framework Carbon +} + +load(qml_plugin) + diff --git a/src/qtdesktop/styleplugin.json b/src/private/privateplugin.json similarity index 100% rename from src/qtdesktop/styleplugin.json rename to src/private/privateplugin.json diff --git a/src/private/qmldir b/src/private/qmldir new file mode 100644 index 000000000..b67fcbd2a --- /dev/null +++ b/src/private/qmldir @@ -0,0 +1,8 @@ +module QtDesktop.Private +plugin privateplugin +ButtonBehavior 1.0 ButtonBehavior.qml +FocusFrame 1.0 FocusFrame.qml +BasicButton 1.0 BasicButton.qml +ScrollBar 1.0 ScrollBar.qml +ScrollAreaHelper 1.0 ScrollAreaHelper.qml +TabBar 1.0 TabBar.qml diff --git a/src/private/qprivateplugin.cpp b/src/private/qprivateplugin.cpp new file mode 100644 index 000000000..b44b53cce --- /dev/null +++ b/src/private/qprivateplugin.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Components project. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qqml.h> +#include "qprivateplugin_p.h" +#include "qrangemodel_p.h" +#include "qwheelarea_p.h" +#include "qstyleitem_p.h" +#include "qquickcomponentsprivate_p.h" +#include "qtsplitterbase_p.h" + +QT_BEGIN_NAMESPACE + +QObject *registerPrivateModule(QQmlEngine *engine, QJSEngine *jsEngine) +{ + Q_UNUSED(engine); + Q_UNUSED(jsEngine); + return new QQuickComponentsPrivate(); +} + + +void StylePlugin::registerTypes(const char *uri) +{ + qmlRegisterType<QRangeModel>(uri, 1, 0, "RangeModel"); + qmlRegisterType<QWheelArea>(uri, 1, 0, "WheelArea"); + qmlRegisterType<QStyleItem>(uri, 1, 0, "StyleItem"); + qmlRegisterType<QtSplitterBase>(uri, 1, 0, "Splitter"); + qmlRegisterSingletonType<QQuickComponentsPrivate>(uri, 1, 0, "PrivateHelper", registerPrivateModule); +} + +QT_END_NAMESPACE diff --git a/src/private/qprivateplugin_p.h b/src/private/qprivateplugin_p.h new file mode 100644 index 000000000..7d7425089 --- /dev/null +++ b/src/private/qprivateplugin_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Components project. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSTYLEPLUGIN_P_H +#define QSTYLEPLUGIN_P_H + +#include <QQmlExtensionPlugin> +#include <QtCore/QTimer> +#include <QtWidgets/QFileSystemModel> + +QT_BEGIN_NAMESPACE + +class StylePlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.playground.qtdesktopcomponents.QQmlExtensionInterface" FILE "privateplugin.json") +public: + void registerTypes(const char *uri); +}; + +QT_END_NAMESPACE + +#endif // QSTYLEPLUGIN_P_H diff --git a/src/qtdesktop/qquickcomponentsprivate.cpp b/src/private/qquickcomponentsprivate.cpp similarity index 100% rename from src/qtdesktop/qquickcomponentsprivate.cpp rename to src/private/qquickcomponentsprivate.cpp diff --git a/src/qtdesktop/qquickcomponentsprivate_p.h b/src/private/qquickcomponentsprivate_p.h similarity index 100% rename from src/qtdesktop/qquickcomponentsprivate_p.h rename to src/private/qquickcomponentsprivate_p.h diff --git a/src/qtdesktop/qrangemodel.cpp b/src/private/qrangemodel.cpp similarity index 100% rename from src/qtdesktop/qrangemodel.cpp rename to src/private/qrangemodel.cpp diff --git a/src/qtdesktop/qrangemodel_p.h b/src/private/qrangemodel_p.h similarity index 100% rename from src/qtdesktop/qrangemodel_p.h rename to src/private/qrangemodel_p.h diff --git a/src/qtdesktop/qrangemodel_p_p.h b/src/private/qrangemodel_p_p.h similarity index 100% rename from src/qtdesktop/qrangemodel_p_p.h rename to src/private/qrangemodel_p_p.h diff --git a/src/qtdesktop/qstyleitem.cpp b/src/private/qstyleitem.cpp similarity index 100% rename from src/qtdesktop/qstyleitem.cpp rename to src/private/qstyleitem.cpp diff --git a/src/qtdesktop/qstyleitem_p.h b/src/private/qstyleitem_p.h similarity index 100% rename from src/qtdesktop/qstyleitem_p.h rename to src/private/qstyleitem_p.h diff --git a/src/qtdesktop/qtsplitterbase.cpp b/src/private/qtsplitterbase.cpp similarity index 100% rename from src/qtdesktop/qtsplitterbase.cpp rename to src/private/qtsplitterbase.cpp diff --git a/src/qtdesktop/qtsplitterbase_p.h b/src/private/qtsplitterbase_p.h similarity index 100% rename from src/qtdesktop/qtsplitterbase_p.h rename to src/private/qtsplitterbase_p.h diff --git a/src/qtdesktop/qwheelarea.cpp b/src/private/qwheelarea.cpp similarity index 100% rename from src/qtdesktop/qwheelarea.cpp rename to src/private/qwheelarea.cpp diff --git a/src/qtdesktop/qwheelarea_p.h b/src/private/qwheelarea_p.h similarity index 100% rename from src/qtdesktop/qwheelarea_p.h rename to src/private/qwheelarea_p.h diff --git a/src/qtdesktop/ApplicationWindow.qml b/src/qtdesktop/ApplicationWindow.qml index 62f096a37..8e429a41c 100644 --- a/src/qtdesktop/ApplicationWindow.qml +++ b/src/qtdesktop/ApplicationWindow.qml @@ -41,6 +41,7 @@ import QtQuick 2.0 import QtQuick.Window 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 /*! \qmltype ApplicationWindow diff --git a/src/qtdesktop/Button.qml b/src/qtdesktop/Button.qml index 06cae159b..5e36b09ef 100644 --- a/src/qtdesktop/Button.qml +++ b/src/qtdesktop/Button.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" +import QtDesktop.Private 1.0 import "Styles/Settings.js" as Settings /*! diff --git a/src/qtdesktop/CheckBox.qml b/src/qtdesktop/CheckBox.qml index ef83bb327..033e09b39 100644 --- a/src/qtdesktop/CheckBox.qml +++ b/src/qtdesktop/CheckBox.qml @@ -41,7 +41,7 @@ import QtQuick 2.0 import QtDesktop 1.0 import "Styles/Settings.js" as Settings -import "private" +import QtDesktop.Private 1.0 /*! \qmltype CheckBox diff --git a/src/qtdesktop/ComboBox.qml b/src/qtdesktop/ComboBox.qml index ba2978cc8..9307e5b85 100644 --- a/src/qtdesktop/ComboBox.qml +++ b/src/qtdesktop/ComboBox.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" as Private +import QtDesktop.Private 1.0 import "Styles/Settings.js" as Settings /*! @@ -96,7 +96,7 @@ import "Styles/Settings.js" as Settings \endqml */ -Private.BasicButton { +BasicButton { id: comboBox default property alias menuItems: popup.menuItems diff --git a/src/qtdesktop/PageStack.qml b/src/qtdesktop/PageStack.qml index 7eade6dbb..f1e708bec 100644 --- a/src/qtdesktop/PageStack.qml +++ b/src/qtdesktop/PageStack.qml @@ -41,8 +41,8 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" -import "private/PageStack.js" as JSArray +import QtDesktop.Private 1.0 +import QtDesktop.Private 1.0/PageStack.js" as JSArray /*! \qmlclass QtDesktop.PageStack diff --git a/src/qtdesktop/ScrollArea.qml b/src/qtdesktop/ScrollArea.qml index acdbfc655..a62cda1e3 100644 --- a/src/qtdesktop/ScrollArea.qml +++ b/src/qtdesktop/ScrollArea.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" as Private +import QtDesktop.Private 1.0 /*! \qmltype ScrollArea @@ -228,7 +228,7 @@ FocusScope { onHorizontalValueChanged: flickableItem.contentX = horizontalValue } - Private.ScrollAreaHelper { + ScrollAreaHelper { id: scroller anchors.fill: parent property int frameWidth: frame ? styleitem.pixelMetric("defaultframewidth") : 0 @@ -258,6 +258,6 @@ FocusScope { clip: true } } - Private.FocusFrame { visible: highlightOnFocus && area.activeFocus } + FocusFrame { visible: highlightOnFocus && area.activeFocus } } } diff --git a/src/qtdesktop/Slider.qml b/src/qtdesktop/Slider.qml index 4cadc7904..1c86f0e34 100644 --- a/src/qtdesktop/Slider.qml +++ b/src/qtdesktop/Slider.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 import "Styles/Settings.js" as Settings /*! diff --git a/src/qtdesktop/SplitterColumn.qml b/src/qtdesktop/SplitterColumn.qml index 9b9fc7f5c..51f6457ae 100644 --- a/src/qtdesktop/SplitterColumn.qml +++ b/src/qtdesktop/SplitterColumn.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import "private" as Private +import QtDesktop.Private 1.0 as Private import QtDesktop 1.0 /*! diff --git a/src/qtdesktop/SplitterRow.qml b/src/qtdesktop/SplitterRow.qml index e56342348..d9ee388fc 100644 --- a/src/qtdesktop/SplitterRow.qml +++ b/src/qtdesktop/SplitterRow.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import "private" as Private +import QtDesktop.Private 1.0 as Private import QtDesktop 1.0 /*! diff --git a/src/qtdesktop/TabFrame.qml b/src/qtdesktop/TabFrame.qml index f64f89dc2..e7d4726a2 100644 --- a/src/qtdesktop/TabFrame.qml +++ b/src/qtdesktop/TabFrame.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" +import QtDesktop.Private 1.0 import "Styles/Settings.js" as Settings /*! diff --git a/src/qtdesktop/TableView.qml b/src/qtdesktop/TableView.qml index 8a90e5e4d..7ad028800 100644 --- a/src/qtdesktop/TableView.qml +++ b/src/qtdesktop/TableView.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" as Private +import QtDesktop.Private 1.0 /*! \qmltype TableView diff --git a/src/qtdesktop/TextArea.qml b/src/qtdesktop/TextArea.qml index f94b08bed..09521a713 100644 --- a/src/qtdesktop/TextArea.qml +++ b/src/qtdesktop/TextArea.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 - +import QtDesktop.Private 1.0 /*! \qmltype TextArea \inqmlmodule QtDesktop 1.0 diff --git a/src/qtdesktop/ToolBar.qml b/src/qtdesktop/ToolBar.qml index 6eb102dfa..34efc11b6 100644 --- a/src/qtdesktop/ToolBar.qml +++ b/src/qtdesktop/ToolBar.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 /*! \qmltype ToolBar diff --git a/src/qtdesktop/ToolButton.qml b/src/qtdesktop/ToolButton.qml index 812f10b4d..63773cd64 100644 --- a/src/qtdesktop/ToolButton.qml +++ b/src/qtdesktop/ToolButton.qml @@ -40,7 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 -import "private" as Private +import QtDesktop.Private 1.0 as Private import "Styles/Settings.js" as Settings /*! diff --git a/src/qtdesktop/qstyleplugin.cpp b/src/qtdesktop/plugin.cpp similarity index 85% rename from src/qtdesktop/qstyleplugin.cpp rename to src/qtdesktop/plugin.cpp index 866027a00..b8c768914 100644 --- a/src/qtdesktop/qstyleplugin.cpp +++ b/src/qtdesktop/plugin.cpp @@ -39,17 +39,12 @@ ****************************************************************************/ #include <qqml.h> -#include "qstyleplugin_p.h" -#include "qstyleitem_p.h" -#include "qrangemodel_p.h" +#include "plugin_p.h" #include "qtaction_p.h" #include "qtexclusivegroup_p.h" #include "qtmenu_p.h" #include "qtmenubar_p.h" -#include "qwheelarea_p.h" -#include "qtsplitterbase_p.h" #include "qquicklinearlayout_p.h" -#include "qquickcomponentsprivate_p.h" #include "qpagestatus.h" #include <qqmlextensionplugin.h> @@ -81,36 +76,22 @@ public: } }; -QObject *registerPrivateModule(QQmlEngine *engine, QJSEngine *jsEngine) -{ - Q_UNUSED(engine); - Q_UNUSED(jsEngine); - return new QQuickComponentsPrivate(); -} - void StylePlugin::registerTypes(const char *uri) { - qmlRegisterSingletonType<QQuickComponentsPrivate>(uri, 1, 0, "PrivateHelper", registerPrivateModule); - - qmlRegisterType<QStyleItem>(uri, 1, 0, "StyleItem"); - qmlRegisterType<QRangeModel>(uri, 1, 0, "RangeModel"); - qmlRegisterType<QWheelArea>(uri, 1, 0, "WheelArea"); - qmlRegisterType<QtAction>(uri, 1, 0, "Action"); qmlRegisterType<QtExclusiveGroup>(uri, 1, 0, "ExclusiveGroup"); qmlRegisterType<QtMenu>(uri, 1, 0, "MenuPrivate"); qmlRegisterType<QtMenuBar>(uri, 1, 0, "MenuBarPrivate"); qmlRegisterType<QtMenuItem>(uri, 1, 0, "MenuItem"); qmlRegisterType<QtMenuSeparator>(uri, 1, 0, "MenuSeparator"); + qmlRegisterType<QtMenuSeparator>(uri, 1, 0, "Separator"); + qmlRegisterUncreatableType<QtMenuBase>(uri, 1, 0, "NativeMenuBase", QLatin1String("Do not create objects of type NativeMenuBase")); qmlRegisterType<QQuickComponentsRowLayout>(uri, 1, 0, "RowLayout"); qmlRegisterType<QQuickComponentsColumnLayout>(uri, 1, 0, "ColumnLayout"); qmlRegisterUncreatableType<QQuickComponentsLayout>(uri, 1, 0, "Layout", QLatin1String("Do not create objects of type Layout")); - qmlRegisterType<QtSplitterBase>(uri, 1, 0, "Splitter"); - - qmlRegisterUncreatableType<QtMenuBase>(uri, 1, 0, "NativeMenuBase", QLatin1String("Do not create objects of type NativeMenuBase")); qmlRegisterUncreatableType<QPageStatus>(uri, 1, 0, "PageStatus", QLatin1String("Do not create objects of type PageStatus")); } diff --git a/src/qtdesktop/plugin.json b/src/qtdesktop/plugin.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/src/qtdesktop/plugin.json @@ -0,0 +1 @@ +{} diff --git a/src/qtdesktop/styleplugin.pri b/src/qtdesktop/plugin.pri similarity index 55% rename from src/qtdesktop/styleplugin.pri rename to src/qtdesktop/plugin.pri index fd5f015f7..5637e75cc 100644 --- a/src/qtdesktop/styleplugin.pri +++ b/src/qtdesktop/plugin.pri @@ -1,38 +1,27 @@ HEADERS += \ - $$PWD/qquickcomponentsprivate_p.h \ $$PWD/qquicklayout_p.h \ $$PWD/qquicklayoutengine_p.h \ $$PWD/qquicklinearlayout_p.h \ - $$PWD/qrangemodel_p.h \ - $$PWD/qrangemodel_p_p.h \ - $$PWD/qstyleitem_p.h \ - $$PWD/qstyleplugin_p.h \ + $$PWD/plugin_p.h \ $$PWD/qtaction_p.h \ $$PWD/qtexclusivegroup_p.h \ $$PWD/qtmenu_p.h \ $$PWD/qtmenubar_p.h \ $$PWD/qtmenuitem_p.h \ $$PWD/qtmenupopupwindow_p.h \ - $$PWD/qtsplitterbase_p.h \ - $$PWD/qwheelarea_p.h \ $$PWD/qpagestatus.h SOURCES += \ - $$PWD/qquickcomponentsprivate.cpp \ $$PWD/qquicklayout.cpp \ $$PWD/qquicklayoutengine.cpp \ $$PWD/qquicklinearlayout.cpp \ - $$PWD/qrangemodel.cpp \ - $$PWD/qstyleitem.cpp \ - $$PWD/qstyleplugin.cpp \ + $$PWD/plugin.cpp \ $$PWD/qtaction.cpp \ $$PWD/qtexclusivegroup.cpp \ $$PWD/qtmenu.cpp \ $$PWD/qtmenubar.cpp \ $$PWD/qtmenuitem.cpp \ - $$PWD/qtmenupopupwindow.cpp \ - $$PWD/qtsplitterbase.cpp \ - $$PWD/qwheelarea.cpp + $$PWD/qtmenupopupwindow.cpp OTHER_FILES += \ - $$PWD/styleplugin.json + $$PWD/plugin.json diff --git a/src/qtdesktop/qstyleplugin_p.h b/src/qtdesktop/plugin_p.h similarity index 97% rename from src/qtdesktop/qstyleplugin_p.h rename to src/qtdesktop/plugin_p.h index 4d50bce30..6d9574c2b 100644 --- a/src/qtdesktop/qstyleplugin_p.h +++ b/src/qtdesktop/plugin_p.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE class StylePlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.playground.qtdesktopcomponents.QQmlExtensionInterface" FILE "styleplugin.json") + Q_PLUGIN_METADATA(IID "org.qt-project.playground.qtdesktopcomponents.QQmlExtensionInterface" FILE "plugin.json") public: void registerTypes(const char *uri); void initializeEngine(QQmlEngine *engine, const char *uri); diff --git a/src/qtdesktop/private/ButtonGroup.js b/src/qtdesktop/private/ButtonGroup.js deleted file mode 100644 index 5b0d9adb0..000000000 --- a/src/qtdesktop/private/ButtonGroup.js +++ /dev/null @@ -1,141 +0,0 @@ -var self; -var checkHandlers = []; -var visibleButtons = []; -var nonVisibleButtons = []; -var direction; - -function create(that, options) { - self = that; - direction = options.direction || Qt.Horizontal; - self.childrenChanged.connect(rebuild); -// self.widthChanged.connect(resizeChildren); - build(); -} - -function isButton(item) { - if (item && item.hasOwnProperty("__position")) - return true; - return false; -} - -function hasChecked(item) { - return (item && item.hasOwnProperty("checked")); -} - -function destroy() { - self.childrenChanged.disconnect(rebuild); -// self.widthChanged.disconnect(resizeChildren); - cleanup(); -} - -function build() { - visibleButtons = []; - nonVisibleButtons = []; - - for (var i = 0, item; (item = self.children[i]); i++) { - - if (item.hasOwnProperty("styleHint")) - item.styleHint = styleHint; - - if (!hasChecked(item)) - continue; - - item.visibleChanged.connect(rebuild); // Not optimal, but hardly a bottleneck in your app - if (!item.visible) { - nonVisibleButtons.push(item); - continue; - } - visibleButtons.push(item); - - if (self.exclusive && item.hasOwnProperty("checkable")) - item.checkable = true; - - if (self.exclusive) { - item.checked = false; - checkHandlers.push(checkExclusive(item)); - item.checkedChanged.connect(checkHandlers[checkHandlers.length - 1]); - } - } - - var nrButtons = visibleButtons.length; - if (nrButtons == 0) - return; - - if (self.checkedButton) - self.checkedButton.checked = true; - else if (self.exclusive) { - self.checkedButton = visibleButtons[0]; - self.checkedButton.checked = true; - } - - if (nrButtons == 1) { - finishButton(visibleButtons[0], "only"); - } else { - finishButton(visibleButtons[0], direction == Qt.Horizontal ? "leftmost" : "top"); - for (var i = 1; i < nrButtons - 1; i++) - finishButton(visibleButtons[i], direction == Qt.Horizontal ? "h_middle": "v_middle"); - finishButton(visibleButtons[nrButtons - 1], direction == Qt.Horizontal ? "rightmost" : "bottom"); - } -} - -function finishButton(button, position) { - if (isButton(button)) { - button.__position = position; - if (direction == Qt.Vertical) { - button.anchors.left = self.left //mm How to make this not cause binding loops? see QTBUG-17162 - button.anchors.right = self.right - } - } -} - -function cleanup() { - visibleButtons.forEach(function(item, i) { - if (checkHandlers[i]) - item.checkedChanged.disconnect(checkHandlers[i]); - item.visibleChanged.disconnect(rebuild); - }); - checkHandlers = []; - - nonVisibleButtons.forEach(function(item, i) { - item.visibleChanged.disconnect(rebuild); - }); -} - -function rebuild() { - if (self == undefined) - return; - - cleanup(); - build(); -} - -function resizeChildren() { - if (direction != Qt.Horizontal) - return; - - var extraPixels = self.width % visibleButtons; - var buttonSize = (self.width - extraPixels) / visibleButtons; - visibleButtons.forEach(function(item, i) { - if (!item || !item.visible) - return; - item.width = buttonSize + (extraPixels > 0 ? 1 : 0); - if (extraPixels > 0) - extraPixels--; - }); -} - -function checkExclusive(item) { - var button = item; - return function() { - for (var i = 0, ref; (ref = visibleButtons[i]); i++) { - if (ref.checked == (button === ref)) - continue; - - // Disconnect the signal to avoid recursive calls - ref.checkedChanged.disconnect(checkHandlers[i]); - ref.checked = !ref.checked; - ref.checkedChanged.connect(checkHandlers[i]); - } - self.checkedButton = button; - } -} diff --git a/src/qtdesktop/qmldir b/src/qtdesktop/qmldir index 5e91f4ac2..2e6383303 100644 --- a/src/qtdesktop/qmldir +++ b/src/qtdesktop/qmldir @@ -1,5 +1,5 @@ module QtDesktop -plugin styleplugin +plugin plugin ApplicationWindow 1.0 ApplicationWindow.qml Button 1.0 Button.qml CheckBox 1.0 CheckBox.qml diff --git a/src/qtdesktop/qtdesktop.pro b/src/qtdesktop/qtdesktop.pro index a618385d1..52bdf33dd 100644 --- a/src/qtdesktop/qtdesktop.pro +++ b/src/qtdesktop/qtdesktop.pro @@ -1,5 +1,5 @@ CXX_MODULE = qml -TARGET = styleplugin +TARGET = plugin TARGETPATH = QtDesktop QT += qml quick widgets gui-private core-private @@ -37,26 +37,9 @@ QML_FILES = \ ToolBar.qml \ ToolButton.qml -# private qml files -QML_FILES += \ - private/TabBar.qml \ - private/BasicButton.qml \ - private/ButtonBehavior.qml \ - private/ButtonGroup.js \ - private/ModalPopupBehavior.qml \ - private/PageSlideTransition.qml \ - private/PageStack.js \ - private/ScrollAreaHelper.qml \ - private/Splitter.qml \ - private/ScrollBar.qml \ - private/FocusFrame.qml - -include(styleplugin.pri) +include(plugin.pri) DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -mac { - LIBS += -framework Carbon -} load(qml_plugin) diff --git a/src/src.pro b/src/src.pro index d7fe56765..224acacf2 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs -SUBDIRS += qtdesktop styles experimental +SUBDIRS += qtdesktop styles experimental private diff --git a/src/styles/Desktop/ButtonStyle.qml b/src/styles/Desktop/ButtonStyle.qml index e4cf7b683..6abee4389 100644 --- a/src/styles/Desktop/ButtonStyle.qml +++ b/src/styles/Desktop/ButtonStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 Item { width: implicitWidth diff --git a/src/styles/Desktop/CheckBoxStyle.qml b/src/styles/Desktop/CheckBoxStyle.qml index fb4d71955..61daa1a68 100644 --- a/src/styles/Desktop/CheckBoxStyle.qml +++ b/src/styles/Desktop/CheckBoxStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "checkbox" diff --git a/src/styles/Desktop/ComboBoxStyle.qml b/src/styles/Desktop/ComboBoxStyle.qml index 81cfa78f2..7a3818bba 100644 --- a/src/styles/Desktop/ComboBoxStyle.qml +++ b/src/styles/Desktop/ComboBoxStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 Item { width: implicitWidth diff --git a/src/styles/Desktop/GroupBoxStyle.qml b/src/styles/Desktop/GroupBoxStyle.qml index c24d70a02..14bd3909e 100644 --- a/src/styles/Desktop/GroupBoxStyle.qml +++ b/src/styles/Desktop/GroupBoxStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { id: styleitem diff --git a/src/styles/Desktop/MenuBarItemStyle.qml b/src/styles/Desktop/MenuBarItemStyle.qml index 9f60f7efb..be20f6494 100644 --- a/src/styles/Desktop/MenuBarItemStyle.qml +++ b/src/styles/Desktop/MenuBarItemStyle.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "menubaritem" diff --git a/src/styles/Desktop/MenuBarStyle.qml b/src/styles/Desktop/MenuBarStyle.qml index bbb86d94d..c7c312257 100644 --- a/src/styles/Desktop/MenuBarStyle.qml +++ b/src/styles/Desktop/MenuBarStyle.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "menubar" diff --git a/src/styles/Desktop/MenuFrameStyle.qml b/src/styles/Desktop/MenuFrameStyle.qml index a8d00276e..d7229061b 100644 --- a/src/styles/Desktop/MenuFrameStyle.qml +++ b/src/styles/Desktop/MenuFrameStyle.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "menu" diff --git a/src/styles/Desktop/MenuItemStyle.qml b/src/styles/Desktop/MenuItemStyle.qml index 4dc6606fe..867d93ca3 100644 --- a/src/styles/Desktop/MenuItemStyle.qml +++ b/src/styles/Desktop/MenuItemStyle.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "menuitem" diff --git a/src/styles/Desktop/ProgressBarStyle.qml b/src/styles/Desktop/ProgressBarStyle.qml index 5117bd557..fcd85401c 100644 --- a/src/styles/Desktop/ProgressBarStyle.qml +++ b/src/styles/Desktop/ProgressBarStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { anchors.fill: parent diff --git a/src/styles/Desktop/RadioButtonStyle.qml b/src/styles/Desktop/RadioButtonStyle.qml index 4829ff9dc..255411458 100644 --- a/src/styles/Desktop/RadioButtonStyle.qml +++ b/src/styles/Desktop/RadioButtonStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "radiobutton" diff --git a/src/styles/Desktop/ScrollAreaStyle.qml b/src/styles/Desktop/ScrollAreaStyle.qml index c1c1b8c50..0374aa776 100644 --- a/src/styles/Desktop/ScrollAreaStyle.qml +++ b/src/styles/Desktop/ScrollAreaStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { id: styleitem diff --git a/src/styles/Desktop/ScrollBarStyle.qml b/src/styles/Desktop/ScrollBarStyle.qml index 2a8a6c826..0ea61df4f 100644 --- a/src/styles/Desktop/ScrollBarStyle.qml +++ b/src/styles/Desktop/ScrollBarStyle.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { id: styleitem diff --git a/src/styles/Desktop/SliderStyle.qml b/src/styles/Desktop/SliderStyle.qml index 15b4c0283..26d550247 100644 --- a/src/styles/Desktop/SliderStyle.qml +++ b/src/styles/Desktop/SliderStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { elementType: "slider" diff --git a/src/styles/Desktop/SpinBoxStyle.qml b/src/styles/Desktop/SpinBoxStyle.qml index 3bc891378..31ff0a6ab 100644 --- a/src/styles/Desktop/SpinBoxStyle.qml +++ b/src/styles/Desktop/SpinBoxStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 Item { id: style diff --git a/src/styles/Desktop/TabFrameStyle.qml b/src/styles/Desktop/TabFrameStyle.qml index 21d3d0adc..56b51db60 100644 --- a/src/styles/Desktop/TabFrameStyle.qml +++ b/src/styles/Desktop/TabFrameStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 QtObject { id: root diff --git a/src/styles/Desktop/TextFieldStyle.qml b/src/styles/Desktop/TextFieldStyle.qml index 2b424edf8..bbd42cfd9 100644 --- a/src/styles/Desktop/TextFieldStyle.qml +++ b/src/styles/Desktop/TextFieldStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { anchors.fill: parent diff --git a/src/styles/Desktop/ToolBarStyle.qml b/src/styles/Desktop/ToolBarStyle.qml index 9e8de799f..e5ba99453 100644 --- a/src/styles/Desktop/ToolBarStyle.qml +++ b/src/styles/Desktop/ToolBarStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { id: toolbar diff --git a/src/styles/Desktop/ToolButtonStyle.qml b/src/styles/Desktop/ToolButtonStyle.qml index cd20e5145..5b165a3a5 100644 --- a/src/styles/Desktop/ToolButtonStyle.qml +++ b/src/styles/Desktop/ToolButtonStyle.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 import QtDesktop 1.0 +import QtDesktop.Private 1.0 StyleItem { id: styleitem diff --git a/tests/auto/qtdesktop/data/rangemodel/rangemodel.qml b/tests/auto/qtdesktop/data/rangemodel/rangemodel.qml index 8644963c9..ce0a4c151 100644 --- a/tests/auto/qtdesktop/data/rangemodel/rangemodel.qml +++ b/tests/auto/qtdesktop/data/rangemodel/rangemodel.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtDesktop 1.0 +import QtDesktop.Private 1.0 RangeModel { minimumValue: 0 diff --git a/tests/auto/qtdesktop/data/tst_shortcuts.qml b/tests/auto/qtdesktop/data/tst_shortcuts.qml index 522078677..8266d511b 100644 --- a/tests/auto/qtdesktop/data/tst_shortcuts.qml +++ b/tests/auto/qtdesktop/data/tst_shortcuts.qml @@ -40,8 +40,8 @@ import QtQuick 2.0 import QtTest 1.0 - import QtDesktop 1.0 +import QtDesktop.Private 1.0 TestCase { id: testCase -- GitLab