From 64230bf97c18297f45bd5d7ccf99b510c8a612bd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 6 Aug 2020 13:20:07 +0200 Subject: Get the scale of the popup item when setting the parent item As there are some styles that will do an transition which animates the scale then we need to size and position based on the final scale it will have to avoid a jump after it has finished the transition. Pick-to: 5.15 Fixes: QTBUG-84488 Change-Id: I4571eb18c921e81de319838ac0e8d3fe3513d438 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpopuppositioner.cpp | 18 ++++++++++-------- src/quicktemplates2/qquickpopuppositioner_p_p.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickpopuppositioner.cpp b/src/quicktemplates2/qquickpopuppositioner.cpp index dbe8ac1d..1bfaafbe 100644 --- a/src/quicktemplates2/qquickpopuppositioner.cpp +++ b/src/quicktemplates2/qquickpopuppositioner.cpp @@ -92,7 +92,10 @@ void QQuickPopupPositioner::setParentItem(QQuickItem *parent) QQuickItemPrivate::get(parent)->addItemChangeListener(this, ItemChangeTypes); addAncestorListeners(parent->parentItem()); - + // Store the scale property so the end result of any transition that could effect the scale + // does not influence the top left of the final popup, so it doesn't appear to flip from one + // position to another as a result + m_popupScale = m_popup->popupItem()->scale(); if (m_popup->popupItem()->isVisible()) QQuickPopupPrivate::get(m_popup)->reposition(); } @@ -108,11 +111,10 @@ void QQuickPopupPositioner::reposition() return; } - const qreal scale = popupItem->scale(); - const qreal w = popupItem->width() * scale; - const qreal h = popupItem->height() * scale; - const qreal iw = popupItem->implicitWidth() * scale; - const qreal ih = popupItem->implicitHeight() * scale; + const qreal w = popupItem->width() * m_popupScale; + const qreal h = popupItem->height() * m_popupScale; + const qreal iw = popupItem->implicitWidth() * m_popupScale; + const qreal ih = popupItem->implicitHeight() * m_popupScale; bool widthAdjusted = false; bool heightAdjusted = false; @@ -258,9 +260,9 @@ void QQuickPopupPositioner::reposition() } if (!p->hasWidth && widthAdjusted && rect.width() > 0) - popupItem->setWidth(rect.width() / scale); + popupItem->setWidth(rect.width() / m_popupScale); if (!p->hasHeight && heightAdjusted && rect.height() > 0) - popupItem->setHeight(rect.height() / scale); + popupItem->setHeight(rect.height() / m_popupScale); m_positioning = false; } diff --git a/src/quicktemplates2/qquickpopuppositioner_p_p.h b/src/quicktemplates2/qquickpopuppositioner_p_p.h index 64f57a3f..03a2e2fe 100644 --- a/src/quicktemplates2/qquickpopuppositioner_p_p.h +++ b/src/quicktemplates2/qquickpopuppositioner_p_p.h @@ -79,6 +79,7 @@ protected: bool m_positioning = false; QQuickItem *m_parentItem = nullptr; QQuickPopup *m_popup = nullptr; + qreal m_popupScale = 1.0; }; QT_END_NAMESPACE -- cgit v1.2.3 From 1a5a0a591c35dcf498a232a802087683f2244ecb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 5 Aug 2020 21:23:45 +0200 Subject: Prevent against re-entering prepareExitTransition after a focus change When a popup is hidden, then it will trigger a prepareExitTransition which can cause the active focus to be lost. If the popup's visibility is tied to that fact then it can retrigger the transition which means the active focus does not go back to where it should. Therefore, we check if hadActiveFocusBeforeExitTransition is false before going through that process as then it will only be called the first time the popup is hidden. Pick-to: 5.15 Fixes: QTBUG-85884 Change-Id: I68054aeb48447617b4235ce6467514a17f1073ba Reviewed-by: Mitch Curtis Reviewed-by: Qt CI Bot --- src/quicktemplates2/qquickpopup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 57b93036..d5a0ccf4 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -451,7 +451,7 @@ bool QQuickPopupPrivate::prepareExitTransition() if (transitionState == ExitTransition && transitionManager.isRunning()) return false; - if (transitionState != ExitTransition) { + if (transitionState != ExitTransition && !hadActiveFocusBeforeExitTransition) { // The setFocus(false) call below removes any active focus before we're // able to check it in finalizeExitTransition. hadActiveFocusBeforeExitTransition = popupItem->hasActiveFocus(); -- cgit v1.2.3 From f3a64b13725081eb94b05dbeb5f68a2298c9163e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 6 Aug 2020 11:12:35 +0200 Subject: SwipeDelegate: don't emit closed() when already closed If the mouse is released while our position is 0, it means we were clicked, and we don't need to begin any transitions to close. Fixes: QTBUG-85806 Pick-to: 5.15 Change-Id: Ic521f48e2977c1a99dbecaa585792a7798b9d749 Reviewed-by: Andy Shaw --- src/quicktemplates2/qquickswipedelegate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index a28d8ecf..3669ce05 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -889,7 +889,11 @@ bool QQuickSwipeDelegatePrivate::handleMouseReleaseEvent(QQuickItem *item, QMous swipePrivate->beginTransition(-1.0); swipePrivate->wasComplete = true; } else if (!swipePrivate->isTransitioning()) { - swipePrivate->beginTransition(0.0); + // The position is either <= 0.5 or >= -0.5, so the position should go to 0. + // However, if the position was already 0 or close to it, we were just clicked, + // and we don't need to start a transition. + if (!qFuzzyIsNull(swipePrivate->position)) + swipePrivate->beginTransition(0.0); swipePrivate->wasComplete = false; } -- cgit v1.2.3 From 6f41c69c9bc5a0ce59444e40d3a55018f7994743 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 7 Aug 2020 13:50:06 +0200 Subject: SwipeDelegate: don't allow calling close() when pressed This conflicts with the behavior of SwipeDelegate. The released() or clicked() signals should be used instead. Fixes: QTBUG-85804 Pick-to: 5.15 Change-Id: I06111b63941f54c06f0e1b828d17264f37d765d5 Reviewed-by: Andy Shaw --- src/quicktemplates2/qquickswipedelegate.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index 3669ce05..4b16609d 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -697,6 +697,11 @@ void QQuickSwipe::close() if (qFuzzyIsNull(d->position)) return; + if (d->control->isPressed()) { + // We don't support closing when we're pressed; release() or clicked() should be used instead. + return; + } + d->beginTransition(0.0); d->wasComplete = false; d->positionBeforePress = 0.0; -- cgit v1.2.3 From 040e0af87a3c54cbf6aa17dd9ee6d16231f345f7 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 17 Aug 2020 13:09:49 +0200 Subject: Doc: Drop dependency on qtgraphicaleffects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtgraphicaleffects is not part of 6.0, drop the doc dependency. Change-Id: I6170d19b148a860ef9516de6f4da58067ebb2f06 Reviewed-by: Topi Reiniƶ --- src/imports/controls/doc/qtquickcontrols.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/imports/controls/doc/qtquickcontrols.qdocconf b/src/imports/controls/doc/qtquickcontrols.qdocconf index 604b4b7d..e77452e2 100644 --- a/src/imports/controls/doc/qtquickcontrols.qdocconf +++ b/src/imports/controls/doc/qtquickcontrols.qdocconf @@ -33,7 +33,7 @@ qhp.QtQuickControls.subprojects.examples.title = Examples qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples qhp.QtQuickControls.subprojects.examples.selectors = fake:example -depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickdialogs qtquickcontrols1 qtquickextras qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects qmake qtcmake +depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickdialogs qtquickcontrols1 qtquickextras qtsql qtwidgets qtlabscalendar qtlabsplatform qmake qtcmake # Specify the install path under QT_INSTALL_EXAMPLES # Note: paths passed to \example command must contain the parent directory, e.g. -- cgit v1.2.3 From 70686007ce8c5f237e3319525682bbb85c99c49e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 6 Aug 2020 11:33:18 +0200 Subject: Document that pop() does nothing if depth is less than or equal to 1 This note is already in the detailed description, but users looking at pop() can easily miss that. Pick-to: 5.15 5.12 Task-number: QTBUG-85903 Change-Id: I92c71c8d98b2a83aefbc99229e5b16a6fb33b937 Reviewed-by: Shawn Rutledge --- src/quicktemplates2/qquickstackview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index 83f99843..7bf4c3d3 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -635,6 +635,9 @@ void QQuickStackView::push(QQmlV4Function *args) items down to (but not including) the first item is popped. If not specified, only the current item is popped. + \note A pop() operation on a stack with depth 1 or 0 does nothing. In such + cases, the stack can be emptied using the \l clear() method. + \include qquickstackview.qdocinc pop-ownership An \a operation can be optionally specified as the last argument. Supported -- cgit v1.2.3 From 2d0794cbc73a6913bea075804f232c4996d5fc4d Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 27 Jul 2020 16:20:47 +0200 Subject: QQuickSpinBox: fix another "function expressions as statements" warning This amends d5fbbddd7794265f24d392d33c4874ac756cb9c9 by also fixing valueFromText(). Task-number: QTBUG-64151 Pick-to: 5.15 Change-Id: I02b053bb4d4579e86eaaa2279826f3b103800fdf Reviewed-by: Fabian Kosmale --- src/quicktemplates2/qquickspinbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp index c1541a99..d53916e1 100644 --- a/src/quicktemplates2/qquickspinbox.cpp +++ b/src/quicktemplates2/qquickspinbox.cpp @@ -700,7 +700,7 @@ QJSValue QQuickSpinBox::valueFromText() const if (!d->valueFromText.isCallable()) { QQmlEngine *engine = qmlEngine(this); if (engine) - d->valueFromText = engine->evaluate(QStringLiteral("function(text, locale) { return Number.fromLocaleString(locale, text); }")); + d->valueFromText = engine->evaluate(QStringLiteral("(function(text, locale) { return Number.fromLocaleString(locale, text); })")); } return d->valueFromText; } -- cgit v1.2.3 From ef771a0fd70f05d7204fb8cbd8789aa1ed6eff4b Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 2 Apr 2020 11:51:21 +0200 Subject: Stop using resolvedUrl() to resolve QML files This is necessary to move away from imperative type registration of QML files (i.e. qmlRegisterType()). A later patch will use qmlRegisterModuleImport() to register the QtQuick.Controls import with the style set by the user, which will require each style to have a qmldir listing the files that it provides. Note that some plugins still register QML files, but these registrations will have to stay for now until we can split out "impl" plugins in later patches where those files can be registered. tst_qquickstyleselector will be added back in some other form in a follow-up patch. Task-number: QTBUG-82922 Change-Id: I8182533d9912ed493efda6eb91c69fc064af07ee Reviewed-by: Ulf Hermann --- .../doc/src/qtquickcontrols2-fileselectors.qdoc | 3 +- .../qtquickcontrols2materialstyleplugin.cpp | 1 - src/imports/controls/qtquickcontrols2plugin.cpp | 109 ++++---------- src/quickcontrols2/qquickstyleplugin.cpp | 42 +----- src/quickcontrols2/qquickstyleplugin_p.h | 6 +- src/quickcontrols2/qquickstyleselector.cpp | 163 --------------------- src/quickcontrols2/qquickstyleselector_p.h | 86 ----------- src/quickcontrols2/qquickstyleselector_p_p.h | 70 --------- src/quickcontrols2/quickcontrols2.pri | 7 +- 9 files changed, 36 insertions(+), 451 deletions(-) delete mode 100644 src/quickcontrols2/qquickstyleselector.cpp delete mode 100644 src/quickcontrols2/qquickstyleselector_p.h delete mode 100644 src/quickcontrols2/qquickstyleselector_p_p.h (limited to 'src') diff --git a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc index d73d1abe..adda3b15 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc @@ -40,8 +40,7 @@ can assume the context, that is, a specific style. This typically leads to some code duplication, but on the other hand, cuts the aforementioned hard dependency to the style, and leads to simpler and more efficient - QML code. The same technique is used to implement the \l {Styling Qt - Quick Controls}{Qt Quick Controls styles}. + QML code. The following example demonstrates a custom rounded button that has a styled drop shadow in the \l {Material Style}{Material style}, and looks diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index d8cc04dd..88f6cd1e 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -42,7 +42,6 @@ #include "qquickmaterialprogressbar_p.h" #include "qquickmaterialripple_p.h" -#include #include QT_BEGIN_NAMESPACE diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 53868d16..38fba04e 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -78,6 +78,7 @@ public: QtQuickControls2Plugin(QObject *parent = nullptr); ~QtQuickControls2Plugin(); + void initializeEngine(QQmlEngine *engine, const char *uri) override; void registerTypes(const char *uri) override; void unregisterTypes() override; @@ -85,6 +86,8 @@ public: void initializeTheme(QQuickTheme *theme) override; private: + void init(); + QList loadStylePlugins(); QQuickTheme *createTheme(const QString &name); }; @@ -99,6 +102,12 @@ QtQuickControls2Plugin::~QtQuickControls2Plugin() // initialization and cleanup, as plugins are not unloaded on macOS. } +void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *uri) +{ + QQuickStylePlugin::initializeEngine(engine, uri); + init(); +} + static bool isDefaultStyle(const QString &style) { return style.isEmpty() || style.compare(QStringLiteral("Default"), Qt::CaseInsensitive) == 0; @@ -108,97 +117,17 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) { QQuickStylePrivate::init(baseUrl()); + QQuickStylePlugin::registerTypes(uri); + const QString style = QQuickStyle::name(); if (!style.isEmpty()) QFileSelectorPrivate::addStatics(QStringList() << style.toLower()); - QQuickTheme *theme = createTheme(style.isEmpty() ? name() : style); - if (isDefaultStyle(style)) - initializeTheme(theme); - - // load the style's plugins to get access to its resources and initialize the theme - QList stylePlugins = loadStylePlugins(); - for (QQuickStylePlugin *stylePlugin : stylePlugins) - stylePlugin->initializeTheme(theme); - qDeleteAll(stylePlugins); - // The minor version used to be the current Qt 5 minor. For compatibility it is the last // Qt 5 release. qmlRegisterModule(uri, 2, 15); - // QtQuick.Controls 2.0 (originally introduced in Qt 5.7) - qmlRegisterType(resolvedUrl(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow"); - qmlRegisterType(resolvedUrl(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("Button.qml")), uri, 2, 0, "Button"); - qmlRegisterType(resolvedUrl(QStringLiteral("ButtonGroup.qml")), uri, 2, 0, "ButtonGroup"); - qmlRegisterType(resolvedUrl(QStringLiteral("CheckBox.qml")), uri, 2, 0, "CheckBox"); - qmlRegisterType(resolvedUrl(QStringLiteral("CheckDelegate.qml")), uri, 2, 0, "CheckDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("ComboBox.qml")), uri, 2, 0, "ComboBox"); - qmlRegisterType(resolvedUrl(QStringLiteral("Container.qml")), uri, 2, 0, "Container"); - qmlRegisterType(resolvedUrl(QStringLiteral("Control.qml")), uri, 2, 0, "Control"); - qmlRegisterType(resolvedUrl(QStringLiteral("Dial.qml")), uri, 2, 0, "Dial"); - qmlRegisterType(resolvedUrl(QStringLiteral("Drawer.qml")), uri, 2, 0, "Drawer"); - qmlRegisterType(resolvedUrl(QStringLiteral("Frame.qml")), uri, 2, 0, "Frame"); - qmlRegisterType(resolvedUrl(QStringLiteral("GroupBox.qml")), uri, 2, 0, "GroupBox"); - qmlRegisterType(resolvedUrl(QStringLiteral("ItemDelegate.qml")), uri, 2, 0, "ItemDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("Label.qml")), uri, 2, 0, "Label"); - qmlRegisterType(resolvedUrl(QStringLiteral("Menu.qml")), uri, 2, 0, "Menu"); - qmlRegisterType(resolvedUrl(QStringLiteral("MenuItem.qml")), uri, 2, 0, "MenuItem"); - qmlRegisterType(resolvedUrl(QStringLiteral("Page.qml")), uri, 2, 0, "Page"); - qmlRegisterType(resolvedUrl(QStringLiteral("PageIndicator.qml")), uri, 2, 0, "PageIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("Pane.qml")), uri, 2, 0, "Pane"); - qmlRegisterType(resolvedUrl(QStringLiteral("Popup.qml")), uri, 2, 0, "Popup"); - qmlRegisterType(resolvedUrl(QStringLiteral("ProgressBar.qml")), uri, 2, 0, "ProgressBar"); - qmlRegisterType(resolvedUrl(QStringLiteral("RadioButton.qml")), uri, 2, 0, "RadioButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("RadioDelegate.qml")), uri, 2, 0, "RadioDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("RangeSlider.qml")), uri, 2, 0, "RangeSlider"); - qmlRegisterType(resolvedUrl(QStringLiteral("ScrollBar.qml")), uri, 2, 0, "ScrollBar"); - qmlRegisterType(resolvedUrl(QStringLiteral("ScrollIndicator.qml")), uri, 2, 0, "ScrollIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("Slider.qml")), uri, 2, 0, "Slider"); - qmlRegisterType(resolvedUrl(QStringLiteral("SpinBox.qml")), uri, 2, 0, "SpinBox"); - qmlRegisterType(resolvedUrl(QStringLiteral("StackView.qml")), uri, 2, 0, "StackView"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwipeDelegate.qml")), uri, 2, 0, "SwipeDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwipeView.qml")), uri, 2, 0, "SwipeView"); - qmlRegisterType(resolvedUrl(QStringLiteral("Switch.qml")), uri, 2, 0, "Switch"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwitchDelegate.qml")), uri, 2, 0, "SwitchDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("TabBar.qml")), uri, 2, 0, "TabBar"); - qmlRegisterType(resolvedUrl(QStringLiteral("TabButton.qml")), uri, 2, 0, "TabButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("TextArea.qml")), uri, 2, 0, "TextArea"); - qmlRegisterType(resolvedUrl(QStringLiteral("TextField.qml")), uri, 2, 0, "TextField"); - qmlRegisterType(resolvedUrl(QStringLiteral("ToolBar.qml")), uri, 2, 0, "ToolBar"); - qmlRegisterType(resolvedUrl(QStringLiteral("ToolButton.qml")), uri, 2, 0, "ToolButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("ToolTip.qml")), uri, 2, 0, "ToolTip"); -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(resolvedUrl(QStringLiteral("Tumbler.qml")), uri, 2, 0, "Tumbler"); -#endif - - // QtQuick.Controls 2.1 (new types in Qt 5.8) - qmlRegisterType(resolvedUrl(QStringLiteral("Dialog.qml")), uri, 2, 1, "Dialog"); - qmlRegisterType(resolvedUrl(QStringLiteral("DialogButtonBox.qml")), uri, 2, 1, "DialogButtonBox"); - qmlRegisterType(resolvedUrl(QStringLiteral("MenuSeparator.qml")), uri, 2, 1, "MenuSeparator"); - qmlRegisterType(resolvedUrl(QStringLiteral("RoundButton.qml")), uri, 2, 1, "RoundButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("ToolSeparator.qml")), uri, 2, 1, "ToolSeparator"); - - // QtQuick.Controls 2.2 (new types in Qt 5.9) - qmlRegisterType(resolvedUrl(QStringLiteral("DelayButton.qml")), uri, 2, 2, "DelayButton"); - qmlRegisterType(resolvedUrl(QStringLiteral("ScrollView.qml")), uri, 2, 2, "ScrollView"); - - // QtQuick.Controls 2.3 (new types in Qt 5.10) - qmlRegisterType(resolvedUrl(QStringLiteral("Action.qml")), uri, 2, 3, "Action"); - qmlRegisterType(resolvedUrl(QStringLiteral("ActionGroup.qml")), uri, 2, 3, "ActionGroup"); - qmlRegisterType(resolvedUrl(QStringLiteral("MenuBar.qml")), uri, 2, 3, "MenuBar"); - qmlRegisterType(resolvedUrl(QStringLiteral("MenuBarItem.qml")), uri, 2, 3, "MenuBarItem"); - qmlRegisterUncreatableType(uri, 2, 3, "Overlay", QStringLiteral("Overlay is only available as an attached property.")); - - // QtQuick.Controls 2.13 (new types in Qt 5.13) - qmlRegisterType(resolvedUrl(QStringLiteral("SplitView.qml")), uri, 2, 13, "SplitView"); - qmlRegisterUncreatableType(uri, 2, 13, "SplitHandle", - QStringLiteral("SplitHandle is only available as an attached property.")); - - // QtQuick.Controls 2.15 (new types in Qt 5.15) - qmlRegisterType(resolvedUrl(QStringLiteral("HorizontalHeaderView.qml")), uri, 2, 15, "HorizontalHeaderView"); - qmlRegisterType(resolvedUrl(QStringLiteral("VerticalHeaderView.qml")), uri, 2, 15, "VerticalHeaderView"); + qmlRegisterTypesAndRevisions(uri, 2); // The minor version used to be the current Qt 5 minor. For compatibility it is the last // Qt 5 release. @@ -256,6 +185,20 @@ void QtQuickControls2Plugin::initializeTheme(QQuickTheme *theme) QQuickDefaultTheme::initialize(theme); } +void QtQuickControls2Plugin::init() +{ + const QString style = QQuickStyle::name(); + QQuickTheme *theme = createTheme(style.isEmpty() ? name() : style); + if (isDefaultStyle(style)) + initializeTheme(theme); + + // load the style's plugins to get access to its resources and initialize the theme + QList stylePlugins = loadStylePlugins(); + for (QQuickStylePlugin *stylePlugin : stylePlugins) + stylePlugin->initializeTheme(theme); + qDeleteAll(stylePlugins); +} + QList QtQuickControls2Plugin::loadStylePlugins() { QList stylePlugins; diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp index 9bbaad11..067d8dff 100644 --- a/src/quickcontrols2/qquickstyleplugin.cpp +++ b/src/quickcontrols2/qquickstyleplugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. @@ -37,18 +37,14 @@ #include "qquickstyleplugin_p.h" #include "qquickstyle.h" #include "qquickstyle_p.h" -#include "qquickstyleselector_p.h" -QT_BEGIN_NAMESPACE +#include +#include -class QQuickStylePluginPrivate -{ -public: - mutable QScopedPointer selector; -}; +QT_BEGIN_NAMESPACE QQuickStylePlugin::QQuickStylePlugin(QObject *parent) - : QQmlExtensionPlugin(parent), d_ptr(new QQuickStylePluginPrivate) + : QQmlExtensionPlugin(parent) { } @@ -66,34 +62,8 @@ void QQuickStylePlugin::initializeTheme(QQuickTheme *theme) Q_UNUSED(theme); } -void QQuickStylePlugin::unregisterTypes() +void QQuickStylePlugin::registerTypes(const char */*uri*/) { - Q_D(QQuickStylePlugin); - // Destroy the selector so that it is recreated in resolvedUrl() and - // any new style that has been set at runtime will be accounted for when selecting QML files. - d->selector.reset(); -} - -QUrl QQuickStylePlugin::resolvedUrl(const QString &fileName) const -{ - Q_D(const QQuickStylePlugin); - if (!d->selector) { - d->selector.reset(new QQuickStyleSelector); - const QString style = QQuickStyle::name(); - if (!style.isEmpty()) - d->selector->addSelector(style); - - const QString fallback = QQuickStylePrivate::fallbackStyle(); - if (!fallback.isEmpty() && fallback != style) - d->selector->addSelector(fallback); - - const QString theme = name(); - if (!theme.isEmpty() && theme != style) - d->selector->addSelector(theme); - - d->selector->setPaths(QQuickStylePrivate::stylePaths(true)); - } - return d->selector->select(fileName); } QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleplugin_p.h b/src/quickcontrols2/qquickstyleplugin_p.h index 67103e12..a9700c15 100644 --- a/src/quickcontrols2/qquickstyleplugin_p.h +++ b/src/quickcontrols2/qquickstyleplugin_p.h @@ -54,7 +54,6 @@ QT_BEGIN_NAMESPACE class QQuickTheme; -class QQuickStylePluginPrivate; class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickStylePlugin : public QQmlExtensionPlugin { @@ -66,14 +65,11 @@ public: virtual QString name() const; virtual void initializeTheme(QQuickTheme *theme); - virtual void unregisterTypes() override; - QUrl resolvedUrl(const QString &fileName) const; + void registerTypes(const char *uri) override; private: Q_DISABLE_COPY(QQuickStylePlugin) - Q_DECLARE_PRIVATE(QQuickStylePlugin) - QScopedPointer d_ptr; }; QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleselector.cpp b/src/quickcontrols2/qquickstyleselector.cpp deleted file mode 100644 index 72e7af66..00000000 --- a/src/quickcontrols2/qquickstyleselector.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 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$ -** -****************************************************************************/ - -#include "qquickstyleselector_p.h" -#include "qquickstyleselector_p_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -Q_LOGGING_CATEGORY(lcStyleSelectorSelect, "qt.quick.controls.styleSelector.select") -Q_LOGGING_CATEGORY(lcStyleSelectorSetPaths, "qt.quick.controls.styleSelector.setPaths") -Q_LOGGING_CATEGORY(lcStyleSelectorAddSelector, "qt.quick.controls.styleSelector.addSelector") - -static QString ensureSlash(const QString &path) -{ - if (path.isEmpty() || path.endsWith(QLatin1Char('/'))) - return path; - return path + QLatin1Char('/'); -} - -static QStringList prefixedPlatformSelectors(const QChar &prefix) -{ - QStringList selectors = QFileSelectorPrivate::platformSelectors(); - for (int i = 0; i < selectors.count(); ++i) - selectors[i].prepend(prefix); - return selectors; -} - -static QStringList allSelectors() -{ - static const QStringList platformSelectors = prefixedPlatformSelectors(QLatin1Char('+')); - QStringList selectors = platformSelectors; - const QString locale = QLocale().name(); - if (!locale.isEmpty()) - selectors += QLatin1Char('+') + locale; - return selectors; -} - -QUrl QQuickStyleSelectorPrivate::select(const QString &filePath) const -{ - QFileInfo fi(filePath); - // If file doesn't exist, don't select - if (!fi.exists()) - return QUrl(); - - const QString selected = QFileSelectorPrivate::selectionHelper(ensureSlash(fi.canonicalPath()), - fi.fileName(), allSelectors(), QChar()); - - if (selected.startsWith(QLatin1Char(':'))) - return QUrl(QLatin1String("qrc") + selected); - - return QUrl::fromLocalFile(selected.isEmpty() ? filePath : selected); -} - -QQuickStyleSelector::QQuickStyleSelector() : d_ptr(new QQuickStyleSelectorPrivate) -{ -} - -QQuickStyleSelector::~QQuickStyleSelector() -{ -} - -QStringList QQuickStyleSelector::selectors() const -{ - Q_D(const QQuickStyleSelector); - return d->selectors; -} - -void QQuickStyleSelector::addSelector(const QString &selector) -{ - Q_D(QQuickStyleSelector); - if (d->selectors.contains(selector)) - return; - - d->selectors += selector; - - qCDebug(lcStyleSelectorSetPaths).nospace() << "added selector " << selector - << "; full list is now: " << d->selectors; -} - -QStringList QQuickStyleSelector::paths() const -{ - Q_D(const QQuickStyleSelector); - return d->paths; -} - -void QQuickStyleSelector::setPaths(const QStringList &paths) -{ - Q_D(QQuickStyleSelector); - qCDebug(lcStyleSelectorSetPaths) << "setting paths to" << paths; - d->paths = paths; -} - -QUrl QQuickStyleSelector::select(const QString &fileName) const -{ - Q_D(const QQuickStyleSelector); - // The lookup order is - // 1) requested style (e.g. "MyStyle", included in d->selectors) - // 2) fallback style (e.g. "Material", included in d->selectors) - // 3) default style (empty selector, not in d->selectors) - qCDebug(lcStyleSelectorSelect) << "selecting" << fileName << "from" << d->paths << "with selectors" << d->selectors; - - int to = d->selectors.count() - 1; - if (d->selectors.isEmpty() || !d->selectors.first().isEmpty()) - ++to; // lookup #3 unless #1 is also empty (redundant) - - // NOTE: last iteration intentionally out of bounds => empty selector - for (int i = 0; i <= to; ++i) { - const QString selector = d->selectors.value(i); - for (const QString &path : d->paths) { - const QUrl selectedUrl = d->select(ensureSlash(path) + selector + QLatin1Char('/') + fileName); - if (selectedUrl.isValid()) { - qCDebug(lcStyleSelectorSelect) << "==>" << selectedUrl << "from" << path << "with selector" << selector; - return selectedUrl; - } - } - } - - return fileName; -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleselector_p.h b/src/quickcontrols2/qquickstyleselector_p.h deleted file mode 100644 index c4c0f540..00000000 --- a/src/quickcontrols2/qquickstyleselector_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 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$ -** -****************************************************************************/ - -#ifndef QQUICKSTYLESELECTOR_P_H -#define QQUICKSTYLESELECTOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickStyleSelectorPrivate; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickStyleSelector -{ -public: - QQuickStyleSelector(); - ~QQuickStyleSelector(); - - QStringList selectors() const; - void addSelector(const QString &selector); - - QStringList paths() const; - void setPaths(const QStringList &paths); - - QUrl select(const QString &fileName) const; - -private: - Q_DISABLE_COPY(QQuickStyleSelector) - Q_DECLARE_PRIVATE(QQuickStyleSelector) - QScopedPointer d_ptr; -}; - -QT_END_NAMESPACE - -#endif // QQUICKSTYLESELECTOR_P_H diff --git a/src/quickcontrols2/qquickstyleselector_p_p.h b/src/quickcontrols2/qquickstyleselector_p_p.h deleted file mode 100644 index e69e7db2..00000000 --- a/src/quickcontrols2/qquickstyleselector_p_p.h +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 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$ -** -****************************************************************************/ - -#ifndef QQUICKSTYLESELECTOR_P_P_H -#define QQUICKSTYLESELECTOR_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickStyleSelectorPrivate -{ -public: - QUrl select(const QString &filePath) const; - - QStringList paths; - QStringList selectors; -}; - -QT_END_NAMESPACE - -#endif // QQUICKSTYLESELECTOR_P_P_H diff --git a/src/quickcontrols2/quickcontrols2.pri b/src/quickcontrols2/quickcontrols2.pri index 781658ef..2c28038f 100644 --- a/src/quickcontrols2/quickcontrols2.pri +++ b/src/quickcontrols2/quickcontrols2.pri @@ -15,9 +15,7 @@ HEADERS += \ $$PWD/qquickplaceholdertext_p.h \ $$PWD/qquickstyle.h \ $$PWD/qquickstyle_p.h \ - $$PWD/qquickstyleplugin_p.h \ - $$PWD/qquickstyleselector_p.h \ - $$PWD/qquickstyleselector_p_p.h + $$PWD/qquickstyleplugin_p.h SOURCES += \ $$PWD/qquickanimatednode.cpp \ @@ -33,8 +31,7 @@ SOURCES += \ $$PWD/qquickpaddedrectangle.cpp \ $$PWD/qquickplaceholdertext.cpp \ $$PWD/qquickstyle.cpp \ - $$PWD/qquickstyleplugin.cpp \ - $$PWD/qquickstyleselector.cpp + $$PWD/qquickstyleplugin.cpp qtConfig(quick-listview):qtConfig(quick-pathview) { HEADERS += \ -- cgit v1.2.3 From 9aafea810b8867fb31f9ec27a238628467e7ab56 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 1 Apr 2020 15:37:07 +0200 Subject: Move Default style out into its own plugin In upcoming patches, we start registering C++ types declaratively. A condition of doing so requires that each .pro corresponds to one QML module. This conflicts with the QtQuick.Controls import, which currently does quite a lot: - Registers (and selects) QML files for the style that was set - Registers private C++ utility types (such as IconLabel) that are useful for all styles under the QtQuick.Controls.impl import - Registers private C++ types that are only useful for the Default style (such as BusyIndicatorImpl). The reason it does so much can probably be explained by the intended usage of Qt Quick Controls 2; when you do import QtQuick.Controls 2.0 you get access to the QML types (e.g. Button) that the style you're using provides. So if you're using the Material style, you'll get a Material style button. API-wise, the button is identical to any other button, because the types in QtQuick.Templates are what we advertise as the public API. If we didn't have this functionality, users would need to import specific style imports to use controls, and the convenience of being able to simply start the application with a different style by e.g. passing an application argument would be lost. To support declarative registration of types while also supporting the existing use cases, we split out the Default-style-specific stuff into a QtQuick.Controls.Default import. Task-number: QTBUG-82922 Change-Id: Ib4f1620cae78d7acdc13d9ac0752a020bc22f3ea Reviewed-by: Ulf Hermann --- src/imports/controls/AbstractButton.qml | 47 -- src/imports/controls/Action.qml | 40 - src/imports/controls/ActionGroup.qml | 40 - src/imports/controls/ApplicationWindow.qml | 47 -- src/imports/controls/BusyIndicator.qml | 63 -- src/imports/controls/Button.qml | 80 -- src/imports/controls/ButtonGroup.qml | 40 - src/imports/controls/CheckBox.qml | 93 --- src/imports/controls/CheckDelegate.qml | 110 --- src/imports/controls/ComboBox.qml | 142 ---- src/imports/controls/Container.qml | 47 -- src/imports/controls/Control.qml | 47 -- src/imports/controls/DelayButton.qml | 105 --- src/imports/controls/Dial.qml | 79 -- src/imports/controls/Dialog.qml | 86 -- src/imports/controls/DialogButtonBox.qml | 72 -- src/imports/controls/Drawer.qml | 79 -- src/imports/controls/Frame.qml | 56 -- src/imports/controls/GroupBox.qml | 74 -- src/imports/controls/HorizontalHeaderView.qml | 68 -- src/imports/controls/ItemDelegate.qml | 77 -- src/imports/controls/Label.qml | 47 -- src/imports/controls/Menu.qml | 82 -- src/imports/controls/MenuBar.qml | 63 -- src/imports/controls/MenuBarItem.qml | 77 -- src/imports/controls/MenuItem.qml | 105 --- src/imports/controls/MenuSeparator.qml | 58 -- src/imports/controls/Page.qml | 57 -- src/imports/controls/PageIndicator.qml | 72 -- src/imports/controls/Pane.qml | 55 -- src/imports/controls/Popup.qml | 64 -- src/imports/controls/ProgressBar.qml | 67 -- src/imports/controls/RadioButton.qml | 86 -- src/imports/controls/RadioDelegate.qml | 103 --- src/imports/controls/RangeSlider.qml | 96 --- src/imports/controls/RoundButton.qml | 81 -- src/imports/controls/ScrollBar.qml | 76 -- src/imports/controls/ScrollIndicator.qml | 76 -- src/imports/controls/ScrollView.qml | 65 -- src/imports/controls/Slider.qml | 83 -- src/imports/controls/SpinBox.qml | 135 ---- src/imports/controls/SplitView.qml | 55 -- src/imports/controls/StackView.qml | 67 -- src/imports/controls/SwipeDelegate.qml | 78 -- src/imports/controls/SwipeView.qml | 66 -- src/imports/controls/Switch.qml | 92 --- src/imports/controls/SwitchDelegate.qml | 109 --- src/imports/controls/TabBar.qml | 69 -- src/imports/controls/TabButton.qml | 73 -- src/imports/controls/TextArea.qml | 75 -- src/imports/controls/TextField.qml | 83 -- src/imports/controls/ToolBar.qml | 54 -- src/imports/controls/ToolButton.qml | 75 -- src/imports/controls/ToolSeparator.qml | 58 -- src/imports/controls/ToolTip.qml | 69 -- src/imports/controls/Tumbler.qml | 75 -- src/imports/controls/VerticalHeaderView.qml | 68 -- src/imports/controls/controls.pri | 72 -- src/imports/controls/controls.pro | 12 +- src/imports/controls/default/AbstractButton.qml | 47 ++ src/imports/controls/default/Action.qml | 40 + src/imports/controls/default/ActionGroup.qml | 40 + src/imports/controls/default/ApplicationWindow.qml | 47 ++ src/imports/controls/default/BusyIndicator.qml | 63 ++ src/imports/controls/default/Button.qml | 80 ++ src/imports/controls/default/ButtonGroup.qml | 40 + src/imports/controls/default/CheckBox.qml | 93 +++ src/imports/controls/default/CheckDelegate.qml | 110 +++ src/imports/controls/default/ComboBox.qml | 142 ++++ src/imports/controls/default/Container.qml | 47 ++ src/imports/controls/default/Control.qml | 47 ++ src/imports/controls/default/DelayButton.qml | 105 +++ src/imports/controls/default/Dial.qml | 79 ++ src/imports/controls/default/Dialog.qml | 86 ++ src/imports/controls/default/DialogButtonBox.qml | 72 ++ src/imports/controls/default/Drawer.qml | 79 ++ src/imports/controls/default/Frame.qml | 56 ++ src/imports/controls/default/GroupBox.qml | 74 ++ .../controls/default/HorizontalHeaderView.qml | 68 ++ src/imports/controls/default/ItemDelegate.qml | 77 ++ src/imports/controls/default/Label.qml | 47 ++ src/imports/controls/default/Menu.qml | 82 ++ src/imports/controls/default/MenuBar.qml | 63 ++ src/imports/controls/default/MenuBarItem.qml | 77 ++ src/imports/controls/default/MenuItem.qml | 105 +++ src/imports/controls/default/MenuSeparator.qml | 58 ++ src/imports/controls/default/Page.qml | 57 ++ src/imports/controls/default/PageIndicator.qml | 72 ++ src/imports/controls/default/Pane.qml | 55 ++ src/imports/controls/default/Popup.qml | 64 ++ src/imports/controls/default/ProgressBar.qml | 67 ++ src/imports/controls/default/RadioButton.qml | 86 ++ src/imports/controls/default/RadioDelegate.qml | 103 +++ src/imports/controls/default/RangeSlider.qml | 96 +++ src/imports/controls/default/RoundButton.qml | 81 ++ src/imports/controls/default/ScrollBar.qml | 76 ++ src/imports/controls/default/ScrollIndicator.qml | 76 ++ src/imports/controls/default/ScrollView.qml | 65 ++ src/imports/controls/default/Slider.qml | 83 ++ src/imports/controls/default/SpinBox.qml | 135 ++++ src/imports/controls/default/SplitView.qml | 55 ++ src/imports/controls/default/StackView.qml | 67 ++ src/imports/controls/default/SwipeDelegate.qml | 78 ++ src/imports/controls/default/SwipeView.qml | 66 ++ src/imports/controls/default/Switch.qml | 92 +++ src/imports/controls/default/SwitchDelegate.qml | 109 +++ src/imports/controls/default/TabBar.qml | 69 ++ src/imports/controls/default/TabButton.qml | 73 ++ src/imports/controls/default/TextArea.qml | 75 ++ src/imports/controls/default/TextField.qml | 83 ++ src/imports/controls/default/ToolBar.qml | 54 ++ src/imports/controls/default/ToolButton.qml | 75 ++ src/imports/controls/default/ToolSeparator.qml | 58 ++ src/imports/controls/default/ToolTip.qml | 69 ++ src/imports/controls/default/Tumbler.qml | 75 ++ .../controls/default/VerticalHeaderView.qml | 68 ++ src/imports/controls/default/default.pri | 72 ++ src/imports/controls/default/default.pro | 27 + src/imports/controls/default/dependencies.json | 17 + .../controls/default/images/arrow-indicator.png | Bin 0 -> 169 bytes .../controls/default/images/arrow-indicator@2x.png | Bin 0 -> 225 bytes .../controls/default/images/arrow-indicator@3x.png | Bin 0 -> 285 bytes .../controls/default/images/arrow-indicator@4x.png | Bin 0 -> 352 bytes src/imports/controls/default/images/check.png | Bin 0 -> 424 bytes src/imports/controls/default/images/check@2x.png | Bin 0 -> 713 bytes src/imports/controls/default/images/check@3x.png | Bin 0 -> 999 bytes src/imports/controls/default/images/check@4x.png | Bin 0 -> 1188 bytes .../controls/default/images/dial-indicator.png | Bin 0 -> 185 bytes .../controls/default/images/dial-indicator@2x.png | Bin 0 -> 243 bytes .../controls/default/images/dial-indicator@3x.png | Bin 0 -> 284 bytes .../controls/default/images/dial-indicator@4x.png | Bin 0 -> 307 bytes .../controls/default/images/double-arrow.png | Bin 0 -> 303 bytes .../controls/default/images/double-arrow@2x.png | Bin 0 -> 484 bytes .../controls/default/images/double-arrow@3x.png | Bin 0 -> 673 bytes .../controls/default/images/double-arrow@4x.png | Bin 0 -> 827 bytes .../controls/default/images/drop-indicator.png | Bin 0 -> 157 bytes .../controls/default/images/drop-indicator@2x.png | Bin 0 -> 226 bytes .../controls/default/images/drop-indicator@3x.png | Bin 0 -> 297 bytes .../controls/default/images/drop-indicator@4x.png | Bin 0 -> 376 bytes src/imports/controls/default/plugins.qmltypes | 895 +++++++++++++++++++++ src/imports/controls/default/qmldir | 4 + .../default/qquickdefaultbusyindicator.cpp | 223 +++++ .../default/qquickdefaultbusyindicator_p.h | 91 +++ src/imports/controls/default/qquickdefaultdial.cpp | 122 +++ src/imports/controls/default/qquickdefaultdial_p.h | 80 ++ .../controls/default/qquickdefaultprogressbar.cpp | 280 +++++++ .../controls/default/qquickdefaultprogressbar_p.h | 89 ++ .../controls/default/qquickdefaultstyle.cpp | 246 ++++++ .../controls/default/qquickdefaultstyle_p.h | 147 ++++ .../controls/default/qquickdefaulttheme.cpp | 89 ++ .../controls/default/qquickdefaulttheme_p.h | 65 ++ .../default/qtquickcontrols2defaultstyleplugin.cpp | 101 +++ .../default/qtquickcontrols2defaultstyleplugin.qrc | 24 + src/imports/controls/dependencies.json | 17 - .../snippets/qtquickcontrols2-button-icononly.qml | 2 +- .../qtquickcontrols2-button-textbesideicon.qml | 2 +- .../doc/src/qtquickcontrols2-customize.qdoc | 4 +- src/imports/controls/images/arrow-indicator.png | Bin 169 -> 0 bytes src/imports/controls/images/arrow-indicator@2x.png | Bin 225 -> 0 bytes src/imports/controls/images/arrow-indicator@3x.png | Bin 285 -> 0 bytes src/imports/controls/images/arrow-indicator@4x.png | Bin 352 -> 0 bytes src/imports/controls/images/check.png | Bin 424 -> 0 bytes src/imports/controls/images/check@2x.png | Bin 713 -> 0 bytes src/imports/controls/images/check@3x.png | Bin 999 -> 0 bytes src/imports/controls/images/check@4x.png | Bin 1188 -> 0 bytes src/imports/controls/images/dial-indicator.png | Bin 185 -> 0 bytes src/imports/controls/images/dial-indicator@2x.png | Bin 243 -> 0 bytes src/imports/controls/images/dial-indicator@3x.png | Bin 284 -> 0 bytes src/imports/controls/images/dial-indicator@4x.png | Bin 307 -> 0 bytes src/imports/controls/images/double-arrow.png | Bin 303 -> 0 bytes src/imports/controls/images/double-arrow@2x.png | Bin 484 -> 0 bytes src/imports/controls/images/double-arrow@3x.png | Bin 673 -> 0 bytes src/imports/controls/images/double-arrow@4x.png | Bin 827 -> 0 bytes src/imports/controls/images/drop-indicator.png | Bin 157 -> 0 bytes src/imports/controls/images/drop-indicator@2x.png | Bin 226 -> 0 bytes src/imports/controls/images/drop-indicator@3x.png | Bin 297 -> 0 bytes src/imports/controls/images/drop-indicator@4x.png | Bin 376 -> 0 bytes src/imports/controls/plugins.qmltypes | 895 --------------------- src/imports/controls/qmldir | 1 + .../controls/qquickdefaultbusyindicator.cpp | 223 ----- .../controls/qquickdefaultbusyindicator_p.h | 91 --- src/imports/controls/qquickdefaultdial.cpp | 122 --- src/imports/controls/qquickdefaultdial_p.h | 80 -- src/imports/controls/qquickdefaultprogressbar.cpp | 280 ------- src/imports/controls/qquickdefaultprogressbar_p.h | 89 -- src/imports/controls/qquickdefaultstyle.cpp | 246 ------ src/imports/controls/qquickdefaultstyle_p.h | 147 ---- src/imports/controls/qquickdefaulttheme.cpp | 89 -- src/imports/controls/qquickdefaulttheme_p.h | 65 -- src/imports/controls/qtquickcontrols2plugin.cpp | 50 +- src/imports/controls/qtquickcontrols2plugin.qrc | 24 - src/imports/imports.pro | 1 + src/quickcontrols2/qquickstyleplugin.cpp | 9 - src/quickcontrols2/qquickstyleplugin_p.h | 2 +- src/quickcontrols2/quickcontrols2.pro | 7 + 195 files changed, 6801 insertions(+), 6713 deletions(-) delete mode 100644 src/imports/controls/AbstractButton.qml delete mode 100644 src/imports/controls/Action.qml delete mode 100644 src/imports/controls/ActionGroup.qml delete mode 100644 src/imports/controls/ApplicationWindow.qml delete mode 100644 src/imports/controls/BusyIndicator.qml delete mode 100644 src/imports/controls/Button.qml delete mode 100644 src/imports/controls/ButtonGroup.qml delete mode 100644 src/imports/controls/CheckBox.qml delete mode 100644 src/imports/controls/CheckDelegate.qml delete mode 100644 src/imports/controls/ComboBox.qml delete mode 100644 src/imports/controls/Container.qml delete mode 100644 src/imports/controls/Control.qml delete mode 100644 src/imports/controls/DelayButton.qml delete mode 100644 src/imports/controls/Dial.qml delete mode 100644 src/imports/controls/Dialog.qml delete mode 100644 src/imports/controls/DialogButtonBox.qml delete mode 100644 src/imports/controls/Drawer.qml delete mode 100644 src/imports/controls/Frame.qml delete mode 100644 src/imports/controls/GroupBox.qml delete mode 100644 src/imports/controls/HorizontalHeaderView.qml delete mode 100644 src/imports/controls/ItemDelegate.qml delete mode 100644 src/imports/controls/Label.qml delete mode 100644 src/imports/controls/Menu.qml delete mode 100644 src/imports/controls/MenuBar.qml delete mode 100644 src/imports/controls/MenuBarItem.qml delete mode 100644 src/imports/controls/MenuItem.qml delete mode 100644 src/imports/controls/MenuSeparator.qml delete mode 100644 src/imports/controls/Page.qml delete mode 100644 src/imports/controls/PageIndicator.qml delete mode 100644 src/imports/controls/Pane.qml delete mode 100644 src/imports/controls/Popup.qml delete mode 100644 src/imports/controls/ProgressBar.qml delete mode 100644 src/imports/controls/RadioButton.qml delete mode 100644 src/imports/controls/RadioDelegate.qml delete mode 100644 src/imports/controls/RangeSlider.qml delete mode 100644 src/imports/controls/RoundButton.qml delete mode 100644 src/imports/controls/ScrollBar.qml delete mode 100644 src/imports/controls/ScrollIndicator.qml delete mode 100644 src/imports/controls/ScrollView.qml delete mode 100644 src/imports/controls/Slider.qml delete mode 100644 src/imports/controls/SpinBox.qml delete mode 100644 src/imports/controls/SplitView.qml delete mode 100644 src/imports/controls/StackView.qml delete mode 100644 src/imports/controls/SwipeDelegate.qml delete mode 100644 src/imports/controls/SwipeView.qml delete mode 100644 src/imports/controls/Switch.qml delete mode 100644 src/imports/controls/SwitchDelegate.qml delete mode 100644 src/imports/controls/TabBar.qml delete mode 100644 src/imports/controls/TabButton.qml delete mode 100644 src/imports/controls/TextArea.qml delete mode 100644 src/imports/controls/TextField.qml delete mode 100644 src/imports/controls/ToolBar.qml delete mode 100644 src/imports/controls/ToolButton.qml delete mode 100644 src/imports/controls/ToolSeparator.qml delete mode 100644 src/imports/controls/ToolTip.qml delete mode 100644 src/imports/controls/Tumbler.qml delete mode 100644 src/imports/controls/VerticalHeaderView.qml delete mode 100644 src/imports/controls/controls.pri create mode 100644 src/imports/controls/default/AbstractButton.qml create mode 100644 src/imports/controls/default/Action.qml create mode 100644 src/imports/controls/default/ActionGroup.qml create mode 100644 src/imports/controls/default/ApplicationWindow.qml create mode 100644 src/imports/controls/default/BusyIndicator.qml create mode 100644 src/imports/controls/default/Button.qml create mode 100644 src/imports/controls/default/ButtonGroup.qml create mode 100644 src/imports/controls/default/CheckBox.qml create mode 100644 src/imports/controls/default/CheckDelegate.qml create mode 100644 src/imports/controls/default/ComboBox.qml create mode 100644 src/imports/controls/default/Container.qml create mode 100644 src/imports/controls/default/Control.qml create mode 100644 src/imports/controls/default/DelayButton.qml create mode 100644 src/imports/controls/default/Dial.qml create mode 100644 src/imports/controls/default/Dialog.qml create mode 100644 src/imports/controls/default/DialogButtonBox.qml create mode 100644 src/imports/controls/default/Drawer.qml create mode 100644 src/imports/controls/default/Frame.qml create mode 100644 src/imports/controls/default/GroupBox.qml create mode 100644 src/imports/controls/default/HorizontalHeaderView.qml create mode 100644 src/imports/controls/default/ItemDelegate.qml create mode 100644 src/imports/controls/default/Label.qml create mode 100644 src/imports/controls/default/Menu.qml create mode 100644 src/imports/controls/default/MenuBar.qml create mode 100644 src/imports/controls/default/MenuBarItem.qml create mode 100644 src/imports/controls/default/MenuItem.qml create mode 100644 src/imports/controls/default/MenuSeparator.qml create mode 100644 src/imports/controls/default/Page.qml create mode 100644 src/imports/controls/default/PageIndicator.qml create mode 100644 src/imports/controls/default/Pane.qml create mode 100644 src/imports/controls/default/Popup.qml create mode 100644 src/imports/controls/default/ProgressBar.qml create mode 100644 src/imports/controls/default/RadioButton.qml create mode 100644 src/imports/controls/default/RadioDelegate.qml create mode 100644 src/imports/controls/default/RangeSlider.qml create mode 100644 src/imports/controls/default/RoundButton.qml create mode 100644 src/imports/controls/default/ScrollBar.qml create mode 100644 src/imports/controls/default/ScrollIndicator.qml create mode 100644 src/imports/controls/default/ScrollView.qml create mode 100644 src/imports/controls/default/Slider.qml create mode 100644 src/imports/controls/default/SpinBox.qml create mode 100644 src/imports/controls/default/SplitView.qml create mode 100644 src/imports/controls/default/StackView.qml create mode 100644 src/imports/controls/default/SwipeDelegate.qml create mode 100644 src/imports/controls/default/SwipeView.qml create mode 100644 src/imports/controls/default/Switch.qml create mode 100644 src/imports/controls/default/SwitchDelegate.qml create mode 100644 src/imports/controls/default/TabBar.qml create mode 100644 src/imports/controls/default/TabButton.qml create mode 100644 src/imports/controls/default/TextArea.qml create mode 100644 src/imports/controls/default/TextField.qml create mode 100644 src/imports/controls/default/ToolBar.qml create mode 100644 src/imports/controls/default/ToolButton.qml create mode 100644 src/imports/controls/default/ToolSeparator.qml create mode 100644 src/imports/controls/default/ToolTip.qml create mode 100644 src/imports/controls/default/Tumbler.qml create mode 100644 src/imports/controls/default/VerticalHeaderView.qml create mode 100644 src/imports/controls/default/default.pri create mode 100644 src/imports/controls/default/default.pro create mode 100644 src/imports/controls/default/dependencies.json create mode 100644 src/imports/controls/default/images/arrow-indicator.png create mode 100644 src/imports/controls/default/images/arrow-indicator@2x.png create mode 100644 src/imports/controls/default/images/arrow-indicator@3x.png create mode 100644 src/imports/controls/default/images/arrow-indicator@4x.png create mode 100644 src/imports/controls/default/images/check.png create mode 100644 src/imports/controls/default/images/check@2x.png create mode 100644 src/imports/controls/default/images/check@3x.png create mode 100644 src/imports/controls/default/images/check@4x.png create mode 100644 src/imports/controls/default/images/dial-indicator.png create mode 100644 src/imports/controls/default/images/dial-indicator@2x.png create mode 100644 src/imports/controls/default/images/dial-indicator@3x.png create mode 100644 src/imports/controls/default/images/dial-indicator@4x.png create mode 100644 src/imports/controls/default/images/double-arrow.png create mode 100644 src/imports/controls/default/images/double-arrow@2x.png create mode 100644 src/imports/controls/default/images/double-arrow@3x.png create mode 100644 src/imports/controls/default/images/double-arrow@4x.png create mode 100644 src/imports/controls/default/images/drop-indicator.png create mode 100644 src/imports/controls/default/images/drop-indicator@2x.png create mode 100644 src/imports/controls/default/images/drop-indicator@3x.png create mode 100644 src/imports/controls/default/images/drop-indicator@4x.png create mode 100644 src/imports/controls/default/plugins.qmltypes create mode 100644 src/imports/controls/default/qmldir create mode 100644 src/imports/controls/default/qquickdefaultbusyindicator.cpp create mode 100644 src/imports/controls/default/qquickdefaultbusyindicator_p.h create mode 100644 src/imports/controls/default/qquickdefaultdial.cpp create mode 100644 src/imports/controls/default/qquickdefaultdial_p.h create mode 100644 src/imports/controls/default/qquickdefaultprogressbar.cpp create mode 100644 src/imports/controls/default/qquickdefaultprogressbar_p.h create mode 100644 src/imports/controls/default/qquickdefaultstyle.cpp create mode 100644 src/imports/controls/default/qquickdefaultstyle_p.h create mode 100644 src/imports/controls/default/qquickdefaulttheme.cpp create mode 100644 src/imports/controls/default/qquickdefaulttheme_p.h create mode 100644 src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp create mode 100644 src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc delete mode 100644 src/imports/controls/dependencies.json delete mode 100644 src/imports/controls/images/arrow-indicator.png delete mode 100644 src/imports/controls/images/arrow-indicator@2x.png delete mode 100644 src/imports/controls/images/arrow-indicator@3x.png delete mode 100644 src/imports/controls/images/arrow-indicator@4x.png delete mode 100644 src/imports/controls/images/check.png delete mode 100644 src/imports/controls/images/check@2x.png delete mode 100644 src/imports/controls/images/check@3x.png delete mode 100644 src/imports/controls/images/check@4x.png delete mode 100644 src/imports/controls/images/dial-indicator.png delete mode 100644 src/imports/controls/images/dial-indicator@2x.png delete mode 100644 src/imports/controls/images/dial-indicator@3x.png delete mode 100644 src/imports/controls/images/dial-indicator@4x.png delete mode 100644 src/imports/controls/images/double-arrow.png delete mode 100644 src/imports/controls/images/double-arrow@2x.png delete mode 100644 src/imports/controls/images/double-arrow@3x.png delete mode 100644 src/imports/controls/images/double-arrow@4x.png delete mode 100644 src/imports/controls/images/drop-indicator.png delete mode 100644 src/imports/controls/images/drop-indicator@2x.png delete mode 100644 src/imports/controls/images/drop-indicator@3x.png delete mode 100644 src/imports/controls/images/drop-indicator@4x.png delete mode 100644 src/imports/controls/plugins.qmltypes delete mode 100644 src/imports/controls/qquickdefaultbusyindicator.cpp delete mode 100644 src/imports/controls/qquickdefaultbusyindicator_p.h delete mode 100644 src/imports/controls/qquickdefaultdial.cpp delete mode 100644 src/imports/controls/qquickdefaultdial_p.h delete mode 100644 src/imports/controls/qquickdefaultprogressbar.cpp delete mode 100644 src/imports/controls/qquickdefaultprogressbar_p.h delete mode 100644 src/imports/controls/qquickdefaultstyle.cpp delete mode 100644 src/imports/controls/qquickdefaultstyle_p.h delete mode 100644 src/imports/controls/qquickdefaulttheme.cpp delete mode 100644 src/imports/controls/qquickdefaulttheme_p.h delete mode 100644 src/imports/controls/qtquickcontrols2plugin.qrc (limited to 'src') diff --git a/src/imports/controls/AbstractButton.qml b/src/imports/controls/AbstractButton.qml deleted file mode 100644 index 50ddb933..00000000 --- a/src/imports/controls/AbstractButton.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.AbstractButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) -} diff --git a/src/imports/controls/Action.qml b/src/imports/controls/Action.qml deleted file mode 100644 index 996e9086..00000000 --- a/src/imports/controls/Action.qml +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.Action { } diff --git a/src/imports/controls/ActionGroup.qml b/src/imports/controls/ActionGroup.qml deleted file mode 100644 index 89e72c8f..00000000 --- a/src/imports/controls/ActionGroup.qml +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.ActionGroup { } diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml deleted file mode 100644 index 235ebf13..00000000 --- a/src/imports/controls/ApplicationWindow.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ApplicationWindow { - id: window - - color: window.palette.window -} diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml deleted file mode 100644 index ff5c191c..00000000 --- a/src/imports/controls/BusyIndicator.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.BusyIndicator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - - contentItem: BusyIndicatorImpl { - implicitWidth: 48 - implicitHeight: 48 - - pen: control.palette.dark - fill: control.palette.dark - - running: control.running - opacity: control.running ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: 250 } } - } -} diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml deleted file mode 100644 index a9e7fce6..00000000 --- a/src/imports/controls/Button.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - horizontalPadding: padding + 2 - spacing: 6 - - icon.width: 24 - icon.height: 24 - icon.color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - - icon: control.icon - text: control.text - font: control.font - color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - visible: !control.flat || control.down || control.checked || control.highlighted - color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, - control.palette.mid, control.down ? 0.5 : 0.0) - border.color: control.palette.highlight - border.width: control.visualFocus ? 2 : 0 - } -} diff --git a/src/imports/controls/ButtonGroup.qml b/src/imports/controls/ButtonGroup.qml deleted file mode 100644 index cf0355ba..00000000 --- a/src/imports/controls/ButtonGroup.qml +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.ButtonGroup { } diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml deleted file mode 100644 index b1f50ed1..00000000 --- a/src/imports/controls/CheckBox.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.CheckBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - // keep in sync with CheckDelegate.qml (shared CheckIndicator.qml was removed for performance reasons) - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: 28 - - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - - color: control.down ? control.palette.light : control.palette.base - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.palette.mid - - ColorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - defaultColor: "#353637" - color: control.palette.text - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" - visible: control.checkState === Qt.Checked - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 16 - height: 3 - color: control.palette.text - visible: control.checkState === Qt.PartiallyChecked - } - } - - contentItem: CheckLabel { - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - - text: control.text - font: control.font - color: control.palette.windowText - } -} diff --git a/src/imports/controls/CheckDelegate.qml b/src/imports/controls/CheckDelegate.qml deleted file mode 100644 index 71b390ac..00000000 --- a/src/imports/controls/CheckDelegate.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.CheckDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 12 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.text - - contentItem: IconLabel { - leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 - - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.text - } - - // keep in sync with CheckBox.qml (shared CheckIndicator.qml was removed for performance reasons) - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: 28 - - x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 - - color: control.down ? control.palette.light : control.palette.base - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.palette.mid - - ColorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - defaultColor: "#353637" - color: control.palette.text - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" - visible: control.checkState === Qt.Checked - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 16 - height: 3 - color: control.palette.text - visible: control.checkState === Qt.PartiallyChecked - } - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - visible: control.down || control.highlighted - color: control.down ? control.palette.midlight : control.palette.light - } -} diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml deleted file mode 100644 index e9f93d66..00000000 --- a/src/imports/controls/ComboBox.qml +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -T.ComboBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) - rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) - - delegate: ItemDelegate { - width: ListView.view.width - text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData - palette.text: control.palette.text - palette.highlightedText: control.palette.highlightedText - font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal - highlighted: control.highlightedIndex === index - hoverEnabled: control.hoverEnabled - } - - indicator: ColorImage { - x: control.mirrored ? control.padding : control.width - width - control.padding - y: control.topPadding + (control.availableHeight - height) / 2 - color: control.palette.dark - defaultColor: "#353637" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" - opacity: enabled ? 1 : 0.3 - } - - contentItem: T.TextField { - leftPadding: !control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 - rightPadding: control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 - topPadding: 6 - control.padding - bottomPadding: 6 - control.padding - - text: control.editable ? control.editText : control.displayText - - enabled: control.editable - autoScroll: control.editable - readOnly: control.down - inputMethodHints: control.inputMethodHints - validator: control.validator - selectByMouse: control.selectTextByMouse - - font: control.font - color: control.editable ? control.palette.text : control.palette.buttonText - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - verticalAlignment: Text.AlignVCenter - - background: Rectangle { - visible: control.enabled && control.editable && !control.flat - border.width: parent && parent.activeFocus ? 2 : 1 - border.color: parent && parent.activeFocus ? control.palette.highlight : control.palette.button - color: control.palette.base - } - } - - background: Rectangle { - implicitWidth: 140 - implicitHeight: 40 - - color: control.down ? control.palette.mid : control.palette.button - border.color: control.palette.highlight - border.width: !control.editable && control.visualFocus ? 2 : 0 - visible: !control.flat || control.down - } - - popup: T.Popup { - y: control.height - width: control.width - height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) - topMargin: 6 - bottomMargin: 6 - - contentItem: ListView { - clip: true - implicitHeight: contentHeight - model: control.delegateModel - currentIndex: control.highlightedIndex - highlightMoveDuration: 0 - - Rectangle { - z: 10 - width: parent.width - height: parent.height - color: "transparent" - border.color: control.palette.mid - } - - T.ScrollIndicator.vertical: ScrollIndicator { } - } - - background: Rectangle { - color: control.palette.window - } - } -} diff --git a/src/imports/controls/Container.qml b/src/imports/controls/Container.qml deleted file mode 100644 index 83ab957d..00000000 --- a/src/imports/controls/Container.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.Container { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) -} diff --git a/src/imports/controls/Control.qml b/src/imports/controls/Control.qml deleted file mode 100644 index a963a563..00000000 --- a/src/imports/controls/Control.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.Control { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) -} diff --git a/src/imports/controls/DelayButton.qml b/src/imports/controls/DelayButton.qml deleted file mode 100644 index 1c545a71..00000000 --- a/src/imports/controls/DelayButton.qml +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.DelayButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - horizontalPadding: padding + 2 - - transition: Transition { - NumberAnimation { - duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress) - } - } - - contentItem: ItemGroup { - ClippedText { - clip: control.progress > 0 - clipX: -control.leftPadding + control.progress * control.width - clipWidth: (1.0 - control.progress) * control.width - visible: control.progress < 1 - - text: control.text - font: control.font - opacity: enabled ? 1 : 0.3 - color: control.palette.buttonText - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - - ClippedText { - clip: control.progress > 0 - clipX: -control.leftPadding - clipWidth: control.progress * control.width - visible: control.progress > 0 - - text: control.text - font: control.font - opacity: enabled ? 1 : 0.3 - color: control.palette.brightText - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - color: Color.blend(control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0) - border.color: control.palette.highlight - border.width: control.visualFocus ? 2 : 0 - - PaddedRectangle { - padding: control.visualFocus ? 2 : 0 - width: control.progress * parent.width - height: parent.height - color: Color.blend(control.palette.dark, control.palette.mid, control.down ? 0.5 : 0.0) - } - } -} diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml deleted file mode 100644 index e7c732cd..00000000 --- a/src/imports/controls/Dial.qml +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Dial { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - background: DialImpl { - implicitWidth: 184 - implicitHeight: 184 - color: control.visualFocus ? control.palette.highlight : control.palette.dark - progress: control.position - opacity: control.enabled ? 1 : 0.3 - } - - handle: ColorImage { - x: control.background.x + control.background.width / 2 - width / 2 - y: control.background.y + control.background.height / 2 - height / 2 - width: 14 - height: 10 - defaultColor: "#353637" - color: control.visualFocus ? control.palette.highlight : control.palette.dark - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/dial-indicator.png" - antialiasing: true - opacity: control.enabled ? 1 : 0.3 - transform: [ - Translate { - y: -Math.min(control.background.width, control.background.height) * 0.4 + control.handle.height / 2 - }, - Rotation { - angle: control.angle - origin.x: control.handle.width / 2 - origin.y: control.handle.height / 2 - } - ] - } -} diff --git a/src/imports/controls/Dialog.qml b/src/imports/controls/Dialog.qml deleted file mode 100644 index 6c2e4b1b..00000000 --- a/src/imports/controls/Dialog.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.Dialog { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - implicitHeaderWidth, - implicitFooterWidth) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding - + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) - + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) - - padding: 12 - - background: Rectangle { - color: control.palette.window - border.color: control.palette.dark - } - - header: Label { - text: control.title - visible: control.title - elide: Label.ElideRight - font.bold: true - padding: 12 - background: Rectangle { - x: 1; y: 1 - width: parent.width - 2 - height: parent.height - 1 - color: control.palette.window - } - } - - footer: DialogButtonBox { - visible: count > 0 - } - - T.Overlay.modal: Rectangle { - color: Color.transparent(control.palette.shadow, 0.5) - } - - T.Overlay.modeless: Rectangle { - color: Color.transparent(control.palette.shadow, 0.12) - } -} diff --git a/src/imports/controls/DialogButtonBox.qml b/src/imports/controls/DialogButtonBox.qml deleted file mode 100644 index 3c9d5b48..00000000 --- a/src/imports/controls/DialogButtonBox.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.DialogButtonBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - (control.count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - contentWidth: contentItem.contentWidth - - spacing: 1 - padding: 12 - alignment: count === 1 ? Qt.AlignRight : undefined - - delegate: Button { - width: control.count === 1 ? control.availableWidth / 2 : undefined - } - - contentItem: ListView { - model: control.contentModel - spacing: control.spacing - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - snapMode: ListView.SnapToItem - } - - background: Rectangle { - implicitHeight: 40 - x: 1; y: 1 - width: parent.width - 2 - height: parent.height - 2 - color: control.palette.window - } -} diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml deleted file mode 100644 index 17465fd4..00000000 --- a/src/imports/controls/Drawer.qml +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Drawer { - id: control - - parent: T.Overlay.overlay - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - topPadding: control.edge === Qt.BottomEdge - leftPadding: control.edge === Qt.RightEdge - rightPadding: control.edge === Qt.LeftEdge - bottomPadding: control.edge === Qt.TopEdge - - enter: Transition { SmoothedAnimation { velocity: 5 } } - exit: Transition { SmoothedAnimation { velocity: 5 } } - - background: Rectangle { - color: control.palette.window - Rectangle { - readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge - width: horizontal ? 1 : parent.width - height: horizontal ? parent.height : 1 - color: control.palette.dark - x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0 - y: control.edge === Qt.TopEdge ? parent.height - 1 : 0 - } - } - - T.Overlay.modal: Rectangle { - color: Color.transparent(control.palette.shadow, 0.5) - } - - T.Overlay.modeless: Rectangle { - color: Color.transparent(control.palette.shadow, 0.12) - } -} diff --git a/src/imports/controls/Frame.qml b/src/imports/controls/Frame.qml deleted file mode 100644 index 2fe46104..00000000 --- a/src/imports/controls/Frame.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Frame { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - - background: Rectangle { - color: "transparent" - border.color: control.palette.mid - } -} diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml deleted file mode 100644 index 96f776f2..00000000 --- a/src/imports/controls/GroupBox.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.GroupBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - implicitLabelWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - spacing: 6 - padding: 12 - topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) - - label: Text { - x: control.leftPadding - width: control.availableWidth - - text: control.title - font: control.font - color: control.palette.windowText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { - y: control.topPadding - control.bottomPadding - width: parent.width - height: parent.height - control.topPadding + control.bottomPadding - - color: "transparent" - border.color: control.palette.mid - } -} diff --git a/src/imports/controls/HorizontalHeaderView.qml b/src/imports/controls/HorizontalHeaderView.qml deleted file mode 100644 index ec91af25..00000000 --- a/src/imports/controls/HorizontalHeaderView.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T - -T.HorizontalHeaderView { - id: control - - implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight - - delegate: Rectangle { - // Qt6: add cellPadding (and font etc) as public API in headerview - readonly property real cellPadding: 8 - - implicitWidth: text.implicitWidth + (cellPadding * 2) - implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2)) - color: "#f6f6f6" - border.color: "#e4e4e4" - - Text { - id: text - text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] - : model[control.textRole]) - : modelData - width: parent.width - height: parent.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: "#ff26282a" - } - } -} diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml deleted file mode 100644 index 6229e2bb..00000000 --- a/src/imports/controls/ItemDelegate.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ItemDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 8 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.text - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.highlighted ? control.palette.highlightedText : control.palette.text - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - visible: control.down || control.highlighted || control.visualFocus - color: Color.blend(control.down ? control.palette.midlight : control.palette.light, - control.palette.highlight, control.visualFocus ? 0.15 : 0.0) - } -} diff --git a/src/imports/controls/Label.qml b/src/imports/controls/Label.qml deleted file mode 100644 index 9a42635f..00000000 --- a/src/imports/controls/Label.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Label { - id: control - - color: control.palette.windowText - linkColor: control.palette.link -} diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml deleted file mode 100644 index cf3a52f2..00000000 --- a/src/imports/controls/Menu.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Window 2.12 - -T.Menu { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - margins: 0 - overlap: 1 - - delegate: MenuItem { } - - contentItem: ListView { - implicitHeight: contentHeight - model: control.contentModel - interactive: Window.window - ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height - : false - clip: true - currentIndex: control.currentIndex - - ScrollIndicator.vertical: ScrollIndicator {} - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 40 - color: control.palette.window - border.color: control.palette.dark - } - - T.Overlay.modal: Rectangle { - color: Color.transparent(control.palette.shadow, 0.5) - } - - T.Overlay.modeless: Rectangle { - color: Color.transparent(control.palette.shadow, 0.12) - } -} diff --git a/src/imports/controls/MenuBar.qml b/src/imports/controls/MenuBar.qml deleted file mode 100644 index 122cdc53..00000000 --- a/src/imports/controls/MenuBar.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.MenuBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - delegate: MenuBarItem { } - - contentItem: Row { - spacing: control.spacing - Repeater { - model: control.contentModel - } - } - - background: Rectangle { - implicitHeight: 40 - color: control.palette.button - } -} diff --git a/src/imports/controls/MenuBarItem.qml b/src/imports/controls/MenuBarItem.qml deleted file mode 100644 index f6835412..00000000 --- a/src/imports/controls/MenuBarItem.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.MenuBarItem { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - spacing: 6 - padding: 6 - leftPadding: 12 - rightPadding: 16 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.buttonText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.buttonText - } - - background: Rectangle { - implicitWidth: 40 - implicitHeight: 40 - color: control.down || control.highlighted ? control.palette.mid : "transparent" - } -} diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml deleted file mode 100644 index 22cdf3ea..00000000 --- a/src/imports/controls/MenuItem.qml +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.MenuItem { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.windowText - - contentItem: IconLabel { - readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0 - readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0 - leftPadding: !control.mirrored ? indicatorPadding : arrowPadding - rightPadding: control.mirrored ? indicatorPadding : arrowPadding - - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.windowText - } - - indicator: ColorImage { - x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding - y: control.topPadding + (control.availableHeight - height) / 2 - - visible: control.checked - source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" : "" - color: control.palette.windowText - defaultColor: "#353637" - } - - arrow: ColorImage { - x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 - - visible: control.subMenu - mirror: control.mirrored - source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/arrow-indicator.png" : "" - color: control.palette.windowText - defaultColor: "#353637" - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 40 - x: 1 - y: 1 - width: control.width - 2 - height: control.height - 2 - color: control.down ? control.palette.midlight : control.highlighted ? control.palette.light : "transparent" - } -} diff --git a/src/imports/controls/MenuSeparator.qml b/src/imports/controls/MenuSeparator.qml deleted file mode 100644 index cc5c2b6e..00000000 --- a/src/imports/controls/MenuSeparator.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.MenuSeparator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 2 - verticalPadding: padding + 4 - - contentItem: Rectangle { - implicitWidth: 188 - implicitHeight: 1 - color: control.palette.mid - } -} diff --git a/src/imports/controls/Page.qml b/src/imports/controls/Page.qml deleted file mode 100644 index 4b3cf3d2..00000000 --- a/src/imports/controls/Page.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Page { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - implicitHeaderWidth, - implicitFooterWidth) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding - + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) - + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) - - background: Rectangle { - color: control.palette.window - } -} diff --git a/src/imports/controls/PageIndicator.qml b/src/imports/controls/PageIndicator.qml deleted file mode 100644 index 78f9e3cf..00000000 --- a/src/imports/controls/PageIndicator.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.PageIndicator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: control.palette.dark - - opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45 - Behavior on opacity { OpacityAnimator { duration: 100 } } - } - - contentItem: Row { - spacing: control.spacing - - Repeater { - model: control.count - delegate: control.delegate - } - } -} diff --git a/src/imports/controls/Pane.qml b/src/imports/controls/Pane.qml deleted file mode 100644 index 47b916e3..00000000 --- a/src/imports/controls/Pane.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Pane { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - - background: Rectangle { - color: control.palette.window - } -} diff --git a/src/imports/controls/Popup.qml b/src/imports/controls/Popup.qml deleted file mode 100644 index ee243c10..00000000 --- a/src/imports/controls/Popup.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Popup { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - - background: Rectangle { - color: control.palette.window - border.color: control.palette.dark - } - - T.Overlay.modal: Rectangle { - color: Color.transparent(control.palette.shadow, 0.5) - } - - T.Overlay.modeless: Rectangle { - color: Color.transparent(control.palette.shadow, 0.12) - } -} diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml deleted file mode 100644 index 61cdea43..00000000 --- a/src/imports/controls/ProgressBar.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.ProgressBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - contentItem: ProgressBarImpl { - implicitHeight: 6 - implicitWidth: 116 - scale: control.mirrored ? -1 : 1 - progress: control.position - indeterminate: control.visible && control.indeterminate - color: control.palette.dark - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 6 - y: (control.height - height) / 2 - height: 6 - - color: control.palette.midlight - } -} diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml deleted file mode 100644 index cdf0c30e..00000000 --- a/src/imports/controls/RadioButton.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.RadioButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - // keep in sync with RadioDelegate.qml (shared RadioIndicator.qml was removed for performance reasons) - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: 28 - - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - - radius: width / 2 - color: control.down ? control.palette.light : control.palette.base - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.palette.mid - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 20 - height: 20 - radius: width / 2 - color: control.palette.text - visible: control.checked - } - } - - contentItem: CheckLabel { - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - - text: control.text - font: control.font - color: control.palette.windowText - } -} diff --git a/src/imports/controls/RadioDelegate.qml b/src/imports/controls/RadioDelegate.qml deleted file mode 100644 index a7e7dec0..00000000 --- a/src/imports/controls/RadioDelegate.qml +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.RadioDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 12 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.text - - contentItem: IconLabel { - leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 - - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.text - } - - // keep in sync with RadioButton.qml (shared RadioIndicator.qml was removed for performance reasons) - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: 28 - - x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 - - radius: width / 2 - color: control.down ? control.palette.light : control.palette.base - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.palette.mid - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 20 - height: 20 - radius: width / 2 - color: control.palette.text - visible: control.checked - } - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - visible: control.down || control.highlighted - color: control.down ? control.palette.midlight : control.palette.light - } -} diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml deleted file mode 100644 index c3e7c964..00000000 --- a/src/imports/controls/RangeSlider.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.RangeSlider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - first.implicitHandleWidth + leftPadding + rightPadding, - second.implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - first.implicitHandleHeight + topPadding + bottomPadding, - second.implicitHandleHeight + topPadding + bottomPadding) - - padding: 6 - - first.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) - implicitWidth: 28 - implicitHeight: 28 - radius: width / 2 - border.width: activeFocus ? 2 : 1 - border.color: activeFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight - color: control.first.pressed ? control.palette.light : control.palette.window - } - - second.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) - implicitWidth: 28 - implicitHeight: 28 - radius: width / 2 - border.width: activeFocus ? 2 : 1 - border.color: activeFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight - color: control.second.pressed ? control.palette.light : control.palette.window - } - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 6 - implicitHeight: control.horizontal ? 6 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - radius: 3 - color: control.palette.midlight - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? control.first.position * parent.width + 3 : 0 - y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3 - width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6 - height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6 - - color: control.palette.dark - } - } -} diff --git a/src/imports/controls/RoundButton.qml b/src/imports/controls/RoundButton.qml deleted file mode 100644 index 825d5252..00000000 --- a/src/imports/controls/RoundButton.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.RoundButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - icon.width: 24 - icon.height: 24 - icon.color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - - icon: control.icon - text: control.text - font: control.font - color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - } - - background: Rectangle { - implicitWidth: 40 - implicitHeight: 40 - radius: control.radius - opacity: enabled ? 1 : 0.3 - visible: !control.flat || control.down || control.checked || control.highlighted - color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, - control.palette.mid, control.down ? 0.5 : 0.0) - border.color: control.palette.highlight - border.width: control.visualFocus ? 2 : 0 - } -} diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml deleted file mode 100644 index 0948fb1d..00000000 --- a/src/imports/controls/ScrollBar.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ScrollBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 2 - visible: control.policy !== T.ScrollBar.AlwaysOff - minimumSize: orientation == Qt.Horizontal ? height / width : width / height - - contentItem: Rectangle { - implicitWidth: control.interactive ? 6 : 2 - implicitHeight: control.interactive ? 6 : 2 - - radius: width / 2 - color: control.pressed ? control.palette.dark : control.palette.mid - opacity: 0.0 - - states: State { - name: "active" - when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) - PropertyChanges { target: control.contentItem; opacity: 0.75 } - } - - transitions: Transition { - from: "active" - SequentialAnimation { - PauseAnimation { duration: 450 } - NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } - } - } - } -} diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml deleted file mode 100644 index 795c20ee..00000000 --- a/src/imports/controls/ScrollIndicator.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ScrollIndicator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 2 - - contentItem: Rectangle { - implicitWidth: 2 - implicitHeight: 2 - - color: control.palette.mid - visible: control.size < 1.0 - opacity: 0.0 - - states: State { - name: "active" - when: control.active - PropertyChanges { target: control.contentItem; opacity: 0.75 } - } - - transitions: [ - Transition { - from: "active" - SequentialAnimation { - PauseAnimation { duration: 450 } - NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } - } - } - ] - } -} diff --git a/src/imports/controls/ScrollView.qml b/src/imports/controls/ScrollView.qml deleted file mode 100644 index f775d624..00000000 --- a/src/imports/controls/ScrollView.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ScrollView { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - ScrollBar.vertical: ScrollBar { - parent: control - x: control.mirrored ? 0 : control.width - width - y: control.topPadding - height: control.availableHeight - active: control.ScrollBar.horizontal.active - } - - ScrollBar.horizontal: ScrollBar { - parent: control - x: control.leftPadding - y: control.height - height - width: control.availableWidth - active: control.ScrollBar.vertical.active - } -} diff --git a/src/imports/controls/Slider.qml b/src/imports/controls/Slider.qml deleted file mode 100644 index 6d532389..00000000 --- a/src/imports/controls/Slider.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 6 - - handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - implicitWidth: 28 - implicitHeight: 28 - radius: width / 2 - color: control.pressed ? control.palette.light : control.palette.window - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight - } - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 6 - implicitHeight: control.horizontal ? 6 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - radius: 3 - color: control.palette.midlight - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - y: control.horizontal ? 0 : control.visualPosition * parent.height - width: control.horizontal ? control.position * parent.width : 6 - height: control.horizontal ? 6 : control.position * parent.height - - radius: 3 - color: control.palette.dark - } - } -} diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml deleted file mode 100644 index d1c2ea5b..00000000 --- a/src/imports/controls/SpinBox.qml +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.SpinBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentItem.implicitWidth + 2 * padding + - up.implicitIndicatorWidth + - down.implicitIndicatorWidth) - implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, - implicitBackgroundHeight, - up.implicitIndicatorHeight, - down.implicitIndicatorHeight) - - padding: 6 - leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) - rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0)) - - validator: IntValidator { - locale: control.locale.name - bottom: Math.min(control.from, control.to) - top: Math.max(control.from, control.to) - } - - contentItem: TextInput { - z: 2 - text: control.displayText - - font: control.font - color: control.palette.text - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - readOnly: !control.editable - validator: control.validator - inputMethodHints: control.inputMethodHints - - Rectangle { - x: -6 - (control.down.indicator ? 1 : 0) - y: -6 - width: control.width - (control.up.indicator ? control.up.indicator.width - 1 : 0) - (control.down.indicator ? control.down.indicator.width - 1 : 0) - height: control.height - visible: control.activeFocus - color: "transparent" - border.color: control.palette.highlight - border.width: 2 - } - } - - up.indicator: Rectangle { - x: control.mirrored ? 0 : parent.width - width - height: parent.height - implicitWidth: 40 - implicitHeight: 40 - color: control.up.pressed ? control.palette.mid : control.palette.button - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 3 - height: 2 - color: enabled ? control.palette.buttonText : control.palette.mid - } - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 2 - height: parent.width / 3 - color: enabled ? control.palette.buttonText : control.palette.mid - } - } - - down.indicator: Rectangle { - x: control.mirrored ? parent.width - width : 0 - height: parent.height - implicitWidth: 40 - implicitHeight: 40 - color: control.down.pressed ? control.palette.mid : control.palette.button - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 3 - height: 2 - color: enabled ? control.palette.buttonText : control.palette.mid - } - } - - background: Rectangle { - implicitWidth: 140 - color: enabled ? control.palette.base : control.palette.button - border.color: control.palette.button - } -} diff --git a/src/imports/controls/SplitView.qml b/src/imports/controls/SplitView.qml deleted file mode 100644 index 9d37a83e..00000000 --- a/src/imports/controls/SplitView.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls 2.13 -import QtQuick.Controls.impl 2.13 - -T.SplitView { - id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - handle: Rectangle { - implicitWidth: control.orientation === Qt.Horizontal ? 6 : control.width - implicitHeight: control.orientation === Qt.Horizontal ? control.height : 6 - color: T.SplitHandle.pressed ? control.palette.mid - : (T.SplitHandle.hovered ? control.palette.midlight : control.palette.button) - } -} diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml deleted file mode 100644 index 3e416b87..00000000 --- a/src/imports/controls/StackView.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T - -T.StackView { - id: control - - popEnter: Transition { - XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } - } - - popExit: Transition { - XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic } - } - - pushEnter: Transition { - XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } - } - - pushExit: Transition { - XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic } - } - - replaceEnter: Transition { - XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } - } - - replaceExit: Transition { - XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic } - } -} diff --git a/src/imports/controls/SwipeDelegate.qml b/src/imports/controls/SwipeDelegate.qml deleted file mode 100644 index 37d66bb6..00000000 --- a/src/imports/controls/SwipeDelegate.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.SwipeDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 12 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.text - - swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } } - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.text - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - color: Color.blend(control.down ? control.palette.midlight : control.palette.light, - control.palette.highlight, control.visualFocus ? 0.15 : 0.0) - } -} diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml deleted file mode 100644 index 7722d258..00000000 --- a/src/imports/controls/SwipeView.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T - -T.SwipeView { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - contentItem: ListView { - model: control.contentModel - interactive: control.interactive - currentIndex: control.currentIndex - focus: control.focus - - spacing: control.spacing - orientation: control.orientation - snapMode: ListView.SnapOneItem - boundsBehavior: Flickable.StopAtBounds - - highlightRangeMode: ListView.StrictlyEnforceRange - preferredHighlightBegin: 0 - preferredHighlightEnd: 0 - highlightMoveDuration: 250 - maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height) - } -} diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml deleted file mode 100644 index f62e2502..00000000 --- a/src/imports/controls/Switch.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.Switch { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - indicator: PaddedRectangle { - implicitWidth: 56 - implicitHeight: 28 - - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - - radius: 8 - leftPadding: 0 - rightPadding: 0 - padding: (height - 16) / 2 - color: control.checked ? control.palette.dark : control.palette.midlight - - Rectangle { - x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) - y: (parent.height - height) / 2 - width: 28 - height: 28 - radius: 16 - color: control.down ? control.palette.light : control.palette.window - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight - - Behavior on x { - enabled: !control.down - SmoothedAnimation { velocity: 200 } - } - } - } - - contentItem: CheckLabel { - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - - text: control.text - font: control.font - color: control.palette.windowText - } -} diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml deleted file mode 100644 index d6447e77..00000000 --- a/src/imports/controls/SwitchDelegate.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 - -T.SwitchDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 12 - - icon.width: 24 - icon.height: 24 - icon.color: control.palette.text - - indicator: PaddedRectangle { - implicitWidth: 56 - implicitHeight: 28 - - x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - - radius: 8 - leftPadding: 0 - rightPadding: 0 - padding: (height - 16) / 2 - color: control.checked ? control.palette.dark : control.palette.midlight - - Rectangle { - x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) - y: (parent.height - height) / 2 - width: 28 - height: 28 - radius: 16 - color: control.down ? control.palette.light : control.palette.window - border.width: control.visualFocus ? 2 : 1 - border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight - - Behavior on x { - enabled: !control.down - SmoothedAnimation { velocity: 200 } - } - } - } - - contentItem: IconLabel { - leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 - - spacing: control.spacing - mirrored: control.mirrored - display: control.display - alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft - - icon: control.icon - text: control.text - font: control.font - color: control.palette.text - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - visible: control.down || control.highlighted - color: control.down ? control.palette.midlight : control.palette.light - } -} diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml deleted file mode 100644 index 83f6b3b2..00000000 --- a/src/imports/controls/TabBar.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T - -T.TabBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - spacing: 1 - - contentItem: ListView { - model: control.contentModel - currentIndex: control.currentIndex - - spacing: control.spacing - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.AutoFlickIfNeeded - snapMode: ListView.SnapToItem - - highlightMoveDuration: 0 - highlightRangeMode: ListView.ApplyRange - preferredHighlightBegin: 40 - preferredHighlightEnd: width - 40 - } - - background: Rectangle { - color: control.palette.window - } -} diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml deleted file mode 100644 index f8b303ea..00000000 --- a/src/imports/controls/TabButton.qml +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.TabButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - icon.width: 24 - icon.height: 24 - icon.color: checked ? control.palette.windowText : control.palette.brightText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - - icon: control.icon - text: control.text - font: control.font - color: control.checked ? control.palette.windowText : control.palette.brightText - } - - background: Rectangle { - implicitHeight: 40 - color: Color.blend(control.checked ? control.palette.window : control.palette.dark, - control.palette.mid, control.down ? 0.5 : 0.0) - } -} diff --git a/src/imports/controls/TextArea.qml b/src/imports/controls/TextArea.qml deleted file mode 100644 index 45790e67..00000000 --- a/src/imports/controls/TextArea.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.TextArea { - id: control - - implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - implicitBackgroundWidth + leftInset + rightInset, - placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - implicitBackgroundHeight + topInset + bottomInset, - placeholder.implicitHeight + topPadding + bottomPadding) - - padding: 6 - leftPadding: padding + 4 - - color: control.palette.text - placeholderTextColor: Color.transparent(control.color, 0.5) - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } -} diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml deleted file mode 100644 index 4d9cb691..00000000 --- a/src/imports/controls/TextField.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.TextField { - id: control - - implicitWidth: implicitBackgroundWidth + leftInset + rightInset - || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - padding: 6 - leftPadding: padding + 4 - - color: control.palette.text - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - placeholderTextColor: Color.transparent(control.color, 0.5) - verticalAlignment: TextInput.AlignVCenter - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 40 - border.width: control.activeFocus ? 2 : 1 - color: control.palette.base - border.color: control.activeFocus ? control.palette.highlight : control.palette.mid - } -} diff --git a/src/imports/controls/ToolBar.qml b/src/imports/controls/ToolBar.qml deleted file mode 100644 index 1e07b6bf..00000000 --- a/src/imports/controls/ToolBar.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ToolBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - background: Rectangle { - implicitHeight: 40 - color: control.palette.button - } -} diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml deleted file mode 100644 index 63aaf893..00000000 --- a/src/imports/controls/ToolButton.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ToolButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - icon.width: 24 - icon.height: 24 - icon.color: visualFocus ? control.palette.highlight : control.palette.buttonText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - - icon: control.icon - text: control.text - font: control.font - color: control.visualFocus ? control.palette.highlight : control.palette.buttonText - } - - background: Rectangle { - implicitWidth: 40 - implicitHeight: 40 - - opacity: control.down ? 1.0 : 0.5 - color: control.down || control.checked || control.highlighted ? control.palette.mid : control.palette.button - } -} diff --git a/src/imports/controls/ToolSeparator.qml b/src/imports/controls/ToolSeparator.qml deleted file mode 100644 index 188d0758..00000000 --- a/src/imports/controls/ToolSeparator.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ToolSeparator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: vertical ? 6 : 2 - verticalPadding: vertical ? 2 : 6 - - contentItem: Rectangle { - implicitWidth: vertical ? 1 : 30 - implicitHeight: vertical ? 30 : 1 - color: control.palette.mid - } -} diff --git a/src/imports/controls/ToolTip.qml b/src/imports/controls/ToolTip.qml deleted file mode 100644 index e0389903..00000000 --- a/src/imports/controls/ToolTip.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.ToolTip { - id: control - - x: parent ? (parent.width - implicitWidth) / 2 : 0 - y: -implicitHeight - 3 - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - margins: 6 - padding: 6 - - closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent - - contentItem: Text { - text: control.text - font: control.font - wrapMode: Text.Wrap - color: control.palette.toolTipText - } - - background: Rectangle { - border.color: control.palette.dark - color: control.palette.toolTipBase - } -} diff --git a/src/imports/controls/Tumbler.qml b/src/imports/controls/Tumbler.qml deleted file mode 100644 index 4d1abdd3..00000000 --- a/src/imports/controls/Tumbler.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T - -T.Tumbler { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - delegate: Text { - text: modelData - color: control.visualFocus ? control.palette.highlight : control.palette.text - font: control.font - opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - contentItem: TumblerView { - implicitWidth: 60 - implicitHeight: 200 - model: control.model - delegate: control.delegate - path: Path { - startX: control.contentItem.width / 2 - startY: -control.contentItem.delegateHeight / 2 - PathLine { - x: control.contentItem.width / 2 - y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 - } - } - - property real delegateHeight: control.availableHeight / control.visibleItemCount - } -} diff --git a/src/imports/controls/VerticalHeaderView.qml b/src/imports/controls/VerticalHeaderView.qml deleted file mode 100644 index 3fc9ca5a..00000000 --- a/src/imports/controls/VerticalHeaderView.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T - -T.VerticalHeaderView { - id: control - - implicitWidth: contentWidth - implicitHeight: syncView ? syncView.height : 0 - - delegate: Rectangle { - // Qt6: add cellPadding (and font etc) as public API in headerview - readonly property real cellPadding: 8 - - implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2)) - implicitHeight: text.implicitHeight + (cellPadding * 2) - color: "#f6f6f6" - border.color: "#e4e4e4" - - Text { - id: text - text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] - : model[control.textRole]) - : modelData - width: parent.width - height: parent.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: "#ff26282a" - } - } -} diff --git a/src/imports/controls/controls.pri b/src/imports/controls/controls.pri deleted file mode 100644 index 03fc0f4b..00000000 --- a/src/imports/controls/controls.pri +++ /dev/null @@ -1,72 +0,0 @@ -HEADERS += \ - $$PWD/qquickdefaultbusyindicator_p.h \ - $$PWD/qquickdefaultdial_p.h \ - $$PWD/qquickdefaultprogressbar_p.h \ - $$PWD/qquickdefaultstyle_p.h \ - $$PWD/qquickdefaulttheme_p.h - -SOURCES += \ - $$PWD/qquickdefaultbusyindicator.cpp \ - $$PWD/qquickdefaultdial.cpp \ - $$PWD/qquickdefaultprogressbar.cpp \ - $$PWD/qquickdefaultstyle.cpp \ - $$PWD/qquickdefaulttheme.cpp - -QML_FILES += \ - $$PWD/AbstractButton.qml \ - $$PWD/Action.qml \ - $$PWD/ActionGroup.qml \ - $$PWD/ApplicationWindow.qml \ - $$PWD/BusyIndicator.qml \ - $$PWD/Button.qml \ - $$PWD/ButtonGroup.qml \ - $$PWD/CheckBox.qml \ - $$PWD/CheckDelegate.qml \ - $$PWD/ComboBox.qml \ - $$PWD/Container.qml \ - $$PWD/Control.qml \ - $$PWD/DelayButton.qml \ - $$PWD/Dial.qml \ - $$PWD/Dialog.qml \ - $$PWD/DialogButtonBox.qml \ - $$PWD/Drawer.qml \ - $$PWD/Frame.qml \ - $$PWD/GroupBox.qml \ - $$PWD/HorizontalHeaderView.qml \ - $$PWD/ItemDelegate.qml \ - $$PWD/Label.qml \ - $$PWD/Menu.qml \ - $$PWD/MenuBar.qml \ - $$PWD/MenuBarItem.qml \ - $$PWD/MenuItem.qml \ - $$PWD/MenuSeparator.qml \ - $$PWD/Page.qml \ - $$PWD/PageIndicator.qml \ - $$PWD/Pane.qml \ - $$PWD/Popup.qml \ - $$PWD/ProgressBar.qml \ - $$PWD/RadioButton.qml \ - $$PWD/RadioDelegate.qml \ - $$PWD/RangeSlider.qml \ - $$PWD/RoundButton.qml \ - $$PWD/ScrollBar.qml \ - $$PWD/ScrollIndicator.qml \ - $$PWD/ScrollView.qml \ - $$PWD/Slider.qml \ - $$PWD/SpinBox.qml \ - $$PWD/SplitView.qml \ - $$PWD/StackView.qml \ - $$PWD/SwipeDelegate.qml \ - $$PWD/Switch.qml \ - $$PWD/SwitchDelegate.qml \ - $$PWD/SwipeView.qml \ - $$PWD/TabBar.qml \ - $$PWD/TabButton.qml \ - $$PWD/TextArea.qml \ - $$PWD/TextField.qml \ - $$PWD/ToolBar.qml \ - $$PWD/ToolButton.qml \ - $$PWD/ToolSeparator.qml \ - $$PWD/ToolTip.qml \ - $$PWD/Tumbler.qml \ - $$PWD/VerticalHeaderView.qml diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 66373d55..9440c36f 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -7,22 +7,14 @@ QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2 DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII -include(controls.pri) - OTHER_FILES += \ - qmldir \ - $$QML_FILES + qmldir SOURCES += \ $$PWD/qtquickcontrols2plugin.cpp -RESOURCES += \ - $$PWD/qtquickcontrols2plugin.qrc - qtConfig(quick-designer): include(designer/designer.pri) include(doc/doc.pri) -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += no_cxx_module load(qml_plugin) - -requires(qtConfig(quickcontrols2-default)) diff --git a/src/imports/controls/default/AbstractButton.qml b/src/imports/controls/default/AbstractButton.qml new file mode 100644 index 00000000..50ddb933 --- /dev/null +++ b/src/imports/controls/default/AbstractButton.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.AbstractButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) +} diff --git a/src/imports/controls/default/Action.qml b/src/imports/controls/default/Action.qml new file mode 100644 index 00000000..996e9086 --- /dev/null +++ b/src/imports/controls/default/Action.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.Action { } diff --git a/src/imports/controls/default/ActionGroup.qml b/src/imports/controls/default/ActionGroup.qml new file mode 100644 index 00000000..89e72c8f --- /dev/null +++ b/src/imports/controls/default/ActionGroup.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.ActionGroup { } diff --git a/src/imports/controls/default/ApplicationWindow.qml b/src/imports/controls/default/ApplicationWindow.qml new file mode 100644 index 00000000..235ebf13 --- /dev/null +++ b/src/imports/controls/default/ApplicationWindow.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Window 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ApplicationWindow { + id: window + + color: window.palette.window +} diff --git a/src/imports/controls/default/BusyIndicator.qml b/src/imports/controls/default/BusyIndicator.qml new file mode 100644 index 00000000..ff5c191c --- /dev/null +++ b/src/imports/controls/default/BusyIndicator.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.BusyIndicator { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + + contentItem: BusyIndicatorImpl { + implicitWidth: 48 + implicitHeight: 48 + + pen: control.palette.dark + fill: control.palette.dark + + running: control.running + opacity: control.running ? 1 : 0 + Behavior on opacity { OpacityAnimator { duration: 250 } } + } +} diff --git a/src/imports/controls/default/Button.qml b/src/imports/controls/default/Button.qml new file mode 100644 index 00000000..a9e7fce6 --- /dev/null +++ b/src/imports/controls/default/Button.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Button { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + horizontalPadding: padding + 2 + spacing: 6 + + icon.width: 24 + icon.height: 24 + icon.color: control.checked || control.highlighted ? control.palette.brightText : + control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + + icon: control.icon + text: control.text + font: control.font + color: control.checked || control.highlighted ? control.palette.brightText : + control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + visible: !control.flat || control.down || control.checked || control.highlighted + color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, + control.palette.mid, control.down ? 0.5 : 0.0) + border.color: control.palette.highlight + border.width: control.visualFocus ? 2 : 0 + } +} diff --git a/src/imports/controls/default/ButtonGroup.qml b/src/imports/controls/default/ButtonGroup.qml new file mode 100644 index 00000000..cf0355ba --- /dev/null +++ b/src/imports/controls/default/ButtonGroup.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.ButtonGroup { } diff --git a/src/imports/controls/default/CheckBox.qml b/src/imports/controls/default/CheckBox.qml new file mode 100644 index 00000000..3a7c3a06 --- /dev/null +++ b/src/imports/controls/default/CheckBox.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.CheckBox { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + // keep in sync with CheckDelegate.qml (shared CheckIndicator.qml was removed for performance reasons) + indicator: Rectangle { + implicitWidth: 28 + implicitHeight: 28 + + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + y: control.topPadding + (control.availableHeight - height) / 2 + + color: control.down ? control.palette.light : control.palette.base + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.palette.mid + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + defaultColor: "#353637" + color: control.palette.text + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + visible: control.checkState === Qt.Checked + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 16 + height: 3 + color: control.palette.text + visible: control.checkState === Qt.PartiallyChecked + } + } + + contentItem: CheckLabel { + leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 + + text: control.text + font: control.font + color: control.palette.windowText + } +} diff --git a/src/imports/controls/default/CheckDelegate.qml b/src/imports/controls/default/CheckDelegate.qml new file mode 100644 index 00000000..4dec9b98 --- /dev/null +++ b/src/imports/controls/default/CheckDelegate.qml @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.CheckDelegate { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 12 + spacing: 12 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.text + + contentItem: IconLabel { + leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 + + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.text + } + + // keep in sync with CheckBox.qml (shared CheckIndicator.qml was removed for performance reasons) + indicator: Rectangle { + implicitWidth: 28 + implicitHeight: 28 + + x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + color: control.down ? control.palette.light : control.palette.base + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.palette.mid + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + defaultColor: "#353637" + color: control.palette.text + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + visible: control.checkState === Qt.Checked + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 16 + height: 3 + color: control.palette.text + visible: control.checkState === Qt.PartiallyChecked + } + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + visible: control.down || control.highlighted + color: control.down ? control.palette.midlight : control.palette.light + } +} diff --git a/src/imports/controls/default/ComboBox.qml b/src/imports/controls/default/ComboBox.qml new file mode 100644 index 00000000..2c36aac6 --- /dev/null +++ b/src/imports/controls/default/ComboBox.qml @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Window 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Controls.impl 2.15 +import QtQuick.Templates 2.15 as T + +T.ComboBox { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) + rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) + + delegate: ItemDelegate { + width: ListView.view.width + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData + palette.text: control.palette.text + palette.highlightedText: control.palette.highlightedText + font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal + highlighted: control.highlightedIndex === index + hoverEnabled: control.hoverEnabled + } + + indicator: ColorImage { + x: control.mirrored ? control.padding : control.width - width - control.padding + y: control.topPadding + (control.availableHeight - height) / 2 + color: control.palette.dark + defaultColor: "#353637" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/double-arrow.png" + opacity: enabled ? 1 : 0.3 + } + + contentItem: T.TextField { + leftPadding: !control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 + rightPadding: control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 + topPadding: 6 - control.padding + bottomPadding: 6 - control.padding + + text: control.editable ? control.editText : control.displayText + + enabled: control.editable + autoScroll: control.editable + readOnly: control.down + inputMethodHints: control.inputMethodHints + validator: control.validator + selectByMouse: control.selectTextByMouse + + font: control.font + color: control.editable ? control.palette.text : control.palette.buttonText + selectionColor: control.palette.highlight + selectedTextColor: control.palette.highlightedText + verticalAlignment: Text.AlignVCenter + + background: Rectangle { + visible: control.enabled && control.editable && !control.flat + border.width: parent && parent.activeFocus ? 2 : 1 + border.color: parent && parent.activeFocus ? control.palette.highlight : control.palette.button + color: control.palette.base + } + } + + background: Rectangle { + implicitWidth: 140 + implicitHeight: 40 + + color: control.down ? control.palette.mid : control.palette.button + border.color: control.palette.highlight + border.width: !control.editable && control.visualFocus ? 2 : 0 + visible: !control.flat || control.down + } + + popup: T.Popup { + y: control.height + width: control.width + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) + topMargin: 6 + bottomMargin: 6 + + contentItem: ListView { + clip: true + implicitHeight: contentHeight + model: control.delegateModel + currentIndex: control.highlightedIndex + highlightMoveDuration: 0 + + Rectangle { + z: 10 + width: parent.width + height: parent.height + color: "transparent" + border.color: control.palette.mid + } + + T.ScrollIndicator.vertical: ScrollIndicator { } + } + + background: Rectangle { + color: control.palette.window + } + } +} diff --git a/src/imports/controls/default/Container.qml b/src/imports/controls/default/Container.qml new file mode 100644 index 00000000..83ab957d --- /dev/null +++ b/src/imports/controls/default/Container.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.Container { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) +} diff --git a/src/imports/controls/default/Control.qml b/src/imports/controls/default/Control.qml new file mode 100644 index 00000000..a963a563 --- /dev/null +++ b/src/imports/controls/default/Control.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.Control { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) +} diff --git a/src/imports/controls/default/DelayButton.qml b/src/imports/controls/default/DelayButton.qml new file mode 100644 index 00000000..1c545a71 --- /dev/null +++ b/src/imports/controls/default/DelayButton.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.DelayButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + horizontalPadding: padding + 2 + + transition: Transition { + NumberAnimation { + duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress) + } + } + + contentItem: ItemGroup { + ClippedText { + clip: control.progress > 0 + clipX: -control.leftPadding + control.progress * control.width + clipWidth: (1.0 - control.progress) * control.width + visible: control.progress < 1 + + text: control.text + font: control.font + opacity: enabled ? 1 : 0.3 + color: control.palette.buttonText + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + ClippedText { + clip: control.progress > 0 + clipX: -control.leftPadding + clipWidth: control.progress * control.width + visible: control.progress > 0 + + text: control.text + font: control.font + opacity: enabled ? 1 : 0.3 + color: control.palette.brightText + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + color: Color.blend(control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0) + border.color: control.palette.highlight + border.width: control.visualFocus ? 2 : 0 + + PaddedRectangle { + padding: control.visualFocus ? 2 : 0 + width: control.progress * parent.width + height: parent.height + color: Color.blend(control.palette.dark, control.palette.mid, control.down ? 0.5 : 0.0) + } + } +} diff --git a/src/imports/controls/default/Dial.qml b/src/imports/controls/default/Dial.qml new file mode 100644 index 00000000..457016d3 --- /dev/null +++ b/src/imports/controls/default/Dial.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Dial { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + background: DialImpl { + implicitWidth: 184 + implicitHeight: 184 + color: control.visualFocus ? control.palette.highlight : control.palette.dark + progress: control.position + opacity: control.enabled ? 1 : 0.3 + } + + handle: ColorImage { + x: control.background.x + control.background.width / 2 - width / 2 + y: control.background.y + control.background.height / 2 - height / 2 + width: 14 + height: 10 + defaultColor: "#353637" + color: control.visualFocus ? control.palette.highlight : control.palette.dark + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/dial-indicator.png" + antialiasing: true + opacity: control.enabled ? 1 : 0.3 + transform: [ + Translate { + y: -Math.min(control.background.width, control.background.height) * 0.4 + control.handle.height / 2 + }, + Rotation { + angle: control.angle + origin.x: control.handle.width / 2 + origin.y: control.handle.height / 2 + } + ] + } +} diff --git a/src/imports/controls/default/Dialog.qml b/src/imports/controls/default/Dialog.qml new file mode 100644 index 00000000..6c2e4b1b --- /dev/null +++ b/src/imports/controls/default/Dialog.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.Dialog { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) + + padding: 12 + + background: Rectangle { + color: control.palette.window + border.color: control.palette.dark + } + + header: Label { + text: control.title + visible: control.title + elide: Label.ElideRight + font.bold: true + padding: 12 + background: Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 1 + color: control.palette.window + } + } + + footer: DialogButtonBox { + visible: count > 0 + } + + T.Overlay.modal: Rectangle { + color: Color.transparent(control.palette.shadow, 0.5) + } + + T.Overlay.modeless: Rectangle { + color: Color.transparent(control.palette.shadow, 0.12) + } +} diff --git a/src/imports/controls/default/DialogButtonBox.qml b/src/imports/controls/default/DialogButtonBox.qml new file mode 100644 index 00000000..3c9d5b48 --- /dev/null +++ b/src/imports/controls/default/DialogButtonBox.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.DialogButtonBox { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + (control.count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + contentWidth: contentItem.contentWidth + + spacing: 1 + padding: 12 + alignment: count === 1 ? Qt.AlignRight : undefined + + delegate: Button { + width: control.count === 1 ? control.availableWidth / 2 : undefined + } + + contentItem: ListView { + model: control.contentModel + spacing: control.spacing + orientation: ListView.Horizontal + boundsBehavior: Flickable.StopAtBounds + snapMode: ListView.SnapToItem + } + + background: Rectangle { + implicitHeight: 40 + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 2 + color: control.palette.window + } +} diff --git a/src/imports/controls/default/Drawer.qml b/src/imports/controls/default/Drawer.qml new file mode 100644 index 00000000..17465fd4 --- /dev/null +++ b/src/imports/controls/default/Drawer.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Drawer { + id: control + + parent: T.Overlay.overlay + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + topPadding: control.edge === Qt.BottomEdge + leftPadding: control.edge === Qt.RightEdge + rightPadding: control.edge === Qt.LeftEdge + bottomPadding: control.edge === Qt.TopEdge + + enter: Transition { SmoothedAnimation { velocity: 5 } } + exit: Transition { SmoothedAnimation { velocity: 5 } } + + background: Rectangle { + color: control.palette.window + Rectangle { + readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge + width: horizontal ? 1 : parent.width + height: horizontal ? parent.height : 1 + color: control.palette.dark + x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0 + y: control.edge === Qt.TopEdge ? parent.height - 1 : 0 + } + } + + T.Overlay.modal: Rectangle { + color: Color.transparent(control.palette.shadow, 0.5) + } + + T.Overlay.modeless: Rectangle { + color: Color.transparent(control.palette.shadow, 0.12) + } +} diff --git a/src/imports/controls/default/Frame.qml b/src/imports/controls/default/Frame.qml new file mode 100644 index 00000000..2fe46104 --- /dev/null +++ b/src/imports/controls/default/Frame.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Frame { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + padding: 12 + + background: Rectangle { + color: "transparent" + border.color: control.palette.mid + } +} diff --git a/src/imports/controls/default/GroupBox.qml b/src/imports/controls/default/GroupBox.qml new file mode 100644 index 00000000..96f776f2 --- /dev/null +++ b/src/imports/controls/default/GroupBox.qml @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.GroupBox { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + spacing: 6 + padding: 12 + topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) + + label: Text { + x: control.leftPadding + width: control.availableWidth + + text: control.title + font: control.font + color: control.palette.windowText + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + + background: Rectangle { + y: control.topPadding - control.bottomPadding + width: parent.width + height: parent.height - control.topPadding + control.bottomPadding + + color: "transparent" + border.color: control.palette.mid + } +} diff --git a/src/imports/controls/default/HorizontalHeaderView.qml b/src/imports/controls/default/HorizontalHeaderView.qml new file mode 100644 index 00000000..ec91af25 --- /dev/null +++ b/src/imports/controls/default/HorizontalHeaderView.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T + +T.HorizontalHeaderView { + id: control + + implicitWidth: syncView ? syncView.width : 0 + implicitHeight: contentHeight + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: text.implicitWidth + (cellPadding * 2) + implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2)) + color: "#f6f6f6" + border.color: "#e4e4e4" + + Text { + id: text + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] + : model[control.textRole]) + : modelData + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: "#ff26282a" + } + } +} diff --git a/src/imports/controls/default/ItemDelegate.qml b/src/imports/controls/default/ItemDelegate.qml new file mode 100644 index 00000000..6229e2bb --- /dev/null +++ b/src/imports/controls/default/ItemDelegate.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ItemDelegate { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 12 + spacing: 8 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.text + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.highlighted ? control.palette.highlightedText : control.palette.text + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + visible: control.down || control.highlighted || control.visualFocus + color: Color.blend(control.down ? control.palette.midlight : control.palette.light, + control.palette.highlight, control.visualFocus ? 0.15 : 0.0) + } +} diff --git a/src/imports/controls/default/Label.qml b/src/imports/controls/default/Label.qml new file mode 100644 index 00000000..9a42635f --- /dev/null +++ b/src/imports/controls/default/Label.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Label { + id: control + + color: control.palette.windowText + linkColor: control.palette.link +} diff --git a/src/imports/controls/default/Menu.qml b/src/imports/controls/default/Menu.qml new file mode 100644 index 00000000..cf3a52f2 --- /dev/null +++ b/src/imports/controls/default/Menu.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Window 2.12 + +T.Menu { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + margins: 0 + overlap: 1 + + delegate: MenuItem { } + + contentItem: ListView { + implicitHeight: contentHeight + model: control.contentModel + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false + clip: true + currentIndex: control.currentIndex + + ScrollIndicator.vertical: ScrollIndicator {} + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 40 + color: control.palette.window + border.color: control.palette.dark + } + + T.Overlay.modal: Rectangle { + color: Color.transparent(control.palette.shadow, 0.5) + } + + T.Overlay.modeless: Rectangle { + color: Color.transparent(control.palette.shadow, 0.12) + } +} diff --git a/src/imports/controls/default/MenuBar.qml b/src/imports/controls/default/MenuBar.qml new file mode 100644 index 00000000..122cdc53 --- /dev/null +++ b/src/imports/controls/default/MenuBar.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.MenuBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + delegate: MenuBarItem { } + + contentItem: Row { + spacing: control.spacing + Repeater { + model: control.contentModel + } + } + + background: Rectangle { + implicitHeight: 40 + color: control.palette.button + } +} diff --git a/src/imports/controls/default/MenuBarItem.qml b/src/imports/controls/default/MenuBarItem.qml new file mode 100644 index 00000000..f6835412 --- /dev/null +++ b/src/imports/controls/default/MenuBarItem.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.MenuBarItem { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + spacing: 6 + padding: 6 + leftPadding: 12 + rightPadding: 16 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.buttonText + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.buttonText + } + + background: Rectangle { + implicitWidth: 40 + implicitHeight: 40 + color: control.down || control.highlighted ? control.palette.mid : "transparent" + } +} diff --git a/src/imports/controls/default/MenuItem.qml b/src/imports/controls/default/MenuItem.qml new file mode 100644 index 00000000..0632decb --- /dev/null +++ b/src/imports/controls/default/MenuItem.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.MenuItem { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.windowText + + contentItem: IconLabel { + readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0 + readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0 + leftPadding: !control.mirrored ? indicatorPadding : arrowPadding + rightPadding: control.mirrored ? indicatorPadding : arrowPadding + + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.windowText + } + + indicator: ColorImage { + x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + visible: control.checked + source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" : "" + color: control.palette.windowText + defaultColor: "#353637" + } + + arrow: ColorImage { + x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + visible: control.subMenu + mirror: control.mirrored + source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/arrow-indicator.png" : "" + color: control.palette.windowText + defaultColor: "#353637" + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 40 + x: 1 + y: 1 + width: control.width - 2 + height: control.height - 2 + color: control.down ? control.palette.midlight : control.highlighted ? control.palette.light : "transparent" + } +} diff --git a/src/imports/controls/default/MenuSeparator.qml b/src/imports/controls/default/MenuSeparator.qml new file mode 100644 index 00000000..cc5c2b6e --- /dev/null +++ b/src/imports/controls/default/MenuSeparator.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.MenuSeparator { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 2 + verticalPadding: padding + 4 + + contentItem: Rectangle { + implicitWidth: 188 + implicitHeight: 1 + color: control.palette.mid + } +} diff --git a/src/imports/controls/default/Page.qml b/src/imports/controls/default/Page.qml new file mode 100644 index 00000000..4b3cf3d2 --- /dev/null +++ b/src/imports/controls/default/Page.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Page { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) + + background: Rectangle { + color: control.palette.window + } +} diff --git a/src/imports/controls/default/PageIndicator.qml b/src/imports/controls/default/PageIndicator.qml new file mode 100644 index 00000000..78f9e3cf --- /dev/null +++ b/src/imports/controls/default/PageIndicator.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.PageIndicator { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: control.palette.dark + + opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45 + Behavior on opacity { OpacityAnimator { duration: 100 } } + } + + contentItem: Row { + spacing: control.spacing + + Repeater { + model: control.count + delegate: control.delegate + } + } +} diff --git a/src/imports/controls/default/Pane.qml b/src/imports/controls/default/Pane.qml new file mode 100644 index 00000000..47b916e3 --- /dev/null +++ b/src/imports/controls/default/Pane.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Pane { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + padding: 12 + + background: Rectangle { + color: control.palette.window + } +} diff --git a/src/imports/controls/default/Popup.qml b/src/imports/controls/default/Popup.qml new file mode 100644 index 00000000..ee243c10 --- /dev/null +++ b/src/imports/controls/default/Popup.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Popup { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + padding: 12 + + background: Rectangle { + color: control.palette.window + border.color: control.palette.dark + } + + T.Overlay.modal: Rectangle { + color: Color.transparent(control.palette.shadow, 0.5) + } + + T.Overlay.modeless: Rectangle { + color: Color.transparent(control.palette.shadow, 0.12) + } +} diff --git a/src/imports/controls/default/ProgressBar.qml b/src/imports/controls/default/ProgressBar.qml new file mode 100644 index 00000000..61cdea43 --- /dev/null +++ b/src/imports/controls/default/ProgressBar.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.ProgressBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + contentItem: ProgressBarImpl { + implicitHeight: 6 + implicitWidth: 116 + scale: control.mirrored ? -1 : 1 + progress: control.position + indeterminate: control.visible && control.indeterminate + color: control.palette.dark + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 6 + y: (control.height - height) / 2 + height: 6 + + color: control.palette.midlight + } +} diff --git a/src/imports/controls/default/RadioButton.qml b/src/imports/controls/default/RadioButton.qml new file mode 100644 index 00000000..cdf0c30e --- /dev/null +++ b/src/imports/controls/default/RadioButton.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.RadioButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + // keep in sync with RadioDelegate.qml (shared RadioIndicator.qml was removed for performance reasons) + indicator: Rectangle { + implicitWidth: 28 + implicitHeight: 28 + + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + y: control.topPadding + (control.availableHeight - height) / 2 + + radius: width / 2 + color: control.down ? control.palette.light : control.palette.base + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.palette.mid + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: width / 2 + color: control.palette.text + visible: control.checked + } + } + + contentItem: CheckLabel { + leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 + + text: control.text + font: control.font + color: control.palette.windowText + } +} diff --git a/src/imports/controls/default/RadioDelegate.qml b/src/imports/controls/default/RadioDelegate.qml new file mode 100644 index 00000000..a7e7dec0 --- /dev/null +++ b/src/imports/controls/default/RadioDelegate.qml @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.RadioDelegate { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 12 + spacing: 12 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.text + + contentItem: IconLabel { + leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 + + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.text + } + + // keep in sync with RadioButton.qml (shared RadioIndicator.qml was removed for performance reasons) + indicator: Rectangle { + implicitWidth: 28 + implicitHeight: 28 + + x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + radius: width / 2 + color: control.down ? control.palette.light : control.palette.base + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.palette.mid + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: width / 2 + color: control.palette.text + visible: control.checked + } + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + visible: control.down || control.highlighted + color: control.down ? control.palette.midlight : control.palette.light + } +} diff --git a/src/imports/controls/default/RangeSlider.qml b/src/imports/controls/default/RangeSlider.qml new file mode 100644 index 00000000..c3e7c964 --- /dev/null +++ b/src/imports/controls/default/RangeSlider.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.RangeSlider { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) + + padding: 6 + + first.handle: Rectangle { + x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) + implicitWidth: 28 + implicitHeight: 28 + radius: width / 2 + border.width: activeFocus ? 2 : 1 + border.color: activeFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight + color: control.first.pressed ? control.palette.light : control.palette.window + } + + second.handle: Rectangle { + x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) + implicitWidth: 28 + implicitHeight: 28 + radius: width / 2 + border.width: activeFocus ? 2 : 1 + border.color: activeFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight + color: control.second.pressed ? control.palette.light : control.palette.window + } + + background: Rectangle { + x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) + implicitWidth: control.horizontal ? 200 : 6 + implicitHeight: control.horizontal ? 6 : 200 + width: control.horizontal ? control.availableWidth : implicitWidth + height: control.horizontal ? implicitHeight : control.availableHeight + radius: 3 + color: control.palette.midlight + scale: control.horizontal && control.mirrored ? -1 : 1 + + Rectangle { + x: control.horizontal ? control.first.position * parent.width + 3 : 0 + y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3 + width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6 + height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6 + + color: control.palette.dark + } + } +} diff --git a/src/imports/controls/default/RoundButton.qml b/src/imports/controls/default/RoundButton.qml new file mode 100644 index 00000000..825d5252 --- /dev/null +++ b/src/imports/controls/default/RoundButton.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.RoundButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + icon.width: 24 + icon.height: 24 + icon.color: control.checked || control.highlighted ? control.palette.brightText : + control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + + icon: control.icon + text: control.text + font: control.font + color: control.checked || control.highlighted ? control.palette.brightText : + control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText + } + + background: Rectangle { + implicitWidth: 40 + implicitHeight: 40 + radius: control.radius + opacity: enabled ? 1 : 0.3 + visible: !control.flat || control.down || control.checked || control.highlighted + color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, + control.palette.mid, control.down ? 0.5 : 0.0) + border.color: control.palette.highlight + border.width: control.visualFocus ? 2 : 0 + } +} diff --git a/src/imports/controls/default/ScrollBar.qml b/src/imports/controls/default/ScrollBar.qml new file mode 100644 index 00000000..0948fb1d --- /dev/null +++ b/src/imports/controls/default/ScrollBar.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ScrollBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 2 + visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height + + contentItem: Rectangle { + implicitWidth: control.interactive ? 6 : 2 + implicitHeight: control.interactive ? 6 : 2 + + radius: width / 2 + color: control.pressed ? control.palette.dark : control.palette.mid + opacity: 0.0 + + states: State { + name: "active" + when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) + PropertyChanges { target: control.contentItem; opacity: 0.75 } + } + + transitions: Transition { + from: "active" + SequentialAnimation { + PauseAnimation { duration: 450 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } + } + } + } +} diff --git a/src/imports/controls/default/ScrollIndicator.qml b/src/imports/controls/default/ScrollIndicator.qml new file mode 100644 index 00000000..795c20ee --- /dev/null +++ b/src/imports/controls/default/ScrollIndicator.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ScrollIndicator { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 2 + + contentItem: Rectangle { + implicitWidth: 2 + implicitHeight: 2 + + color: control.palette.mid + visible: control.size < 1.0 + opacity: 0.0 + + states: State { + name: "active" + when: control.active + PropertyChanges { target: control.contentItem; opacity: 0.75 } + } + + transitions: [ + Transition { + from: "active" + SequentialAnimation { + PauseAnimation { duration: 450 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } + } + } + ] + } +} diff --git a/src/imports/controls/default/ScrollView.qml b/src/imports/controls/default/ScrollView.qml new file mode 100644 index 00000000..f775d624 --- /dev/null +++ b/src/imports/controls/default/ScrollView.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ScrollView { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + ScrollBar.vertical: ScrollBar { + parent: control + x: control.mirrored ? 0 : control.width - width + y: control.topPadding + height: control.availableHeight + active: control.ScrollBar.horizontal.active + } + + ScrollBar.horizontal: ScrollBar { + parent: control + x: control.leftPadding + y: control.height - height + width: control.availableWidth + active: control.ScrollBar.vertical.active + } +} diff --git a/src/imports/controls/default/Slider.qml b/src/imports/controls/default/Slider.qml new file mode 100644 index 00000000..6d532389 --- /dev/null +++ b/src/imports/controls/default/Slider.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Slider { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) + + padding: 6 + + handle: Rectangle { + x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) + implicitWidth: 28 + implicitHeight: 28 + radius: width / 2 + color: control.pressed ? control.palette.light : control.palette.window + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight + } + + background: Rectangle { + x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) + implicitWidth: control.horizontal ? 200 : 6 + implicitHeight: control.horizontal ? 6 : 200 + width: control.horizontal ? control.availableWidth : implicitWidth + height: control.horizontal ? implicitHeight : control.availableHeight + radius: 3 + color: control.palette.midlight + scale: control.horizontal && control.mirrored ? -1 : 1 + + Rectangle { + y: control.horizontal ? 0 : control.visualPosition * parent.height + width: control.horizontal ? control.position * parent.width : 6 + height: control.horizontal ? 6 : control.position * parent.height + + radius: 3 + color: control.palette.dark + } + } +} diff --git a/src/imports/controls/default/SpinBox.qml b/src/imports/controls/default/SpinBox.qml new file mode 100644 index 00000000..d1c2ea5b --- /dev/null +++ b/src/imports/controls/default/SpinBox.qml @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.SpinBox { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentItem.implicitWidth + 2 * padding + + up.implicitIndicatorWidth + + down.implicitIndicatorWidth) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight, + down.implicitIndicatorHeight) + + padding: 6 + leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) + rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0)) + + validator: IntValidator { + locale: control.locale.name + bottom: Math.min(control.from, control.to) + top: Math.max(control.from, control.to) + } + + contentItem: TextInput { + z: 2 + text: control.displayText + + font: control.font + color: control.palette.text + selectionColor: control.palette.highlight + selectedTextColor: control.palette.highlightedText + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + readOnly: !control.editable + validator: control.validator + inputMethodHints: control.inputMethodHints + + Rectangle { + x: -6 - (control.down.indicator ? 1 : 0) + y: -6 + width: control.width - (control.up.indicator ? control.up.indicator.width - 1 : 0) - (control.down.indicator ? control.down.indicator.width - 1 : 0) + height: control.height + visible: control.activeFocus + color: "transparent" + border.color: control.palette.highlight + border.width: 2 + } + } + + up.indicator: Rectangle { + x: control.mirrored ? 0 : parent.width - width + height: parent.height + implicitWidth: 40 + implicitHeight: 40 + color: control.up.pressed ? control.palette.mid : control.palette.button + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 3 + height: 2 + color: enabled ? control.palette.buttonText : control.palette.mid + } + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 2 + height: parent.width / 3 + color: enabled ? control.palette.buttonText : control.palette.mid + } + } + + down.indicator: Rectangle { + x: control.mirrored ? parent.width - width : 0 + height: parent.height + implicitWidth: 40 + implicitHeight: 40 + color: control.down.pressed ? control.palette.mid : control.palette.button + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 3 + height: 2 + color: enabled ? control.palette.buttonText : control.palette.mid + } + } + + background: Rectangle { + implicitWidth: 140 + color: enabled ? control.palette.base : control.palette.button + border.color: control.palette.button + } +} diff --git a/src/imports/controls/default/SplitView.qml b/src/imports/controls/default/SplitView.qml new file mode 100644 index 00000000..9d37a83e --- /dev/null +++ b/src/imports/controls/default/SplitView.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.13 +import QtQuick.Templates 2.13 as T +import QtQuick.Controls 2.13 +import QtQuick.Controls.impl 2.13 + +T.SplitView { + id: control + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + handle: Rectangle { + implicitWidth: control.orientation === Qt.Horizontal ? 6 : control.width + implicitHeight: control.orientation === Qt.Horizontal ? control.height : 6 + color: T.SplitHandle.pressed ? control.palette.mid + : (T.SplitHandle.hovered ? control.palette.midlight : control.palette.button) + } +} diff --git a/src/imports/controls/default/StackView.qml b/src/imports/controls/default/StackView.qml new file mode 100644 index 00000000..3e416b87 --- /dev/null +++ b/src/imports/controls/default/StackView.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Templates 2.12 as T + +T.StackView { + id: control + + popEnter: Transition { + XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + } + + popExit: Transition { + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic } + } + + pushEnter: Transition { + XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + } + + pushExit: Transition { + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic } + } + + replaceEnter: Transition { + XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + } + + replaceExit: Transition { + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic } + } +} diff --git a/src/imports/controls/default/SwipeDelegate.qml b/src/imports/controls/default/SwipeDelegate.qml new file mode 100644 index 00000000..37d66bb6 --- /dev/null +++ b/src/imports/controls/default/SwipeDelegate.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.SwipeDelegate { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 12 + spacing: 12 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.text + + swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } } + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.text + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + color: Color.blend(control.down ? control.palette.midlight : control.palette.light, + control.palette.highlight, control.visualFocus ? 0.15 : 0.0) + } +} diff --git a/src/imports/controls/default/SwipeView.qml b/src/imports/controls/default/SwipeView.qml new file mode 100644 index 00000000..7722d258 --- /dev/null +++ b/src/imports/controls/default/SwipeView.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Templates 2.12 as T + +T.SwipeView { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + contentItem: ListView { + model: control.contentModel + interactive: control.interactive + currentIndex: control.currentIndex + focus: control.focus + + spacing: control.spacing + orientation: control.orientation + snapMode: ListView.SnapOneItem + boundsBehavior: Flickable.StopAtBounds + + highlightRangeMode: ListView.StrictlyEnforceRange + preferredHighlightBegin: 0 + preferredHighlightEnd: 0 + highlightMoveDuration: 250 + maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height) + } +} diff --git a/src/imports/controls/default/Switch.qml b/src/imports/controls/default/Switch.qml new file mode 100644 index 00000000..f62e2502 --- /dev/null +++ b/src/imports/controls/default/Switch.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.Switch { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + indicator: PaddedRectangle { + implicitWidth: 56 + implicitHeight: 28 + + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + y: control.topPadding + (control.availableHeight - height) / 2 + + radius: 8 + leftPadding: 0 + rightPadding: 0 + padding: (height - 16) / 2 + color: control.checked ? control.palette.dark : control.palette.midlight + + Rectangle { + x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) + y: (parent.height - height) / 2 + width: 28 + height: 28 + radius: 16 + color: control.down ? control.palette.light : control.palette.window + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight + + Behavior on x { + enabled: !control.down + SmoothedAnimation { velocity: 200 } + } + } + } + + contentItem: CheckLabel { + leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 + + text: control.text + font: control.font + color: control.palette.windowText + } +} diff --git a/src/imports/controls/default/SwitchDelegate.qml b/src/imports/controls/default/SwitchDelegate.qml new file mode 100644 index 00000000..d6447e77 --- /dev/null +++ b/src/imports/controls/default/SwitchDelegate.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 + +T.SwitchDelegate { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + padding: 12 + spacing: 12 + + icon.width: 24 + icon.height: 24 + icon.color: control.palette.text + + indicator: PaddedRectangle { + implicitWidth: 56 + implicitHeight: 28 + + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + y: control.topPadding + (control.availableHeight - height) / 2 + + radius: 8 + leftPadding: 0 + rightPadding: 0 + padding: (height - 16) / 2 + color: control.checked ? control.palette.dark : control.palette.midlight + + Rectangle { + x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) + y: (parent.height - height) / 2 + width: 28 + height: 28 + radius: 16 + color: control.down ? control.palette.light : control.palette.window + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? control.palette.highlight : control.enabled ? control.palette.mid : control.palette.midlight + + Behavior on x { + enabled: !control.down + SmoothedAnimation { velocity: 200 } + } + } + } + + contentItem: IconLabel { + leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 + + spacing: control.spacing + mirrored: control.mirrored + display: control.display + alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft + + icon: control.icon + text: control.text + font: control.font + color: control.palette.text + } + + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + visible: control.down || control.highlighted + color: control.down ? control.palette.midlight : control.palette.light + } +} diff --git a/src/imports/controls/default/TabBar.qml b/src/imports/controls/default/TabBar.qml new file mode 100644 index 00000000..83f6b3b2 --- /dev/null +++ b/src/imports/controls/default/TabBar.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T + +T.TabBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + spacing: 1 + + contentItem: ListView { + model: control.contentModel + currentIndex: control.currentIndex + + spacing: control.spacing + orientation: ListView.Horizontal + boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded + snapMode: ListView.SnapToItem + + highlightMoveDuration: 0 + highlightRangeMode: ListView.ApplyRange + preferredHighlightBegin: 40 + preferredHighlightEnd: width - 40 + } + + background: Rectangle { + color: control.palette.window + } +} diff --git a/src/imports/controls/default/TabButton.qml b/src/imports/controls/default/TabButton.qml new file mode 100644 index 00000000..f8b303ea --- /dev/null +++ b/src/imports/controls/default/TabButton.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.TabButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + icon.width: 24 + icon.height: 24 + icon.color: checked ? control.palette.windowText : control.palette.brightText + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + + icon: control.icon + text: control.text + font: control.font + color: control.checked ? control.palette.windowText : control.palette.brightText + } + + background: Rectangle { + implicitHeight: 40 + color: Color.blend(control.checked ? control.palette.window : control.palette.dark, + control.palette.mid, control.down ? 0.5 : 0.0) + } +} diff --git a/src/imports/controls/default/TextArea.qml b/src/imports/controls/default/TextArea.qml new file mode 100644 index 00000000..45790e67 --- /dev/null +++ b/src/imports/controls/default/TextArea.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.TextArea { + id: control + + implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, + implicitBackgroundWidth + leftInset + rightInset, + placeholder.implicitWidth + leftPadding + rightPadding) + implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, + implicitBackgroundHeight + topInset + bottomInset, + placeholder.implicitHeight + topPadding + bottomPadding) + + padding: 6 + leftPadding: padding + 4 + + color: control.palette.text + placeholderTextColor: Color.transparent(control.color, 0.5) + selectionColor: control.palette.highlight + selectedTextColor: control.palette.highlightedText + + PlaceholderText { + id: placeholder + x: control.leftPadding + y: control.topPadding + width: control.width - (control.leftPadding + control.rightPadding) + height: control.height - (control.topPadding + control.bottomPadding) + + text: control.placeholderText + font: control.font + color: control.placeholderTextColor + verticalAlignment: control.verticalAlignment + visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) + elide: Text.ElideRight + renderType: control.renderType + } +} diff --git a/src/imports/controls/default/TextField.qml b/src/imports/controls/default/TextField.qml new file mode 100644 index 00000000..4d9cb691 --- /dev/null +++ b/src/imports/controls/default/TextField.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.TextField { + id: control + + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, + placeholder.implicitHeight + topPadding + bottomPadding) + + padding: 6 + leftPadding: padding + 4 + + color: control.palette.text + selectionColor: control.palette.highlight + selectedTextColor: control.palette.highlightedText + placeholderTextColor: Color.transparent(control.color, 0.5) + verticalAlignment: TextInput.AlignVCenter + + PlaceholderText { + id: placeholder + x: control.leftPadding + y: control.topPadding + width: control.width - (control.leftPadding + control.rightPadding) + height: control.height - (control.topPadding + control.bottomPadding) + + text: control.placeholderText + font: control.font + color: control.placeholderTextColor + verticalAlignment: control.verticalAlignment + visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) + elide: Text.ElideRight + renderType: control.renderType + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 40 + border.width: control.activeFocus ? 2 : 1 + color: control.palette.base + border.color: control.activeFocus ? control.palette.highlight : control.palette.mid + } +} diff --git a/src/imports/controls/default/ToolBar.qml b/src/imports/controls/default/ToolBar.qml new file mode 100644 index 00000000..1e07b6bf --- /dev/null +++ b/src/imports/controls/default/ToolBar.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ToolBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + background: Rectangle { + implicitHeight: 40 + color: control.palette.button + } +} diff --git a/src/imports/controls/default/ToolButton.qml b/src/imports/controls/default/ToolButton.qml new file mode 100644 index 00000000..63aaf893 --- /dev/null +++ b/src/imports/controls/default/ToolButton.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ToolButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + icon.width: 24 + icon.height: 24 + icon.color: visualFocus ? control.palette.highlight : control.palette.buttonText + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + + icon: control.icon + text: control.text + font: control.font + color: control.visualFocus ? control.palette.highlight : control.palette.buttonText + } + + background: Rectangle { + implicitWidth: 40 + implicitHeight: 40 + + opacity: control.down ? 1.0 : 0.5 + color: control.down || control.checked || control.highlighted ? control.palette.mid : control.palette.button + } +} diff --git a/src/imports/controls/default/ToolSeparator.qml b/src/imports/controls/default/ToolSeparator.qml new file mode 100644 index 00000000..188d0758 --- /dev/null +++ b/src/imports/controls/default/ToolSeparator.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ToolSeparator { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: vertical ? 6 : 2 + verticalPadding: vertical ? 2 : 6 + + contentItem: Rectangle { + implicitWidth: vertical ? 1 : 30 + implicitHeight: vertical ? 30 : 1 + color: control.palette.mid + } +} diff --git a/src/imports/controls/default/ToolTip.qml b/src/imports/controls/default/ToolTip.qml new file mode 100644 index 00000000..e0389903 --- /dev/null +++ b/src/imports/controls/default/ToolTip.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.ToolTip { + id: control + + x: parent ? (parent.width - implicitWidth) / 2 : 0 + y: -implicitHeight - 3 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + margins: 6 + padding: 6 + + closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent + + contentItem: Text { + text: control.text + font: control.font + wrapMode: Text.Wrap + color: control.palette.toolTipText + } + + background: Rectangle { + border.color: control.palette.dark + color: control.palette.toolTipBase + } +} diff --git a/src/imports/controls/default/Tumbler.qml b/src/imports/controls/default/Tumbler.qml new file mode 100644 index 00000000..4d1abdd3 --- /dev/null +++ b/src/imports/controls/default/Tumbler.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Templates 2.12 as T + +T.Tumbler { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + delegate: Text { + text: modelData + color: control.visualFocus ? control.palette.highlight : control.palette.text + font: control.font + opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2) + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 + model: control.model + delegate: control.delegate + path: Path { + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 + PathLine { + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 + } + } + + property real delegateHeight: control.availableHeight / control.visibleItemCount + } +} diff --git a/src/imports/controls/default/VerticalHeaderView.qml b/src/imports/controls/default/VerticalHeaderView.qml new file mode 100644 index 00000000..3fc9ca5a --- /dev/null +++ b/src/imports/controls/default/VerticalHeaderView.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T + +T.VerticalHeaderView { + id: control + + implicitWidth: contentWidth + implicitHeight: syncView ? syncView.height : 0 + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2)) + implicitHeight: text.implicitHeight + (cellPadding * 2) + color: "#f6f6f6" + border.color: "#e4e4e4" + + Text { + id: text + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] + : model[control.textRole]) + : modelData + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: "#ff26282a" + } + } +} diff --git a/src/imports/controls/default/default.pri b/src/imports/controls/default/default.pri new file mode 100644 index 00000000..03fc0f4b --- /dev/null +++ b/src/imports/controls/default/default.pri @@ -0,0 +1,72 @@ +HEADERS += \ + $$PWD/qquickdefaultbusyindicator_p.h \ + $$PWD/qquickdefaultdial_p.h \ + $$PWD/qquickdefaultprogressbar_p.h \ + $$PWD/qquickdefaultstyle_p.h \ + $$PWD/qquickdefaulttheme_p.h + +SOURCES += \ + $$PWD/qquickdefaultbusyindicator.cpp \ + $$PWD/qquickdefaultdial.cpp \ + $$PWD/qquickdefaultprogressbar.cpp \ + $$PWD/qquickdefaultstyle.cpp \ + $$PWD/qquickdefaulttheme.cpp + +QML_FILES += \ + $$PWD/AbstractButton.qml \ + $$PWD/Action.qml \ + $$PWD/ActionGroup.qml \ + $$PWD/ApplicationWindow.qml \ + $$PWD/BusyIndicator.qml \ + $$PWD/Button.qml \ + $$PWD/ButtonGroup.qml \ + $$PWD/CheckBox.qml \ + $$PWD/CheckDelegate.qml \ + $$PWD/ComboBox.qml \ + $$PWD/Container.qml \ + $$PWD/Control.qml \ + $$PWD/DelayButton.qml \ + $$PWD/Dial.qml \ + $$PWD/Dialog.qml \ + $$PWD/DialogButtonBox.qml \ + $$PWD/Drawer.qml \ + $$PWD/Frame.qml \ + $$PWD/GroupBox.qml \ + $$PWD/HorizontalHeaderView.qml \ + $$PWD/ItemDelegate.qml \ + $$PWD/Label.qml \ + $$PWD/Menu.qml \ + $$PWD/MenuBar.qml \ + $$PWD/MenuBarItem.qml \ + $$PWD/MenuItem.qml \ + $$PWD/MenuSeparator.qml \ + $$PWD/Page.qml \ + $$PWD/PageIndicator.qml \ + $$PWD/Pane.qml \ + $$PWD/Popup.qml \ + $$PWD/ProgressBar.qml \ + $$PWD/RadioButton.qml \ + $$PWD/RadioDelegate.qml \ + $$PWD/RangeSlider.qml \ + $$PWD/RoundButton.qml \ + $$PWD/ScrollBar.qml \ + $$PWD/ScrollIndicator.qml \ + $$PWD/ScrollView.qml \ + $$PWD/Slider.qml \ + $$PWD/SpinBox.qml \ + $$PWD/SplitView.qml \ + $$PWD/StackView.qml \ + $$PWD/SwipeDelegate.qml \ + $$PWD/Switch.qml \ + $$PWD/SwitchDelegate.qml \ + $$PWD/SwipeView.qml \ + $$PWD/TabBar.qml \ + $$PWD/TabButton.qml \ + $$PWD/TextArea.qml \ + $$PWD/TextField.qml \ + $$PWD/ToolBar.qml \ + $$PWD/ToolButton.qml \ + $$PWD/ToolSeparator.qml \ + $$PWD/ToolTip.qml \ + $$PWD/Tumbler.qml \ + $$PWD/VerticalHeaderView.qml diff --git a/src/imports/controls/default/default.pro b/src/imports/controls/default/default.pro new file mode 100644 index 00000000..46e46531 --- /dev/null +++ b/src/imports/controls/default/default.pro @@ -0,0 +1,27 @@ +TARGET = qtquickcontrols2defaultstyleplugin +TARGETPATH = QtQuick/Controls.2/Default + +IMPORT_NAME = QtQuick.Controls.Default +IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +include(default.pri) + +OTHER_FILES += \ + qmldir \ + $$QML_FILES + +SOURCES += \ + $$PWD/qtquickcontrols2defaultstyleplugin.cpp + +RESOURCES += \ + $$PWD/qtquickcontrols2defaultstyleplugin.qrc + +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +load(qml_plugin) + +requires(qtConfig(quickcontrols2-default)) diff --git a/src/imports/controls/default/dependencies.json b/src/imports/controls/default/dependencies.json new file mode 100644 index 00000000..78029004 --- /dev/null +++ b/src/imports/controls/default/dependencies.json @@ -0,0 +1,17 @@ +[ + { + "name": "QtQuick", + "type": "module", + "version": "2.11" + }, + { + "name": "QtQuick.Window", + "type": "module", + "version": "2.2" + }, + { + "name": "QtQuick.Templates", + "type": "module", + "version": "2.5" + } +] diff --git a/src/imports/controls/default/images/arrow-indicator.png b/src/imports/controls/default/images/arrow-indicator.png new file mode 100644 index 00000000..d833d52c Binary files /dev/null and b/src/imports/controls/default/images/arrow-indicator.png differ diff --git a/src/imports/controls/default/images/arrow-indicator@2x.png b/src/imports/controls/default/images/arrow-indicator@2x.png new file mode 100644 index 00000000..55c7940a Binary files /dev/null and b/src/imports/controls/default/images/arrow-indicator@2x.png differ diff --git a/src/imports/controls/default/images/arrow-indicator@3x.png b/src/imports/controls/default/images/arrow-indicator@3x.png new file mode 100644 index 00000000..c7067c5c Binary files /dev/null and b/src/imports/controls/default/images/arrow-indicator@3x.png differ diff --git a/src/imports/controls/default/images/arrow-indicator@4x.png b/src/imports/controls/default/images/arrow-indicator@4x.png new file mode 100644 index 00000000..4c5cf351 Binary files /dev/null and b/src/imports/controls/default/images/arrow-indicator@4x.png differ diff --git a/src/imports/controls/default/images/check.png b/src/imports/controls/default/images/check.png new file mode 100644 index 00000000..479a8442 Binary files /dev/null and b/src/imports/controls/default/images/check.png differ diff --git a/src/imports/controls/default/images/check@2x.png b/src/imports/controls/default/images/check@2x.png new file mode 100644 index 00000000..79663c0b Binary files /dev/null and b/src/imports/controls/default/images/check@2x.png differ diff --git a/src/imports/controls/default/images/check@3x.png b/src/imports/controls/default/images/check@3x.png new file mode 100644 index 00000000..fd0135ab Binary files /dev/null and b/src/imports/controls/default/images/check@3x.png differ diff --git a/src/imports/controls/default/images/check@4x.png b/src/imports/controls/default/images/check@4x.png new file mode 100644 index 00000000..e7e0b640 Binary files /dev/null and b/src/imports/controls/default/images/check@4x.png differ diff --git a/src/imports/controls/default/images/dial-indicator.png b/src/imports/controls/default/images/dial-indicator.png new file mode 100644 index 00000000..92357c51 Binary files /dev/null and b/src/imports/controls/default/images/dial-indicator.png differ diff --git a/src/imports/controls/default/images/dial-indicator@2x.png b/src/imports/controls/default/images/dial-indicator@2x.png new file mode 100644 index 00000000..f436443b Binary files /dev/null and b/src/imports/controls/default/images/dial-indicator@2x.png differ diff --git a/src/imports/controls/default/images/dial-indicator@3x.png b/src/imports/controls/default/images/dial-indicator@3x.png new file mode 100644 index 00000000..d883045b Binary files /dev/null and b/src/imports/controls/default/images/dial-indicator@3x.png differ diff --git a/src/imports/controls/default/images/dial-indicator@4x.png b/src/imports/controls/default/images/dial-indicator@4x.png new file mode 100644 index 00000000..79477712 Binary files /dev/null and b/src/imports/controls/default/images/dial-indicator@4x.png differ diff --git a/src/imports/controls/default/images/double-arrow.png b/src/imports/controls/default/images/double-arrow.png new file mode 100644 index 00000000..3ecd7f89 Binary files /dev/null and b/src/imports/controls/default/images/double-arrow.png differ diff --git a/src/imports/controls/default/images/double-arrow@2x.png b/src/imports/controls/default/images/double-arrow@2x.png new file mode 100644 index 00000000..eeb03e28 Binary files /dev/null and b/src/imports/controls/default/images/double-arrow@2x.png differ diff --git a/src/imports/controls/default/images/double-arrow@3x.png b/src/imports/controls/default/images/double-arrow@3x.png new file mode 100644 index 00000000..f0662d20 Binary files /dev/null and b/src/imports/controls/default/images/double-arrow@3x.png differ diff --git a/src/imports/controls/default/images/double-arrow@4x.png b/src/imports/controls/default/images/double-arrow@4x.png new file mode 100644 index 00000000..10891e91 Binary files /dev/null and b/src/imports/controls/default/images/double-arrow@4x.png differ diff --git a/src/imports/controls/default/images/drop-indicator.png b/src/imports/controls/default/images/drop-indicator.png new file mode 100644 index 00000000..80c1d958 Binary files /dev/null and b/src/imports/controls/default/images/drop-indicator.png differ diff --git a/src/imports/controls/default/images/drop-indicator@2x.png b/src/imports/controls/default/images/drop-indicator@2x.png new file mode 100644 index 00000000..6e0f228c Binary files /dev/null and b/src/imports/controls/default/images/drop-indicator@2x.png differ diff --git a/src/imports/controls/default/images/drop-indicator@3x.png b/src/imports/controls/default/images/drop-indicator@3x.png new file mode 100644 index 00000000..199752fb Binary files /dev/null and b/src/imports/controls/default/images/drop-indicator@3x.png differ diff --git a/src/imports/controls/default/images/drop-indicator@4x.png b/src/imports/controls/default/images/drop-indicator@4x.png new file mode 100644 index 00000000..58311fbe Binary files /dev/null and b/src/imports/controls/default/images/drop-indicator@4x.png differ diff --git a/src/imports/controls/default/plugins.qmltypes b/src/imports/controls/default/plugins.qmltypes new file mode 100644 index 00000000..e8212c55 --- /dev/null +++ b/src/imports/controls/default/plugins.qmltypes @@ -0,0 +1,895 @@ +import QtQuick.tooling 1.2 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.15' + +Module { + dependencies: [ + "QtQuick 2.11", + "QtQuick.Templates 2.5", + "QtQuick.Window 2.2" + ] + Component { + name: "QQuickCheckLabel" + defaultProperty: "data" + prototype: "QQuickText" + exports: ["QtQuick.Controls.impl/CheckLabel 2.3"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QQuickClippedText" + defaultProperty: "data" + prototype: "QQuickText" + exports: ["QtQuick.Controls.impl/ClippedText 2.2"] + exportMetaObjectRevisions: [0] + Property { name: "clipX"; type: "double" } + Property { name: "clipY"; type: "double" } + Property { name: "clipWidth"; type: "double" } + Property { name: "clipHeight"; type: "double" } + } + Component { + name: "QQuickColor" + prototype: "QObject" + exports: ["QtQuick.Controls.impl/Color 2.3"] + isCreatable: false + isSingleton: true + exportMetaObjectRevisions: [0] + Method { + name: "transparent" + type: "QColor" + Parameter { name: "color"; type: "QColor" } + Parameter { name: "opacity"; type: "double" } + } + Method { + name: "blend" + type: "QColor" + Parameter { name: "a"; type: "QColor" } + Parameter { name: "b"; type: "QColor" } + Parameter { name: "factor"; type: "double" } + } + } + Component { + name: "QQuickColorImage" + defaultProperty: "data" + prototype: "QQuickImage" + exports: ["QtQuick.Controls.impl/ColorImage 2.3"] + exportMetaObjectRevisions: [0] + Property { name: "color"; type: "QColor" } + Property { name: "defaultColor"; type: "QColor" } + } + Component { + name: "QQuickDefaultBusyIndicator" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls.impl/BusyIndicatorImpl 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "pen"; type: "QColor" } + Property { name: "fill"; type: "QColor" } + Property { name: "running"; type: "bool" } + } + Component { + name: "QQuickDefaultDial" + defaultProperty: "data" + prototype: "QQuickPaintedItem" + exports: ["QtQuick.Controls.impl/DialImpl 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "progress"; type: "double" } + Property { name: "color"; type: "QColor" } + } + Component { + name: "QQuickDefaultProgressBar" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls.impl/ProgressBarImpl 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "indeterminate"; type: "bool" } + Property { name: "progress"; type: "double" } + Property { name: "color"; type: "QColor" } + } + Component { + name: "QQuickDefaultStyle" + prototype: "QObject" + exports: ["QtQuick.Controls.impl/Default 2.1"] + isCreatable: false + isSingleton: true + exportMetaObjectRevisions: [0] + Property { name: "backgroundColor"; type: "QColor"; isReadonly: true } + Property { name: "overlayModalColor"; type: "QColor"; isReadonly: true } + Property { name: "overlayDimColor"; type: "QColor"; isReadonly: true } + Property { name: "textColor"; type: "QColor"; isReadonly: true } + Property { name: "textDarkColor"; type: "QColor"; isReadonly: true } + Property { name: "textLightColor"; type: "QColor"; isReadonly: true } + Property { name: "textLinkColor"; type: "QColor"; isReadonly: true } + Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true } + Property { name: "textDisabledColor"; type: "QColor"; isReadonly: true } + Property { name: "textDisabledLightColor"; type: "QColor"; isReadonly: true } + Property { name: "textPlaceholderColor"; type: "QColor"; isReadonly: true } + Property { name: "focusColor"; type: "QColor"; isReadonly: true } + Property { name: "focusLightColor"; type: "QColor"; isReadonly: true } + Property { name: "focusPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "buttonColor"; type: "QColor"; isReadonly: true } + Property { name: "buttonPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "buttonCheckedColor"; type: "QColor"; isReadonly: true } + Property { name: "buttonCheckedPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "buttonCheckedFocusColor"; type: "QColor"; isReadonly: true } + Property { name: "toolButtonColor"; type: "QColor"; isReadonly: true } + Property { name: "tabButtonColor"; type: "QColor"; isReadonly: true } + Property { name: "tabButtonPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "tabButtonCheckedPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "delegateColor"; type: "QColor"; isReadonly: true } + Property { name: "delegatePressedColor"; type: "QColor"; isReadonly: true } + Property { name: "delegateFocusColor"; type: "QColor"; isReadonly: true } + Property { name: "indicatorPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "indicatorDisabledColor"; type: "QColor"; isReadonly: true } + Property { name: "indicatorFrameColor"; type: "QColor"; isReadonly: true } + Property { name: "indicatorFramePressedColor"; type: "QColor"; isReadonly: true } + Property { name: "indicatorFrameDisabledColor"; type: "QColor"; isReadonly: true } + Property { name: "frameDarkColor"; type: "QColor"; isReadonly: true } + Property { name: "frameLightColor"; type: "QColor"; isReadonly: true } + Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true } + Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true } + Property { name: "progressBarColor"; type: "QColor"; isReadonly: true } + Property { name: "pageIndicatorColor"; type: "QColor"; isReadonly: true } + Property { name: "separatorColor"; type: "QColor"; isReadonly: true } + Property { name: "disabledDarkColor"; type: "QColor"; isReadonly: true } + Property { name: "disabledLightColor"; type: "QColor"; isReadonly: true } + } + Component { + name: "QQuickIconImage" + defaultProperty: "data" + prototype: "QQuickImage" + exports: ["QtQuick.Controls.impl/IconImage 2.3"] + exportMetaObjectRevisions: [0] + Property { name: "name"; type: "string" } + Property { name: "color"; type: "QColor" } + } + Component { + name: "QQuickIconLabel" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls.impl/IconLabel 2.3"] + exportMetaObjectRevisions: [0] + Enum { + name: "Display" + values: { + "IconOnly": 0, + "TextOnly": 1, + "TextBesideIcon": 2, + "TextUnderIcon": 3 + } + } + Property { name: "icon"; type: "QQuickIcon" } + Property { name: "text"; type: "string" } + Property { name: "font"; type: "QFont" } + Property { name: "color"; type: "QColor" } + Property { name: "display"; type: "Display" } + Property { name: "spacing"; type: "double" } + Property { name: "mirrored"; type: "bool" } + Property { name: "alignment"; type: "Qt::Alignment" } + Property { name: "topPadding"; type: "double" } + Property { name: "leftPadding"; type: "double" } + Property { name: "rightPadding"; type: "double" } + Property { name: "bottomPadding"; type: "double" } + } + Component { + name: "QQuickImplicitSizeItem" + defaultProperty: "data" + prototype: "QQuickItem" + Property { name: "implicitWidth"; type: "double"; isReadonly: true } + Property { name: "implicitHeight"; type: "double"; isReadonly: true } + } + Component { + name: "QQuickItemGroup" + defaultProperty: "data" + prototype: "QQuickImplicitSizeItem" + exports: ["QtQuick.Controls.impl/ItemGroup 2.2"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QQuickMnemonicLabel" + defaultProperty: "data" + prototype: "QQuickText" + exports: ["QtQuick.Controls.impl/MnemonicLabel 2.3"] + exportMetaObjectRevisions: [0] + Property { name: "text"; type: "string" } + Property { name: "mnemonicVisible"; type: "bool" } + } + Component { + name: "QQuickOverlay" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls/Overlay 2.3"] + isCreatable: false + exportMetaObjectRevisions: [0] + attachedType: "QQuickOverlayAttached" + Property { name: "modal"; type: "QQmlComponent"; isPointer: true } + Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } + Signal { name: "pressed" } + Signal { name: "released" } + } + Component { + name: "QQuickPaddedRectangle" + defaultProperty: "data" + prototype: "QQuickRectangle" + exports: ["QtQuick.Controls.impl/PaddedRectangle 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "padding"; type: "double" } + Property { name: "topPadding"; type: "double" } + Property { name: "leftPadding"; type: "double" } + Property { name: "rightPadding"; type: "double" } + Property { name: "bottomPadding"; type: "double" } + } + Component { + name: "QQuickPlaceholderText" + defaultProperty: "data" + prototype: "QQuickText" + exports: ["QtQuick.Controls.impl/PlaceholderText 2.2"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QQuickSplitHandleAttached" + prototype: "QObject" + exports: ["QtQuick.Controls/SplitHandle 2.13"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "hovered"; type: "bool"; isReadonly: true } + Property { name: "pressed"; type: "bool"; isReadonly: true } + } + Component { + name: "QQuickText" + defaultProperty: "data" + prototype: "QQuickImplicitSizeItem" + Enum { + name: "HAlignment" + values: { + "AlignLeft": 1, + "AlignRight": 2, + "AlignHCenter": 4, + "AlignJustify": 8 + } + } + Enum { + name: "VAlignment" + values: { + "AlignTop": 32, + "AlignBottom": 64, + "AlignVCenter": 128 + } + } + Enum { + name: "TextStyle" + values: { + "Normal": 0, + "Outline": 1, + "Raised": 2, + "Sunken": 3 + } + } + Enum { + name: "TextFormat" + values: { + "PlainText": 0, + "RichText": 1, + "MarkdownText": 3, + "AutoText": 2, + "StyledText": 4 + } + } + Enum { + name: "TextElideMode" + values: { + "ElideLeft": 0, + "ElideRight": 1, + "ElideMiddle": 2, + "ElideNone": 3 + } + } + Enum { + name: "WrapMode" + values: { + "NoWrap": 0, + "WordWrap": 1, + "WrapAnywhere": 3, + "WrapAtWordBoundaryOrAnywhere": 4, + "Wrap": 4 + } + } + Enum { + name: "RenderType" + values: { + "QtRendering": 0, + "NativeRendering": 1 + } + } + Enum { + name: "LineHeightMode" + values: { + "ProportionalHeight": 0, + "FixedHeight": 1 + } + } + Enum { + name: "FontSizeMode" + values: { + "FixedSize": 0, + "HorizontalFit": 1, + "VerticalFit": 2, + "Fit": 3 + } + } + Property { name: "text"; type: "string" } + Property { name: "font"; type: "QFont" } + Property { name: "color"; type: "QColor" } + Property { name: "linkColor"; type: "QColor" } + Property { name: "style"; type: "TextStyle" } + Property { name: "styleColor"; type: "QColor" } + Property { name: "horizontalAlignment"; type: "HAlignment" } + Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } + Property { name: "verticalAlignment"; type: "VAlignment" } + Property { name: "wrapMode"; type: "WrapMode" } + Property { name: "lineCount"; type: "int"; isReadonly: true } + Property { name: "truncated"; type: "bool"; isReadonly: true } + Property { name: "maximumLineCount"; type: "int" } + Property { name: "textFormat"; type: "TextFormat" } + Property { name: "elide"; type: "TextElideMode" } + Property { name: "contentWidth"; type: "double"; isReadonly: true } + Property { name: "contentHeight"; type: "double"; isReadonly: true } + Property { name: "paintedWidth"; type: "double"; isReadonly: true } + Property { name: "paintedHeight"; type: "double"; isReadonly: true } + Property { name: "lineHeight"; type: "double" } + Property { name: "lineHeightMode"; type: "LineHeightMode" } + Property { name: "baseUrl"; type: "QUrl" } + Property { name: "minimumPixelSize"; type: "int" } + Property { name: "minimumPointSize"; type: "int" } + Property { name: "fontSizeMode"; type: "FontSizeMode" } + Property { name: "renderType"; type: "RenderType" } + Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } + Property { name: "padding"; revision: 6; type: "double" } + Property { name: "topPadding"; revision: 6; type: "double" } + Property { name: "leftPadding"; revision: 6; type: "double" } + Property { name: "rightPadding"; revision: 6; type: "double" } + Property { name: "bottomPadding"; revision: 6; type: "double" } + Property { name: "fontInfo"; revision: 9; type: "QJSValue"; isReadonly: true } + Property { name: "advance"; revision: 10; type: "QSizeF"; isReadonly: true } + Signal { + name: "textChanged" + Parameter { name: "text"; type: "string" } + } + Signal { + name: "linkActivated" + Parameter { name: "link"; type: "string" } + } + Signal { + name: "linkHovered" + revision: 2 + Parameter { name: "link"; type: "string" } + } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "styleChanged" + Parameter { name: "style"; type: "QQuickText::TextStyle" } + } + Signal { + name: "horizontalAlignmentChanged" + Parameter { name: "alignment"; type: "QQuickText::HAlignment" } + } + Signal { + name: "verticalAlignmentChanged" + Parameter { name: "alignment"; type: "QQuickText::VAlignment" } + } + Signal { + name: "textFormatChanged" + Parameter { name: "textFormat"; type: "QQuickText::TextFormat" } + } + Signal { + name: "elideModeChanged" + Parameter { name: "mode"; type: "QQuickText::TextElideMode" } + } + Signal { name: "contentSizeChanged" } + Signal { + name: "contentWidthChanged" + Parameter { name: "contentWidth"; type: "double" } + } + Signal { + name: "contentHeightChanged" + Parameter { name: "contentHeight"; type: "double" } + } + Signal { + name: "lineHeightChanged" + Parameter { name: "lineHeight"; type: "double" } + } + Signal { + name: "lineHeightModeChanged" + Parameter { name: "mode"; type: "LineHeightMode" } + } + Signal { + name: "lineLaidOut" + Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } + } + Signal { name: "paddingChanged"; revision: 6 } + Signal { name: "topPaddingChanged"; revision: 6 } + Signal { name: "leftPaddingChanged"; revision: 6 } + Signal { name: "rightPaddingChanged"; revision: 6 } + Signal { name: "bottomPaddingChanged"; revision: 6 } + Signal { name: "fontInfoChanged"; revision: 9 } + Method { name: "doLayout" } + Method { name: "forceLayout"; revision: 9 } + Method { + name: "linkAt" + revision: 3 + type: "string" + Parameter { name: "x"; type: "double" } + Parameter { name: "y"; type: "double" } + } + } + Component { + name: "QQuickTumblerView" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls.impl/TumblerView 2.1"] + exportMetaObjectRevisions: [0] + Property { name: "model"; type: "QVariant" } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "path"; type: "QQuickPath"; isPointer: true } + } + Component { + prototype: "QQuickAbstractButton" + name: "QtQuick.Controls/AbstractButton 2.0" + exports: ["QtQuick.Controls/AbstractButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickAction" + name: "QtQuick.Controls/Action 2.3" + exports: ["QtQuick.Controls/Action 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + } + Component { + prototype: "QQuickActionGroup" + name: "QtQuick.Controls/ActionGroup 2.3" + exports: ["QtQuick.Controls/ActionGroup 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "actions" + } + Component { + prototype: "QQuickApplicationWindow" + name: "QtQuick.Controls/ApplicationWindow 2.0" + exports: ["QtQuick.Controls/ApplicationWindow 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickBusyIndicator" + name: "QtQuick.Controls/BusyIndicator 2.0" + exports: ["QtQuick.Controls/BusyIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickButton" + name: "QtQuick.Controls/Button 2.0" + exports: ["QtQuick.Controls/Button 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickButtonGroup" + name: "QtQuick.Controls/ButtonGroup 2.0" + exports: ["QtQuick.Controls/ButtonGroup 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + } + Component { + prototype: "QQuickCheckBox" + name: "QtQuick.Controls/CheckBox 2.0" + exports: ["QtQuick.Controls/CheckBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickCheckDelegate" + name: "QtQuick.Controls/CheckDelegate 2.0" + exports: ["QtQuick.Controls/CheckDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickComboBox" + name: "QtQuick.Controls/ComboBox 2.0" + exports: ["QtQuick.Controls/ComboBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickContainer" + name: "QtQuick.Controls/Container 2.0" + exports: ["QtQuick.Controls/Container 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickControl" + name: "QtQuick.Controls/Control 2.0" + exports: ["QtQuick.Controls/Control 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDelayButton" + name: "QtQuick.Controls/DelayButton 2.2" + exports: ["QtQuick.Controls/DelayButton 2.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDial" + name: "QtQuick.Controls/Dial 2.0" + exports: ["QtQuick.Controls/Dial 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDialog" + name: "QtQuick.Controls/Dialog 2.1" + exports: ["QtQuick.Controls/Dialog 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickDialogButtonBox" + name: "QtQuick.Controls/DialogButtonBox 2.1" + exports: ["QtQuick.Controls/DialogButtonBox 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickDrawer" + name: "QtQuick.Controls/Drawer 2.0" + exports: ["QtQuick.Controls/Drawer 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickFrame" + name: "QtQuick.Controls/Frame 2.0" + exports: ["QtQuick.Controls/Frame 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickGroupBox" + name: "QtQuick.Controls/GroupBox 2.0" + exports: ["QtQuick.Controls/GroupBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickHorizontalHeaderView" + name: "QtQuick.Controls/HorizontalHeaderView 2.15" + exports: ["QtQuick.Controls/HorizontalHeaderView 2.15"] + exportMetaObjectRevisions: [15] + isComposite: true + defaultProperty: "flickableData" + } + Component { + prototype: "QQuickItemDelegate" + name: "QtQuick.Controls/ItemDelegate 2.0" + exports: ["QtQuick.Controls/ItemDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickLabel" + name: "QtQuick.Controls/Label 2.0" + exports: ["QtQuick.Controls/Label 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenu" + name: "QtQuick.Controls/Menu 2.0" + exports: ["QtQuick.Controls/Menu 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickMenuBar" + name: "QtQuick.Controls/MenuBar 2.3" + exports: ["QtQuick.Controls/MenuBar 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickMenuBarItem" + name: "QtQuick.Controls/MenuBarItem 2.3" + exports: ["QtQuick.Controls/MenuBarItem 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenuItem" + name: "QtQuick.Controls/MenuItem 2.0" + exports: ["QtQuick.Controls/MenuItem 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenuSeparator" + name: "QtQuick.Controls/MenuSeparator 2.1" + exports: ["QtQuick.Controls/MenuSeparator 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickPage" + name: "QtQuick.Controls/Page 2.0" + exports: ["QtQuick.Controls/Page 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickPageIndicator" + name: "QtQuick.Controls/PageIndicator 2.0" + exports: ["QtQuick.Controls/PageIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickPane" + name: "QtQuick.Controls/Pane 2.0" + exports: ["QtQuick.Controls/Pane 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickPopup" + name: "QtQuick.Controls/Popup 2.0" + exports: ["QtQuick.Controls/Popup 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickProgressBar" + name: "QtQuick.Controls/ProgressBar 2.0" + exports: ["QtQuick.Controls/ProgressBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRadioButton" + name: "QtQuick.Controls/RadioButton 2.0" + exports: ["QtQuick.Controls/RadioButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRadioDelegate" + name: "QtQuick.Controls/RadioDelegate 2.0" + exports: ["QtQuick.Controls/RadioDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRangeSlider" + name: "QtQuick.Controls/RangeSlider 2.0" + exports: ["QtQuick.Controls/RangeSlider 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRoundButton" + name: "QtQuick.Controls/RoundButton 2.1" + exports: ["QtQuick.Controls/RoundButton 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollBar" + name: "QtQuick.Controls/ScrollBar 2.0" + exports: ["QtQuick.Controls/ScrollBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollIndicator" + name: "QtQuick.Controls/ScrollIndicator 2.0" + exports: ["QtQuick.Controls/ScrollIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollView" + name: "QtQuick.Controls/ScrollView 2.2" + exports: ["QtQuick.Controls/ScrollView 2.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickSlider" + name: "QtQuick.Controls/Slider 2.0" + exports: ["QtQuick.Controls/Slider 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSpinBox" + name: "QtQuick.Controls/SpinBox 2.0" + exports: ["QtQuick.Controls/SpinBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSplitView" + name: "QtQuick.Controls/SplitView 2.13" + exports: ["QtQuick.Controls/SplitView 2.13"] + exportMetaObjectRevisions: [13] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickStackView" + name: "QtQuick.Controls/StackView 2.0" + exports: ["QtQuick.Controls/StackView 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwipeDelegate" + name: "QtQuick.Controls/SwipeDelegate 2.0" + exports: ["QtQuick.Controls/SwipeDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwipeView" + name: "QtQuick.Controls/SwipeView 2.0" + exports: ["QtQuick.Controls/SwipeView 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickSwitch" + name: "QtQuick.Controls/Switch 2.0" + exports: ["QtQuick.Controls/Switch 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwitchDelegate" + name: "QtQuick.Controls/SwitchDelegate 2.0" + exports: ["QtQuick.Controls/SwitchDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickTabBar" + name: "QtQuick.Controls/TabBar 2.0" + exports: ["QtQuick.Controls/TabBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickTabButton" + name: "QtQuick.Controls/TabButton 2.0" + exports: ["QtQuick.Controls/TabButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickTextArea" + name: "QtQuick.Controls/TextArea 2.0" + exports: ["QtQuick.Controls/TextArea 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickTextField" + name: "QtQuick.Controls/TextField 2.0" + exports: ["QtQuick.Controls/TextField 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolBar" + name: "QtQuick.Controls/ToolBar 2.0" + exports: ["QtQuick.Controls/ToolBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickToolButton" + name: "QtQuick.Controls/ToolButton 2.0" + exports: ["QtQuick.Controls/ToolButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolSeparator" + name: "QtQuick.Controls/ToolSeparator 2.1" + exports: ["QtQuick.Controls/ToolSeparator 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolTip" + name: "QtQuick.Controls/ToolTip 2.0" + exports: ["QtQuick.Controls/ToolTip 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickTumbler" + name: "QtQuick.Controls/Tumbler 2.0" + exports: ["QtQuick.Controls/Tumbler 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickVerticalHeaderView" + name: "QtQuick.Controls/VerticalHeaderView 2.15" + exports: ["QtQuick.Controls/VerticalHeaderView 2.15"] + exportMetaObjectRevisions: [15] + isComposite: true + defaultProperty: "flickableData" + } +} diff --git a/src/imports/controls/default/qmldir b/src/imports/controls/default/qmldir new file mode 100644 index 00000000..69b219aa --- /dev/null +++ b/src/imports/controls/default/qmldir @@ -0,0 +1,4 @@ +module QtQuick.Controls.Default +plugin qtquickcontrols2defaultstyleplugin +classname QtQuickControls2DefaultStylePlugin +depends QtQuick.Controls 2.5 diff --git a/src/imports/controls/default/qquickdefaultbusyindicator.cpp b/src/imports/controls/default/qquickdefaultbusyindicator.cpp new file mode 100644 index 00000000..aca795d9 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultbusyindicator.cpp @@ -0,0 +1,223 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultbusyindicator_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int CircleCount = 10; +static const int TotalDuration = 100 * CircleCount * 2; +static const QRgb TransparentColor = 0x00000000; + +static QPointF moveCircle(const QPointF &pos, qreal rotation, qreal distance) +{ + return pos - QTransform().rotate(rotation).map(QPointF(0, distance)); +} + +class QQuickDefaultBusyIndicatorNode : public QQuickAnimatedNode +{ +public: + QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + QColor m_pen; + QColor m_fill; +}; + +QQuickDefaultBusyIndicatorNode::QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); + setCurrentTime(item->elapsed()); + + for (int i = 0; i < CircleCount; ++i) { + QSGTransformNode *transformNode = new QSGTransformNode; + appendChildNode(transformNode); + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + transformNode->appendChildNode(rectNode); + } +} + +void QQuickDefaultBusyIndicatorNode::updateCurrentTime(int time) +{ + const qreal percentageComplete = time / qreal(TotalDuration); + const qreal firstPhaseProgress = percentageComplete <= 0.5 ? percentageComplete * 2 : 0; + const qreal secondPhaseProgress = percentageComplete > 0.5 ? (percentageComplete - 0.5) * 2 : 0; + + QSGTransformNode *transformNode = static_cast(firstChild()); + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + for (int i = 0; i < CircleCount; ++i) { + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + const bool fill = (firstPhaseProgress > qreal(i) / CircleCount) || (secondPhaseProgress > 0 && secondPhaseProgress < qreal(i) / CircleCount); + rectNode->setColor(fill ? m_fill : QColor::fromRgba(TransparentColor)); + rectNode->setPenColor(m_pen); + rectNode->setPenWidth(1); + rectNode->update(); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +void QQuickDefaultBusyIndicatorNode::sync(QQuickItem *item) +{ + const qreal w = item->width(); + const qreal h = item->height(); + const qreal sz = qMin(w, h); + const qreal dx = (w - sz) / 2; + const qreal dy = (h - sz) / 2; + const int circleRadius = sz / 12; + + m_pen = static_cast(item)->pen(); + m_fill = static_cast(item)->fill(); + + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < CircleCount; ++i) { + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius); + pos = moveCircle(pos, 360.0 / CircleCount * i, sz / 2 - circleRadius); + + QMatrix4x4 m; + m.translate(dx + pos.x(), dy + pos.y()); + transformNode->setMatrix(m); + + rectNode->setRect(QRectF(QPointF(), QSizeF(circleRadius * 2, circleRadius * 2))); + rectNode->setRadius(circleRadius); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +QQuickDefaultBusyIndicator::QQuickDefaultBusyIndicator(QQuickItem *parent) : + QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +QColor QQuickDefaultBusyIndicator::pen() const +{ + return m_pen; +} + +void QQuickDefaultBusyIndicator::setPen(const QColor &pen) +{ + if (pen == m_pen) + return; + + m_pen = pen; + update(); +} + +QColor QQuickDefaultBusyIndicator::fill() const +{ + return m_fill; +} + +void QQuickDefaultBusyIndicator::setFill(const QColor &fill) +{ + if (fill == m_fill) + return; + + m_fill = fill; + update(); +} + +bool QQuickDefaultBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickDefaultBusyIndicator::setRunning(bool running) +{ + if (running) + setVisible(true); +} + +int QQuickDefaultBusyIndicator::elapsed() const +{ + return m_elapsed; +} + +void QQuickDefaultBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + switch (change) { + case ItemOpacityHasChanged: + if (qFuzzyIsNull(data.realValue)) + setVisible(false); + break; + case ItemVisibleHasChanged: + update(); + break; + default: + break; + } +} + +QSGNode *QQuickDefaultBusyIndicator::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickDefaultBusyIndicatorNode *node = static_cast(oldNode); + if (isRunning() && width() > 0 && height() > 0) { + if (!node) { + node = new QQuickDefaultBusyIndicatorNode(this); + node->start(); + } + node->sync(this); + } else { + m_elapsed = node ? node->currentTime() : 0; + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultbusyindicator_p.h b/src/imports/controls/default/qquickdefaultbusyindicator_p.h new file mode 100644 index 00000000..eedaf09a --- /dev/null +++ b/src/imports/controls/default/qquickdefaultbusyindicator_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTBUSYINDICATOR_P_H +#define QQUICKDEFAULTBUSYINDICATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultBusyIndicator : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor pen READ pen WRITE setPen FINAL) + Q_PROPERTY(QColor fill READ fill WRITE setFill FINAL) + Q_PROPERTY(bool running READ isRunning WRITE setRunning) + +public: + explicit QQuickDefaultBusyIndicator(QQuickItem *parent = nullptr); + + QColor pen() const; + void setPen(const QColor &pen); + + QColor fill() const; + void setFill(const QColor &fill); + + bool isRunning() const; + void setRunning(bool running); + + int elapsed() const; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + int m_elapsed = 0; + QColor m_pen; + QColor m_fill; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickDefaultBusyIndicator) + +#endif // QQUICKDEFAULTBUSYINDICATOR_P_H diff --git a/src/imports/controls/default/qquickdefaultdial.cpp b/src/imports/controls/default/qquickdefaultdial.cpp new file mode 100644 index 00000000..1653def7 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultdial.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultdial_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickDefaultDial::QQuickDefaultDial(QQuickItem *parent) : + QQuickPaintedItem(parent) +{ +} + +qreal QQuickDefaultDial::progress() const +{ + return m_progress; +} + +void QQuickDefaultDial::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +QColor QQuickDefaultDial::color() const +{ + return m_color; +} + +void QQuickDefaultDial::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +void QQuickDefaultDial::paint(QPainter *painter) +{ + if (width() <= 0 || height() <= 0) + return; + + QPen pen(m_color); + pen.setWidth(8); + pen.setCapStyle(Qt::FlatCap); + painter->setPen(pen); + + const QRectF bounds = boundingRect(); + const qreal smallest = qMin(bounds.width(), bounds.height()); + QRectF rect = QRectF(pen.widthF() / 2.0 + 1, pen.widthF() / 2.0 + 1, smallest - pen.widthF() - 2, smallest - pen.widthF() - 2); + rect.moveCenter(bounds.center()); + + // Make sure the arc is aligned to whole pixels. + if (rect.x() - int(rect.x()) > 0) + rect.setX(qCeil(rect.x())); + if (rect.y() - int(rect.y()) > 0) + rect.setY(qCeil(rect.y())); + if (rect.width() - int(rect.width()) > 0) + rect.setWidth(qFloor(rect.width())); + if (rect.height() - int(rect.height()) > 0) + rect.setHeight(qFloor(rect.height())); + + painter->setRenderHint(QPainter::Antialiasing); + + const qreal startAngle = (140 + 90); + const qreal spanAngle = (m_progress * 280) * -1; + QPainterPath path; + path.arcMoveTo(rect, startAngle); + path.arcTo(rect, startAngle, spanAngle); + painter->drawPath(path); + + rect.adjust(-pen.widthF() / 2.0, -pen.widthF() / 2.0, pen.widthF() / 2.0, pen.widthF() / 2.0); + pen.setWidth(1); + painter->setPen(pen); + + path = QPainterPath(); + path.arcMoveTo(rect, 0); + path.arcTo(rect, 0, 360); + painter->drawPath(path); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultdial_p.h b/src/imports/controls/default/qquickdefaultdial_p.h new file mode 100644 index 00000000..73e14321 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultdial_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTDIAL_P_H +#define QQUICKDEFAULTDIAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultDial : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + +public: + explicit QQuickDefaultDial(QQuickItem *parent = nullptr); + + qreal progress() const; + void setProgress(qreal progress); + + QColor color() const; + void setColor(const QColor &color); + + void paint(QPainter *painter) override; + +private: + qreal m_progress = 0; + QColor m_color = Qt::black; +}; + +QT_END_NAMESPACE + +#endif // QQUICKDEFAULTDIAL_P_H diff --git a/src/imports/controls/default/qquickdefaultprogressbar.cpp b/src/imports/controls/default/qquickdefaultprogressbar.cpp new file mode 100644 index 00000000..f44065e4 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultprogressbar.cpp @@ -0,0 +1,280 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultprogressbar_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int Blocks = 4; +static const int BlockWidth = 16; +static const int BlockRestingSpacing = 4; +static const int BlockMovingSpacing = 48; +static const int BlockSpan = Blocks * (BlockWidth + BlockRestingSpacing) - BlockRestingSpacing; +static const int TotalDuration = 4000; +static const int SecondPhaseStart = TotalDuration * 0.4; +static const int ThirdPhaseStart = TotalDuration * 0.6; + +static inline qreal blockStartX(int blockIndex) +{ + return ((blockIndex + 1) * -BlockWidth) - (blockIndex * BlockMovingSpacing); +} + +static inline qreal blockRestX(int blockIndex, qreal availableWidth) +{ + const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2.0; + return spanRightEdgePos - (blockIndex + 1) * BlockWidth - (blockIndex * BlockRestingSpacing); +} + +static inline qreal blockEndX(int blockIndex, qreal availableWidth) +{ + return availableWidth - blockStartX(Blocks - 1 - blockIndex) - BlockWidth; +} + +class QQuickDefaultProgressBarNode : public QQuickAnimatedNode +{ +public: + QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + bool m_indeterminate = false; + qreal m_pixelsPerSecond = 0; +}; + +QQuickDefaultProgressBarNode::QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item) + : QQuickAnimatedNode(item), + m_pixelsPerSecond(item->width()) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); +} + +void QQuickDefaultProgressBarNode::updateCurrentTime(int time) +{ + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < Blocks; ++i) { + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + + QMatrix4x4 m; + const qreal restX = blockRestX(i, m_pixelsPerSecond); + const qreal timeInSeconds = time / 1000.0; + + if (time < SecondPhaseStart) { + // Move into the resting position for the first phase. + QEasingCurve easingCurve(QEasingCurve::InQuad); + const qreal easedCompletion = easingCurve.valueForProgress(time / qreal(SecondPhaseStart)); + const qreal distance = m_pixelsPerSecond * (easedCompletion * (SecondPhaseStart / 1000.0)); + const qreal position = blockStartX(i) + distance; + const qreal destination = restX; + m.translate(qMin(position, destination), 0); + } else if (time < ThirdPhaseStart) { + // Stay in the same position for the second phase. + m.translate(restX, 0); + } else { + // Move out of view for the third phase. + const int thirdPhaseSubKickoff = (BlockMovingSpacing / m_pixelsPerSecond) * 1000; + const int subphase = (time - ThirdPhaseStart) / thirdPhaseSubKickoff; + // If we're not at this subphase yet, don't try to animate movement, + // because it will be incorrect. + if (subphase < i) + return; + + const qreal timeSinceSecondPhase = timeInSeconds - (ThirdPhaseStart / 1000.0); + // We only want to start keeping track of time once our subphase has started, + // otherwise we move too much because we account for time that has already elapsed. + // For example, if we were 60 milliseconds into the third subphase: + // + // 0 ..... 1 ..... 2 ... + // 100 100 60 + // + // i == 0, timeSinceOurKickoff == 260 + // i == 1, timeSinceOurKickoff == 160 + // i == 2, timeSinceOurKickoff == 60 + const qreal timeSinceOurKickoff = timeSinceSecondPhase - (thirdPhaseSubKickoff / 1000.0 * i); + const qreal position = restX + (m_pixelsPerSecond * (timeSinceOurKickoff)); + const qreal destination = blockEndX(i, m_pixelsPerSecond); + m.translate(qMin(position, destination), 0); + } + + transformNode->setMatrix(m); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +void QQuickDefaultProgressBarNode::sync(QQuickItem *item) +{ + QQuickDefaultProgressBar *bar = static_cast(item); + if (m_indeterminate != bar->isIndeterminate()) { + m_indeterminate = bar->isIndeterminate(); + if (m_indeterminate) + start(); + else + stop(); + } + m_pixelsPerSecond = item->width(); + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + + QMatrix4x4 m; + m.translate(0, (item->height() - item->implicitHeight()) / 2); + setMatrix(m); + + if (m_indeterminate) { + if (childCount() != Blocks) { + // This was previously a regular progress bar; remove the old nodes. + removeAllChildNodes(); + } + + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < Blocks; ++i) { + if (!transformNode) { + transformNode = new QSGTransformNode; + appendChildNode(transformNode); + } + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + if (!rectNode) { + rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setColor(bar->color()); + transformNode->appendChildNode(rectNode); + } + + QMatrix4x4 m; + m.translate(blockStartX(i), 0); + transformNode->setMatrix(m); + + rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(BlockWidth, item->implicitHeight()))); + rectNode->update(); + + transformNode = static_cast(transformNode->nextSibling()); + } + } else { + if (childCount() > 1) { + // This was previously an indeterminate progress bar; remove the old nodes. + removeAllChildNodes(); + } + + QSGInternalRectangleNode *rectNode = static_cast(firstChild()); + if (!rectNode) { + rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setColor(bar->color()); + appendChildNode(rectNode); + } + + rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(bar->progress() * item->width(), item->implicitHeight()))); + rectNode->update(); + } +} + +QQuickDefaultProgressBar::QQuickDefaultProgressBar(QQuickItem *parent) : + QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +qreal QQuickDefaultProgressBar::progress() const +{ + return m_progress; +} + +void QQuickDefaultProgressBar::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +bool QQuickDefaultProgressBar::isIndeterminate() const +{ + return m_indeterminate; +} + +void QQuickDefaultProgressBar::setIndeterminate(bool indeterminate) +{ + if (indeterminate == m_indeterminate) + return; + + m_indeterminate = indeterminate; + setClip(m_indeterminate); + update(); +} + +QColor QQuickDefaultProgressBar::color() const +{ + return m_color; +} + +void QQuickDefaultProgressBar::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +void QQuickDefaultProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemVisibleHasChanged) + update(); +} + +QSGNode *QQuickDefaultProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickDefaultProgressBarNode *node = static_cast(oldNode); + if (isVisible() && width() > 0 && height() > 0) { + if (!node) + node = new QQuickDefaultProgressBarNode(this); + node->sync(this); + } else { + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultprogressbar_p.h b/src/imports/controls/default/qquickdefaultprogressbar_p.h new file mode 100644 index 00000000..241d0b3b --- /dev/null +++ b/src/imports/controls/default/qquickdefaultprogressbar_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTPROGRESSBAR_P_H +#define QQUICKDEFAULTPROGRESSBAR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultProgressBar : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + +public: + explicit QQuickDefaultProgressBar(QQuickItem *parent = nullptr); + + bool isIndeterminate() const; + void setIndeterminate(bool indeterminate); + + qreal progress() const; + void setProgress(qreal progress); + + QColor color() const; + void setColor(const QColor &color); + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + qreal m_progress = 0; + bool m_indeterminate = false; + QColor m_color; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickDefaultProgressBar) + +#endif // QQUICKDEFAULTPROGRESSBAR_P_H diff --git a/src/imports/controls/default/qquickdefaultstyle.cpp b/src/imports/controls/default/qquickdefaultstyle.cpp new file mode 100644 index 00000000..15c59798 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultstyle.cpp @@ -0,0 +1,246 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultstyle_p.h" + +QT_BEGIN_NAMESPACE + +QQuickDefaultStyle::QQuickDefaultStyle(QObject *parent) : + QObject(parent) +{ +} + +QColor QQuickDefaultStyle::backgroundColor() const +{ + return QColor::fromRgba(0xFFFFFFFF); +} + +QColor QQuickDefaultStyle::overlayModalColor() const +{ + return QColor::fromRgba(0x7F28282A); +} + +QColor QQuickDefaultStyle::overlayDimColor() const +{ + return QColor::fromRgba(0x1F28282A); +} + +QColor QQuickDefaultStyle::textColor() const +{ + return QColor::fromRgba(0xFF353637); +} + +QColor QQuickDefaultStyle::textDarkColor() const +{ + return QColor::fromRgba(0xFF26282A); +} + +QColor QQuickDefaultStyle::textLightColor() const +{ + return QColor::fromRgba(0xFFFFFFFF); +} + +QColor QQuickDefaultStyle::textLinkColor() const +{ + return QColor::fromRgba(0xFF45A7D7); +} + +QColor QQuickDefaultStyle::textSelectionColor() const +{ + return QColor::fromRgba(0xFFFDDD5C); +} + +QColor QQuickDefaultStyle::textDisabledColor() const +{ + return QColor::fromRgba(0xFFBDBEBF); +} + +QColor QQuickDefaultStyle::textDisabledLightColor() const +{ + return QColor::fromRgba(0xFFC2C2C2); +} + +QColor QQuickDefaultStyle::textPlaceholderColor() const +{ + return QColor::fromRgba(0xFF777777); +} + +QColor QQuickDefaultStyle::focusColor() const +{ + return QColor::fromRgba(0xFF0066FF); +} + +QColor QQuickDefaultStyle::focusLightColor() const +{ + return QColor::fromRgba(0xFFF0F6FF); +} + +QColor QQuickDefaultStyle::focusPressedColor() const +{ + return QColor::fromRgba(0xFFCCE0FF); +} + +QColor QQuickDefaultStyle::buttonColor() const +{ + return QColor::fromRgba(0xFFE0E0E0); +} + +QColor QQuickDefaultStyle::buttonPressedColor() const +{ + return QColor::fromRgba(0xFFD0D0D0); +} + +QColor QQuickDefaultStyle::buttonCheckedColor() const +{ + return QColor::fromRgba(0xFF353637); +} + +QColor QQuickDefaultStyle::buttonCheckedPressedColor() const +{ + return QColor::fromRgba(0xFF585A5C); +} + +QColor QQuickDefaultStyle::buttonCheckedFocusColor() const +{ + return QColor::fromRgba(0xFF599BFF); +} + +QColor QQuickDefaultStyle::toolButtonColor() const +{ + return QColor::fromRgba(0x33333333); +} + +QColor QQuickDefaultStyle::tabButtonColor() const +{ + return QColor::fromRgba(0xFF353637); +} + +QColor QQuickDefaultStyle::tabButtonPressedColor() const +{ + return QColor::fromRgba(0xFF585A5C); +} + +QColor QQuickDefaultStyle::tabButtonCheckedPressedColor() const +{ + return QColor::fromRgba(0xFFE4E4E4); +} + +QColor QQuickDefaultStyle::delegateColor() const +{ + return QColor::fromRgba(0xFFEEEEEE); +} + +QColor QQuickDefaultStyle::delegatePressedColor() const +{ + return QColor::fromRgba(0xFFBDBEBF); +} + +QColor QQuickDefaultStyle::delegateFocusColor() const +{ + return QColor::fromRgba(0xFFE5EFFF); +} + +QColor QQuickDefaultStyle::indicatorPressedColor() const +{ + return QColor::fromRgba(0xFFF6F6F6); +} + +QColor QQuickDefaultStyle::indicatorDisabledColor() const +{ + return QColor::fromRgba(0xFFFDFDFD); +} + +QColor QQuickDefaultStyle::indicatorFrameColor() const +{ + return QColor::fromRgba(0xFF909090); +} + +QColor QQuickDefaultStyle::indicatorFramePressedColor() const +{ + return QColor::fromRgba(0xFF808080); +} + +QColor QQuickDefaultStyle::indicatorFrameDisabledColor() const +{ + return QColor::fromRgba(0xFFD6D6D6); +} + +QColor QQuickDefaultStyle::frameDarkColor() const +{ + return QColor::fromRgba(0xFF353637); +} + +QColor QQuickDefaultStyle::frameLightColor() const +{ + return QColor::fromRgba(0xFFBDBEBF); +} + +QColor QQuickDefaultStyle::scrollBarColor() const +{ + return QColor::fromRgba(0xFFBDBEBF); +} + +QColor QQuickDefaultStyle::scrollBarPressedColor() const +{ + return QColor::fromRgba(0xFF28282A); +} + +QColor QQuickDefaultStyle::progressBarColor() const +{ + return QColor::fromRgba(0xFFE4E4E4); +} + +QColor QQuickDefaultStyle::pageIndicatorColor() const +{ + return QColor::fromRgba(0xFF28282A); +} + +QColor QQuickDefaultStyle::separatorColor() const +{ + return QColor::fromRgba(0xFFCCCCCC); +} + +QColor QQuickDefaultStyle::disabledDarkColor() const +{ + return QColor::fromRgba(0xFF353637); +} + +QColor QQuickDefaultStyle::disabledLightColor() const +{ + return QColor::fromRgba(0xFFBDBEBF); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultstyle_p.h b/src/imports/controls/default/qquickdefaultstyle_p.h new file mode 100644 index 00000000..fcd489a0 --- /dev/null +++ b/src/imports/controls/default/qquickdefaultstyle_p.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTSTYLE_P_H +#define QQUICKDEFAULTSTYLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultStyle : public QObject +{ + Q_OBJECT + Q_PROPERTY(QColor backgroundColor READ backgroundColor CONSTANT FINAL) + Q_PROPERTY(QColor overlayModalColor READ overlayModalColor CONSTANT FINAL) + Q_PROPERTY(QColor overlayDimColor READ overlayDimColor CONSTANT FINAL) + Q_PROPERTY(QColor textColor READ textColor CONSTANT FINAL) + Q_PROPERTY(QColor textDarkColor READ textDarkColor CONSTANT FINAL) + Q_PROPERTY(QColor textLightColor READ textLightColor CONSTANT FINAL) + Q_PROPERTY(QColor textLinkColor READ textLinkColor CONSTANT FINAL) + Q_PROPERTY(QColor textSelectionColor READ textSelectionColor CONSTANT FINAL) + Q_PROPERTY(QColor textDisabledColor READ textDisabledColor CONSTANT FINAL) + Q_PROPERTY(QColor textDisabledLightColor READ textDisabledLightColor CONSTANT FINAL) + Q_PROPERTY(QColor textPlaceholderColor READ textPlaceholderColor CONSTANT FINAL) + Q_PROPERTY(QColor focusColor READ focusColor CONSTANT FINAL) + Q_PROPERTY(QColor focusLightColor READ focusLightColor CONSTANT FINAL) + Q_PROPERTY(QColor focusPressedColor READ focusPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor buttonColor READ buttonColor CONSTANT FINAL) + Q_PROPERTY(QColor buttonPressedColor READ buttonPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor buttonCheckedColor READ buttonCheckedColor CONSTANT FINAL) + Q_PROPERTY(QColor buttonCheckedPressedColor READ buttonCheckedPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor buttonCheckedFocusColor READ buttonCheckedFocusColor CONSTANT FINAL) + Q_PROPERTY(QColor toolButtonColor READ toolButtonColor CONSTANT FINAL) + Q_PROPERTY(QColor tabButtonColor READ tabButtonColor CONSTANT FINAL) + Q_PROPERTY(QColor tabButtonPressedColor READ tabButtonPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor tabButtonCheckedPressedColor READ tabButtonCheckedPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor delegateColor READ delegateColor CONSTANT FINAL) + Q_PROPERTY(QColor delegatePressedColor READ delegatePressedColor CONSTANT FINAL) + Q_PROPERTY(QColor delegateFocusColor READ delegateFocusColor CONSTANT FINAL) + Q_PROPERTY(QColor indicatorPressedColor READ indicatorPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor indicatorDisabledColor READ indicatorDisabledColor CONSTANT FINAL) + Q_PROPERTY(QColor indicatorFrameColor READ indicatorFrameColor CONSTANT FINAL) + Q_PROPERTY(QColor indicatorFramePressedColor READ indicatorFramePressedColor CONSTANT FINAL) + Q_PROPERTY(QColor indicatorFrameDisabledColor READ indicatorFrameDisabledColor CONSTANT FINAL) + Q_PROPERTY(QColor frameDarkColor READ frameDarkColor CONSTANT FINAL) + Q_PROPERTY(QColor frameLightColor READ frameLightColor CONSTANT FINAL) + Q_PROPERTY(QColor scrollBarColor READ scrollBarColor CONSTANT FINAL) + Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor CONSTANT FINAL) + Q_PROPERTY(QColor progressBarColor READ progressBarColor CONSTANT FINAL) + Q_PROPERTY(QColor pageIndicatorColor READ pageIndicatorColor CONSTANT FINAL) + Q_PROPERTY(QColor separatorColor READ separatorColor CONSTANT FINAL) + Q_PROPERTY(QColor disabledDarkColor READ disabledDarkColor CONSTANT FINAL) + Q_PROPERTY(QColor disabledLightColor READ disabledLightColor CONSTANT FINAL) + +public: + explicit QQuickDefaultStyle(QObject *parent = nullptr); + + QColor backgroundColor() const; + QColor overlayModalColor() const; + QColor overlayDimColor() const; + QColor textColor() const; + QColor textDarkColor() const; + QColor textLightColor() const; + QColor textLinkColor() const; + QColor textSelectionColor() const; + QColor textDisabledColor() const; + QColor textDisabledLightColor() const; + QColor textPlaceholderColor() const; + QColor focusColor() const; + QColor focusLightColor() const; + QColor focusPressedColor() const; + QColor buttonColor() const; + QColor buttonPressedColor() const; + QColor buttonCheckedColor() const; + QColor buttonCheckedPressedColor() const; + QColor buttonCheckedFocusColor() const; + QColor toolButtonColor() const; + QColor tabButtonColor() const; + QColor tabButtonPressedColor() const; + QColor tabButtonCheckedPressedColor() const; + QColor delegateColor() const; + QColor delegatePressedColor() const; + QColor delegateFocusColor() const; + QColor indicatorPressedColor() const; + QColor indicatorDisabledColor() const; + QColor indicatorFrameColor() const; + QColor indicatorFramePressedColor() const; + QColor indicatorFrameDisabledColor() const; + QColor frameDarkColor() const; + QColor frameLightColor() const; + QColor scrollBarColor() const; + QColor scrollBarPressedColor() const; + QColor progressBarColor() const; + QColor pageIndicatorColor() const; + QColor separatorColor() const; + QColor disabledDarkColor() const; + QColor disabledLightColor() const; +}; + +QT_END_NAMESPACE + +#endif // QQUICKDEFAULTSTYLE_P_H diff --git a/src/imports/controls/default/qquickdefaulttheme.cpp b/src/imports/controls/default/qquickdefaulttheme.cpp new file mode 100644 index 00000000..26fb2a2f --- /dev/null +++ b/src/imports/controls/default/qquickdefaulttheme.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaulttheme_p.h" + +#include + +QT_BEGIN_NAMESPACE + +void QQuickDefaultTheme::initialize(QQuickTheme *theme) +{ + QPalette systemPalette; + + systemPalette.setColor(QPalette::Base, QColor::fromRgba(0xFFFFFFFF)); + systemPalette.setColor(QPalette::Disabled, QPalette::Base, QColor::fromRgba(0xFFD6D6D6)); + + systemPalette.setColor(QPalette::Button, QColor::fromRgba(0xFFE0E0E0)); + + systemPalette.setColor(QPalette::ButtonText, QColor::fromRgba(0xFF26282A)); + systemPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor::fromRgba(0x4D26282A)); + + systemPalette.setColor(QPalette::BrightText, QColor::fromRgba(0xFFFFFFFF)); + systemPalette.setColor(QPalette::Disabled, QPalette::BrightText, QColor::fromRgba(0x4DFFFFFF)); + + systemPalette.setColor(QPalette::Dark, QColor::fromRgba(0xFF353637)); + + systemPalette.setColor(QPalette::Highlight, QColor::fromRgba(0xFF0066FF)); + systemPalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor::fromRgba(0xFFF0F6FF)); + + systemPalette.setColor(QPalette::HighlightedText, QColor::fromRgba(0xFF090909)); + + systemPalette.setColor(QPalette::Light, QColor::fromRgba(0xFFF6F6F6)); + + systemPalette.setColor(QPalette::Link, QColor::fromRgba(0xFF45A7D7)); + + systemPalette.setColor(QPalette::Mid, QColor::fromRgba(0xFFBDBDBD)); + + systemPalette.setColor(QPalette::Midlight, QColor::fromRgba(0xFFE4E4E4)); + + systemPalette.setColor(QPalette::Text, QColor::fromRgba(0xFF353637)); + systemPalette.setColor(QPalette::Disabled, QPalette::Text, QColor::fromRgba(0x7F353637)); + + systemPalette.setColor(QPalette::Shadow, QColor::fromRgba(0xFF28282A)); + + systemPalette.setColor(QPalette::ToolTipBase, QColor::fromRgba(0xFFFFFFFF)); + systemPalette.setColor(QPalette::ToolTipText, QColor::fromRgba(0xFF000000)); + + systemPalette.setColor(QPalette::Window, QColor::fromRgba(0xFFFFFFFF)); + + systemPalette.setColor(QPalette::WindowText, QColor::fromRgba(0xFF26282A)); + systemPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor::fromRgba(0xFFBDBEBF)); + + theme->setPalette(QQuickTheme::System, systemPalette); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaulttheme_p.h b/src/imports/controls/default/qquickdefaulttheme_p.h new file mode 100644 index 00000000..3a7311c7 --- /dev/null +++ b/src/imports/controls/default/qquickdefaulttheme_p.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTTHEME_P_H +#define QQUICKDEFAULTTHEME_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QQuickTheme; + +class QQuickDefaultTheme +{ +public: + static void initialize(QQuickTheme *theme); +}; + +QT_END_NAMESPACE + +#endif // QQUICKDEFAULTTHEME_P_H diff --git a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp new file mode 100644 index 00000000..6e396dcf --- /dev/null +++ b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qquickdefaultbusyindicator_p.h" +#include "qquickdefaultdial_p.h" +#include "qquickdefaultprogressbar_p.h" +#include "qquickdefaultstyle_p.h" +#include "qquickdefaulttheme_p.h" + +QT_BEGIN_NAMESPACE + +class QtQuickControls2DefaultStylePlugin: public QQuickStylePlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2DefaultStylePlugin(QObject *parent = nullptr); + + void registerTypes(const char *uri) override; + + QString name() const override; + void initializeTheme(QQuickTheme *theme) override; +}; + +QtQuickControls2DefaultStylePlugin::QtQuickControls2DefaultStylePlugin(QObject *parent) : QQuickStylePlugin(parent) +{ +} + +void QtQuickControls2DefaultStylePlugin::registerTypes(const char *uri) +{ + // The minor version used to be the current Qt 5 minor. For compatibility it is the last + // Qt 5 release. + qmlRegisterModule(uri, 2, 15); + + // The minor version used to be the current Qt 5 minor. For compatibility it is the last + // Qt 5 release. + const QByteArray import = QByteArray(uri) + ".impl"; + qmlRegisterModule(import, 2, 15); + + // QtQuick.Controls.impl 2.0 (Qt 5.7) + qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); + qmlRegisterType(import, 2, 0, "DialImpl"); + qmlRegisterType(import, 2, 0, "ProgressBarImpl"); + + // QtQuick.Controls.impl 2.1 (Qt 5.8) + qmlRegisterSingletonType(import, 2, 1, "Default", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { + Q_UNUSED(engine); + Q_UNUSED(scriptEngine); + return new QQuickDefaultStyle; + }); +} + +QString QtQuickControls2DefaultStylePlugin::name() const +{ + return QStringLiteral("Default"); +} + +void QtQuickControls2DefaultStylePlugin::initializeTheme(QQuickTheme *theme) +{ + QQuickDefaultTheme::initialize(theme); +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2defaultstyleplugin.moc" diff --git a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc new file mode 100644 index 00000000..eddadf2d --- /dev/null +++ b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc @@ -0,0 +1,24 @@ + + + images/arrow-indicator.png + images/arrow-indicator@2x.png + images/arrow-indicator@3x.png + images/arrow-indicator@4x.png + images/check.png + images/check@2x.png + images/check@3x.png + images/check@4x.png + images/dial-indicator.png + images/dial-indicator@2x.png + images/dial-indicator@3x.png + images/dial-indicator@4x.png + images/drop-indicator.png + images/drop-indicator@2x.png + images/drop-indicator@3x.png + images/drop-indicator@4x.png + images/double-arrow.png + images/double-arrow@2x.png + images/double-arrow@3x.png + images/double-arrow@4x.png + + diff --git a/src/imports/controls/dependencies.json b/src/imports/controls/dependencies.json deleted file mode 100644 index 78029004..00000000 --- a/src/imports/controls/dependencies.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "name": "QtQuick", - "type": "module", - "version": "2.11" - }, - { - "name": "QtQuick.Window", - "type": "module", - "version": "2.2" - }, - { - "name": "QtQuick.Templates", - "type": "module", - "version": "2.5" - } -] diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml index f6559376..a04f93cb 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml @@ -29,6 +29,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 Button { - icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" display: Button.IconOnly } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml index bc99bba7..0c1f8ef1 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml @@ -30,6 +30,6 @@ import QtQuick.Controls 2.12 Button { text: "Button" - icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" display: Button.TextBesideIcon } diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc index 938b8d42..5226646e 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc @@ -58,7 +58,7 @@ \c Button.qml. This file can be found in the following path in your Qt installation: - \c {$QTDIR/qml/QtQuick/Controls.2/Button.qml} + \c {$QTDIR/qml/QtQuick/Controls.2/Default/Button.qml} After doing that, we'll simply add the following line: @@ -397,7 +397,7 @@ \endcode We then copy \c Button.qml from the Default style in - \c {$QTDIR/qml/QtQuick/Controls.2/} into a new \c myproject folder in our + \c {$QTDIR/qml/QtQuick/Controls.2/Default/} into a new \c myproject folder in our project directory. Add the newly copied \c Button.qml to \c qml.qrc, which is the resource file that contains our QML files. diff --git a/src/imports/controls/images/arrow-indicator.png b/src/imports/controls/images/arrow-indicator.png deleted file mode 100644 index d833d52c..00000000 Binary files a/src/imports/controls/images/arrow-indicator.png and /dev/null differ diff --git a/src/imports/controls/images/arrow-indicator@2x.png b/src/imports/controls/images/arrow-indicator@2x.png deleted file mode 100644 index 55c7940a..00000000 Binary files a/src/imports/controls/images/arrow-indicator@2x.png and /dev/null differ diff --git a/src/imports/controls/images/arrow-indicator@3x.png b/src/imports/controls/images/arrow-indicator@3x.png deleted file mode 100644 index c7067c5c..00000000 Binary files a/src/imports/controls/images/arrow-indicator@3x.png and /dev/null differ diff --git a/src/imports/controls/images/arrow-indicator@4x.png b/src/imports/controls/images/arrow-indicator@4x.png deleted file mode 100644 index 4c5cf351..00000000 Binary files a/src/imports/controls/images/arrow-indicator@4x.png and /dev/null differ diff --git a/src/imports/controls/images/check.png b/src/imports/controls/images/check.png deleted file mode 100644 index 479a8442..00000000 Binary files a/src/imports/controls/images/check.png and /dev/null differ diff --git a/src/imports/controls/images/check@2x.png b/src/imports/controls/images/check@2x.png deleted file mode 100644 index 79663c0b..00000000 Binary files a/src/imports/controls/images/check@2x.png and /dev/null differ diff --git a/src/imports/controls/images/check@3x.png b/src/imports/controls/images/check@3x.png deleted file mode 100644 index fd0135ab..00000000 Binary files a/src/imports/controls/images/check@3x.png and /dev/null differ diff --git a/src/imports/controls/images/check@4x.png b/src/imports/controls/images/check@4x.png deleted file mode 100644 index e7e0b640..00000000 Binary files a/src/imports/controls/images/check@4x.png and /dev/null differ diff --git a/src/imports/controls/images/dial-indicator.png b/src/imports/controls/images/dial-indicator.png deleted file mode 100644 index 92357c51..00000000 Binary files a/src/imports/controls/images/dial-indicator.png and /dev/null differ diff --git a/src/imports/controls/images/dial-indicator@2x.png b/src/imports/controls/images/dial-indicator@2x.png deleted file mode 100644 index f436443b..00000000 Binary files a/src/imports/controls/images/dial-indicator@2x.png and /dev/null differ diff --git a/src/imports/controls/images/dial-indicator@3x.png b/src/imports/controls/images/dial-indicator@3x.png deleted file mode 100644 index d883045b..00000000 Binary files a/src/imports/controls/images/dial-indicator@3x.png and /dev/null differ diff --git a/src/imports/controls/images/dial-indicator@4x.png b/src/imports/controls/images/dial-indicator@4x.png deleted file mode 100644 index 79477712..00000000 Binary files a/src/imports/controls/images/dial-indicator@4x.png and /dev/null differ diff --git a/src/imports/controls/images/double-arrow.png b/src/imports/controls/images/double-arrow.png deleted file mode 100644 index 3ecd7f89..00000000 Binary files a/src/imports/controls/images/double-arrow.png and /dev/null differ diff --git a/src/imports/controls/images/double-arrow@2x.png b/src/imports/controls/images/double-arrow@2x.png deleted file mode 100644 index eeb03e28..00000000 Binary files a/src/imports/controls/images/double-arrow@2x.png and /dev/null differ diff --git a/src/imports/controls/images/double-arrow@3x.png b/src/imports/controls/images/double-arrow@3x.png deleted file mode 100644 index f0662d20..00000000 Binary files a/src/imports/controls/images/double-arrow@3x.png and /dev/null differ diff --git a/src/imports/controls/images/double-arrow@4x.png b/src/imports/controls/images/double-arrow@4x.png deleted file mode 100644 index 10891e91..00000000 Binary files a/src/imports/controls/images/double-arrow@4x.png and /dev/null differ diff --git a/src/imports/controls/images/drop-indicator.png b/src/imports/controls/images/drop-indicator.png deleted file mode 100644 index 80c1d958..00000000 Binary files a/src/imports/controls/images/drop-indicator.png and /dev/null differ diff --git a/src/imports/controls/images/drop-indicator@2x.png b/src/imports/controls/images/drop-indicator@2x.png deleted file mode 100644 index 6e0f228c..00000000 Binary files a/src/imports/controls/images/drop-indicator@2x.png and /dev/null differ diff --git a/src/imports/controls/images/drop-indicator@3x.png b/src/imports/controls/images/drop-indicator@3x.png deleted file mode 100644 index 199752fb..00000000 Binary files a/src/imports/controls/images/drop-indicator@3x.png and /dev/null differ diff --git a/src/imports/controls/images/drop-indicator@4x.png b/src/imports/controls/images/drop-indicator@4x.png deleted file mode 100644 index 58311fbe..00000000 Binary files a/src/imports/controls/images/drop-indicator@4x.png and /dev/null differ diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes deleted file mode 100644 index e8212c55..00000000 --- a/src/imports/controls/plugins.qmltypes +++ /dev/null @@ -1,895 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.15' - -Module { - dependencies: [ - "QtQuick 2.11", - "QtQuick.Templates 2.5", - "QtQuick.Window 2.2" - ] - Component { - name: "QQuickCheckLabel" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/CheckLabel 2.3"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickClippedText" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/ClippedText 2.2"] - exportMetaObjectRevisions: [0] - Property { name: "clipX"; type: "double" } - Property { name: "clipY"; type: "double" } - Property { name: "clipWidth"; type: "double" } - Property { name: "clipHeight"; type: "double" } - } - Component { - name: "QQuickColor" - prototype: "QObject" - exports: ["QtQuick.Controls.impl/Color 2.3"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Method { - name: "transparent" - type: "QColor" - Parameter { name: "color"; type: "QColor" } - Parameter { name: "opacity"; type: "double" } - } - Method { - name: "blend" - type: "QColor" - Parameter { name: "a"; type: "QColor" } - Parameter { name: "b"; type: "QColor" } - Parameter { name: "factor"; type: "double" } - } - } - Component { - name: "QQuickColorImage" - defaultProperty: "data" - prototype: "QQuickImage" - exports: ["QtQuick.Controls.impl/ColorImage 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "defaultColor"; type: "QColor" } - } - Component { - name: "QQuickDefaultBusyIndicator" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/BusyIndicatorImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "pen"; type: "QColor" } - Property { name: "fill"; type: "QColor" } - Property { name: "running"; type: "bool" } - } - Component { - name: "QQuickDefaultDial" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.impl/DialImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "progress"; type: "double" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickDefaultProgressBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/ProgressBarImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "indeterminate"; type: "bool" } - Property { name: "progress"; type: "double" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickDefaultStyle" - prototype: "QObject" - exports: ["QtQuick.Controls.impl/Default 2.1"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "backgroundColor"; type: "QColor"; isReadonly: true } - Property { name: "overlayModalColor"; type: "QColor"; isReadonly: true } - Property { name: "overlayDimColor"; type: "QColor"; isReadonly: true } - Property { name: "textColor"; type: "QColor"; isReadonly: true } - Property { name: "textDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "textLightColor"; type: "QColor"; isReadonly: true } - Property { name: "textLinkColor"; type: "QColor"; isReadonly: true } - Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true } - Property { name: "textDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "textDisabledLightColor"; type: "QColor"; isReadonly: true } - Property { name: "textPlaceholderColor"; type: "QColor"; isReadonly: true } - Property { name: "focusColor"; type: "QColor"; isReadonly: true } - Property { name: "focusLightColor"; type: "QColor"; isReadonly: true } - Property { name: "focusPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedFocusColor"; type: "QColor"; isReadonly: true } - Property { name: "toolButtonColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonCheckedPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "delegateColor"; type: "QColor"; isReadonly: true } - Property { name: "delegatePressedColor"; type: "QColor"; isReadonly: true } - Property { name: "delegateFocusColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFrameColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFramePressedColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFrameDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "frameDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "frameLightColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "progressBarColor"; type: "QColor"; isReadonly: true } - Property { name: "pageIndicatorColor"; type: "QColor"; isReadonly: true } - Property { name: "separatorColor"; type: "QColor"; isReadonly: true } - Property { name: "disabledDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "disabledLightColor"; type: "QColor"; isReadonly: true } - } - Component { - name: "QQuickIconImage" - defaultProperty: "data" - prototype: "QQuickImage" - exports: ["QtQuick.Controls.impl/IconImage 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "name"; type: "string" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickIconLabel" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/IconLabel 2.3"] - exportMetaObjectRevisions: [0] - Enum { - name: "Display" - values: { - "IconOnly": 0, - "TextOnly": 1, - "TextBesideIcon": 2, - "TextUnderIcon": 3 - } - } - Property { name: "icon"; type: "QQuickIcon" } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "display"; type: "Display" } - Property { name: "spacing"; type: "double" } - Property { name: "mirrored"; type: "bool" } - Property { name: "alignment"; type: "Qt::Alignment" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - } - Component { - name: "QQuickImplicitSizeItem" - defaultProperty: "data" - prototype: "QQuickItem" - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickItemGroup" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - exports: ["QtQuick.Controls.impl/ItemGroup 2.2"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickMnemonicLabel" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/MnemonicLabel 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "text"; type: "string" } - Property { name: "mnemonicVisible"; type: "bool" } - } - Component { - name: "QQuickOverlay" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls/Overlay 2.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - attachedType: "QQuickOverlayAttached" - Property { name: "modal"; type: "QQmlComponent"; isPointer: true } - Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } - Signal { name: "pressed" } - Signal { name: "released" } - } - Component { - name: "QQuickPaddedRectangle" - defaultProperty: "data" - prototype: "QQuickRectangle" - exports: ["QtQuick.Controls.impl/PaddedRectangle 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "padding"; type: "double" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - } - Component { - name: "QQuickPlaceholderText" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/PlaceholderText 2.2"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickSplitHandleAttached" - prototype: "QObject" - exports: ["QtQuick.Controls/SplitHandle 2.13"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "hovered"; type: "bool"; isReadonly: true } - Property { name: "pressed"; type: "bool"; isReadonly: true } - } - Component { - name: "QQuickText" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4, - "AlignJustify": 8 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "TextStyle" - values: { - "Normal": 0, - "Outline": 1, - "Raised": 2, - "Sunken": 3 - } - } - Enum { - name: "TextFormat" - values: { - "PlainText": 0, - "RichText": 1, - "MarkdownText": 3, - "AutoText": 2, - "StyledText": 4 - } - } - Enum { - name: "TextElideMode" - values: { - "ElideLeft": 0, - "ElideRight": 1, - "ElideMiddle": 2, - "ElideNone": 3 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Enum { - name: "LineHeightMode" - values: { - "ProportionalHeight": 0, - "FixedHeight": 1 - } - } - Enum { - name: "FontSizeMode" - values: { - "FixedSize": 0, - "HorizontalFit": 1, - "VerticalFit": 2, - "Fit": 3 - } - } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "linkColor"; type: "QColor" } - Property { name: "style"; type: "TextStyle" } - Property { name: "styleColor"; type: "QColor" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "lineCount"; type: "int"; isReadonly: true } - Property { name: "truncated"; type: "bool"; isReadonly: true } - Property { name: "maximumLineCount"; type: "int" } - Property { name: "textFormat"; type: "TextFormat" } - Property { name: "elide"; type: "TextElideMode" } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "lineHeight"; type: "double" } - Property { name: "lineHeightMode"; type: "LineHeightMode" } - Property { name: "baseUrl"; type: "QUrl" } - Property { name: "minimumPixelSize"; type: "int" } - Property { name: "minimumPointSize"; type: "int" } - Property { name: "fontSizeMode"; type: "FontSizeMode" } - Property { name: "renderType"; type: "RenderType" } - Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } - Property { name: "padding"; revision: 6; type: "double" } - Property { name: "topPadding"; revision: 6; type: "double" } - Property { name: "leftPadding"; revision: 6; type: "double" } - Property { name: "rightPadding"; revision: 6; type: "double" } - Property { name: "bottomPadding"; revision: 6; type: "double" } - Property { name: "fontInfo"; revision: 9; type: "QJSValue"; isReadonly: true } - Property { name: "advance"; revision: 10; type: "QSizeF"; isReadonly: true } - Signal { - name: "textChanged" - Parameter { name: "text"; type: "string" } - } - Signal { - name: "linkActivated" - Parameter { name: "link"; type: "string" } - } - Signal { - name: "linkHovered" - revision: 2 - Parameter { name: "link"; type: "string" } - } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "styleChanged" - Parameter { name: "style"; type: "QQuickText::TextStyle" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::VAlignment" } - } - Signal { - name: "textFormatChanged" - Parameter { name: "textFormat"; type: "QQuickText::TextFormat" } - } - Signal { - name: "elideModeChanged" - Parameter { name: "mode"; type: "QQuickText::TextElideMode" } - } - Signal { name: "contentSizeChanged" } - Signal { - name: "contentWidthChanged" - Parameter { name: "contentWidth"; type: "double" } - } - Signal { - name: "contentHeightChanged" - Parameter { name: "contentHeight"; type: "double" } - } - Signal { - name: "lineHeightChanged" - Parameter { name: "lineHeight"; type: "double" } - } - Signal { - name: "lineHeightModeChanged" - Parameter { name: "mode"; type: "LineHeightMode" } - } - Signal { - name: "lineLaidOut" - Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } - } - Signal { name: "paddingChanged"; revision: 6 } - Signal { name: "topPaddingChanged"; revision: 6 } - Signal { name: "leftPaddingChanged"; revision: 6 } - Signal { name: "rightPaddingChanged"; revision: 6 } - Signal { name: "bottomPaddingChanged"; revision: 6 } - Signal { name: "fontInfoChanged"; revision: 9 } - Method { name: "doLayout" } - Method { name: "forceLayout"; revision: 9 } - Method { - name: "linkAt" - revision: 3 - type: "string" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickTumblerView" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/TumblerView 2.1"] - exportMetaObjectRevisions: [0] - Property { name: "model"; type: "QVariant" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "path"; type: "QQuickPath"; isPointer: true } - } - Component { - prototype: "QQuickAbstractButton" - name: "QtQuick.Controls/AbstractButton 2.0" - exports: ["QtQuick.Controls/AbstractButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickAction" - name: "QtQuick.Controls/Action 2.3" - exports: ["QtQuick.Controls/Action 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - } - Component { - prototype: "QQuickActionGroup" - name: "QtQuick.Controls/ActionGroup 2.3" - exports: ["QtQuick.Controls/ActionGroup 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "actions" - } - Component { - prototype: "QQuickApplicationWindow" - name: "QtQuick.Controls/ApplicationWindow 2.0" - exports: ["QtQuick.Controls/ApplicationWindow 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickBusyIndicator" - name: "QtQuick.Controls/BusyIndicator 2.0" - exports: ["QtQuick.Controls/BusyIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickButton" - name: "QtQuick.Controls/Button 2.0" - exports: ["QtQuick.Controls/Button 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickButtonGroup" - name: "QtQuick.Controls/ButtonGroup 2.0" - exports: ["QtQuick.Controls/ButtonGroup 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - } - Component { - prototype: "QQuickCheckBox" - name: "QtQuick.Controls/CheckBox 2.0" - exports: ["QtQuick.Controls/CheckBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickCheckDelegate" - name: "QtQuick.Controls/CheckDelegate 2.0" - exports: ["QtQuick.Controls/CheckDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickComboBox" - name: "QtQuick.Controls/ComboBox 2.0" - exports: ["QtQuick.Controls/ComboBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickContainer" - name: "QtQuick.Controls/Container 2.0" - exports: ["QtQuick.Controls/Container 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickControl" - name: "QtQuick.Controls/Control 2.0" - exports: ["QtQuick.Controls/Control 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDelayButton" - name: "QtQuick.Controls/DelayButton 2.2" - exports: ["QtQuick.Controls/DelayButton 2.2"] - exportMetaObjectRevisions: [2] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDial" - name: "QtQuick.Controls/Dial 2.0" - exports: ["QtQuick.Controls/Dial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDialog" - name: "QtQuick.Controls/Dialog 2.1" - exports: ["QtQuick.Controls/Dialog 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickDialogButtonBox" - name: "QtQuick.Controls/DialogButtonBox 2.1" - exports: ["QtQuick.Controls/DialogButtonBox 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickDrawer" - name: "QtQuick.Controls/Drawer 2.0" - exports: ["QtQuick.Controls/Drawer 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickFrame" - name: "QtQuick.Controls/Frame 2.0" - exports: ["QtQuick.Controls/Frame 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickGroupBox" - name: "QtQuick.Controls/GroupBox 2.0" - exports: ["QtQuick.Controls/GroupBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickHorizontalHeaderView" - name: "QtQuick.Controls/HorizontalHeaderView 2.15" - exports: ["QtQuick.Controls/HorizontalHeaderView 2.15"] - exportMetaObjectRevisions: [15] - isComposite: true - defaultProperty: "flickableData" - } - Component { - prototype: "QQuickItemDelegate" - name: "QtQuick.Controls/ItemDelegate 2.0" - exports: ["QtQuick.Controls/ItemDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickLabel" - name: "QtQuick.Controls/Label 2.0" - exports: ["QtQuick.Controls/Label 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenu" - name: "QtQuick.Controls/Menu 2.0" - exports: ["QtQuick.Controls/Menu 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickMenuBar" - name: "QtQuick.Controls/MenuBar 2.3" - exports: ["QtQuick.Controls/MenuBar 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickMenuBarItem" - name: "QtQuick.Controls/MenuBarItem 2.3" - exports: ["QtQuick.Controls/MenuBarItem 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenuItem" - name: "QtQuick.Controls/MenuItem 2.0" - exports: ["QtQuick.Controls/MenuItem 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenuSeparator" - name: "QtQuick.Controls/MenuSeparator 2.1" - exports: ["QtQuick.Controls/MenuSeparator 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickPage" - name: "QtQuick.Controls/Page 2.0" - exports: ["QtQuick.Controls/Page 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickPageIndicator" - name: "QtQuick.Controls/PageIndicator 2.0" - exports: ["QtQuick.Controls/PageIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickPane" - name: "QtQuick.Controls/Pane 2.0" - exports: ["QtQuick.Controls/Pane 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickPopup" - name: "QtQuick.Controls/Popup 2.0" - exports: ["QtQuick.Controls/Popup 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickProgressBar" - name: "QtQuick.Controls/ProgressBar 2.0" - exports: ["QtQuick.Controls/ProgressBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRadioButton" - name: "QtQuick.Controls/RadioButton 2.0" - exports: ["QtQuick.Controls/RadioButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRadioDelegate" - name: "QtQuick.Controls/RadioDelegate 2.0" - exports: ["QtQuick.Controls/RadioDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRangeSlider" - name: "QtQuick.Controls/RangeSlider 2.0" - exports: ["QtQuick.Controls/RangeSlider 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRoundButton" - name: "QtQuick.Controls/RoundButton 2.1" - exports: ["QtQuick.Controls/RoundButton 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollBar" - name: "QtQuick.Controls/ScrollBar 2.0" - exports: ["QtQuick.Controls/ScrollBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollIndicator" - name: "QtQuick.Controls/ScrollIndicator 2.0" - exports: ["QtQuick.Controls/ScrollIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollView" - name: "QtQuick.Controls/ScrollView 2.2" - exports: ["QtQuick.Controls/ScrollView 2.2"] - exportMetaObjectRevisions: [2] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickSlider" - name: "QtQuick.Controls/Slider 2.0" - exports: ["QtQuick.Controls/Slider 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSpinBox" - name: "QtQuick.Controls/SpinBox 2.0" - exports: ["QtQuick.Controls/SpinBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSplitView" - name: "QtQuick.Controls/SplitView 2.13" - exports: ["QtQuick.Controls/SplitView 2.13"] - exportMetaObjectRevisions: [13] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickStackView" - name: "QtQuick.Controls/StackView 2.0" - exports: ["QtQuick.Controls/StackView 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwipeDelegate" - name: "QtQuick.Controls/SwipeDelegate 2.0" - exports: ["QtQuick.Controls/SwipeDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwipeView" - name: "QtQuick.Controls/SwipeView 2.0" - exports: ["QtQuick.Controls/SwipeView 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickSwitch" - name: "QtQuick.Controls/Switch 2.0" - exports: ["QtQuick.Controls/Switch 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwitchDelegate" - name: "QtQuick.Controls/SwitchDelegate 2.0" - exports: ["QtQuick.Controls/SwitchDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTabBar" - name: "QtQuick.Controls/TabBar 2.0" - exports: ["QtQuick.Controls/TabBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickTabButton" - name: "QtQuick.Controls/TabButton 2.0" - exports: ["QtQuick.Controls/TabButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTextArea" - name: "QtQuick.Controls/TextArea 2.0" - exports: ["QtQuick.Controls/TextArea 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTextField" - name: "QtQuick.Controls/TextField 2.0" - exports: ["QtQuick.Controls/TextField 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolBar" - name: "QtQuick.Controls/ToolBar 2.0" - exports: ["QtQuick.Controls/ToolBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickToolButton" - name: "QtQuick.Controls/ToolButton 2.0" - exports: ["QtQuick.Controls/ToolButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolSeparator" - name: "QtQuick.Controls/ToolSeparator 2.1" - exports: ["QtQuick.Controls/ToolSeparator 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolTip" - name: "QtQuick.Controls/ToolTip 2.0" - exports: ["QtQuick.Controls/ToolTip 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickTumbler" - name: "QtQuick.Controls/Tumbler 2.0" - exports: ["QtQuick.Controls/Tumbler 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickVerticalHeaderView" - name: "QtQuick.Controls/VerticalHeaderView 2.15" - exports: ["QtQuick.Controls/VerticalHeaderView 2.15"] - exportMetaObjectRevisions: [15] - isComposite: true - defaultProperty: "flickableData" - } -} diff --git a/src/imports/controls/qmldir b/src/imports/controls/qmldir index c9ccb8f9..ae46e973 100644 --- a/src/imports/controls/qmldir +++ b/src/imports/controls/qmldir @@ -2,4 +2,5 @@ module QtQuick.Controls plugin qtquickcontrols2plugin classname QtQuickControls2Plugin depends QtQuick.Templates 2.5 +import QtQuick.Controls.impl auto designersupported diff --git a/src/imports/controls/qquickdefaultbusyindicator.cpp b/src/imports/controls/qquickdefaultbusyindicator.cpp deleted file mode 100644 index aca795d9..00000000 --- a/src/imports/controls/qquickdefaultbusyindicator.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultbusyindicator_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int CircleCount = 10; -static const int TotalDuration = 100 * CircleCount * 2; -static const QRgb TransparentColor = 0x00000000; - -static QPointF moveCircle(const QPointF &pos, qreal rotation, qreal distance) -{ - return pos - QTransform().rotate(rotation).map(QPointF(0, distance)); -} - -class QQuickDefaultBusyIndicatorNode : public QQuickAnimatedNode -{ -public: - QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - QColor m_pen; - QColor m_fill; -}; - -QQuickDefaultBusyIndicatorNode::QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); - setCurrentTime(item->elapsed()); - - for (int i = 0; i < CircleCount; ++i) { - QSGTransformNode *transformNode = new QSGTransformNode; - appendChildNode(transformNode); - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - transformNode->appendChildNode(rectNode); - } -} - -void QQuickDefaultBusyIndicatorNode::updateCurrentTime(int time) -{ - const qreal percentageComplete = time / qreal(TotalDuration); - const qreal firstPhaseProgress = percentageComplete <= 0.5 ? percentageComplete * 2 : 0; - const qreal secondPhaseProgress = percentageComplete > 0.5 ? (percentageComplete - 0.5) * 2 : 0; - - QSGTransformNode *transformNode = static_cast(firstChild()); - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - for (int i = 0; i < CircleCount; ++i) { - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - const bool fill = (firstPhaseProgress > qreal(i) / CircleCount) || (secondPhaseProgress > 0 && secondPhaseProgress < qreal(i) / CircleCount); - rectNode->setColor(fill ? m_fill : QColor::fromRgba(TransparentColor)); - rectNode->setPenColor(m_pen); - rectNode->setPenWidth(1); - rectNode->update(); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -void QQuickDefaultBusyIndicatorNode::sync(QQuickItem *item) -{ - const qreal w = item->width(); - const qreal h = item->height(); - const qreal sz = qMin(w, h); - const qreal dx = (w - sz) / 2; - const qreal dy = (h - sz) / 2; - const int circleRadius = sz / 12; - - m_pen = static_cast(item)->pen(); - m_fill = static_cast(item)->fill(); - - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < CircleCount; ++i) { - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius); - pos = moveCircle(pos, 360.0 / CircleCount * i, sz / 2 - circleRadius); - - QMatrix4x4 m; - m.translate(dx + pos.x(), dy + pos.y()); - transformNode->setMatrix(m); - - rectNode->setRect(QRectF(QPointF(), QSizeF(circleRadius * 2, circleRadius * 2))); - rectNode->setRadius(circleRadius); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -QQuickDefaultBusyIndicator::QQuickDefaultBusyIndicator(QQuickItem *parent) : - QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -QColor QQuickDefaultBusyIndicator::pen() const -{ - return m_pen; -} - -void QQuickDefaultBusyIndicator::setPen(const QColor &pen) -{ - if (pen == m_pen) - return; - - m_pen = pen; - update(); -} - -QColor QQuickDefaultBusyIndicator::fill() const -{ - return m_fill; -} - -void QQuickDefaultBusyIndicator::setFill(const QColor &fill) -{ - if (fill == m_fill) - return; - - m_fill = fill; - update(); -} - -bool QQuickDefaultBusyIndicator::isRunning() const -{ - return isVisible(); -} - -void QQuickDefaultBusyIndicator::setRunning(bool running) -{ - if (running) - setVisible(true); -} - -int QQuickDefaultBusyIndicator::elapsed() const -{ - return m_elapsed; -} - -void QQuickDefaultBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - switch (change) { - case ItemOpacityHasChanged: - if (qFuzzyIsNull(data.realValue)) - setVisible(false); - break; - case ItemVisibleHasChanged: - update(); - break; - default: - break; - } -} - -QSGNode *QQuickDefaultBusyIndicator::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickDefaultBusyIndicatorNode *node = static_cast(oldNode); - if (isRunning() && width() > 0 && height() > 0) { - if (!node) { - node = new QQuickDefaultBusyIndicatorNode(this); - node->start(); - } - node->sync(this); - } else { - m_elapsed = node ? node->currentTime() : 0; - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaultbusyindicator_p.h b/src/imports/controls/qquickdefaultbusyindicator_p.h deleted file mode 100644 index eedaf09a..00000000 --- a/src/imports/controls/qquickdefaultbusyindicator_p.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTBUSYINDICATOR_P_H -#define QQUICKDEFAULTBUSYINDICATOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultBusyIndicator : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor pen READ pen WRITE setPen FINAL) - Q_PROPERTY(QColor fill READ fill WRITE setFill FINAL) - Q_PROPERTY(bool running READ isRunning WRITE setRunning) - -public: - explicit QQuickDefaultBusyIndicator(QQuickItem *parent = nullptr); - - QColor pen() const; - void setPen(const QColor &pen); - - QColor fill() const; - void setFill(const QColor &fill); - - bool isRunning() const; - void setRunning(bool running); - - int elapsed() const; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - int m_elapsed = 0; - QColor m_pen; - QColor m_fill; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickDefaultBusyIndicator) - -#endif // QQUICKDEFAULTBUSYINDICATOR_P_H diff --git a/src/imports/controls/qquickdefaultdial.cpp b/src/imports/controls/qquickdefaultdial.cpp deleted file mode 100644 index 1653def7..00000000 --- a/src/imports/controls/qquickdefaultdial.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultdial_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickDefaultDial::QQuickDefaultDial(QQuickItem *parent) : - QQuickPaintedItem(parent) -{ -} - -qreal QQuickDefaultDial::progress() const -{ - return m_progress; -} - -void QQuickDefaultDial::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -QColor QQuickDefaultDial::color() const -{ - return m_color; -} - -void QQuickDefaultDial::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -void QQuickDefaultDial::paint(QPainter *painter) -{ - if (width() <= 0 || height() <= 0) - return; - - QPen pen(m_color); - pen.setWidth(8); - pen.setCapStyle(Qt::FlatCap); - painter->setPen(pen); - - const QRectF bounds = boundingRect(); - const qreal smallest = qMin(bounds.width(), bounds.height()); - QRectF rect = QRectF(pen.widthF() / 2.0 + 1, pen.widthF() / 2.0 + 1, smallest - pen.widthF() - 2, smallest - pen.widthF() - 2); - rect.moveCenter(bounds.center()); - - // Make sure the arc is aligned to whole pixels. - if (rect.x() - int(rect.x()) > 0) - rect.setX(qCeil(rect.x())); - if (rect.y() - int(rect.y()) > 0) - rect.setY(qCeil(rect.y())); - if (rect.width() - int(rect.width()) > 0) - rect.setWidth(qFloor(rect.width())); - if (rect.height() - int(rect.height()) > 0) - rect.setHeight(qFloor(rect.height())); - - painter->setRenderHint(QPainter::Antialiasing); - - const qreal startAngle = (140 + 90); - const qreal spanAngle = (m_progress * 280) * -1; - QPainterPath path; - path.arcMoveTo(rect, startAngle); - path.arcTo(rect, startAngle, spanAngle); - painter->drawPath(path); - - rect.adjust(-pen.widthF() / 2.0, -pen.widthF() / 2.0, pen.widthF() / 2.0, pen.widthF() / 2.0); - pen.setWidth(1); - painter->setPen(pen); - - path = QPainterPath(); - path.arcMoveTo(rect, 0); - path.arcTo(rect, 0, 360); - painter->drawPath(path); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaultdial_p.h b/src/imports/controls/qquickdefaultdial_p.h deleted file mode 100644 index 73e14321..00000000 --- a/src/imports/controls/qquickdefaultdial_p.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTDIAL_P_H -#define QQUICKDEFAULTDIAL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultDial : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - -public: - explicit QQuickDefaultDial(QQuickItem *parent = nullptr); - - qreal progress() const; - void setProgress(qreal progress); - - QColor color() const; - void setColor(const QColor &color); - - void paint(QPainter *painter) override; - -private: - qreal m_progress = 0; - QColor m_color = Qt::black; -}; - -QT_END_NAMESPACE - -#endif // QQUICKDEFAULTDIAL_P_H diff --git a/src/imports/controls/qquickdefaultprogressbar.cpp b/src/imports/controls/qquickdefaultprogressbar.cpp deleted file mode 100644 index f44065e4..00000000 --- a/src/imports/controls/qquickdefaultprogressbar.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultprogressbar_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int Blocks = 4; -static const int BlockWidth = 16; -static const int BlockRestingSpacing = 4; -static const int BlockMovingSpacing = 48; -static const int BlockSpan = Blocks * (BlockWidth + BlockRestingSpacing) - BlockRestingSpacing; -static const int TotalDuration = 4000; -static const int SecondPhaseStart = TotalDuration * 0.4; -static const int ThirdPhaseStart = TotalDuration * 0.6; - -static inline qreal blockStartX(int blockIndex) -{ - return ((blockIndex + 1) * -BlockWidth) - (blockIndex * BlockMovingSpacing); -} - -static inline qreal blockRestX(int blockIndex, qreal availableWidth) -{ - const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2.0; - return spanRightEdgePos - (blockIndex + 1) * BlockWidth - (blockIndex * BlockRestingSpacing); -} - -static inline qreal blockEndX(int blockIndex, qreal availableWidth) -{ - return availableWidth - blockStartX(Blocks - 1 - blockIndex) - BlockWidth; -} - -class QQuickDefaultProgressBarNode : public QQuickAnimatedNode -{ -public: - QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - bool m_indeterminate = false; - qreal m_pixelsPerSecond = 0; -}; - -QQuickDefaultProgressBarNode::QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item) - : QQuickAnimatedNode(item), - m_pixelsPerSecond(item->width()) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); -} - -void QQuickDefaultProgressBarNode::updateCurrentTime(int time) -{ - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < Blocks; ++i) { - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - - QMatrix4x4 m; - const qreal restX = blockRestX(i, m_pixelsPerSecond); - const qreal timeInSeconds = time / 1000.0; - - if (time < SecondPhaseStart) { - // Move into the resting position for the first phase. - QEasingCurve easingCurve(QEasingCurve::InQuad); - const qreal easedCompletion = easingCurve.valueForProgress(time / qreal(SecondPhaseStart)); - const qreal distance = m_pixelsPerSecond * (easedCompletion * (SecondPhaseStart / 1000.0)); - const qreal position = blockStartX(i) + distance; - const qreal destination = restX; - m.translate(qMin(position, destination), 0); - } else if (time < ThirdPhaseStart) { - // Stay in the same position for the second phase. - m.translate(restX, 0); - } else { - // Move out of view for the third phase. - const int thirdPhaseSubKickoff = (BlockMovingSpacing / m_pixelsPerSecond) * 1000; - const int subphase = (time - ThirdPhaseStart) / thirdPhaseSubKickoff; - // If we're not at this subphase yet, don't try to animate movement, - // because it will be incorrect. - if (subphase < i) - return; - - const qreal timeSinceSecondPhase = timeInSeconds - (ThirdPhaseStart / 1000.0); - // We only want to start keeping track of time once our subphase has started, - // otherwise we move too much because we account for time that has already elapsed. - // For example, if we were 60 milliseconds into the third subphase: - // - // 0 ..... 1 ..... 2 ... - // 100 100 60 - // - // i == 0, timeSinceOurKickoff == 260 - // i == 1, timeSinceOurKickoff == 160 - // i == 2, timeSinceOurKickoff == 60 - const qreal timeSinceOurKickoff = timeSinceSecondPhase - (thirdPhaseSubKickoff / 1000.0 * i); - const qreal position = restX + (m_pixelsPerSecond * (timeSinceOurKickoff)); - const qreal destination = blockEndX(i, m_pixelsPerSecond); - m.translate(qMin(position, destination), 0); - } - - transformNode->setMatrix(m); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -void QQuickDefaultProgressBarNode::sync(QQuickItem *item) -{ - QQuickDefaultProgressBar *bar = static_cast(item); - if (m_indeterminate != bar->isIndeterminate()) { - m_indeterminate = bar->isIndeterminate(); - if (m_indeterminate) - start(); - else - stop(); - } - m_pixelsPerSecond = item->width(); - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - - QMatrix4x4 m; - m.translate(0, (item->height() - item->implicitHeight()) / 2); - setMatrix(m); - - if (m_indeterminate) { - if (childCount() != Blocks) { - // This was previously a regular progress bar; remove the old nodes. - removeAllChildNodes(); - } - - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < Blocks; ++i) { - if (!transformNode) { - transformNode = new QSGTransformNode; - appendChildNode(transformNode); - } - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - if (!rectNode) { - rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setColor(bar->color()); - transformNode->appendChildNode(rectNode); - } - - QMatrix4x4 m; - m.translate(blockStartX(i), 0); - transformNode->setMatrix(m); - - rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(BlockWidth, item->implicitHeight()))); - rectNode->update(); - - transformNode = static_cast(transformNode->nextSibling()); - } - } else { - if (childCount() > 1) { - // This was previously an indeterminate progress bar; remove the old nodes. - removeAllChildNodes(); - } - - QSGInternalRectangleNode *rectNode = static_cast(firstChild()); - if (!rectNode) { - rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setColor(bar->color()); - appendChildNode(rectNode); - } - - rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(bar->progress() * item->width(), item->implicitHeight()))); - rectNode->update(); - } -} - -QQuickDefaultProgressBar::QQuickDefaultProgressBar(QQuickItem *parent) : - QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -qreal QQuickDefaultProgressBar::progress() const -{ - return m_progress; -} - -void QQuickDefaultProgressBar::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -bool QQuickDefaultProgressBar::isIndeterminate() const -{ - return m_indeterminate; -} - -void QQuickDefaultProgressBar::setIndeterminate(bool indeterminate) -{ - if (indeterminate == m_indeterminate) - return; - - m_indeterminate = indeterminate; - setClip(m_indeterminate); - update(); -} - -QColor QQuickDefaultProgressBar::color() const -{ - return m_color; -} - -void QQuickDefaultProgressBar::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -void QQuickDefaultProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) - update(); -} - -QSGNode *QQuickDefaultProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickDefaultProgressBarNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { - if (!node) - node = new QQuickDefaultProgressBarNode(this); - node->sync(this); - } else { - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaultprogressbar_p.h b/src/imports/controls/qquickdefaultprogressbar_p.h deleted file mode 100644 index 241d0b3b..00000000 --- a/src/imports/controls/qquickdefaultprogressbar_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTPROGRESSBAR_P_H -#define QQUICKDEFAULTPROGRESSBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultProgressBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - -public: - explicit QQuickDefaultProgressBar(QQuickItem *parent = nullptr); - - bool isIndeterminate() const; - void setIndeterminate(bool indeterminate); - - qreal progress() const; - void setProgress(qreal progress); - - QColor color() const; - void setColor(const QColor &color); - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - qreal m_progress = 0; - bool m_indeterminate = false; - QColor m_color; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickDefaultProgressBar) - -#endif // QQUICKDEFAULTPROGRESSBAR_P_H diff --git a/src/imports/controls/qquickdefaultstyle.cpp b/src/imports/controls/qquickdefaultstyle.cpp deleted file mode 100644 index 15c59798..00000000 --- a/src/imports/controls/qquickdefaultstyle.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultstyle_p.h" - -QT_BEGIN_NAMESPACE - -QQuickDefaultStyle::QQuickDefaultStyle(QObject *parent) : - QObject(parent) -{ -} - -QColor QQuickDefaultStyle::backgroundColor() const -{ - return QColor::fromRgba(0xFFFFFFFF); -} - -QColor QQuickDefaultStyle::overlayModalColor() const -{ - return QColor::fromRgba(0x7F28282A); -} - -QColor QQuickDefaultStyle::overlayDimColor() const -{ - return QColor::fromRgba(0x1F28282A); -} - -QColor QQuickDefaultStyle::textColor() const -{ - return QColor::fromRgba(0xFF353637); -} - -QColor QQuickDefaultStyle::textDarkColor() const -{ - return QColor::fromRgba(0xFF26282A); -} - -QColor QQuickDefaultStyle::textLightColor() const -{ - return QColor::fromRgba(0xFFFFFFFF); -} - -QColor QQuickDefaultStyle::textLinkColor() const -{ - return QColor::fromRgba(0xFF45A7D7); -} - -QColor QQuickDefaultStyle::textSelectionColor() const -{ - return QColor::fromRgba(0xFFFDDD5C); -} - -QColor QQuickDefaultStyle::textDisabledColor() const -{ - return QColor::fromRgba(0xFFBDBEBF); -} - -QColor QQuickDefaultStyle::textDisabledLightColor() const -{ - return QColor::fromRgba(0xFFC2C2C2); -} - -QColor QQuickDefaultStyle::textPlaceholderColor() const -{ - return QColor::fromRgba(0xFF777777); -} - -QColor QQuickDefaultStyle::focusColor() const -{ - return QColor::fromRgba(0xFF0066FF); -} - -QColor QQuickDefaultStyle::focusLightColor() const -{ - return QColor::fromRgba(0xFFF0F6FF); -} - -QColor QQuickDefaultStyle::focusPressedColor() const -{ - return QColor::fromRgba(0xFFCCE0FF); -} - -QColor QQuickDefaultStyle::buttonColor() const -{ - return QColor::fromRgba(0xFFE0E0E0); -} - -QColor QQuickDefaultStyle::buttonPressedColor() const -{ - return QColor::fromRgba(0xFFD0D0D0); -} - -QColor QQuickDefaultStyle::buttonCheckedColor() const -{ - return QColor::fromRgba(0xFF353637); -} - -QColor QQuickDefaultStyle::buttonCheckedPressedColor() const -{ - return QColor::fromRgba(0xFF585A5C); -} - -QColor QQuickDefaultStyle::buttonCheckedFocusColor() const -{ - return QColor::fromRgba(0xFF599BFF); -} - -QColor QQuickDefaultStyle::toolButtonColor() const -{ - return QColor::fromRgba(0x33333333); -} - -QColor QQuickDefaultStyle::tabButtonColor() const -{ - return QColor::fromRgba(0xFF353637); -} - -QColor QQuickDefaultStyle::tabButtonPressedColor() const -{ - return QColor::fromRgba(0xFF585A5C); -} - -QColor QQuickDefaultStyle::tabButtonCheckedPressedColor() const -{ - return QColor::fromRgba(0xFFE4E4E4); -} - -QColor QQuickDefaultStyle::delegateColor() const -{ - return QColor::fromRgba(0xFFEEEEEE); -} - -QColor QQuickDefaultStyle::delegatePressedColor() const -{ - return QColor::fromRgba(0xFFBDBEBF); -} - -QColor QQuickDefaultStyle::delegateFocusColor() const -{ - return QColor::fromRgba(0xFFE5EFFF); -} - -QColor QQuickDefaultStyle::indicatorPressedColor() const -{ - return QColor::fromRgba(0xFFF6F6F6); -} - -QColor QQuickDefaultStyle::indicatorDisabledColor() const -{ - return QColor::fromRgba(0xFFFDFDFD); -} - -QColor QQuickDefaultStyle::indicatorFrameColor() const -{ - return QColor::fromRgba(0xFF909090); -} - -QColor QQuickDefaultStyle::indicatorFramePressedColor() const -{ - return QColor::fromRgba(0xFF808080); -} - -QColor QQuickDefaultStyle::indicatorFrameDisabledColor() const -{ - return QColor::fromRgba(0xFFD6D6D6); -} - -QColor QQuickDefaultStyle::frameDarkColor() const -{ - return QColor::fromRgba(0xFF353637); -} - -QColor QQuickDefaultStyle::frameLightColor() const -{ - return QColor::fromRgba(0xFFBDBEBF); -} - -QColor QQuickDefaultStyle::scrollBarColor() const -{ - return QColor::fromRgba(0xFFBDBEBF); -} - -QColor QQuickDefaultStyle::scrollBarPressedColor() const -{ - return QColor::fromRgba(0xFF28282A); -} - -QColor QQuickDefaultStyle::progressBarColor() const -{ - return QColor::fromRgba(0xFFE4E4E4); -} - -QColor QQuickDefaultStyle::pageIndicatorColor() const -{ - return QColor::fromRgba(0xFF28282A); -} - -QColor QQuickDefaultStyle::separatorColor() const -{ - return QColor::fromRgba(0xFFCCCCCC); -} - -QColor QQuickDefaultStyle::disabledDarkColor() const -{ - return QColor::fromRgba(0xFF353637); -} - -QColor QQuickDefaultStyle::disabledLightColor() const -{ - return QColor::fromRgba(0xFFBDBEBF); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaultstyle_p.h b/src/imports/controls/qquickdefaultstyle_p.h deleted file mode 100644 index fcd489a0..00000000 --- a/src/imports/controls/qquickdefaultstyle_p.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTSTYLE_P_H -#define QQUICKDEFAULTSTYLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultStyle : public QObject -{ - Q_OBJECT - Q_PROPERTY(QColor backgroundColor READ backgroundColor CONSTANT FINAL) - Q_PROPERTY(QColor overlayModalColor READ overlayModalColor CONSTANT FINAL) - Q_PROPERTY(QColor overlayDimColor READ overlayDimColor CONSTANT FINAL) - Q_PROPERTY(QColor textColor READ textColor CONSTANT FINAL) - Q_PROPERTY(QColor textDarkColor READ textDarkColor CONSTANT FINAL) - Q_PROPERTY(QColor textLightColor READ textLightColor CONSTANT FINAL) - Q_PROPERTY(QColor textLinkColor READ textLinkColor CONSTANT FINAL) - Q_PROPERTY(QColor textSelectionColor READ textSelectionColor CONSTANT FINAL) - Q_PROPERTY(QColor textDisabledColor READ textDisabledColor CONSTANT FINAL) - Q_PROPERTY(QColor textDisabledLightColor READ textDisabledLightColor CONSTANT FINAL) - Q_PROPERTY(QColor textPlaceholderColor READ textPlaceholderColor CONSTANT FINAL) - Q_PROPERTY(QColor focusColor READ focusColor CONSTANT FINAL) - Q_PROPERTY(QColor focusLightColor READ focusLightColor CONSTANT FINAL) - Q_PROPERTY(QColor focusPressedColor READ focusPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor buttonColor READ buttonColor CONSTANT FINAL) - Q_PROPERTY(QColor buttonPressedColor READ buttonPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor buttonCheckedColor READ buttonCheckedColor CONSTANT FINAL) - Q_PROPERTY(QColor buttonCheckedPressedColor READ buttonCheckedPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor buttonCheckedFocusColor READ buttonCheckedFocusColor CONSTANT FINAL) - Q_PROPERTY(QColor toolButtonColor READ toolButtonColor CONSTANT FINAL) - Q_PROPERTY(QColor tabButtonColor READ tabButtonColor CONSTANT FINAL) - Q_PROPERTY(QColor tabButtonPressedColor READ tabButtonPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor tabButtonCheckedPressedColor READ tabButtonCheckedPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor delegateColor READ delegateColor CONSTANT FINAL) - Q_PROPERTY(QColor delegatePressedColor READ delegatePressedColor CONSTANT FINAL) - Q_PROPERTY(QColor delegateFocusColor READ delegateFocusColor CONSTANT FINAL) - Q_PROPERTY(QColor indicatorPressedColor READ indicatorPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor indicatorDisabledColor READ indicatorDisabledColor CONSTANT FINAL) - Q_PROPERTY(QColor indicatorFrameColor READ indicatorFrameColor CONSTANT FINAL) - Q_PROPERTY(QColor indicatorFramePressedColor READ indicatorFramePressedColor CONSTANT FINAL) - Q_PROPERTY(QColor indicatorFrameDisabledColor READ indicatorFrameDisabledColor CONSTANT FINAL) - Q_PROPERTY(QColor frameDarkColor READ frameDarkColor CONSTANT FINAL) - Q_PROPERTY(QColor frameLightColor READ frameLightColor CONSTANT FINAL) - Q_PROPERTY(QColor scrollBarColor READ scrollBarColor CONSTANT FINAL) - Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor CONSTANT FINAL) - Q_PROPERTY(QColor progressBarColor READ progressBarColor CONSTANT FINAL) - Q_PROPERTY(QColor pageIndicatorColor READ pageIndicatorColor CONSTANT FINAL) - Q_PROPERTY(QColor separatorColor READ separatorColor CONSTANT FINAL) - Q_PROPERTY(QColor disabledDarkColor READ disabledDarkColor CONSTANT FINAL) - Q_PROPERTY(QColor disabledLightColor READ disabledLightColor CONSTANT FINAL) - -public: - explicit QQuickDefaultStyle(QObject *parent = nullptr); - - QColor backgroundColor() const; - QColor overlayModalColor() const; - QColor overlayDimColor() const; - QColor textColor() const; - QColor textDarkColor() const; - QColor textLightColor() const; - QColor textLinkColor() const; - QColor textSelectionColor() const; - QColor textDisabledColor() const; - QColor textDisabledLightColor() const; - QColor textPlaceholderColor() const; - QColor focusColor() const; - QColor focusLightColor() const; - QColor focusPressedColor() const; - QColor buttonColor() const; - QColor buttonPressedColor() const; - QColor buttonCheckedColor() const; - QColor buttonCheckedPressedColor() const; - QColor buttonCheckedFocusColor() const; - QColor toolButtonColor() const; - QColor tabButtonColor() const; - QColor tabButtonPressedColor() const; - QColor tabButtonCheckedPressedColor() const; - QColor delegateColor() const; - QColor delegatePressedColor() const; - QColor delegateFocusColor() const; - QColor indicatorPressedColor() const; - QColor indicatorDisabledColor() const; - QColor indicatorFrameColor() const; - QColor indicatorFramePressedColor() const; - QColor indicatorFrameDisabledColor() const; - QColor frameDarkColor() const; - QColor frameLightColor() const; - QColor scrollBarColor() const; - QColor scrollBarPressedColor() const; - QColor progressBarColor() const; - QColor pageIndicatorColor() const; - QColor separatorColor() const; - QColor disabledDarkColor() const; - QColor disabledLightColor() const; -}; - -QT_END_NAMESPACE - -#endif // QQUICKDEFAULTSTYLE_P_H diff --git a/src/imports/controls/qquickdefaulttheme.cpp b/src/imports/controls/qquickdefaulttheme.cpp deleted file mode 100644 index 26fb2a2f..00000000 --- a/src/imports/controls/qquickdefaulttheme.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaulttheme_p.h" - -#include - -QT_BEGIN_NAMESPACE - -void QQuickDefaultTheme::initialize(QQuickTheme *theme) -{ - QPalette systemPalette; - - systemPalette.setColor(QPalette::Base, QColor::fromRgba(0xFFFFFFFF)); - systemPalette.setColor(QPalette::Disabled, QPalette::Base, QColor::fromRgba(0xFFD6D6D6)); - - systemPalette.setColor(QPalette::Button, QColor::fromRgba(0xFFE0E0E0)); - - systemPalette.setColor(QPalette::ButtonText, QColor::fromRgba(0xFF26282A)); - systemPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor::fromRgba(0x4D26282A)); - - systemPalette.setColor(QPalette::BrightText, QColor::fromRgba(0xFFFFFFFF)); - systemPalette.setColor(QPalette::Disabled, QPalette::BrightText, QColor::fromRgba(0x4DFFFFFF)); - - systemPalette.setColor(QPalette::Dark, QColor::fromRgba(0xFF353637)); - - systemPalette.setColor(QPalette::Highlight, QColor::fromRgba(0xFF0066FF)); - systemPalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor::fromRgba(0xFFF0F6FF)); - - systemPalette.setColor(QPalette::HighlightedText, QColor::fromRgba(0xFF090909)); - - systemPalette.setColor(QPalette::Light, QColor::fromRgba(0xFFF6F6F6)); - - systemPalette.setColor(QPalette::Link, QColor::fromRgba(0xFF45A7D7)); - - systemPalette.setColor(QPalette::Mid, QColor::fromRgba(0xFFBDBDBD)); - - systemPalette.setColor(QPalette::Midlight, QColor::fromRgba(0xFFE4E4E4)); - - systemPalette.setColor(QPalette::Text, QColor::fromRgba(0xFF353637)); - systemPalette.setColor(QPalette::Disabled, QPalette::Text, QColor::fromRgba(0x7F353637)); - - systemPalette.setColor(QPalette::Shadow, QColor::fromRgba(0xFF28282A)); - - systemPalette.setColor(QPalette::ToolTipBase, QColor::fromRgba(0xFFFFFFFF)); - systemPalette.setColor(QPalette::ToolTipText, QColor::fromRgba(0xFF000000)); - - systemPalette.setColor(QPalette::Window, QColor::fromRgba(0xFFFFFFFF)); - - systemPalette.setColor(QPalette::WindowText, QColor::fromRgba(0xFF26282A)); - systemPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor::fromRgba(0xFFBDBEBF)); - - theme->setPalette(QQuickTheme::System, systemPalette); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaulttheme_p.h b/src/imports/controls/qquickdefaulttheme_p.h deleted file mode 100644 index 3a7311c7..00000000 --- a/src/imports/controls/qquickdefaulttheme_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTTHEME_P_H -#define QQUICKDEFAULTTHEME_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickTheme; - -class QQuickDefaultTheme -{ -public: - static void initialize(QQuickTheme *theme); -}; - -QT_END_NAMESPACE - -#endif // QQUICKDEFAULTTHEME_P_H diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 38fba04e..55a03c36 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include @@ -56,20 +58,13 @@ #include #endif #include -#include #include #include #include -#include "qquickdefaultbusyindicator_p.h" -#include "qquickdefaultdial_p.h" -#include "qquickdefaultprogressbar_p.h" -#include "qquickdefaultstyle_p.h" -#include "qquickdefaulttheme_p.h" - QT_BEGIN_NAMESPACE -class QtQuickControls2Plugin: public QQuickStylePlugin +class QtQuickControls2Plugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) @@ -82,9 +77,6 @@ public: void registerTypes(const char *uri) override; void unregisterTypes() override; - QString name() const override; - void initializeTheme(QQuickTheme *theme) override; - private: void init(); @@ -92,7 +84,7 @@ private: QQuickTheme *createTheme(const QString &name); }; -QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQuickStylePlugin(parent) +QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQmlExtensionPlugin(parent) { } @@ -102,23 +94,16 @@ QtQuickControls2Plugin::~QtQuickControls2Plugin() // initialization and cleanup, as plugins are not unloaded on macOS. } -void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *uri) +void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char */*uri*/) { - QQuickStylePlugin::initializeEngine(engine, uri); + engine->addUrlInterceptor(&QQuickStylePrivate::urlInterceptor); init(); } -static bool isDefaultStyle(const QString &style) -{ - return style.isEmpty() || style.compare(QStringLiteral("Default"), Qt::CaseInsensitive) == 0; -} - void QtQuickControls2Plugin::registerTypes(const char *uri) { QQuickStylePrivate::init(baseUrl()); - QQuickStylePlugin::registerTypes(uri); - const QString style = QQuickStyle::name(); if (!style.isEmpty()) QFileSelectorPrivate::addStatics(QStringList() << style.toLower()); @@ -135,20 +120,12 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) qmlRegisterModule(import, 2, 15); // QtQuick.Controls.impl 2.0 (Qt 5.7) - qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); - qmlRegisterType(import, 2, 0, "DialImpl"); qmlRegisterType(import, 2, 0, "PaddedRectangle"); - qmlRegisterType(import, 2, 0, "ProgressBarImpl"); // QtQuick.Controls.impl 2.1 (Qt 5.8) #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) qmlRegisterType(import, 2, 1, "TumblerView"); #endif - qmlRegisterSingletonType(import, 2, 1, "Default", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - return new QQuickDefaultStyle; - }); // QtQuick.Controls.impl 2.2 (Qt 5.9) qmlRegisterType(import, 2, 2, "ClippedText"); @@ -171,26 +148,13 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) void QtQuickControls2Plugin::unregisterTypes() { - QQuickStylePlugin::unregisterTypes(); QQuickStylePrivate::reset(); } -QString QtQuickControls2Plugin::name() const -{ - return QStringLiteral("Default"); -} - -void QtQuickControls2Plugin::initializeTheme(QQuickTheme *theme) -{ - QQuickDefaultTheme::initialize(theme); -} - void QtQuickControls2Plugin::init() { const QString style = QQuickStyle::name(); - QQuickTheme *theme = createTheme(style.isEmpty() ? name() : style); - if (isDefaultStyle(style)) - initializeTheme(theme); + QQuickTheme *theme = createTheme(style.isEmpty() ? QLatin1String("Default") : style); // load the style's plugins to get access to its resources and initialize the theme QList stylePlugins = loadStylePlugins(); diff --git a/src/imports/controls/qtquickcontrols2plugin.qrc b/src/imports/controls/qtquickcontrols2plugin.qrc deleted file mode 100644 index c2dd9d39..00000000 --- a/src/imports/controls/qtquickcontrols2plugin.qrc +++ /dev/null @@ -1,24 +0,0 @@ - - - images/arrow-indicator.png - images/arrow-indicator@2x.png - images/arrow-indicator@3x.png - images/arrow-indicator@4x.png - images/check.png - images/check@2x.png - images/check@3x.png - images/check@4x.png - images/dial-indicator.png - images/dial-indicator@2x.png - images/dial-indicator@3x.png - images/dial-indicator@4x.png - images/drop-indicator.png - images/drop-indicator@2x.png - images/drop-indicator@3x.png - images/drop-indicator@4x.png - images/double-arrow.png - images/double-arrow@2x.png - images/double-arrow@3x.png - images/double-arrow@4x.png - - diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 2345616e..387418de 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -5,6 +5,7 @@ SUBDIRS += \ templates SUBDIRS += \ + controls/default/default.pro \ controls/fusion/fusion.pro \ controls/imagine/imagine.pro \ controls/material/material.pro \ diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp index 067d8dff..b387b378 100644 --- a/src/quickcontrols2/qquickstyleplugin.cpp +++ b/src/quickcontrols2/qquickstyleplugin.cpp @@ -57,13 +57,4 @@ QString QQuickStylePlugin::name() const return QString(); } -void QQuickStylePlugin::initializeTheme(QQuickTheme *theme) -{ - Q_UNUSED(theme); -} - -void QQuickStylePlugin::registerTypes(const char */*uri*/) -{ -} - QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleplugin_p.h b/src/quickcontrols2/qquickstyleplugin_p.h index a9700c15..f5c5705c 100644 --- a/src/quickcontrols2/qquickstyleplugin_p.h +++ b/src/quickcontrols2/qquickstyleplugin_p.h @@ -64,7 +64,7 @@ public: ~QQuickStylePlugin(); virtual QString name() const; - virtual void initializeTheme(QQuickTheme *theme); + virtual void initializeTheme(QQuickTheme *theme) = 0; void registerTypes(const char *uri) override; diff --git a/src/quickcontrols2/quickcontrols2.pro b/src/quickcontrols2/quickcontrols2.pro index 8aec9953..5a11dcd2 100644 --- a/src/quickcontrols2/quickcontrols2.pro +++ b/src/quickcontrols2/quickcontrols2.pro @@ -11,4 +11,11 @@ HEADERS += \ $$PWD/qtquickcontrols2global_p.h include(quickcontrols2.pri) + +QMLTYPES_FILENAME = plugins.qmltypes +QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls.2 +QML_IMPORT_NAME = QtQuick.Controls +QML_IMPORT_VERSION = 2.15 +CONFIG += qmltypes install_qmltypes install_metatypes + load(qt_module) -- cgit v1.2.3 From 5246dd2de211ffb81313a5c29ae7894545a28c43 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 27 Mar 2020 11:17:35 +0100 Subject: Register C++ types declaratively Adapt to the new way of registering C++ types. The types need to be seen at compile time so that code can be generated that invokes them. This patch: - Adds QML_* macros where applicable. - Adapts the build system files to the new way of registering modules. - Splits up the QtQuick.Controls[.*].impl files into their own plugins, as we can only register one QML module per .pro file. - Removes C++ type registration calls in every plugin. - Moves private types from src/quickcontrols2/quickcontrols2.pro to src/quickcontrols2/impl/quickcontrols2-impl.pro. Some of these types need to be exposed to QML, but quickcontrols2.pro is already in use to declare the QtQuick.Controls import (and also provides the public C++ QQuickStyle API), and the new QML_IMPORT_NAME/VERSION syntax only allows one module per project. As some of the types that need to be exposed to QML are also referenced by some C++ code (e.g. tests, etc.), we just move all of the private types to the new library. Follow-up patches will register the QML types declaratively. Task-number: QTBUG-82922 Change-Id: Iaf9ee106237d61701d57a8896f3822304c8151a6 Reviewed-by: Ulf Hermann --- src/imports/controls/.prev_CMakeLists.txt | 6 +- src/imports/controls/CMakeLists.txt | 6 +- src/imports/controls/controls.pro | 2 +- src/imports/controls/default/BusyIndicator.qml | 2 +- src/imports/controls/default/Dial.qml | 1 + src/imports/controls/default/ProgressBar.qml | 2 +- src/imports/controls/default/default.pri | 6 - src/imports/controls/default/impl/default-impl.pro | 30 + src/imports/controls/default/impl/qmldir | 5 + .../default/impl/qquickdefaultbusyindicator.cpp | 223 +++++++ .../default/impl/qquickdefaultbusyindicator_p.h | 93 +++ .../controls/default/impl/qquickdefaultdial.cpp | 122 ++++ .../controls/default/impl/qquickdefaultdial_p.h | 82 +++ .../default/impl/qquickdefaultprogressbar.cpp | 280 +++++++++ .../default/impl/qquickdefaultprogressbar_p.h | 91 +++ .../qtquickcontrols2defaultstyleimplplugin.cpp | 57 ++ .../default/qquickdefaultbusyindicator.cpp | 223 ------- .../default/qquickdefaultbusyindicator_p.h | 91 --- src/imports/controls/default/qquickdefaultdial.cpp | 122 ---- src/imports/controls/default/qquickdefaultdial_p.h | 80 --- .../controls/default/qquickdefaultprogressbar.cpp | 280 --------- .../controls/default/qquickdefaultprogressbar_p.h | 89 --- .../controls/default/qquickdefaultstyle_p.h | 4 + .../default/qtquickcontrols2defaultstyleplugin.cpp | 33 +- .../doc/src/qtquickcontrols2-environment.qdoc | 2 +- src/imports/controls/fusion/.prev_CMakeLists.txt | 6 +- src/imports/controls/fusion/ButtonPanel.qml | 77 --- src/imports/controls/fusion/CMakeLists.txt | 6 +- src/imports/controls/fusion/CheckIndicator.qml | 92 --- src/imports/controls/fusion/ComboBox.qml | 2 +- src/imports/controls/fusion/MenuItem.qml | 2 +- src/imports/controls/fusion/ProgressBar.qml | 2 +- src/imports/controls/fusion/RadioIndicator.qml | 78 --- src/imports/controls/fusion/SliderGroove.qml | 94 --- src/imports/controls/fusion/SliderHandle.qml | 86 --- src/imports/controls/fusion/SpinBox.qml | 4 +- src/imports/controls/fusion/SwitchIndicator.qml | 137 ----- src/imports/controls/fusion/fusion.pri | 12 - src/imports/controls/fusion/impl/ButtonPanel.qml | 77 +++ .../controls/fusion/impl/CheckIndicator.qml | 92 +++ .../controls/fusion/impl/RadioIndicator.qml | 78 +++ src/imports/controls/fusion/impl/SliderGroove.qml | 94 +++ src/imports/controls/fusion/impl/SliderHandle.qml | 86 +++ .../controls/fusion/impl/SwitchIndicator.qml | 137 +++++ src/imports/controls/fusion/impl/fusion-impl.pro | 39 ++ src/imports/controls/fusion/impl/qmldir | 3 + .../fusion/impl/qquickfusionbusyindicator.cpp | 111 ++++ .../fusion/impl/qquickfusionbusyindicator_p.h | 84 +++ .../controls/fusion/impl/qquickfusiondial.cpp | 139 +++++ .../controls/fusion/impl/qquickfusiondial_p.h | 76 +++ .../controls/fusion/impl/qquickfusionknob.cpp | 88 +++ .../controls/fusion/impl/qquickfusionknob_p.h | 69 +++ .../impl/qtquickcontrols2fusionstyleimplplugin.cpp | 57 ++ .../controls/fusion/qquickfusionbusyindicator.cpp | 111 ---- .../controls/fusion/qquickfusionbusyindicator_p.h | 82 --- src/imports/controls/fusion/qquickfusiondial.cpp | 139 ----- src/imports/controls/fusion/qquickfusiondial_p.h | 74 --- src/imports/controls/fusion/qquickfusionknob.cpp | 88 --- src/imports/controls/fusion/qquickfusionknob_p.h | 67 --- src/imports/controls/fusion/qquickfusionstyle_p.h | 4 + .../fusion/qtquickcontrols2fusionstyle.qrc | 2 +- .../fusion/qtquickcontrols2fusionstyleplugin.cpp | 21 +- src/imports/controls/imagine/.prev_CMakeLists.txt | 6 +- src/imports/controls/imagine/CMakeLists.txt | 6 +- src/imports/controls/imagine/OpacityMask.qml | 68 --- src/imports/controls/imagine/imagine.pri | 21 +- src/imports/controls/imagine/imagine.pro | 9 +- src/imports/controls/imagine/impl/OpacityMask.qml | 68 +++ src/imports/controls/imagine/impl/imagine-impl.pro | 39 ++ src/imports/controls/imagine/impl/qmldir | 6 + .../controls/imagine/impl/qquickimageselector.cpp | 338 +++++++++++ .../controls/imagine/impl/qquickimageselector_p.h | 157 +++++ .../controls/imagine/impl/qquickninepatchimage.cpp | 457 +++++++++++++++ .../controls/imagine/impl/qquickninepatchimage_p.h | 108 ++++ .../qtquickcontrols2imaginestyleimplplugin.cpp | 57 ++ .../impl/shaders/+glslcore/OpacityMask.frag | 13 + .../imagine/impl/shaders/+qsb/OpacityMask.frag | Bin 0 -> 1409 bytes .../controls/imagine/impl/shaders/OpacityMask.frag | 7 + .../imagine/impl/shaders/OpacityMask_rhi.frag | 17 + .../controls/imagine/impl/shaders/compile.bat | 40 ++ .../controls/imagine/qquickimageselector.cpp | 338 ----------- .../controls/imagine/qquickimageselector_p.h | 151 ----- .../controls/imagine/qquickimaginestyle.cpp | 4 +- .../controls/imagine/qquickimaginestyle_p.h | 6 +- .../controls/imagine/qquickninepatchimage.cpp | 457 --------------- .../controls/imagine/qquickninepatchimage_p.h | 106 ---- .../imagine/qtquickcontrols2imaginestyleplugin.cpp | 25 +- .../imagine/shaders/+glslcore/OpacityMask.frag | 13 - .../controls/imagine/shaders/+qsb/OpacityMask.frag | Bin 1409 -> 0 bytes .../controls/imagine/shaders/OpacityMask.frag | 7 - .../controls/imagine/shaders/OpacityMask_rhi.frag | 17 - src/imports/controls/imagine/shaders/compile.bat | 40 -- src/imports/controls/material/.prev_CMakeLists.txt | 6 +- src/imports/controls/material/BoxShadow.qml | 70 --- src/imports/controls/material/CMakeLists.txt | 6 +- src/imports/controls/material/CheckIndicator.qml | 120 ---- src/imports/controls/material/ComboBox.qml | 2 +- src/imports/controls/material/CursorDelegate.qml | 65 --- src/imports/controls/material/ElevationEffect.qml | 279 --------- src/imports/controls/material/MenuItem.qml | 2 +- src/imports/controls/material/RadioIndicator.qml | 62 -- src/imports/controls/material/RectangularGlow.qml | 240 -------- src/imports/controls/material/SliderHandle.qml | 76 --- src/imports/controls/material/SwitchIndicator.qml | 81 --- src/imports/controls/material/impl/BoxShadow.qml | 70 +++ .../controls/material/impl/CheckIndicator.qml | 120 ++++ .../controls/material/impl/CursorDelegate.qml | 65 +++ .../controls/material/impl/ElevationEffect.qml | 279 +++++++++ .../controls/material/impl/RadioIndicator.qml | 62 ++ .../controls/material/impl/RectangularGlow.qml | 240 ++++++++ .../controls/material/impl/SliderHandle.qml | 76 +++ .../controls/material/impl/SwitchIndicator.qml | 81 +++ .../controls/material/impl/material-impl.pro | 41 ++ src/imports/controls/material/impl/qmldir | 3 + .../material/impl/qquickmaterialbusyindicator.cpp | 245 ++++++++ .../material/impl/qquickmaterialbusyindicator_p.h | 88 +++ .../material/impl/qquickmaterialprogressbar.cpp | 245 ++++++++ .../material/impl/qquickmaterialprogressbar_p.h | 91 +++ .../material/impl/qquickmaterialripple.cpp | 442 ++++++++++++++ .../material/impl/qquickmaterialripple_p.h | 120 ++++ .../qtquickcontrols2materialstyleimplplugin.cpp | 57 ++ src/imports/controls/material/material.pri | 14 - src/imports/controls/material/material.pro | 2 +- .../material/qquickmaterialbusyindicator.cpp | 245 -------- .../material/qquickmaterialbusyindicator_p.h | 86 --- .../material/qquickmaterialprogressbar.cpp | 245 -------- .../material/qquickmaterialprogressbar_p.h | 89 --- .../controls/material/qquickmaterialripple.cpp | 442 -------------- .../controls/material/qquickmaterialripple_p.h | 118 ---- .../controls/material/qquickmaterialstyle_p.h | 7 +- .../qtquickcontrols2materialstyleplugin.cpp | 11 +- .../qtquickcontrols2materialstyleplugin.qrc | 2 +- src/imports/controls/qtquickcontrols2plugin.cpp | 22 +- .../controls/universal/.prev_CMakeLists.txt | 6 +- src/imports/controls/universal/CMakeLists.txt | 6 +- src/imports/controls/universal/CheckIndicator.qml | 82 --- src/imports/controls/universal/ComboBox.qml | 2 +- src/imports/controls/universal/MenuItem.qml | 4 +- src/imports/controls/universal/RadioIndicator.qml | 80 --- src/imports/controls/universal/SpinBox.qml | 4 +- src/imports/controls/universal/SwitchIndicator.qml | 81 --- .../controls/universal/impl/CheckIndicator.qml | 82 +++ .../controls/universal/impl/RadioIndicator.qml | 80 +++ .../controls/universal/impl/SwitchIndicator.qml | 81 +++ src/imports/controls/universal/impl/qmldir | 3 + .../impl/qquickuniversalbusyindicator.cpp | 251 ++++++++ .../impl/qquickuniversalbusyindicator_p.h | 89 +++ .../impl/qquickuniversalfocusrectangle.cpp | 84 +++ .../impl/qquickuniversalfocusrectangle_p.h | 69 +++ .../universal/impl/qquickuniversalprogressbar.cpp | 338 +++++++++++ .../universal/impl/qquickuniversalprogressbar_p.h | 91 +++ .../qtquickcontrols2universalstyleimplplugin.cpp | 57 ++ .../controls/universal/impl/universal-impl.pro | 36 ++ .../universal/qquickuniversalbusyindicator.cpp | 251 -------- .../universal/qquickuniversalbusyindicator_p.h | 87 --- .../universal/qquickuniversalfocusrectangle.cpp | 84 --- .../universal/qquickuniversalfocusrectangle_p.h | 67 --- .../universal/qquickuniversalprogressbar.cpp | 338 ----------- .../universal/qquickuniversalprogressbar_p.h | 89 --- .../controls/universal/qquickuniversalstyle_p.h | 7 +- .../qtquickcontrols2universalstyleplugin.cpp | 12 +- .../qtquickcontrols2universalstyleplugin.qrc | 2 +- src/imports/controls/universal/universal.pri | 25 +- src/imports/controls/universal/universal.pro | 2 +- src/imports/controlsimpl/controlsimpl.pro | 17 + src/imports/controlsimpl/qmldir | 4 + .../controlsimpl/qtquickcontrols2implplugin.cpp | 59 ++ src/imports/imports.pro | 8 +- src/imports/platform/qquickplatformmenu_p.h | 4 +- src/imports/platform/qquickplatformmenuitem_p.h | 4 +- .../platform/qquickplatformsystemtrayicon_p.h | 8 +- src/imports/templates/CMakeLists.txt | 4 +- src/imports/templates/qtquicktemplates2plugin.cpp | 280 +-------- src/imports/templates/templates.pro | 4 +- src/quickcontrols2/qquickanimatednode.cpp | 167 ------ src/quickcontrols2/qquickanimatednode_p.h | 112 ---- src/quickcontrols2/qquickattachedobject.cpp | 274 --------- src/quickcontrols2/qquickattachedobject_p.h | 84 --- src/quickcontrols2/qquickchecklabel.cpp | 49 -- src/quickcontrols2/qquickchecklabel_p.h | 68 --- src/quickcontrols2/qquickclippedtext.cpp | 116 ---- src/quickcontrols2/qquickclippedtext_p.h | 96 --- src/quickcontrols2/qquickcolor.cpp | 66 --- src/quickcontrols2/qquickcolor_p.h | 70 --- src/quickcontrols2/qquickcolorimage.cpp | 103 ---- src/quickcontrols2/qquickcolorimage_p.h | 88 --- src/quickcontrols2/qquickiconimage.cpp | 213 ------- src/quickcontrols2/qquickiconimage_p.h | 94 --- src/quickcontrols2/qquickiconimage_p_p.h | 77 --- src/quickcontrols2/qquickiconlabel.cpp | 642 --------------------- src/quickcontrols2/qquickiconlabel_p.h | 140 ----- src/quickcontrols2/qquickiconlabel_p_p.h | 111 ---- src/quickcontrols2/qquickitemgroup.cpp | 122 ---- src/quickcontrols2/qquickitemgroup_p.h | 83 --- src/quickcontrols2/qquickmnemoniclabel.cpp | 132 ----- src/quickcontrols2/qquickmnemoniclabel_p.h | 82 --- src/quickcontrols2/qquickpaddedrectangle.cpp | 211 ------- src/quickcontrols2/qquickpaddedrectangle_p.h | 119 ---- src/quickcontrols2/qquickplaceholdertext.cpp | 73 --- src/quickcontrols2/qquickplaceholdertext_p.h | 74 --- src/quickcontrols2/qquickstyle.cpp | 4 +- src/quickcontrols2/qquickstyle_p.h | 4 +- src/quickcontrols2/qquickstyleplugin.cpp | 3 +- src/quickcontrols2/qquickstyleplugin_p.h | 4 +- src/quickcontrols2/qquicktumblerview.cpp | 320 ---------- src/quickcontrols2/qquicktumblerview_p.h | 109 ---- src/quickcontrols2/qtquickcontrols2global_p.h | 56 -- src/quickcontrols2/quickcontrols2.pri | 41 -- src/quickcontrols2/quickcontrols2.pro | 10 +- src/quickcontrols2impl/qquickanimatednode.cpp | 167 ++++++ src/quickcontrols2impl/qquickanimatednode_p.h | 112 ++++ src/quickcontrols2impl/qquickattachedobject.cpp | 274 +++++++++ src/quickcontrols2impl/qquickattachedobject_p.h | 84 +++ src/quickcontrols2impl/qquickchecklabel.cpp | 49 ++ src/quickcontrols2impl/qquickchecklabel_p.h | 78 +++ src/quickcontrols2impl/qquickclippedtext.cpp | 116 ++++ src/quickcontrols2impl/qquickclippedtext_p.h | 98 ++++ src/quickcontrols2impl/qquickcolor.cpp | 66 +++ src/quickcontrols2impl/qquickcolor_p.h | 74 +++ src/quickcontrols2impl/qquickcolorimage.cpp | 103 ++++ src/quickcontrols2impl/qquickcolorimage_p.h | 90 +++ src/quickcontrols2impl/qquickiconimage.cpp | 213 +++++++ src/quickcontrols2impl/qquickiconimage_p.h | 96 +++ src/quickcontrols2impl/qquickiconimage_p_p.h | 77 +++ src/quickcontrols2impl/qquickiconlabel.cpp | 642 +++++++++++++++++++++ src/quickcontrols2impl/qquickiconlabel_p.h | 142 +++++ src/quickcontrols2impl/qquickiconlabel_p_p.h | 111 ++++ src/quickcontrols2impl/qquickitemgroup.cpp | 122 ++++ src/quickcontrols2impl/qquickitemgroup_p.h | 85 +++ src/quickcontrols2impl/qquickmnemoniclabel.cpp | 132 +++++ src/quickcontrols2impl/qquickmnemoniclabel_p.h | 84 +++ src/quickcontrols2impl/qquickpaddedrectangle.cpp | 211 +++++++ src/quickcontrols2impl/qquickpaddedrectangle_p.h | 121 ++++ src/quickcontrols2impl/qquickplaceholdertext.cpp | 73 +++ src/quickcontrols2impl/qquickplaceholdertext_p.h | 76 +++ src/quickcontrols2impl/qquicktumblerview.cpp | 320 ++++++++++ src/quickcontrols2impl/qquicktumblerview_p.h | 111 ++++ src/quickcontrols2impl/qtquickcontrols2foreign_p.h | 76 +++ .../qtquickcontrols2implglobal_p.h | 67 +++ src/quickcontrols2impl/quickcontrols2impl.pro | 54 ++ src/quicktemplates2/qquickabstractbutton_p.h | 40 +- src/quicktemplates2/qquickaction_p.h | 2 + src/quicktemplates2/qquickactiongroup_p.h | 3 + src/quicktemplates2/qquickapplicationwindow_p.h | 36 +- src/quicktemplates2/qquickbusyindicator_p.h | 2 + src/quicktemplates2/qquickbutton_p.h | 2 + src/quicktemplates2/qquickbuttongroup_p.h | 13 +- src/quicktemplates2/qquickcheckbox_p.h | 6 +- src/quicktemplates2/qquickcheckdelegate_p.h | 6 +- src/quicktemplates2/qquickcombobox_p.h | 62 +- src/quicktemplates2/qquickcontainer_p.h | 16 +- src/quicktemplates2/qquickcontrol_p.h | 57 +- src/quicktemplates2/qquickdelaybutton_p.h | 2 + src/quicktemplates2/qquickdial_p.h | 12 +- src/quicktemplates2/qquickdialog_p.h | 24 +- src/quicktemplates2/qquickdialogbuttonbox_p.h | 13 +- src/quicktemplates2/qquickdrawer_p.h | 6 +- src/quicktemplates2/qquickframe_p.h | 2 + src/quicktemplates2/qquickgroupbox_p.h | 10 +- src/quicktemplates2/qquickheaderview_p.h | 12 + src/quicktemplates2/qquickicon_p.h | 3 + src/quicktemplates2/qquickitemdelegate_p.h | 2 + src/quicktemplates2/qquicklabel_p.h | 34 +- src/quicktemplates2/qquickmenu_p.h | 48 +- src/quicktemplates2/qquickmenubar_p.h | 2 + src/quicktemplates2/qquickmenubaritem_p.h | 2 + src/quicktemplates2/qquickmenuitem_p.h | 14 +- src/quicktemplates2/qquickmenuseparator_p.h | 2 + src/quicktemplates2/qquickoverlay_p.h | 4 + src/quicktemplates2/qquickpage_p.h | 14 +- src/quicktemplates2/qquickpageindicator_p.h | 2 + src/quicktemplates2/qquickpane_p.h | 2 + src/quicktemplates2/qquickpopup_p.h | 62 +- src/quicktemplates2/qquickpopupanchors_p.h | 2 + src/quicktemplates2/qquickprogressbar_p.h | 2 + src/quicktemplates2/qquickradiobutton_p.h | 2 + src/quicktemplates2/qquickradiodelegate_p.h | 2 + src/quicktemplates2/qquickrangeslider_p.h | 32 +- src/quicktemplates2/qquickroundbutton_p.h | 2 + src/quicktemplates2/qquickscrollbar_p.h | 31 +- src/quicktemplates2/qquickscrollindicator_p.h | 19 +- src/quicktemplates2/qquickscrollview_p.h | 2 + src/quicktemplates2/qquickslider_p.h | 26 +- src/quicktemplates2/qquickspinbox_p.h | 34 +- src/quicktemplates2/qquicksplitview_p.h | 7 + src/quicktemplates2/qquickstackview_p.h | 21 +- src/quicktemplates2/qquickswipe_p.h | 20 +- src/quicktemplates2/qquickswipedelegate_p.h | 3 + src/quicktemplates2/qquickswipeview_p.h | 23 +- src/quicktemplates2/qquickswitch_p.h | 2 + src/quicktemplates2/qquickswitchdelegate_p.h | 2 + src/quicktemplates2/qquicktabbar_p.h | 7 +- src/quicktemplates2/qquicktabbutton_p.h | 2 + src/quicktemplates2/qquicktextarea_p.h | 50 +- src/quicktemplates2/qquicktextfield_p.h | 50 +- src/quicktemplates2/qquicktoolbar_p.h | 2 + src/quicktemplates2/qquicktoolbutton_p.h | 2 + src/quicktemplates2/qquicktoolseparator_p.h | 2 + src/quicktemplates2/qquicktooltip_p.h | 7 +- src/quicktemplates2/qquicktumbler_p.h | 13 +- src/quicktemplates2/qtquicktemplates2global_p.h | 2 + src/quicktemplates2/quicktemplates2.pro | 6 + src/src.pro | 4 +- 303 files changed, 12025 insertions(+), 11440 deletions(-) create mode 100644 src/imports/controls/default/impl/default-impl.pro create mode 100644 src/imports/controls/default/impl/qmldir create mode 100644 src/imports/controls/default/impl/qquickdefaultbusyindicator.cpp create mode 100644 src/imports/controls/default/impl/qquickdefaultbusyindicator_p.h create mode 100644 src/imports/controls/default/impl/qquickdefaultdial.cpp create mode 100644 src/imports/controls/default/impl/qquickdefaultdial_p.h create mode 100644 src/imports/controls/default/impl/qquickdefaultprogressbar.cpp create mode 100644 src/imports/controls/default/impl/qquickdefaultprogressbar_p.h create mode 100644 src/imports/controls/default/impl/qtquickcontrols2defaultstyleimplplugin.cpp delete mode 100644 src/imports/controls/default/qquickdefaultbusyindicator.cpp delete mode 100644 src/imports/controls/default/qquickdefaultbusyindicator_p.h delete mode 100644 src/imports/controls/default/qquickdefaultdial.cpp delete mode 100644 src/imports/controls/default/qquickdefaultdial_p.h delete mode 100644 src/imports/controls/default/qquickdefaultprogressbar.cpp delete mode 100644 src/imports/controls/default/qquickdefaultprogressbar_p.h delete mode 100644 src/imports/controls/fusion/ButtonPanel.qml delete mode 100644 src/imports/controls/fusion/CheckIndicator.qml delete mode 100644 src/imports/controls/fusion/RadioIndicator.qml delete mode 100644 src/imports/controls/fusion/SliderGroove.qml delete mode 100644 src/imports/controls/fusion/SliderHandle.qml delete mode 100644 src/imports/controls/fusion/SwitchIndicator.qml create mode 100644 src/imports/controls/fusion/impl/ButtonPanel.qml create mode 100644 src/imports/controls/fusion/impl/CheckIndicator.qml create mode 100644 src/imports/controls/fusion/impl/RadioIndicator.qml create mode 100644 src/imports/controls/fusion/impl/SliderGroove.qml create mode 100644 src/imports/controls/fusion/impl/SliderHandle.qml create mode 100644 src/imports/controls/fusion/impl/SwitchIndicator.qml create mode 100644 src/imports/controls/fusion/impl/fusion-impl.pro create mode 100644 src/imports/controls/fusion/impl/qmldir create mode 100644 src/imports/controls/fusion/impl/qquickfusionbusyindicator.cpp create mode 100644 src/imports/controls/fusion/impl/qquickfusionbusyindicator_p.h create mode 100644 src/imports/controls/fusion/impl/qquickfusiondial.cpp create mode 100644 src/imports/controls/fusion/impl/qquickfusiondial_p.h create mode 100644 src/imports/controls/fusion/impl/qquickfusionknob.cpp create mode 100644 src/imports/controls/fusion/impl/qquickfusionknob_p.h create mode 100644 src/imports/controls/fusion/impl/qtquickcontrols2fusionstyleimplplugin.cpp delete mode 100644 src/imports/controls/fusion/qquickfusionbusyindicator.cpp delete mode 100644 src/imports/controls/fusion/qquickfusionbusyindicator_p.h delete mode 100644 src/imports/controls/fusion/qquickfusiondial.cpp delete mode 100644 src/imports/controls/fusion/qquickfusiondial_p.h delete mode 100644 src/imports/controls/fusion/qquickfusionknob.cpp delete mode 100644 src/imports/controls/fusion/qquickfusionknob_p.h delete mode 100644 src/imports/controls/imagine/OpacityMask.qml create mode 100644 src/imports/controls/imagine/impl/OpacityMask.qml create mode 100644 src/imports/controls/imagine/impl/imagine-impl.pro create mode 100644 src/imports/controls/imagine/impl/qmldir create mode 100644 src/imports/controls/imagine/impl/qquickimageselector.cpp create mode 100644 src/imports/controls/imagine/impl/qquickimageselector_p.h create mode 100644 src/imports/controls/imagine/impl/qquickninepatchimage.cpp create mode 100644 src/imports/controls/imagine/impl/qquickninepatchimage_p.h create mode 100644 src/imports/controls/imagine/impl/qtquickcontrols2imaginestyleimplplugin.cpp create mode 100644 src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag create mode 100644 src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag create mode 100644 src/imports/controls/imagine/impl/shaders/OpacityMask.frag create mode 100644 src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag create mode 100644 src/imports/controls/imagine/impl/shaders/compile.bat delete mode 100644 src/imports/controls/imagine/qquickimageselector.cpp delete mode 100644 src/imports/controls/imagine/qquickimageselector_p.h delete mode 100644 src/imports/controls/imagine/qquickninepatchimage.cpp delete mode 100644 src/imports/controls/imagine/qquickninepatchimage_p.h delete mode 100644 src/imports/controls/imagine/shaders/+glslcore/OpacityMask.frag delete mode 100644 src/imports/controls/imagine/shaders/+qsb/OpacityMask.frag delete mode 100644 src/imports/controls/imagine/shaders/OpacityMask.frag delete mode 100644 src/imports/controls/imagine/shaders/OpacityMask_rhi.frag delete mode 100644 src/imports/controls/imagine/shaders/compile.bat delete mode 100644 src/imports/controls/material/BoxShadow.qml delete mode 100644 src/imports/controls/material/CheckIndicator.qml delete mode 100644 src/imports/controls/material/CursorDelegate.qml delete mode 100644 src/imports/controls/material/ElevationEffect.qml delete mode 100644 src/imports/controls/material/RadioIndicator.qml delete mode 100644 src/imports/controls/material/RectangularGlow.qml delete mode 100644 src/imports/controls/material/SliderHandle.qml delete mode 100644 src/imports/controls/material/SwitchIndicator.qml create mode 100644 src/imports/controls/material/impl/BoxShadow.qml create mode 100644 src/imports/controls/material/impl/CheckIndicator.qml create mode 100644 src/imports/controls/material/impl/CursorDelegate.qml create mode 100644 src/imports/controls/material/impl/ElevationEffect.qml create mode 100644 src/imports/controls/material/impl/RadioIndicator.qml create mode 100644 src/imports/controls/material/impl/RectangularGlow.qml create mode 100644 src/imports/controls/material/impl/SliderHandle.qml create mode 100644 src/imports/controls/material/impl/SwitchIndicator.qml create mode 100644 src/imports/controls/material/impl/material-impl.pro create mode 100644 src/imports/controls/material/impl/qmldir create mode 100644 src/imports/controls/material/impl/qquickmaterialbusyindicator.cpp create mode 100644 src/imports/controls/material/impl/qquickmaterialbusyindicator_p.h create mode 100644 src/imports/controls/material/impl/qquickmaterialprogressbar.cpp create mode 100644 src/imports/controls/material/impl/qquickmaterialprogressbar_p.h create mode 100644 src/imports/controls/material/impl/qquickmaterialripple.cpp create mode 100644 src/imports/controls/material/impl/qquickmaterialripple_p.h create mode 100644 src/imports/controls/material/impl/qtquickcontrols2materialstyleimplplugin.cpp delete mode 100644 src/imports/controls/material/qquickmaterialbusyindicator.cpp delete mode 100644 src/imports/controls/material/qquickmaterialbusyindicator_p.h delete mode 100644 src/imports/controls/material/qquickmaterialprogressbar.cpp delete mode 100644 src/imports/controls/material/qquickmaterialprogressbar_p.h delete mode 100644 src/imports/controls/material/qquickmaterialripple.cpp delete mode 100644 src/imports/controls/material/qquickmaterialripple_p.h delete mode 100644 src/imports/controls/universal/CheckIndicator.qml delete mode 100644 src/imports/controls/universal/RadioIndicator.qml delete mode 100644 src/imports/controls/universal/SwitchIndicator.qml create mode 100644 src/imports/controls/universal/impl/CheckIndicator.qml create mode 100644 src/imports/controls/universal/impl/RadioIndicator.qml create mode 100644 src/imports/controls/universal/impl/SwitchIndicator.qml create mode 100644 src/imports/controls/universal/impl/qmldir create mode 100644 src/imports/controls/universal/impl/qquickuniversalbusyindicator.cpp create mode 100644 src/imports/controls/universal/impl/qquickuniversalbusyindicator_p.h create mode 100644 src/imports/controls/universal/impl/qquickuniversalfocusrectangle.cpp create mode 100644 src/imports/controls/universal/impl/qquickuniversalfocusrectangle_p.h create mode 100644 src/imports/controls/universal/impl/qquickuniversalprogressbar.cpp create mode 100644 src/imports/controls/universal/impl/qquickuniversalprogressbar_p.h create mode 100644 src/imports/controls/universal/impl/qtquickcontrols2universalstyleimplplugin.cpp create mode 100644 src/imports/controls/universal/impl/universal-impl.pro delete mode 100644 src/imports/controls/universal/qquickuniversalbusyindicator.cpp delete mode 100644 src/imports/controls/universal/qquickuniversalbusyindicator_p.h delete mode 100644 src/imports/controls/universal/qquickuniversalfocusrectangle.cpp delete mode 100644 src/imports/controls/universal/qquickuniversalfocusrectangle_p.h delete mode 100644 src/imports/controls/universal/qquickuniversalprogressbar.cpp delete mode 100644 src/imports/controls/universal/qquickuniversalprogressbar_p.h create mode 100644 src/imports/controlsimpl/controlsimpl.pro create mode 100644 src/imports/controlsimpl/qmldir create mode 100644 src/imports/controlsimpl/qtquickcontrols2implplugin.cpp delete mode 100644 src/quickcontrols2/qquickanimatednode.cpp delete mode 100644 src/quickcontrols2/qquickanimatednode_p.h delete mode 100644 src/quickcontrols2/qquickattachedobject.cpp delete mode 100644 src/quickcontrols2/qquickattachedobject_p.h delete mode 100644 src/quickcontrols2/qquickchecklabel.cpp delete mode 100644 src/quickcontrols2/qquickchecklabel_p.h delete mode 100644 src/quickcontrols2/qquickclippedtext.cpp delete mode 100644 src/quickcontrols2/qquickclippedtext_p.h delete mode 100644 src/quickcontrols2/qquickcolor.cpp delete mode 100644 src/quickcontrols2/qquickcolor_p.h delete mode 100644 src/quickcontrols2/qquickcolorimage.cpp delete mode 100644 src/quickcontrols2/qquickcolorimage_p.h delete mode 100644 src/quickcontrols2/qquickiconimage.cpp delete mode 100644 src/quickcontrols2/qquickiconimage_p.h delete mode 100644 src/quickcontrols2/qquickiconimage_p_p.h delete mode 100644 src/quickcontrols2/qquickiconlabel.cpp delete mode 100644 src/quickcontrols2/qquickiconlabel_p.h delete mode 100644 src/quickcontrols2/qquickiconlabel_p_p.h delete mode 100644 src/quickcontrols2/qquickitemgroup.cpp delete mode 100644 src/quickcontrols2/qquickitemgroup_p.h delete mode 100644 src/quickcontrols2/qquickmnemoniclabel.cpp delete mode 100644 src/quickcontrols2/qquickmnemoniclabel_p.h delete mode 100644 src/quickcontrols2/qquickpaddedrectangle.cpp delete mode 100644 src/quickcontrols2/qquickpaddedrectangle_p.h delete mode 100644 src/quickcontrols2/qquickplaceholdertext.cpp delete mode 100644 src/quickcontrols2/qquickplaceholdertext_p.h delete mode 100644 src/quickcontrols2/qquicktumblerview.cpp delete mode 100644 src/quickcontrols2/qquicktumblerview_p.h delete mode 100644 src/quickcontrols2/qtquickcontrols2global_p.h delete mode 100644 src/quickcontrols2/quickcontrols2.pri create mode 100644 src/quickcontrols2impl/qquickanimatednode.cpp create mode 100644 src/quickcontrols2impl/qquickanimatednode_p.h create mode 100644 src/quickcontrols2impl/qquickattachedobject.cpp create mode 100644 src/quickcontrols2impl/qquickattachedobject_p.h create mode 100644 src/quickcontrols2impl/qquickchecklabel.cpp create mode 100644 src/quickcontrols2impl/qquickchecklabel_p.h create mode 100644 src/quickcontrols2impl/qquickclippedtext.cpp create mode 100644 src/quickcontrols2impl/qquickclippedtext_p.h create mode 100644 src/quickcontrols2impl/qquickcolor.cpp create mode 100644 src/quickcontrols2impl/qquickcolor_p.h create mode 100644 src/quickcontrols2impl/qquickcolorimage.cpp create mode 100644 src/quickcontrols2impl/qquickcolorimage_p.h create mode 100644 src/quickcontrols2impl/qquickiconimage.cpp create mode 100644 src/quickcontrols2impl/qquickiconimage_p.h create mode 100644 src/quickcontrols2impl/qquickiconimage_p_p.h create mode 100644 src/quickcontrols2impl/qquickiconlabel.cpp create mode 100644 src/quickcontrols2impl/qquickiconlabel_p.h create mode 100644 src/quickcontrols2impl/qquickiconlabel_p_p.h create mode 100644 src/quickcontrols2impl/qquickitemgroup.cpp create mode 100644 src/quickcontrols2impl/qquickitemgroup_p.h create mode 100644 src/quickcontrols2impl/qquickmnemoniclabel.cpp create mode 100644 src/quickcontrols2impl/qquickmnemoniclabel_p.h create mode 100644 src/quickcontrols2impl/qquickpaddedrectangle.cpp create mode 100644 src/quickcontrols2impl/qquickpaddedrectangle_p.h create mode 100644 src/quickcontrols2impl/qquickplaceholdertext.cpp create mode 100644 src/quickcontrols2impl/qquickplaceholdertext_p.h create mode 100644 src/quickcontrols2impl/qquicktumblerview.cpp create mode 100644 src/quickcontrols2impl/qquicktumblerview_p.h create mode 100644 src/quickcontrols2impl/qtquickcontrols2foreign_p.h create mode 100644 src/quickcontrols2impl/qtquickcontrols2implglobal_p.h create mode 100644 src/quickcontrols2impl/quickcontrols2impl.pro (limited to 'src') diff --git a/src/imports/controls/.prev_CMakeLists.txt b/src/imports/controls/.prev_CMakeLists.txt index e017f0fe..a8f8da6b 100644 --- a/src/imports/controls/.prev_CMakeLists.txt +++ b/src/imports/controls/.prev_CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### add_qml_module(qtquickcontrols2plugin - TARGET_PATH "QtQuick/Controls.2" + TARGET_PATH "QtQuick/Controls" URI "QtQuick.Controls" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" DESIGNER_SUPPORTED @@ -63,7 +63,7 @@ set(qtquickcontrols2plugin_resource_files add_qt_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2" + "/qt-project.org/imports/QtQuick/Controls" FILES ${qtquickcontrols2plugin_resource_files} ) @@ -72,7 +72,7 @@ add_qt_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" #### Keys ignored in scope 1:.:.:controls.pro:: # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/calendar/*.qdoc" "$$PWD/src/templates/*.qdoc" -# TARGETPATH = "QtQuick/Controls.2" +# TARGETPATH = "QtQuick/Controls" # _REQUIREMENTS = "qtConfig(quickcontrols2-default)" ## Scopes: diff --git a/src/imports/controls/CMakeLists.txt b/src/imports/controls/CMakeLists.txt index 3cef4d26..567de0fd 100644 --- a/src/imports/controls/CMakeLists.txt +++ b/src/imports/controls/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2plugin - TARGET_PATH "QtQuick/Controls.2" + TARGET_PATH "QtQuick/Controls" URI "QtQuick.Controls" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" DESIGNER_SUPPORTED @@ -63,7 +63,7 @@ set(qtquickcontrols2plugin_resource_files qt_add_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2" + "/qt-project.org/imports/QtQuick/Controls" FILES ${qtquickcontrols2plugin_resource_files} ) @@ -72,7 +72,7 @@ qt_add_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" #### Keys ignored in scope 1:.:.:controls.pro:: # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/templates/*.qdoc" -# TARGETPATH = "QtQuick/Controls.2" +# TARGETPATH = "QtQuick/Controls" # _REQUIREMENTS = "qtConfig(quickcontrols2-default)" ## Scopes: diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 9440c36f..5a782f2d 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -3,7 +3,7 @@ TARGETPATH = QtQuick/Controls.2 IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/src/imports/controls/default/BusyIndicator.qml b/src/imports/controls/default/BusyIndicator.qml index ff5c191c..c8b12732 100644 --- a/src/imports/controls/default/BusyIndicator.qml +++ b/src/imports/controls/default/BusyIndicator.qml @@ -36,7 +36,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Default.impl 2.12 import QtQuick.Templates 2.12 as T T.BusyIndicator { diff --git a/src/imports/controls/default/Dial.qml b/src/imports/controls/default/Dial.qml index 457016d3..daae1e64 100644 --- a/src/imports/controls/default/Dial.qml +++ b/src/imports/controls/default/Dial.qml @@ -37,6 +37,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Default.impl 2.12 import QtQuick.Templates 2.12 as T T.Dial { diff --git a/src/imports/controls/default/ProgressBar.qml b/src/imports/controls/default/ProgressBar.qml index 61cdea43..218cc442 100644 --- a/src/imports/controls/default/ProgressBar.qml +++ b/src/imports/controls/default/ProgressBar.qml @@ -37,7 +37,7 @@ import QtQuick 2.12 import QtQuick.Templates 2.12 as T import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Default.impl 2.12 T.ProgressBar { id: control diff --git a/src/imports/controls/default/default.pri b/src/imports/controls/default/default.pri index 03fc0f4b..e7147af4 100644 --- a/src/imports/controls/default/default.pri +++ b/src/imports/controls/default/default.pri @@ -1,14 +1,8 @@ HEADERS += \ - $$PWD/qquickdefaultbusyindicator_p.h \ - $$PWD/qquickdefaultdial_p.h \ - $$PWD/qquickdefaultprogressbar_p.h \ $$PWD/qquickdefaultstyle_p.h \ $$PWD/qquickdefaulttheme_p.h SOURCES += \ - $$PWD/qquickdefaultbusyindicator.cpp \ - $$PWD/qquickdefaultdial.cpp \ - $$PWD/qquickdefaultprogressbar.cpp \ $$PWD/qquickdefaultstyle.cpp \ $$PWD/qquickdefaulttheme.cpp diff --git a/src/imports/controls/default/impl/default-impl.pro b/src/imports/controls/default/impl/default-impl.pro new file mode 100644 index 00000000..88ec2077 --- /dev/null +++ b/src/imports/controls/default/impl/default-impl.pro @@ -0,0 +1,30 @@ +TARGET = qtquickcontrols2defaultstyleimplplugin +TARGETPATH = QtQuick/Controls.2/Default/impl + +QML_IMPORT_NAME = QtQuick.Controls.Default.impl +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private +QT_FOR_CONFIG = quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +OTHER_FILES += \ + qmldir + +HEADERS += \ + $$PWD/qquickdefaultbusyindicator_p.h \ + $$PWD/qquickdefaultdial_p.h \ + $$PWD/qquickdefaultprogressbar_p.h + +SOURCES += \ + $$PWD/qquickdefaultbusyindicator.cpp \ + $$PWD/qquickdefaultdial.cpp \ + $$PWD/qquickdefaultprogressbar.cpp \ + $$PWD/qtquickcontrols2defaultstyleimplplugin.cpp + +CONFIG += qmltypes install_qmltypes no_cxx_module +load(qml_plugin) + +requires(qtConfig(quickcontrols2-default)) diff --git a/src/imports/controls/default/impl/qmldir b/src/imports/controls/default/impl/qmldir new file mode 100644 index 00000000..95deed07 --- /dev/null +++ b/src/imports/controls/default/impl/qmldir @@ -0,0 +1,5 @@ +module QtQuick.Controls.Default.impl +plugin qtquickcontrols2defaultstyleimplplugin +classname QtQuickControls2DefaultStyleImplPlugin +depends QtQuick.Templates 6.0 +depends QtQuick.Controls 6.0 diff --git a/src/imports/controls/default/impl/qquickdefaultbusyindicator.cpp b/src/imports/controls/default/impl/qquickdefaultbusyindicator.cpp new file mode 100644 index 00000000..880d869b --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultbusyindicator.cpp @@ -0,0 +1,223 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultbusyindicator_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int CircleCount = 10; +static const int TotalDuration = 100 * CircleCount * 2; +static const QRgb TransparentColor = 0x00000000; + +static QPointF moveCircle(const QPointF &pos, qreal rotation, qreal distance) +{ + return pos - QTransform().rotate(rotation).map(QPointF(0, distance)); +} + +class QQuickDefaultBusyIndicatorNode : public QQuickAnimatedNode +{ +public: + QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + QColor m_pen; + QColor m_fill; +}; + +QQuickDefaultBusyIndicatorNode::QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); + setCurrentTime(item->elapsed()); + + for (int i = 0; i < CircleCount; ++i) { + QSGTransformNode *transformNode = new QSGTransformNode; + appendChildNode(transformNode); + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + transformNode->appendChildNode(rectNode); + } +} + +void QQuickDefaultBusyIndicatorNode::updateCurrentTime(int time) +{ + const qreal percentageComplete = time / qreal(TotalDuration); + const qreal firstPhaseProgress = percentageComplete <= 0.5 ? percentageComplete * 2 : 0; + const qreal secondPhaseProgress = percentageComplete > 0.5 ? (percentageComplete - 0.5) * 2 : 0; + + QSGTransformNode *transformNode = static_cast(firstChild()); + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + for (int i = 0; i < CircleCount; ++i) { + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + const bool fill = (firstPhaseProgress > qreal(i) / CircleCount) || (secondPhaseProgress > 0 && secondPhaseProgress < qreal(i) / CircleCount); + rectNode->setColor(fill ? m_fill : QColor::fromRgba(TransparentColor)); + rectNode->setPenColor(m_pen); + rectNode->setPenWidth(1); + rectNode->update(); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +void QQuickDefaultBusyIndicatorNode::sync(QQuickItem *item) +{ + const qreal w = item->width(); + const qreal h = item->height(); + const qreal sz = qMin(w, h); + const qreal dx = (w - sz) / 2; + const qreal dy = (h - sz) / 2; + const int circleRadius = sz / 12; + + m_pen = static_cast(item)->pen(); + m_fill = static_cast(item)->fill(); + + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < CircleCount; ++i) { + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius); + pos = moveCircle(pos, 360.0 / CircleCount * i, sz / 2 - circleRadius); + + QMatrix4x4 m; + m.translate(dx + pos.x(), dy + pos.y()); + transformNode->setMatrix(m); + + rectNode->setRect(QRectF(QPointF(), QSizeF(circleRadius * 2, circleRadius * 2))); + rectNode->setRadius(circleRadius); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +QQuickDefaultBusyIndicator::QQuickDefaultBusyIndicator(QQuickItem *parent) : + QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +QColor QQuickDefaultBusyIndicator::pen() const +{ + return m_pen; +} + +void QQuickDefaultBusyIndicator::setPen(const QColor &pen) +{ + if (pen == m_pen) + return; + + m_pen = pen; + update(); +} + +QColor QQuickDefaultBusyIndicator::fill() const +{ + return m_fill; +} + +void QQuickDefaultBusyIndicator::setFill(const QColor &fill) +{ + if (fill == m_fill) + return; + + m_fill = fill; + update(); +} + +bool QQuickDefaultBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickDefaultBusyIndicator::setRunning(bool running) +{ + if (running) + setVisible(true); +} + +int QQuickDefaultBusyIndicator::elapsed() const +{ + return m_elapsed; +} + +void QQuickDefaultBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + switch (change) { + case ItemOpacityHasChanged: + if (qFuzzyIsNull(data.realValue)) + setVisible(false); + break; + case ItemVisibleHasChanged: + update(); + break; + default: + break; + } +} + +QSGNode *QQuickDefaultBusyIndicator::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickDefaultBusyIndicatorNode *node = static_cast(oldNode); + if (isRunning() && width() > 0 && height() > 0) { + if (!node) { + node = new QQuickDefaultBusyIndicatorNode(this); + node->start(); + } + node->sync(this); + } else { + m_elapsed = node ? node->currentTime() : 0; + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/impl/qquickdefaultbusyindicator_p.h b/src/imports/controls/default/impl/qquickdefaultbusyindicator_p.h new file mode 100644 index 00000000..5cd60ff5 --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultbusyindicator_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTBUSYINDICATOR_P_H +#define QQUICKDEFAULTBUSYINDICATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultBusyIndicator : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor pen READ pen WRITE setPen FINAL) + Q_PROPERTY(QColor fill READ fill WRITE setFill FINAL) + Q_PROPERTY(bool running READ isRunning WRITE setRunning) + QML_NAMED_ELEMENT(BusyIndicatorImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickDefaultBusyIndicator(QQuickItem *parent = nullptr); + + QColor pen() const; + void setPen(const QColor &pen); + + QColor fill() const; + void setFill(const QColor &fill); + + bool isRunning() const; + void setRunning(bool running); + + int elapsed() const; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + int m_elapsed = 0; + QColor m_pen; + QColor m_fill; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickDefaultBusyIndicator) + +#endif // QQUICKDEFAULTBUSYINDICATOR_P_H diff --git a/src/imports/controls/default/impl/qquickdefaultdial.cpp b/src/imports/controls/default/impl/qquickdefaultdial.cpp new file mode 100644 index 00000000..1653def7 --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultdial.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultdial_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickDefaultDial::QQuickDefaultDial(QQuickItem *parent) : + QQuickPaintedItem(parent) +{ +} + +qreal QQuickDefaultDial::progress() const +{ + return m_progress; +} + +void QQuickDefaultDial::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +QColor QQuickDefaultDial::color() const +{ + return m_color; +} + +void QQuickDefaultDial::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +void QQuickDefaultDial::paint(QPainter *painter) +{ + if (width() <= 0 || height() <= 0) + return; + + QPen pen(m_color); + pen.setWidth(8); + pen.setCapStyle(Qt::FlatCap); + painter->setPen(pen); + + const QRectF bounds = boundingRect(); + const qreal smallest = qMin(bounds.width(), bounds.height()); + QRectF rect = QRectF(pen.widthF() / 2.0 + 1, pen.widthF() / 2.0 + 1, smallest - pen.widthF() - 2, smallest - pen.widthF() - 2); + rect.moveCenter(bounds.center()); + + // Make sure the arc is aligned to whole pixels. + if (rect.x() - int(rect.x()) > 0) + rect.setX(qCeil(rect.x())); + if (rect.y() - int(rect.y()) > 0) + rect.setY(qCeil(rect.y())); + if (rect.width() - int(rect.width()) > 0) + rect.setWidth(qFloor(rect.width())); + if (rect.height() - int(rect.height()) > 0) + rect.setHeight(qFloor(rect.height())); + + painter->setRenderHint(QPainter::Antialiasing); + + const qreal startAngle = (140 + 90); + const qreal spanAngle = (m_progress * 280) * -1; + QPainterPath path; + path.arcMoveTo(rect, startAngle); + path.arcTo(rect, startAngle, spanAngle); + painter->drawPath(path); + + rect.adjust(-pen.widthF() / 2.0, -pen.widthF() / 2.0, pen.widthF() / 2.0, pen.widthF() / 2.0); + pen.setWidth(1); + painter->setPen(pen); + + path = QPainterPath(); + path.arcMoveTo(rect, 0); + path.arcTo(rect, 0, 360); + painter->drawPath(path); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/impl/qquickdefaultdial_p.h b/src/imports/controls/default/impl/qquickdefaultdial_p.h new file mode 100644 index 00000000..7cdc5e9a --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultdial_p.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTDIAL_P_H +#define QQUICKDEFAULTDIAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultDial : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + QML_NAMED_ELEMENT(DialImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickDefaultDial(QQuickItem *parent = nullptr); + + qreal progress() const; + void setProgress(qreal progress); + + QColor color() const; + void setColor(const QColor &color); + + void paint(QPainter *painter) override; + +private: + qreal m_progress = 0; + QColor m_color = Qt::black; +}; + +QT_END_NAMESPACE + +#endif // QQUICKDEFAULTDIAL_P_H diff --git a/src/imports/controls/default/impl/qquickdefaultprogressbar.cpp b/src/imports/controls/default/impl/qquickdefaultprogressbar.cpp new file mode 100644 index 00000000..fcaada94 --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultprogressbar.cpp @@ -0,0 +1,280 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickdefaultprogressbar_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int Blocks = 4; +static const int BlockWidth = 16; +static const int BlockRestingSpacing = 4; +static const int BlockMovingSpacing = 48; +static const int BlockSpan = Blocks * (BlockWidth + BlockRestingSpacing) - BlockRestingSpacing; +static const int TotalDuration = 4000; +static const int SecondPhaseStart = TotalDuration * 0.4; +static const int ThirdPhaseStart = TotalDuration * 0.6; + +static inline qreal blockStartX(int blockIndex) +{ + return ((blockIndex + 1) * -BlockWidth) - (blockIndex * BlockMovingSpacing); +} + +static inline qreal blockRestX(int blockIndex, qreal availableWidth) +{ + const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2.0; + return spanRightEdgePos - (blockIndex + 1) * BlockWidth - (blockIndex * BlockRestingSpacing); +} + +static inline qreal blockEndX(int blockIndex, qreal availableWidth) +{ + return availableWidth - blockStartX(Blocks - 1 - blockIndex) - BlockWidth; +} + +class QQuickDefaultProgressBarNode : public QQuickAnimatedNode +{ +public: + QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + bool m_indeterminate = false; + qreal m_pixelsPerSecond = 0; +}; + +QQuickDefaultProgressBarNode::QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item) + : QQuickAnimatedNode(item), + m_pixelsPerSecond(item->width()) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); +} + +void QQuickDefaultProgressBarNode::updateCurrentTime(int time) +{ + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < Blocks; ++i) { + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + + QMatrix4x4 m; + const qreal restX = blockRestX(i, m_pixelsPerSecond); + const qreal timeInSeconds = time / 1000.0; + + if (time < SecondPhaseStart) { + // Move into the resting position for the first phase. + QEasingCurve easingCurve(QEasingCurve::InQuad); + const qreal easedCompletion = easingCurve.valueForProgress(time / qreal(SecondPhaseStart)); + const qreal distance = m_pixelsPerSecond * (easedCompletion * (SecondPhaseStart / 1000.0)); + const qreal position = blockStartX(i) + distance; + const qreal destination = restX; + m.translate(qMin(position, destination), 0); + } else if (time < ThirdPhaseStart) { + // Stay in the same position for the second phase. + m.translate(restX, 0); + } else { + // Move out of view for the third phase. + const int thirdPhaseSubKickoff = (BlockMovingSpacing / m_pixelsPerSecond) * 1000; + const int subphase = (time - ThirdPhaseStart) / thirdPhaseSubKickoff; + // If we're not at this subphase yet, don't try to animate movement, + // because it will be incorrect. + if (subphase < i) + return; + + const qreal timeSinceSecondPhase = timeInSeconds - (ThirdPhaseStart / 1000.0); + // We only want to start keeping track of time once our subphase has started, + // otherwise we move too much because we account for time that has already elapsed. + // For example, if we were 60 milliseconds into the third subphase: + // + // 0 ..... 1 ..... 2 ... + // 100 100 60 + // + // i == 0, timeSinceOurKickoff == 260 + // i == 1, timeSinceOurKickoff == 160 + // i == 2, timeSinceOurKickoff == 60 + const qreal timeSinceOurKickoff = timeSinceSecondPhase - (thirdPhaseSubKickoff / 1000.0 * i); + const qreal position = restX + (m_pixelsPerSecond * (timeSinceOurKickoff)); + const qreal destination = blockEndX(i, m_pixelsPerSecond); + m.translate(qMin(position, destination), 0); + } + + transformNode->setMatrix(m); + + transformNode = static_cast(transformNode->nextSibling()); + } +} + +void QQuickDefaultProgressBarNode::sync(QQuickItem *item) +{ + QQuickDefaultProgressBar *bar = static_cast(item); + if (m_indeterminate != bar->isIndeterminate()) { + m_indeterminate = bar->isIndeterminate(); + if (m_indeterminate) + start(); + else + stop(); + } + m_pixelsPerSecond = item->width(); + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + + QMatrix4x4 m; + m.translate(0, (item->height() - item->implicitHeight()) / 2); + setMatrix(m); + + if (m_indeterminate) { + if (childCount() != Blocks) { + // This was previously a regular progress bar; remove the old nodes. + removeAllChildNodes(); + } + + QSGTransformNode *transformNode = static_cast(firstChild()); + for (int i = 0; i < Blocks; ++i) { + if (!transformNode) { + transformNode = new QSGTransformNode; + appendChildNode(transformNode); + } + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + if (!rectNode) { + rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setColor(bar->color()); + transformNode->appendChildNode(rectNode); + } + + QMatrix4x4 m; + m.translate(blockStartX(i), 0); + transformNode->setMatrix(m); + + rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(BlockWidth, item->implicitHeight()))); + rectNode->update(); + + transformNode = static_cast(transformNode->nextSibling()); + } + } else { + if (childCount() > 1) { + // This was previously an indeterminate progress bar; remove the old nodes. + removeAllChildNodes(); + } + + QSGInternalRectangleNode *rectNode = static_cast(firstChild()); + if (!rectNode) { + rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setColor(bar->color()); + appendChildNode(rectNode); + } + + rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(bar->progress() * item->width(), item->implicitHeight()))); + rectNode->update(); + } +} + +QQuickDefaultProgressBar::QQuickDefaultProgressBar(QQuickItem *parent) : + QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +qreal QQuickDefaultProgressBar::progress() const +{ + return m_progress; +} + +void QQuickDefaultProgressBar::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +bool QQuickDefaultProgressBar::isIndeterminate() const +{ + return m_indeterminate; +} + +void QQuickDefaultProgressBar::setIndeterminate(bool indeterminate) +{ + if (indeterminate == m_indeterminate) + return; + + m_indeterminate = indeterminate; + setClip(m_indeterminate); + update(); +} + +QColor QQuickDefaultProgressBar::color() const +{ + return m_color; +} + +void QQuickDefaultProgressBar::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +void QQuickDefaultProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemVisibleHasChanged) + update(); +} + +QSGNode *QQuickDefaultProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickDefaultProgressBarNode *node = static_cast(oldNode); + if (isVisible() && width() > 0 && height() > 0) { + if (!node) + node = new QQuickDefaultProgressBarNode(this); + node->sync(this); + } else { + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/default/impl/qquickdefaultprogressbar_p.h b/src/imports/controls/default/impl/qquickdefaultprogressbar_p.h new file mode 100644 index 00000000..3e4955c4 --- /dev/null +++ b/src/imports/controls/default/impl/qquickdefaultprogressbar_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDEFAULTPROGRESSBAR_P_H +#define QQUICKDEFAULTPROGRESSBAR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickDefaultProgressBar : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + QML_NAMED_ELEMENT(ProgressBarImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickDefaultProgressBar(QQuickItem *parent = nullptr); + + bool isIndeterminate() const; + void setIndeterminate(bool indeterminate); + + qreal progress() const; + void setProgress(qreal progress); + + QColor color() const; + void setColor(const QColor &color); + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + qreal m_progress = 0; + bool m_indeterminate = false; + QColor m_color; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickDefaultProgressBar) + +#endif // QQUICKDEFAULTPROGRESSBAR_P_H diff --git a/src/imports/controls/default/impl/qtquickcontrols2defaultstyleimplplugin.cpp b/src/imports/controls/default/impl/qtquickcontrols2defaultstyleimplplugin.cpp new file mode 100644 index 00000000..734d32de --- /dev/null +++ b/src/imports/controls/default/impl/qtquickcontrols2defaultstyleimplplugin.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2DefaultStyleImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2DefaultStyleImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2DefaultStyleImplPlugin::QtQuickControls2DefaultStyleImplPlugin(QObject *parent) + : QQmlEngineExtensionPlugin(parent) +{ +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2defaultstyleimplplugin.moc" diff --git a/src/imports/controls/default/qquickdefaultbusyindicator.cpp b/src/imports/controls/default/qquickdefaultbusyindicator.cpp deleted file mode 100644 index aca795d9..00000000 --- a/src/imports/controls/default/qquickdefaultbusyindicator.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultbusyindicator_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int CircleCount = 10; -static const int TotalDuration = 100 * CircleCount * 2; -static const QRgb TransparentColor = 0x00000000; - -static QPointF moveCircle(const QPointF &pos, qreal rotation, qreal distance) -{ - return pos - QTransform().rotate(rotation).map(QPointF(0, distance)); -} - -class QQuickDefaultBusyIndicatorNode : public QQuickAnimatedNode -{ -public: - QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - QColor m_pen; - QColor m_fill; -}; - -QQuickDefaultBusyIndicatorNode::QQuickDefaultBusyIndicatorNode(QQuickDefaultBusyIndicator *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); - setCurrentTime(item->elapsed()); - - for (int i = 0; i < CircleCount; ++i) { - QSGTransformNode *transformNode = new QSGTransformNode; - appendChildNode(transformNode); - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - transformNode->appendChildNode(rectNode); - } -} - -void QQuickDefaultBusyIndicatorNode::updateCurrentTime(int time) -{ - const qreal percentageComplete = time / qreal(TotalDuration); - const qreal firstPhaseProgress = percentageComplete <= 0.5 ? percentageComplete * 2 : 0; - const qreal secondPhaseProgress = percentageComplete > 0.5 ? (percentageComplete - 0.5) * 2 : 0; - - QSGTransformNode *transformNode = static_cast(firstChild()); - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - for (int i = 0; i < CircleCount; ++i) { - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - const bool fill = (firstPhaseProgress > qreal(i) / CircleCount) || (secondPhaseProgress > 0 && secondPhaseProgress < qreal(i) / CircleCount); - rectNode->setColor(fill ? m_fill : QColor::fromRgba(TransparentColor)); - rectNode->setPenColor(m_pen); - rectNode->setPenWidth(1); - rectNode->update(); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -void QQuickDefaultBusyIndicatorNode::sync(QQuickItem *item) -{ - const qreal w = item->width(); - const qreal h = item->height(); - const qreal sz = qMin(w, h); - const qreal dx = (w - sz) / 2; - const qreal dy = (h - sz) / 2; - const int circleRadius = sz / 12; - - m_pen = static_cast(item)->pen(); - m_fill = static_cast(item)->fill(); - - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < CircleCount; ++i) { - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius); - pos = moveCircle(pos, 360.0 / CircleCount * i, sz / 2 - circleRadius); - - QMatrix4x4 m; - m.translate(dx + pos.x(), dy + pos.y()); - transformNode->setMatrix(m); - - rectNode->setRect(QRectF(QPointF(), QSizeF(circleRadius * 2, circleRadius * 2))); - rectNode->setRadius(circleRadius); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -QQuickDefaultBusyIndicator::QQuickDefaultBusyIndicator(QQuickItem *parent) : - QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -QColor QQuickDefaultBusyIndicator::pen() const -{ - return m_pen; -} - -void QQuickDefaultBusyIndicator::setPen(const QColor &pen) -{ - if (pen == m_pen) - return; - - m_pen = pen; - update(); -} - -QColor QQuickDefaultBusyIndicator::fill() const -{ - return m_fill; -} - -void QQuickDefaultBusyIndicator::setFill(const QColor &fill) -{ - if (fill == m_fill) - return; - - m_fill = fill; - update(); -} - -bool QQuickDefaultBusyIndicator::isRunning() const -{ - return isVisible(); -} - -void QQuickDefaultBusyIndicator::setRunning(bool running) -{ - if (running) - setVisible(true); -} - -int QQuickDefaultBusyIndicator::elapsed() const -{ - return m_elapsed; -} - -void QQuickDefaultBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - switch (change) { - case ItemOpacityHasChanged: - if (qFuzzyIsNull(data.realValue)) - setVisible(false); - break; - case ItemVisibleHasChanged: - update(); - break; - default: - break; - } -} - -QSGNode *QQuickDefaultBusyIndicator::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickDefaultBusyIndicatorNode *node = static_cast(oldNode); - if (isRunning() && width() > 0 && height() > 0) { - if (!node) { - node = new QQuickDefaultBusyIndicatorNode(this); - node->start(); - } - node->sync(this); - } else { - m_elapsed = node ? node->currentTime() : 0; - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultbusyindicator_p.h b/src/imports/controls/default/qquickdefaultbusyindicator_p.h deleted file mode 100644 index eedaf09a..00000000 --- a/src/imports/controls/default/qquickdefaultbusyindicator_p.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTBUSYINDICATOR_P_H -#define QQUICKDEFAULTBUSYINDICATOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultBusyIndicator : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor pen READ pen WRITE setPen FINAL) - Q_PROPERTY(QColor fill READ fill WRITE setFill FINAL) - Q_PROPERTY(bool running READ isRunning WRITE setRunning) - -public: - explicit QQuickDefaultBusyIndicator(QQuickItem *parent = nullptr); - - QColor pen() const; - void setPen(const QColor &pen); - - QColor fill() const; - void setFill(const QColor &fill); - - bool isRunning() const; - void setRunning(bool running); - - int elapsed() const; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - int m_elapsed = 0; - QColor m_pen; - QColor m_fill; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickDefaultBusyIndicator) - -#endif // QQUICKDEFAULTBUSYINDICATOR_P_H diff --git a/src/imports/controls/default/qquickdefaultdial.cpp b/src/imports/controls/default/qquickdefaultdial.cpp deleted file mode 100644 index 1653def7..00000000 --- a/src/imports/controls/default/qquickdefaultdial.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultdial_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickDefaultDial::QQuickDefaultDial(QQuickItem *parent) : - QQuickPaintedItem(parent) -{ -} - -qreal QQuickDefaultDial::progress() const -{ - return m_progress; -} - -void QQuickDefaultDial::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -QColor QQuickDefaultDial::color() const -{ - return m_color; -} - -void QQuickDefaultDial::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -void QQuickDefaultDial::paint(QPainter *painter) -{ - if (width() <= 0 || height() <= 0) - return; - - QPen pen(m_color); - pen.setWidth(8); - pen.setCapStyle(Qt::FlatCap); - painter->setPen(pen); - - const QRectF bounds = boundingRect(); - const qreal smallest = qMin(bounds.width(), bounds.height()); - QRectF rect = QRectF(pen.widthF() / 2.0 + 1, pen.widthF() / 2.0 + 1, smallest - pen.widthF() - 2, smallest - pen.widthF() - 2); - rect.moveCenter(bounds.center()); - - // Make sure the arc is aligned to whole pixels. - if (rect.x() - int(rect.x()) > 0) - rect.setX(qCeil(rect.x())); - if (rect.y() - int(rect.y()) > 0) - rect.setY(qCeil(rect.y())); - if (rect.width() - int(rect.width()) > 0) - rect.setWidth(qFloor(rect.width())); - if (rect.height() - int(rect.height()) > 0) - rect.setHeight(qFloor(rect.height())); - - painter->setRenderHint(QPainter::Antialiasing); - - const qreal startAngle = (140 + 90); - const qreal spanAngle = (m_progress * 280) * -1; - QPainterPath path; - path.arcMoveTo(rect, startAngle); - path.arcTo(rect, startAngle, spanAngle); - painter->drawPath(path); - - rect.adjust(-pen.widthF() / 2.0, -pen.widthF() / 2.0, pen.widthF() / 2.0, pen.widthF() / 2.0); - pen.setWidth(1); - painter->setPen(pen); - - path = QPainterPath(); - path.arcMoveTo(rect, 0); - path.arcTo(rect, 0, 360); - painter->drawPath(path); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultdial_p.h b/src/imports/controls/default/qquickdefaultdial_p.h deleted file mode 100644 index 73e14321..00000000 --- a/src/imports/controls/default/qquickdefaultdial_p.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTDIAL_P_H -#define QQUICKDEFAULTDIAL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultDial : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - -public: - explicit QQuickDefaultDial(QQuickItem *parent = nullptr); - - qreal progress() const; - void setProgress(qreal progress); - - QColor color() const; - void setColor(const QColor &color); - - void paint(QPainter *painter) override; - -private: - qreal m_progress = 0; - QColor m_color = Qt::black; -}; - -QT_END_NAMESPACE - -#endif // QQUICKDEFAULTDIAL_P_H diff --git a/src/imports/controls/default/qquickdefaultprogressbar.cpp b/src/imports/controls/default/qquickdefaultprogressbar.cpp deleted file mode 100644 index f44065e4..00000000 --- a/src/imports/controls/default/qquickdefaultprogressbar.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdefaultprogressbar_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int Blocks = 4; -static const int BlockWidth = 16; -static const int BlockRestingSpacing = 4; -static const int BlockMovingSpacing = 48; -static const int BlockSpan = Blocks * (BlockWidth + BlockRestingSpacing) - BlockRestingSpacing; -static const int TotalDuration = 4000; -static const int SecondPhaseStart = TotalDuration * 0.4; -static const int ThirdPhaseStart = TotalDuration * 0.6; - -static inline qreal blockStartX(int blockIndex) -{ - return ((blockIndex + 1) * -BlockWidth) - (blockIndex * BlockMovingSpacing); -} - -static inline qreal blockRestX(int blockIndex, qreal availableWidth) -{ - const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2.0; - return spanRightEdgePos - (blockIndex + 1) * BlockWidth - (blockIndex * BlockRestingSpacing); -} - -static inline qreal blockEndX(int blockIndex, qreal availableWidth) -{ - return availableWidth - blockStartX(Blocks - 1 - blockIndex) - BlockWidth; -} - -class QQuickDefaultProgressBarNode : public QQuickAnimatedNode -{ -public: - QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - bool m_indeterminate = false; - qreal m_pixelsPerSecond = 0; -}; - -QQuickDefaultProgressBarNode::QQuickDefaultProgressBarNode(QQuickDefaultProgressBar *item) - : QQuickAnimatedNode(item), - m_pixelsPerSecond(item->width()) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); -} - -void QQuickDefaultProgressBarNode::updateCurrentTime(int time) -{ - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < Blocks; ++i) { - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - - QMatrix4x4 m; - const qreal restX = blockRestX(i, m_pixelsPerSecond); - const qreal timeInSeconds = time / 1000.0; - - if (time < SecondPhaseStart) { - // Move into the resting position for the first phase. - QEasingCurve easingCurve(QEasingCurve::InQuad); - const qreal easedCompletion = easingCurve.valueForProgress(time / qreal(SecondPhaseStart)); - const qreal distance = m_pixelsPerSecond * (easedCompletion * (SecondPhaseStart / 1000.0)); - const qreal position = blockStartX(i) + distance; - const qreal destination = restX; - m.translate(qMin(position, destination), 0); - } else if (time < ThirdPhaseStart) { - // Stay in the same position for the second phase. - m.translate(restX, 0); - } else { - // Move out of view for the third phase. - const int thirdPhaseSubKickoff = (BlockMovingSpacing / m_pixelsPerSecond) * 1000; - const int subphase = (time - ThirdPhaseStart) / thirdPhaseSubKickoff; - // If we're not at this subphase yet, don't try to animate movement, - // because it will be incorrect. - if (subphase < i) - return; - - const qreal timeSinceSecondPhase = timeInSeconds - (ThirdPhaseStart / 1000.0); - // We only want to start keeping track of time once our subphase has started, - // otherwise we move too much because we account for time that has already elapsed. - // For example, if we were 60 milliseconds into the third subphase: - // - // 0 ..... 1 ..... 2 ... - // 100 100 60 - // - // i == 0, timeSinceOurKickoff == 260 - // i == 1, timeSinceOurKickoff == 160 - // i == 2, timeSinceOurKickoff == 60 - const qreal timeSinceOurKickoff = timeSinceSecondPhase - (thirdPhaseSubKickoff / 1000.0 * i); - const qreal position = restX + (m_pixelsPerSecond * (timeSinceOurKickoff)); - const qreal destination = blockEndX(i, m_pixelsPerSecond); - m.translate(qMin(position, destination), 0); - } - - transformNode->setMatrix(m); - - transformNode = static_cast(transformNode->nextSibling()); - } -} - -void QQuickDefaultProgressBarNode::sync(QQuickItem *item) -{ - QQuickDefaultProgressBar *bar = static_cast(item); - if (m_indeterminate != bar->isIndeterminate()) { - m_indeterminate = bar->isIndeterminate(); - if (m_indeterminate) - start(); - else - stop(); - } - m_pixelsPerSecond = item->width(); - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - - QMatrix4x4 m; - m.translate(0, (item->height() - item->implicitHeight()) / 2); - setMatrix(m); - - if (m_indeterminate) { - if (childCount() != Blocks) { - // This was previously a regular progress bar; remove the old nodes. - removeAllChildNodes(); - } - - QSGTransformNode *transformNode = static_cast(firstChild()); - for (int i = 0; i < Blocks; ++i) { - if (!transformNode) { - transformNode = new QSGTransformNode; - appendChildNode(transformNode); - } - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - if (!rectNode) { - rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setColor(bar->color()); - transformNode->appendChildNode(rectNode); - } - - QMatrix4x4 m; - m.translate(blockStartX(i), 0); - transformNode->setMatrix(m); - - rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(BlockWidth, item->implicitHeight()))); - rectNode->update(); - - transformNode = static_cast(transformNode->nextSibling()); - } - } else { - if (childCount() > 1) { - // This was previously an indeterminate progress bar; remove the old nodes. - removeAllChildNodes(); - } - - QSGInternalRectangleNode *rectNode = static_cast(firstChild()); - if (!rectNode) { - rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setColor(bar->color()); - appendChildNode(rectNode); - } - - rectNode->setRect(QRectF(QPointF(0, 0), QSizeF(bar->progress() * item->width(), item->implicitHeight()))); - rectNode->update(); - } -} - -QQuickDefaultProgressBar::QQuickDefaultProgressBar(QQuickItem *parent) : - QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -qreal QQuickDefaultProgressBar::progress() const -{ - return m_progress; -} - -void QQuickDefaultProgressBar::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -bool QQuickDefaultProgressBar::isIndeterminate() const -{ - return m_indeterminate; -} - -void QQuickDefaultProgressBar::setIndeterminate(bool indeterminate) -{ - if (indeterminate == m_indeterminate) - return; - - m_indeterminate = indeterminate; - setClip(m_indeterminate); - update(); -} - -QColor QQuickDefaultProgressBar::color() const -{ - return m_color; -} - -void QQuickDefaultProgressBar::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -void QQuickDefaultProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) - update(); -} - -QSGNode *QQuickDefaultProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickDefaultProgressBarNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { - if (!node) - node = new QQuickDefaultProgressBarNode(this); - node->sync(this); - } else { - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/default/qquickdefaultprogressbar_p.h b/src/imports/controls/default/qquickdefaultprogressbar_p.h deleted file mode 100644 index 241d0b3b..00000000 --- a/src/imports/controls/default/qquickdefaultprogressbar_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKDEFAULTPROGRESSBAR_P_H -#define QQUICKDEFAULTPROGRESSBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickDefaultProgressBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - -public: - explicit QQuickDefaultProgressBar(QQuickItem *parent = nullptr); - - bool isIndeterminate() const; - void setIndeterminate(bool indeterminate); - - qreal progress() const; - void setProgress(qreal progress); - - QColor color() const; - void setColor(const QColor &color); - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - qreal m_progress = 0; - bool m_indeterminate = false; - QColor m_color; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickDefaultProgressBar) - -#endif // QQUICKDEFAULTPROGRESSBAR_P_H diff --git a/src/imports/controls/default/qquickdefaultstyle_p.h b/src/imports/controls/default/qquickdefaultstyle_p.h index fcd489a0..fa4e77a8 100644 --- a/src/imports/controls/default/qquickdefaultstyle_p.h +++ b/src/imports/controls/default/qquickdefaultstyle_p.h @@ -50,6 +50,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -96,6 +97,9 @@ class QQuickDefaultStyle : public QObject Q_PROPERTY(QColor separatorColor READ separatorColor CONSTANT FINAL) Q_PROPERTY(QColor disabledDarkColor READ disabledDarkColor CONSTANT FINAL) Q_PROPERTY(QColor disabledLightColor READ disabledLightColor CONSTANT FINAL) + QML_NAMED_ELEMENT(Default) + QML_SINGLETON + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickDefaultStyle(QObject *parent = nullptr); diff --git a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp index 6e396dcf..0ed33d12 100644 --- a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp +++ b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp @@ -34,14 +34,11 @@ ** ****************************************************************************/ -#include - -#include "qquickdefaultbusyindicator_p.h" -#include "qquickdefaultdial_p.h" -#include "qquickdefaultprogressbar_p.h" #include "qquickdefaultstyle_p.h" #include "qquickdefaulttheme_p.h" +#include + QT_BEGIN_NAMESPACE class QtQuickControls2DefaultStylePlugin: public QQuickStylePlugin @@ -52,8 +49,6 @@ class QtQuickControls2DefaultStylePlugin: public QQuickStylePlugin public: QtQuickControls2DefaultStylePlugin(QObject *parent = nullptr); - void registerTypes(const char *uri) override; - QString name() const override; void initializeTheme(QQuickTheme *theme) override; }; @@ -62,30 +57,6 @@ QtQuickControls2DefaultStylePlugin::QtQuickControls2DefaultStylePlugin(QObject * { } -void QtQuickControls2DefaultStylePlugin::registerTypes(const char *uri) -{ - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 2, 15); - - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - const QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); - - // QtQuick.Controls.impl 2.0 (Qt 5.7) - qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); - qmlRegisterType(import, 2, 0, "DialImpl"); - qmlRegisterType(import, 2, 0, "ProgressBarImpl"); - - // QtQuick.Controls.impl 2.1 (Qt 5.8) - qmlRegisterSingletonType(import, 2, 1, "Default", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - return new QQuickDefaultStyle; - }); -} - QString QtQuickControls2DefaultStylePlugin::name() const { return QStringLiteral("Default"); diff --git a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc index 37be7b4c..e1461ee4 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc @@ -51,7 +51,7 @@ \li Specifies a list of additional paths that are used to lookup \l {Styling Qt Quick Controls} {Qt Quick Controls styles}. Multiple path entries must be \l {QDir::listSeparator}{separated} by \c ':' under Unix and \c ';' under Windows. By default, styles are looked up from - \c $QML2_IMPORT_PATH/QtQuick/Controls.2. + \c $QML2_IMPORT_PATH/QtQuick/Controls. \row \li \c QT_QUICK_CONTROLS_CONF \li Specifies the location of the \l {Qt Quick Controls configuration file}. diff --git a/src/imports/controls/fusion/.prev_CMakeLists.txt b/src/imports/controls/fusion/.prev_CMakeLists.txt index 2fb5b2a1..4c59e4f6 100644 --- a/src/imports/controls/fusion/.prev_CMakeLists.txt +++ b/src/imports/controls/fusion/.prev_CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### add_qml_module(qtquickcontrols2fusionstyleplugin - TARGET_PATH "QtQuick/Controls.2/Fusion" + TARGET_PATH "QtQuick/Controls/Fusion" URI "QtQuick.Controls.Fusion" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2FusionStylePlugin @@ -54,7 +54,7 @@ set(qtquickcontrols2fusionstyle_resource_files add_qt_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Fusion" + "/qt-project.org/imports/QtQuick/Controls/Fusion" FILES ${qtquickcontrols2fusionstyle_resource_files} ) @@ -64,7 +64,7 @@ add_qt_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" # IMPORT_NAME = "QtQuick.Controls.Fusion" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Fusion" +# TARGETPATH = "QtQuick/Controls/Fusion" # _REQUIREMENTS = "qtConfig(quickcontrols2-fusion)" set(qml_files diff --git a/src/imports/controls/fusion/ButtonPanel.qml b/src/imports/controls/fusion/ButtonPanel.qml deleted file mode 100644 index 125aa2f3..00000000 --- a/src/imports/controls/fusion/ButtonPanel.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: panel - - property Item control - property bool highlighted: control.highlighted - - visible: !control.flat || control.down || control.checked - - color: Fusion.buttonColor(control.palette, panel.highlighted, control.down || control.checked, control.hovered) - gradient: control.down || control.checked ? null : buttonGradient - - Gradient { - id: buttonGradient - GradientStop { - position: 0 - color: Fusion.gradientStart(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) - } - GradientStop { - position: 1 - color: Fusion.gradientStop(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) - } - } - - radius: 2 - border.color: Fusion.buttonOutline(control.palette, panel.highlighted || control.visualFocus, control.enabled) - - Rectangle { - x: 1; y: 1 - width: parent.width - 2 - height: parent.height - 2 - border.color: Fusion.innerContrastLine - color: "transparent" - radius: 2 - } -} diff --git a/src/imports/controls/fusion/CMakeLists.txt b/src/imports/controls/fusion/CMakeLists.txt index 59b06842..5eb28d21 100644 --- a/src/imports/controls/fusion/CMakeLists.txt +++ b/src/imports/controls/fusion/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2fusionstyleplugin - TARGET_PATH "QtQuick/Controls.2/Fusion" + TARGET_PATH "QtQuick/Controls/Fusion" URI "QtQuick.Controls.Fusion" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2FusionStylePlugin @@ -54,7 +54,7 @@ set(qtquickcontrols2fusionstyle_resource_files qt_add_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Fusion" + "/qt-project.org/imports/QtQuick/Controls/Fusion" FILES ${qtquickcontrols2fusionstyle_resource_files} ) @@ -64,7 +64,7 @@ qt_add_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" # IMPORT_NAME = "QtQuick.Controls.Fusion" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Fusion" +# TARGETPATH = "QtQuick/Controls/Fusion" # _REQUIREMENTS = "qtConfig(quickcontrols2-fusion)" set(qml_files diff --git a/src/imports/controls/fusion/CheckIndicator.qml b/src/imports/controls/fusion/CheckIndicator.qml deleted file mode 100644 index 7dcfee30..00000000 --- a/src/imports/controls/fusion/CheckIndicator.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: indicator - - property Item control - readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) - readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) - - implicitWidth: 14 - implicitHeight: 14 - - color: control.down ? indicator.pressedColor : control.palette.base - border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) - : Qt.lighter(Fusion.outline(control.palette), 1.1) - - Rectangle { - x: 1; y: 1 - width: parent.width - 2 - height: 1 - color: Fusion.topShadow - visible: indicator.control.enabled && !indicator.control.down - } - - ColorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - color: Color.transparent(indicator.checkMarkColor, 210 / 255) - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/checkmark.png" - visible: indicator.control.checkState === Qt.Checked || (indicator.control.checked && indicator.control.checkState === undefined) - } - - Rectangle { - x: 3; y: 3 - width: parent.width - 6 - height: parent.width - 6 - - visible: indicator.control.checkState === Qt.PartiallyChecked - - gradient: Gradient { - GradientStop { - position: 0 - color: Color.transparent(indicator.checkMarkColor, 80 / 255) - } - GradientStop { - position: 1 - color: Color.transparent(indicator.checkMarkColor, 140 / 255) - } - } - border.color: Color.transparent(indicator.checkMarkColor, 180 / 255) - } -} diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index d0e4b564..64e9603f 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -66,7 +66,7 @@ T.ComboBox { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 color: control.editable ? control.palette.text : control.palette.buttonText - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/arrow.png" width: 20 fillMode: Image.Pad } diff --git a/src/imports/controls/fusion/MenuItem.qml b/src/imports/controls/fusion/MenuItem.qml index a428fbc8..ebd727e0 100644 --- a/src/imports/controls/fusion/MenuItem.qml +++ b/src/imports/controls/fusion/MenuItem.qml @@ -81,7 +81,7 @@ T.MenuItem { visible: control.subMenu rotation: control.mirrored ? 90 : -90 color: control.down || control.hovered || control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/arrow.png" fillMode: Image.Pad } diff --git a/src/imports/controls/fusion/ProgressBar.qml b/src/imports/controls/fusion/ProgressBar.qml index 5deade58..a522563a 100644 --- a/src/imports/controls/fusion/ProgressBar.qml +++ b/src/imports/controls/fusion/ProgressBar.qml @@ -85,7 +85,7 @@ T.ProgressBar { mirror: control.mirrored fillMode: Image.TileHorizontally - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/progressmask.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/progressmask.png" color: Color.transparent(Qt.lighter(Fusion.highlight(control.palette), 1.2), 160 / 255) visible: control.indeterminate diff --git a/src/imports/controls/fusion/RadioIndicator.qml b/src/imports/controls/fusion/RadioIndicator.qml deleted file mode 100644 index c73cd49f..00000000 --- a/src/imports/controls/fusion/RadioIndicator.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: indicator - - property Item control - readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) - readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) - - implicitWidth: 14 - implicitHeight: 14 - - radius: width / 2 - color: control.down ? indicator.pressedColor : control.palette.base - border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) - : Qt.darker(control.palette.window, 1.5) - - Rectangle { - y: 1 - width: parent.width - height: parent.height - 1 - radius: width / 2 - color: "transparent" - border.color: Fusion.topShadow - visible: indicator.control.enabled && !indicator.control.down - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 2.32 - height: parent.height / 2.32 - radius: width / 2 - color: Color.transparent(indicator.checkMarkColor, 180 / 255) - border.color: Color.transparent(indicator.checkMarkColor, 200 / 255) - visible: indicator.control.checked - } -} diff --git a/src/imports/controls/fusion/SliderGroove.qml b/src/imports/controls/fusion/SliderGroove.qml deleted file mode 100644 index 381a02b5..00000000 --- a/src/imports/controls/fusion/SliderGroove.qml +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: groove - - property Item control - property real offset - property real progress - property real visualProgress - - x: control.horizontal ? 0 : (control.availableWidth - width) / 2 - y: control.horizontal ? (control.availableHeight - height) / 2 : 0 - - implicitWidth: control.horizontal ? 160 : 5 - implicitHeight: control.horizontal ? 5 : 160 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - border.color: Fusion.outline(control.palette) - scale: control.horizontal && control.mirrored ? -1 : 1 - - gradient: Gradient { - GradientStop { - position: 0 - color: Qt.darker(Fusion.grooveColor(groove.control.palette), 1.1) - } - GradientStop { - position: 1 - color: Qt.lighter(Fusion.grooveColor(groove.control.palette), 1.1) - } - } - - Rectangle { - x: groove.control.horizontal ? groove.offset * parent.width : 0 - y: groove.control.horizontal ? 0 : groove.visualProgress * parent.height - width: groove.control.horizontal ? groove.progress * parent.width - groove.offset * parent.width : 5 - height: groove.control.horizontal ? 5 : groove.progress * parent.height - groove.offset * parent.height - - radius: 2 - border.color: Qt.darker(Fusion.highlightedOutline(groove.control.palette), 1.1) - - gradient: Gradient { - GradientStop { - position: 0 - color: Fusion.highlight(groove.control.palette) - } - GradientStop { - position: 1 - color: Qt.lighter(Fusion.highlight(groove.control.palette), 1.2) - } - } - } -} diff --git a/src/imports/controls/fusion/SliderHandle.qml b/src/imports/controls/fusion/SliderHandle.qml deleted file mode 100644 index c53af57e..00000000 --- a/src/imports/controls/fusion/SliderHandle.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: handle - - property var palette - property bool pressed - property bool hovered - property bool vertical - property bool visualFocus - - implicitWidth: 13 - implicitHeight: 13 - - gradient: Gradient { - GradientStop { - position: 0 - color: Fusion.gradientStart(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered)) - } - GradientStop { - position: 1 - color: Fusion.gradientStop(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered)) - } - } - rotation: handle.vertical ? -90 : 0 - border.width: 1 - border.color: "transparent" - radius: 2 - - Rectangle { - width: parent.width - height: parent.height - border.color: handle.visualFocus ? Fusion.highlightedOutline(handle.palette) : Fusion.outline(handle.palette) - color: "transparent" - radius: 2 - - Rectangle { - x: 1; y: 1 - width: parent.width - 2 - height: parent.height - 2 - border.color: Fusion.innerContrastLine - color: "transparent" - radius: 2 - } - } -} diff --git a/src/imports/controls/fusion/SpinBox.qml b/src/imports/controls/fusion/SpinBox.qml index 41754f63..44387e3c 100644 --- a/src/imports/controls/fusion/SpinBox.qml +++ b/src/imports/controls/fusion/SpinBox.qml @@ -98,7 +98,7 @@ T.SpinBox { height: parent.height opacity: enabled ? 1.0 : 0.5 color: control.palette.buttonText - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/arrow.png" fillMode: Image.Pad } } @@ -121,7 +121,7 @@ T.SpinBox { height: parent.height opacity: enabled ? 1.0 : 0.5 color: control.palette.buttonText - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/arrow.png" fillMode: Image.Pad } } diff --git a/src/imports/controls/fusion/SwitchIndicator.qml b/src/imports/controls/fusion/SwitchIndicator.qml deleted file mode 100644 index ae7c89a0..00000000 --- a/src/imports/controls/fusion/SwitchIndicator.qml +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 - -Rectangle { - id: indicator - - property Item control - readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) - readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) - - implicitWidth: 40 - implicitHeight: 16 - - radius: 2 - border.color: Fusion.outline(control.palette) - - gradient: Gradient { - GradientStop { - position: 0 - color: Qt.darker(Fusion.grooveColor(indicator.control.palette), 1.1) - } - GradientStop { - position: 1 - color: Qt.lighter(Fusion.grooveColor(indicator.control.palette), 1.1) - } - } - - Rectangle { - x: indicator.control.mirrored ? handle.x : 0 - width: indicator.control.mirrored ? parent.width - handle.x : handle.x + handle.width - height: parent.height - - opacity: indicator.control.checked ? 1 : 0 - Behavior on opacity { - enabled: !indicator.control.down - NumberAnimation { duration: 80 } - } - - radius: 2 - border.color: Qt.darker(Fusion.highlightedOutline(indicator.control.palette), 1.1) - border.width: indicator.control.enabled ? 1 : 0 - - gradient: Gradient { - GradientStop { - position: 0 - color: Fusion.highlight(indicator.control.palette) - } - GradientStop { - position: 1 - color: Qt.lighter(Fusion.highlight(indicator.control.palette), 1.2) - } - } - } - - Rectangle { - id: handle - x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) - y: (parent.height - height) / 2 - width: 20 - height: 16 - radius: 2 - - gradient: Gradient { - GradientStop { - position: 0 - color: Fusion.gradientStart(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) - } - GradientStop { - position: 1 - color: Fusion.gradientStop(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) - } - } - border.width: 1 - border.color: "transparent" - - Rectangle { - width: parent.width - height: parent.height - border.color: indicator.control.visualFocus ? Fusion.highlightedOutline(indicator.control.palette) : Fusion.outline(indicator.control.palette) - color: "transparent" - radius: 2 - - Rectangle { - x: 1; y: 1 - width: parent.width - 2 - height: parent.height - 2 - border.color: Fusion.innerContrastLine - color: "transparent" - radius: 2 - } - } - - Behavior on x { - enabled: !indicator.control.down - SmoothedAnimation { velocity: 200 } - } - } -} diff --git a/src/imports/controls/fusion/fusion.pri b/src/imports/controls/fusion/fusion.pri index bdc413fd..5bc3fbce 100644 --- a/src/imports/controls/fusion/fusion.pri +++ b/src/imports/controls/fusion/fusion.pri @@ -1,14 +1,8 @@ HEADERS += \ - $$PWD/qquickfusionbusyindicator_p.h \ - $$PWD/qquickfusiondial_p.h \ - $$PWD/qquickfusionknob_p.h \ $$PWD/qquickfusionstyle_p.h \ $$PWD/qquickfusiontheme_p.h SOURCES += \ - $$PWD/qquickfusionbusyindicator.cpp \ - $$PWD/qquickfusiondial.cpp \ - $$PWD/qquickfusionknob.cpp \ $$PWD/qquickfusionstyle.cpp \ $$PWD/qquickfusiontheme.cpp @@ -16,10 +10,8 @@ QML_FILES += \ $$PWD/ApplicationWindow.qml \ $$PWD/BusyIndicator.qml \ $$PWD/Button.qml \ - $$PWD/ButtonPanel.qml \ $$PWD/CheckBox.qml \ $$PWD/CheckDelegate.qml \ - $$PWD/CheckIndicator.qml \ $$PWD/ComboBox.qml \ $$PWD/DelayButton.qml \ $$PWD/Dial.qml \ @@ -43,19 +35,15 @@ QML_FILES += \ $$PWD/ProgressBar.qml \ $$PWD/RadioButton.qml \ $$PWD/RadioDelegate.qml \ - $$PWD/RadioIndicator.qml \ $$PWD/RangeSlider.qml \ $$PWD/RoundButton.qml \ $$PWD/ScrollBar.qml \ $$PWD/ScrollIndicator.qml \ $$PWD/Slider.qml \ - $$PWD/SliderGroove.qml \ - $$PWD/SliderHandle.qml \ $$PWD/SpinBox.qml \ $$PWD/SplitView.qml \ $$PWD/SwipeDelegate.qml \ $$PWD/SwitchDelegate.qml \ - $$PWD/SwitchIndicator.qml \ $$PWD/Switch.qml \ $$PWD/TabBar.qml \ $$PWD/TabButton.qml \ diff --git a/src/imports/controls/fusion/impl/ButtonPanel.qml b/src/imports/controls/fusion/impl/ButtonPanel.qml new file mode 100644 index 00000000..125aa2f3 --- /dev/null +++ b/src/imports/controls/fusion/impl/ButtonPanel.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: panel + + property Item control + property bool highlighted: control.highlighted + + visible: !control.flat || control.down || control.checked + + color: Fusion.buttonColor(control.palette, panel.highlighted, control.down || control.checked, control.hovered) + gradient: control.down || control.checked ? null : buttonGradient + + Gradient { + id: buttonGradient + GradientStop { + position: 0 + color: Fusion.gradientStart(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) + } + GradientStop { + position: 1 + color: Fusion.gradientStop(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) + } + } + + radius: 2 + border.color: Fusion.buttonOutline(control.palette, panel.highlighted || control.visualFocus, control.enabled) + + Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 2 + border.color: Fusion.innerContrastLine + color: "transparent" + radius: 2 + } +} diff --git a/src/imports/controls/fusion/impl/CheckIndicator.qml b/src/imports/controls/fusion/impl/CheckIndicator.qml new file mode 100644 index 00000000..f8c127c4 --- /dev/null +++ b/src/imports/controls/fusion/impl/CheckIndicator.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: indicator + + property Item control + readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) + readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) + + implicitWidth: 14 + implicitHeight: 14 + + color: control.down ? indicator.pressedColor : control.palette.base + border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) + : Qt.lighter(Fusion.outline(control.palette), 1.1) + + Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: 1 + color: Fusion.topShadow + visible: indicator.control.enabled && !indicator.control.down + } + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + color: Color.transparent(indicator.checkMarkColor, 210 / 255) + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/images/checkmark.png" + visible: indicator.control.checkState === Qt.Checked || (indicator.control.checked && indicator.control.checkState === undefined) + } + + Rectangle { + x: 3; y: 3 + width: parent.width - 6 + height: parent.width - 6 + + visible: indicator.control.checkState === Qt.PartiallyChecked + + gradient: Gradient { + GradientStop { + position: 0 + color: Color.transparent(indicator.checkMarkColor, 80 / 255) + } + GradientStop { + position: 1 + color: Color.transparent(indicator.checkMarkColor, 140 / 255) + } + } + border.color: Color.transparent(indicator.checkMarkColor, 180 / 255) + } +} diff --git a/src/imports/controls/fusion/impl/RadioIndicator.qml b/src/imports/controls/fusion/impl/RadioIndicator.qml new file mode 100644 index 00000000..c73cd49f --- /dev/null +++ b/src/imports/controls/fusion/impl/RadioIndicator.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: indicator + + property Item control + readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) + readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) + + implicitWidth: 14 + implicitHeight: 14 + + radius: width / 2 + color: control.down ? indicator.pressedColor : control.palette.base + border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) + : Qt.darker(control.palette.window, 1.5) + + Rectangle { + y: 1 + width: parent.width + height: parent.height - 1 + radius: width / 2 + color: "transparent" + border.color: Fusion.topShadow + visible: indicator.control.enabled && !indicator.control.down + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 2.32 + height: parent.height / 2.32 + radius: width / 2 + color: Color.transparent(indicator.checkMarkColor, 180 / 255) + border.color: Color.transparent(indicator.checkMarkColor, 200 / 255) + visible: indicator.control.checked + } +} diff --git a/src/imports/controls/fusion/impl/SliderGroove.qml b/src/imports/controls/fusion/impl/SliderGroove.qml new file mode 100644 index 00000000..381a02b5 --- /dev/null +++ b/src/imports/controls/fusion/impl/SliderGroove.qml @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: groove + + property Item control + property real offset + property real progress + property real visualProgress + + x: control.horizontal ? 0 : (control.availableWidth - width) / 2 + y: control.horizontal ? (control.availableHeight - height) / 2 : 0 + + implicitWidth: control.horizontal ? 160 : 5 + implicitHeight: control.horizontal ? 5 : 160 + width: control.horizontal ? control.availableWidth : implicitWidth + height: control.horizontal ? implicitHeight : control.availableHeight + + radius: 2 + border.color: Fusion.outline(control.palette) + scale: control.horizontal && control.mirrored ? -1 : 1 + + gradient: Gradient { + GradientStop { + position: 0 + color: Qt.darker(Fusion.grooveColor(groove.control.palette), 1.1) + } + GradientStop { + position: 1 + color: Qt.lighter(Fusion.grooveColor(groove.control.palette), 1.1) + } + } + + Rectangle { + x: groove.control.horizontal ? groove.offset * parent.width : 0 + y: groove.control.horizontal ? 0 : groove.visualProgress * parent.height + width: groove.control.horizontal ? groove.progress * parent.width - groove.offset * parent.width : 5 + height: groove.control.horizontal ? 5 : groove.progress * parent.height - groove.offset * parent.height + + radius: 2 + border.color: Qt.darker(Fusion.highlightedOutline(groove.control.palette), 1.1) + + gradient: Gradient { + GradientStop { + position: 0 + color: Fusion.highlight(groove.control.palette) + } + GradientStop { + position: 1 + color: Qt.lighter(Fusion.highlight(groove.control.palette), 1.2) + } + } + } +} diff --git a/src/imports/controls/fusion/impl/SliderHandle.qml b/src/imports/controls/fusion/impl/SliderHandle.qml new file mode 100644 index 00000000..c53af57e --- /dev/null +++ b/src/imports/controls/fusion/impl/SliderHandle.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: handle + + property var palette + property bool pressed + property bool hovered + property bool vertical + property bool visualFocus + + implicitWidth: 13 + implicitHeight: 13 + + gradient: Gradient { + GradientStop { + position: 0 + color: Fusion.gradientStart(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered)) + } + GradientStop { + position: 1 + color: Fusion.gradientStop(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered)) + } + } + rotation: handle.vertical ? -90 : 0 + border.width: 1 + border.color: "transparent" + radius: 2 + + Rectangle { + width: parent.width + height: parent.height + border.color: handle.visualFocus ? Fusion.highlightedOutline(handle.palette) : Fusion.outline(handle.palette) + color: "transparent" + radius: 2 + + Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 2 + border.color: Fusion.innerContrastLine + color: "transparent" + radius: 2 + } + } +} diff --git a/src/imports/controls/fusion/impl/SwitchIndicator.qml b/src/imports/controls/fusion/impl/SwitchIndicator.qml new file mode 100644 index 00000000..ae7c89a0 --- /dev/null +++ b/src/imports/controls/fusion/impl/SwitchIndicator.qml @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Fusion 2.12 +import QtQuick.Controls.Fusion.impl 2.12 + +Rectangle { + id: indicator + + property Item control + readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85) + readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2) + + implicitWidth: 40 + implicitHeight: 16 + + radius: 2 + border.color: Fusion.outline(control.palette) + + gradient: Gradient { + GradientStop { + position: 0 + color: Qt.darker(Fusion.grooveColor(indicator.control.palette), 1.1) + } + GradientStop { + position: 1 + color: Qt.lighter(Fusion.grooveColor(indicator.control.palette), 1.1) + } + } + + Rectangle { + x: indicator.control.mirrored ? handle.x : 0 + width: indicator.control.mirrored ? parent.width - handle.x : handle.x + handle.width + height: parent.height + + opacity: indicator.control.checked ? 1 : 0 + Behavior on opacity { + enabled: !indicator.control.down + NumberAnimation { duration: 80 } + } + + radius: 2 + border.color: Qt.darker(Fusion.highlightedOutline(indicator.control.palette), 1.1) + border.width: indicator.control.enabled ? 1 : 0 + + gradient: Gradient { + GradientStop { + position: 0 + color: Fusion.highlight(indicator.control.palette) + } + GradientStop { + position: 1 + color: Qt.lighter(Fusion.highlight(indicator.control.palette), 1.2) + } + } + } + + Rectangle { + id: handle + x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) + y: (parent.height - height) / 2 + width: 20 + height: 16 + radius: 2 + + gradient: Gradient { + GradientStop { + position: 0 + color: Fusion.gradientStart(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) + } + GradientStop { + position: 1 + color: Fusion.gradientStop(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) + } + } + border.width: 1 + border.color: "transparent" + + Rectangle { + width: parent.width + height: parent.height + border.color: indicator.control.visualFocus ? Fusion.highlightedOutline(indicator.control.palette) : Fusion.outline(indicator.control.palette) + color: "transparent" + radius: 2 + + Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 2 + border.color: Fusion.innerContrastLine + color: "transparent" + radius: 2 + } + } + + Behavior on x { + enabled: !indicator.control.down + SmoothedAnimation { velocity: 200 } + } + } +} diff --git a/src/imports/controls/fusion/impl/fusion-impl.pro b/src/imports/controls/fusion/impl/fusion-impl.pro new file mode 100644 index 00000000..e3333e18 --- /dev/null +++ b/src/imports/controls/fusion/impl/fusion-impl.pro @@ -0,0 +1,39 @@ +TARGET = qtquickcontrols2fusionstyleimplplugin +TARGETPATH = QtQuick/Controls.2/Fusion/impl + +QML_IMPORT_NAME = QtQuick.Controls.Fusion.impl +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private +QT_FOR_CONFIG = quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +QML_FILES += \ + $$PWD/ButtonPanel.qml \ + $$PWD/CheckIndicator.qml \ + $$PWD/RadioIndicator.qml \ + $$PWD/SliderGroove.qml \ + $$PWD/SliderHandle.qml \ + $$PWD/SwitchIndicator.qml + +OTHER_FILES += \ + qmldir \ + $$QML_FILES + +HEADERS += \ + $$PWD/qquickfusionbusyindicator_p.h \ + $$PWD/qquickfusiondial_p.h \ + $$PWD/qquickfusionknob_p.h + +SOURCES += \ + $$PWD/qquickfusionbusyindicator.cpp \ + $$PWD/qquickfusiondial.cpp \ + $$PWD/qquickfusionknob.cpp \ + $$PWD/qtquickcontrols2fusionstyleimplplugin.cpp + +CONFIG += qmltypes install_qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler +load(qml_plugin) + +requires(qtConfig(quickcontrols2-fusion)) diff --git a/src/imports/controls/fusion/impl/qmldir b/src/imports/controls/fusion/impl/qmldir new file mode 100644 index 00000000..16ed7fd8 --- /dev/null +++ b/src/imports/controls/fusion/impl/qmldir @@ -0,0 +1,3 @@ +module QtQuick.Controls.Fusion.impl +plugin qtquickcontrols2fusionstyleimplplugin +classname QtQuickControls2FusionStyleImpPlugin diff --git a/src/imports/controls/fusion/impl/qquickfusionbusyindicator.cpp b/src/imports/controls/fusion/impl/qquickfusionbusyindicator.cpp new file mode 100644 index 00000000..a9b75d27 --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusionbusyindicator.cpp @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickfusionbusyindicator_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickFusionBusyIndicator::QQuickFusionBusyIndicator(QQuickItem *parent) + : QQuickPaintedItem(parent) +{ +} + +QColor QQuickFusionBusyIndicator::color() const +{ + return m_color; +} + +void QQuickFusionBusyIndicator::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +bool QQuickFusionBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickFusionBusyIndicator::setRunning(bool running) +{ + if (running) { + setVisible(true); + update(); + } +} + +void QQuickFusionBusyIndicator::paint(QPainter *painter) +{ + const qreal w = width(); + const qreal h = height(); + if (w <= 0 || h <= 0 || !isRunning()) + return; + + const qreal sz = qMin(w, h); + const qreal dx = (w - sz) / 2; + const qreal dy = (h - sz) / 2; + const int hpw = qRound(qMax(qreal(1), sz / 14)) & -1; + const int pw = 2 * hpw; + const QRectF bounds(dx + hpw, dy + hpw, sz - pw - 1, sz - pw - 1); + + QConicalGradient gradient; + gradient.setCenter(QPointF(dx + sz / 2, dy + sz / 2)); + gradient.setColorAt(0, m_color); + gradient.setColorAt(0.1, m_color); + gradient.setColorAt(1, Qt::transparent); + + painter->translate(0.5, 0.5); + painter->setRenderHint(QPainter::Antialiasing, true); + painter->setPen(QPen(gradient, pw, Qt::SolidLine)); + painter->drawArc(bounds, 0, 360 * 16); + painter->setPen(QPen(m_color, pw, Qt::SolidLine, Qt::RoundCap)); + painter->drawArc(bounds, 0, 20 * 16); +} + +void QQuickFusionBusyIndicator::itemChange(ItemChange change, const ItemChangeData &data) +{ + QQuickPaintedItem::itemChange(change, data); + + if (change == ItemOpacityHasChanged && qFuzzyIsNull(data.realValue)) + setVisible(false); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/impl/qquickfusionbusyindicator_p.h b/src/imports/controls/fusion/impl/qquickfusionbusyindicator_p.h new file mode 100644 index 00000000..5aeea6c4 --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusionbusyindicator_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKFUSIONBUSYINDICATOR_P_H +#define QQUICKFUSIONBUSYINDICATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickFusionBusyIndicator : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(bool running READ isRunning WRITE setRunning) + QML_NAMED_ELEMENT(BusyIndicatorImpl) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickFusionBusyIndicator(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + + bool isRunning() const; + void setRunning(bool running); + + void paint(QPainter *painter) override; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + +private: + QColor m_color; +}; + +QT_END_NAMESPACE + +#endif // QQUICKFUSIONBUSYINDICATOR_P_H diff --git a/src/imports/controls/fusion/impl/qquickfusiondial.cpp b/src/imports/controls/fusion/impl/qquickfusiondial.cpp new file mode 100644 index 00000000..eb6f21ad --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusiondial.cpp @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickfusiondial_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickFusionDial::QQuickFusionDial(QQuickItem *parent) + : QQuickPaintedItem(parent) +{ +} + +bool QQuickFusionDial::highlight() const +{ + return m_highlight; +} + +void QQuickFusionDial::setHighlight(bool highlight) +{ + if (m_highlight == highlight) + return; + + m_highlight = highlight; + update(); +} + +// based on QStyleHelper::drawDial() +void QQuickFusionDial::paint(QPainter *painter) +{ + const int width = QQuickItem::width(); + const int height = QQuickItem::height(); + if (width <= 0 || height <= 0 || !isVisible()) + return; + + QColor buttonColor = QQuickItemPrivate::get(this)->palette()->button(); + const bool enabled = isEnabled(); + qreal r = qMin(width, height) / 2.0; + r -= r/50; + const qreal penSize = r/20.0; + + painter->setRenderHint(QPainter::Antialiasing); + + const qreal d_ = r / 6; + const qreal dx = d_ + (width - 2 * r) / 2 + 1; + const qreal dy = d_ + (height - 2 * r) / 2 + 1; + + QRectF br = QRectF(dx + 0.5, dy + 0.5, + int(r * 2 - 2 * d_ - 2), + int(r * 2 - 2 * d_ - 2)); + buttonColor.setHsv(buttonColor .hue(), + qMin(140, buttonColor .saturation()), + qMax(180, buttonColor.value())); + + if (enabled) { + // Drop shadow + qreal shadowSize = qMax(1.0, penSize/2.0); + QRectF shadowRect= br.adjusted(-2*shadowSize, -2*shadowSize, + 2*shadowSize, 2*shadowSize); + QRadialGradient shadowGradient(shadowRect.center().x(), + shadowRect.center().y(), shadowRect.width()/2.0, + shadowRect.center().x(), shadowRect.center().y()); + shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40)); + shadowGradient.setColorAt(qreal(1.0), Qt::transparent); + painter->setBrush(shadowGradient); + painter->setPen(Qt::NoPen); + painter->translate(shadowSize, shadowSize); + painter->drawEllipse(shadowRect); + painter->translate(-shadowSize, -shadowSize); + + // Main gradient + QRadialGradient gradient(br.center().x() - br.width()/3, dy, + br.width()*1.3, br.center().x(), + br.center().y() - br.height()/2); + gradient.setColorAt(0, buttonColor.lighter(110)); + gradient.setColorAt(qreal(0.5), buttonColor); + gradient.setColorAt(qreal(0.501), buttonColor.darker(102)); + gradient.setColorAt(1, buttonColor.darker(115)); + painter->setBrush(gradient); + } else { + painter->setBrush(Qt::NoBrush); + } + + painter->setPen(QPen(buttonColor.darker(280))); + painter->drawEllipse(br); + painter->setBrush(Qt::NoBrush); + painter->setPen(buttonColor.lighter(110)); + painter->drawEllipse(br.adjusted(1, 1, -1, -1)); + + if (m_highlight) { + QColor highlight = QQuickItemPrivate::get(this)->palette()->highlight(); + highlight.setHsv(highlight.hue(), + qMin(160, highlight.saturation()), + qMax(230, highlight.value())); + highlight.setAlpha(127); + painter->setPen(QPen(highlight, 2.0)); + painter->setBrush(Qt::NoBrush); + painter->drawEllipse(br.adjusted(-1, -1, 1, 1)); + } +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/impl/qquickfusiondial_p.h b/src/imports/controls/fusion/impl/qquickfusiondial_p.h new file mode 100644 index 00000000..c320527a --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusiondial_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKFUSIONDIAL_P_H +#define QQUICKFUSIONDIAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QQuickFusionDial : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(bool highlight READ highlight WRITE setHighlight FINAL) + QML_NAMED_ELEMENT(DialImpl) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickFusionDial(QQuickItem *parent = nullptr); + + bool highlight() const; + void setHighlight(bool highlight); + + void paint(QPainter *painter) override; + +private: + bool m_highlight = false; +}; + +QT_END_NAMESPACE + +#endif // QQUICKFUSIONDIAL_P_H diff --git a/src/imports/controls/fusion/impl/qquickfusionknob.cpp b/src/imports/controls/fusion/impl/qquickfusionknob.cpp new file mode 100644 index 00000000..a641d190 --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusionknob.cpp @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickfusionknob_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickFusionKnob::QQuickFusionKnob(QQuickItem *parent) + : QQuickPaintedItem(parent) +{ + connect(this, &QQuickItem::paletteChanged, this, [this](){ update(); }); +} + +// extracted from QStyleHelper::drawDial() +void QQuickFusionKnob::paint(QPainter *painter) +{ + const qreal w = width(); + const qreal h = height(); + if (w <= 0 || h <= 0) + return; + + QColor color = QQuickItemPrivate::get(this)->palette()->button(); + color.setHsv(color.hue(), + qMin(140, color .saturation()), + qMax(180, color.value())); + color = color.lighter(104); + color.setAlphaF(qreal(0.8)); + + const qreal sz = qMin(w, h); + QRectF rect(0, 0, sz, sz); + rect.moveCenter(QPointF(w / 2.0, h / 2.0)); + const QPointF center = rect.center(); + + QRadialGradient gradient(center.x() + rect.width() / 2, + center.y() + rect.width(), + rect.width() * 2, + center.x(), center.y()); + gradient.setColorAt(1, color.darker(140)); + gradient.setColorAt(qreal(0.4), color.darker(120)); + gradient.setColorAt(0, color.darker(110)); + + painter->setRenderHint(QPainter::Antialiasing); + painter->setBrush(gradient); + painter->setPen(QColor(255, 255, 255, 150)); + painter->drawEllipse(rect); + painter->setPen(QColor(0, 0, 0, 80)); + painter->drawEllipse(rect.adjusted(1, 1, -1, -1)); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/impl/qquickfusionknob_p.h b/src/imports/controls/fusion/impl/qquickfusionknob_p.h new file mode 100644 index 00000000..b9b9c377 --- /dev/null +++ b/src/imports/controls/fusion/impl/qquickfusionknob_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKFUSIONKNOB_P_H +#define QQUICKFUSIONKNOB_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QQuickFusionKnob : public QQuickPaintedItem +{ + Q_OBJECT + QML_NAMED_ELEMENT(KnobImpl) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickFusionKnob(QQuickItem *parent = nullptr); + + void paint(QPainter *painter) override; +}; + +QT_END_NAMESPACE + +#endif // QQUICKFUSIONKNOB_P_H diff --git a/src/imports/controls/fusion/impl/qtquickcontrols2fusionstyleimplplugin.cpp b/src/imports/controls/fusion/impl/qtquickcontrols2fusionstyleimplplugin.cpp new file mode 100644 index 00000000..56cfc151 --- /dev/null +++ b/src/imports/controls/fusion/impl/qtquickcontrols2fusionstyleimplplugin.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2FusionStyleImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2FusionStyleImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2FusionStyleImplPlugin::QtQuickControls2FusionStyleImplPlugin(QObject *parent) + : QQmlEngineExtensionPlugin(parent) +{ +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2fusionstyleimplplugin.moc" diff --git a/src/imports/controls/fusion/qquickfusionbusyindicator.cpp b/src/imports/controls/fusion/qquickfusionbusyindicator.cpp deleted file mode 100644 index a9b75d27..00000000 --- a/src/imports/controls/fusion/qquickfusionbusyindicator.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickfusionbusyindicator_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickFusionBusyIndicator::QQuickFusionBusyIndicator(QQuickItem *parent) - : QQuickPaintedItem(parent) -{ -} - -QColor QQuickFusionBusyIndicator::color() const -{ - return m_color; -} - -void QQuickFusionBusyIndicator::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -bool QQuickFusionBusyIndicator::isRunning() const -{ - return isVisible(); -} - -void QQuickFusionBusyIndicator::setRunning(bool running) -{ - if (running) { - setVisible(true); - update(); - } -} - -void QQuickFusionBusyIndicator::paint(QPainter *painter) -{ - const qreal w = width(); - const qreal h = height(); - if (w <= 0 || h <= 0 || !isRunning()) - return; - - const qreal sz = qMin(w, h); - const qreal dx = (w - sz) / 2; - const qreal dy = (h - sz) / 2; - const int hpw = qRound(qMax(qreal(1), sz / 14)) & -1; - const int pw = 2 * hpw; - const QRectF bounds(dx + hpw, dy + hpw, sz - pw - 1, sz - pw - 1); - - QConicalGradient gradient; - gradient.setCenter(QPointF(dx + sz / 2, dy + sz / 2)); - gradient.setColorAt(0, m_color); - gradient.setColorAt(0.1, m_color); - gradient.setColorAt(1, Qt::transparent); - - painter->translate(0.5, 0.5); - painter->setRenderHint(QPainter::Antialiasing, true); - painter->setPen(QPen(gradient, pw, Qt::SolidLine)); - painter->drawArc(bounds, 0, 360 * 16); - painter->setPen(QPen(m_color, pw, Qt::SolidLine, Qt::RoundCap)); - painter->drawArc(bounds, 0, 20 * 16); -} - -void QQuickFusionBusyIndicator::itemChange(ItemChange change, const ItemChangeData &data) -{ - QQuickPaintedItem::itemChange(change, data); - - if (change == ItemOpacityHasChanged && qFuzzyIsNull(data.realValue)) - setVisible(false); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/qquickfusionbusyindicator_p.h b/src/imports/controls/fusion/qquickfusionbusyindicator_p.h deleted file mode 100644 index 77487ec8..00000000 --- a/src/imports/controls/fusion/qquickfusionbusyindicator_p.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKFUSIONBUSYINDICATOR_P_H -#define QQUICKFUSIONBUSYINDICATOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickFusionBusyIndicator : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(bool running READ isRunning WRITE setRunning) - -public: - explicit QQuickFusionBusyIndicator(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - bool isRunning() const; - void setRunning(bool running); - - void paint(QPainter *painter) override; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - -private: - QColor m_color; -}; - -QT_END_NAMESPACE - -#endif // QQUICKFUSIONBUSYINDICATOR_P_H diff --git a/src/imports/controls/fusion/qquickfusiondial.cpp b/src/imports/controls/fusion/qquickfusiondial.cpp deleted file mode 100644 index eb6f21ad..00000000 --- a/src/imports/controls/fusion/qquickfusiondial.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickfusiondial_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickFusionDial::QQuickFusionDial(QQuickItem *parent) - : QQuickPaintedItem(parent) -{ -} - -bool QQuickFusionDial::highlight() const -{ - return m_highlight; -} - -void QQuickFusionDial::setHighlight(bool highlight) -{ - if (m_highlight == highlight) - return; - - m_highlight = highlight; - update(); -} - -// based on QStyleHelper::drawDial() -void QQuickFusionDial::paint(QPainter *painter) -{ - const int width = QQuickItem::width(); - const int height = QQuickItem::height(); - if (width <= 0 || height <= 0 || !isVisible()) - return; - - QColor buttonColor = QQuickItemPrivate::get(this)->palette()->button(); - const bool enabled = isEnabled(); - qreal r = qMin(width, height) / 2.0; - r -= r/50; - const qreal penSize = r/20.0; - - painter->setRenderHint(QPainter::Antialiasing); - - const qreal d_ = r / 6; - const qreal dx = d_ + (width - 2 * r) / 2 + 1; - const qreal dy = d_ + (height - 2 * r) / 2 + 1; - - QRectF br = QRectF(dx + 0.5, dy + 0.5, - int(r * 2 - 2 * d_ - 2), - int(r * 2 - 2 * d_ - 2)); - buttonColor.setHsv(buttonColor .hue(), - qMin(140, buttonColor .saturation()), - qMax(180, buttonColor.value())); - - if (enabled) { - // Drop shadow - qreal shadowSize = qMax(1.0, penSize/2.0); - QRectF shadowRect= br.adjusted(-2*shadowSize, -2*shadowSize, - 2*shadowSize, 2*shadowSize); - QRadialGradient shadowGradient(shadowRect.center().x(), - shadowRect.center().y(), shadowRect.width()/2.0, - shadowRect.center().x(), shadowRect.center().y()); - shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40)); - shadowGradient.setColorAt(qreal(1.0), Qt::transparent); - painter->setBrush(shadowGradient); - painter->setPen(Qt::NoPen); - painter->translate(shadowSize, shadowSize); - painter->drawEllipse(shadowRect); - painter->translate(-shadowSize, -shadowSize); - - // Main gradient - QRadialGradient gradient(br.center().x() - br.width()/3, dy, - br.width()*1.3, br.center().x(), - br.center().y() - br.height()/2); - gradient.setColorAt(0, buttonColor.lighter(110)); - gradient.setColorAt(qreal(0.5), buttonColor); - gradient.setColorAt(qreal(0.501), buttonColor.darker(102)); - gradient.setColorAt(1, buttonColor.darker(115)); - painter->setBrush(gradient); - } else { - painter->setBrush(Qt::NoBrush); - } - - painter->setPen(QPen(buttonColor.darker(280))); - painter->drawEllipse(br); - painter->setBrush(Qt::NoBrush); - painter->setPen(buttonColor.lighter(110)); - painter->drawEllipse(br.adjusted(1, 1, -1, -1)); - - if (m_highlight) { - QColor highlight = QQuickItemPrivate::get(this)->palette()->highlight(); - highlight.setHsv(highlight.hue(), - qMin(160, highlight.saturation()), - qMax(230, highlight.value())); - highlight.setAlpha(127); - painter->setPen(QPen(highlight, 2.0)); - painter->setBrush(Qt::NoBrush); - painter->drawEllipse(br.adjusted(-1, -1, 1, 1)); - } -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/qquickfusiondial_p.h b/src/imports/controls/fusion/qquickfusiondial_p.h deleted file mode 100644 index 07c80cdb..00000000 --- a/src/imports/controls/fusion/qquickfusiondial_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKFUSIONDIAL_P_H -#define QQUICKFUSIONDIAL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickFusionDial : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(bool highlight READ highlight WRITE setHighlight FINAL) - -public: - explicit QQuickFusionDial(QQuickItem *parent = nullptr); - - bool highlight() const; - void setHighlight(bool highlight); - - void paint(QPainter *painter) override; - -private: - bool m_highlight = false; -}; - -QT_END_NAMESPACE - -#endif // QQUICKFUSIONDIAL_P_H diff --git a/src/imports/controls/fusion/qquickfusionknob.cpp b/src/imports/controls/fusion/qquickfusionknob.cpp deleted file mode 100644 index a641d190..00000000 --- a/src/imports/controls/fusion/qquickfusionknob.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickfusionknob_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickFusionKnob::QQuickFusionKnob(QQuickItem *parent) - : QQuickPaintedItem(parent) -{ - connect(this, &QQuickItem::paletteChanged, this, [this](){ update(); }); -} - -// extracted from QStyleHelper::drawDial() -void QQuickFusionKnob::paint(QPainter *painter) -{ - const qreal w = width(); - const qreal h = height(); - if (w <= 0 || h <= 0) - return; - - QColor color = QQuickItemPrivate::get(this)->palette()->button(); - color.setHsv(color.hue(), - qMin(140, color .saturation()), - qMax(180, color.value())); - color = color.lighter(104); - color.setAlphaF(qreal(0.8)); - - const qreal sz = qMin(w, h); - QRectF rect(0, 0, sz, sz); - rect.moveCenter(QPointF(w / 2.0, h / 2.0)); - const QPointF center = rect.center(); - - QRadialGradient gradient(center.x() + rect.width() / 2, - center.y() + rect.width(), - rect.width() * 2, - center.x(), center.y()); - gradient.setColorAt(1, color.darker(140)); - gradient.setColorAt(qreal(0.4), color.darker(120)); - gradient.setColorAt(0, color.darker(110)); - - painter->setRenderHint(QPainter::Antialiasing); - painter->setBrush(gradient); - painter->setPen(QColor(255, 255, 255, 150)); - painter->drawEllipse(rect); - painter->setPen(QColor(0, 0, 0, 80)); - painter->drawEllipse(rect.adjusted(1, 1, -1, -1)); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/qquickfusionknob_p.h b/src/imports/controls/fusion/qquickfusionknob_p.h deleted file mode 100644 index 85e5f53e..00000000 --- a/src/imports/controls/fusion/qquickfusionknob_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKFUSIONKNOB_P_H -#define QQUICKFUSIONKNOB_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickFusionKnob : public QQuickPaintedItem -{ - Q_OBJECT - -public: - explicit QQuickFusionKnob(QQuickItem *parent = nullptr); - - void paint(QPainter *painter) override; -}; - -QT_END_NAMESPACE - -#endif // QQUICKFUSIONKNOB_P_H diff --git a/src/imports/controls/fusion/qquickfusionstyle_p.h b/src/imports/controls/fusion/qquickfusionstyle_p.h index 0e7526ee..4655fd3d 100644 --- a/src/imports/controls/fusion/qquickfusionstyle_p.h +++ b/src/imports/controls/fusion/qquickfusionstyle_p.h @@ -50,6 +50,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -62,6 +63,9 @@ class QQuickFusionStyle : public QObject Q_PROPERTY(QColor darkShade READ darkShade CONSTANT) Q_PROPERTY(QColor topShadow READ topShadow CONSTANT) Q_PROPERTY(QColor innerContrastLine READ innerContrastLine CONSTANT) + QML_NAMED_ELEMENT(Fusion) + QML_SINGLETON + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickFusionStyle(QObject *parent = nullptr); diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc b/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc index 74c8e671..0a9e195a 100644 --- a/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc +++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc @@ -1,5 +1,5 @@ - + images/arrow.png images/arrow@2x.png images/arrow@3x.png diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp index 985945cf..1f9b4a1b 100644 --- a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp +++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp @@ -37,22 +37,12 @@ #include #include -#include "qquickfusionbusyindicator_p.h" -#include "qquickfusiondial_p.h" -#include "qquickfusionknob_p.h" #include "qquickfusionstyle_p.h" #include "qquickfusiontheme_p.h" QT_BEGIN_NAMESPACE -static QObject *styleSingleton(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - return new QQuickFusionStyle; -} - -class QtQuickControls2FusionStylePlugin: public QQuickStylePlugin +class QtQuickControls2FusionStylePlugin : public QQuickStylePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) @@ -72,18 +62,9 @@ QtQuickControls2FusionStylePlugin::QtQuickControls2FusionStylePlugin(QObject *pa void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri) { - qmlRegisterModule(uri, 2, 3); // Qt 5.10->2.3 - qmlRegisterModule(uri, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterSingletonType(import, 2, 3, "Fusion", styleSingleton); - - qmlRegisterType(import, 2, 3, "BusyIndicatorImpl"); - qmlRegisterType(import, 2, 3, "DialImpl"); - qmlRegisterType(import, 2, 3, "KnobImpl"); - qmlRegisterType(resolvedUrl(QStringLiteral("ButtonPanel.qml")), import, 2, 3, "ButtonPanel"); qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 3, "CheckIndicator"); qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 3, "RadioIndicator"); diff --git a/src/imports/controls/imagine/.prev_CMakeLists.txt b/src/imports/controls/imagine/.prev_CMakeLists.txt index 5533f872..a7c0a59e 100644 --- a/src/imports/controls/imagine/.prev_CMakeLists.txt +++ b/src/imports/controls/imagine/.prev_CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2imaginestyleplugin - TARGET_PATH "QtQuick/Controls.2/Imagine" + TARGET_PATH "QtQuick/Controls/Imagine" URI "QtQuick.Controls.Imagine" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2ImagineStylePlugin @@ -56,7 +56,7 @@ set(qmake_qtquickcontrols2imaginestyle_resource_files qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imaginestyle" PREFIX - "qt-project.org/imports/QtQuick/Controls.2/Imagine" + "qt-project.org/imports/QtQuick/Controls/Imagine" FILES ${qmake_qtquickcontrols2imaginestyle_resource_files} ) @@ -66,7 +66,7 @@ qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imagin # IMPORT_NAME = "QtQuick.Controls.Imagine" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Imagine" +# TARGETPATH = "QtQuick/Controls/Imagine" # _REQUIREMENTS = "qtConfig(quickcontrols2-imagine)" set(qml_files diff --git a/src/imports/controls/imagine/CMakeLists.txt b/src/imports/controls/imagine/CMakeLists.txt index 5533f872..a7c0a59e 100644 --- a/src/imports/controls/imagine/CMakeLists.txt +++ b/src/imports/controls/imagine/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2imaginestyleplugin - TARGET_PATH "QtQuick/Controls.2/Imagine" + TARGET_PATH "QtQuick/Controls/Imagine" URI "QtQuick.Controls.Imagine" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2ImagineStylePlugin @@ -56,7 +56,7 @@ set(qmake_qtquickcontrols2imaginestyle_resource_files qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imaginestyle" PREFIX - "qt-project.org/imports/QtQuick/Controls.2/Imagine" + "qt-project.org/imports/QtQuick/Controls/Imagine" FILES ${qmake_qtquickcontrols2imaginestyle_resource_files} ) @@ -66,7 +66,7 @@ qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imagin # IMPORT_NAME = "QtQuick.Controls.Imagine" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Imagine" +# TARGETPATH = "QtQuick/Controls/Imagine" # _REQUIREMENTS = "qtConfig(quickcontrols2-imagine)" set(qml_files diff --git a/src/imports/controls/imagine/OpacityMask.qml b/src/imports/controls/imagine/OpacityMask.qml deleted file mode 100644 index 040bdcf4..00000000 --- a/src/imports/controls/imagine/OpacityMask.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 - -/* - A cross-graphics API implementation of QtGraphicalEffects' OpacityMask. - */ -Item { - id: rootItem - - property variant source - property variant maskSource - property bool cached: false - - ShaderEffectSource { - id: cacheItem - anchors.fill: parent - visible: rootItem.cached - smooth: true - sourceItem: shaderItem - live: true - hideSource: visible - } - - ShaderEffect { - id: shaderItem - property variant source: rootItem.source - property variant maskSource: rootItem.maskSource - - anchors.fill: parent - - fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/shaders/OpacityMask.frag" - } -} diff --git a/src/imports/controls/imagine/imagine.pri b/src/imports/controls/imagine/imagine.pri index 9033808f..1c9ffaa2 100644 --- a/src/imports/controls/imagine/imagine.pri +++ b/src/imports/controls/imagine/imagine.pri @@ -1,3 +1,11 @@ +HEADERS += \ + $$PWD/qquickimaginestyle_p.h \ + $$PWD/qquickimaginetheme_p.h + +SOURCES += \ + $$PWD/qquickimaginestyle.cpp \ + $$PWD/qquickimaginetheme.cpp + QML_FILES += \ $$PWD/ApplicationWindow.qml \ $$PWD/BusyIndicator.qml \ @@ -18,7 +26,6 @@ QML_FILES += \ $$PWD/Menu.qml \ $$PWD/MenuItem.qml \ $$PWD/MenuSeparator.qml \ - $$PWD/OpacityMask.qml \ $$PWD/PageIndicator.qml \ $$PWD/Page.qml \ $$PWD/Pane.qml \ @@ -48,15 +55,3 @@ QML_FILES += \ $$PWD/ToolTip.qml \ $$PWD/Tumbler.qml \ $$PWD/VerticalHeaderView.qml - -HEADERS += \ - $$PWD/qquickimageselector_p.h \ - $$PWD/qquickimaginestyle_p.h \ - $$PWD/qquickimaginetheme_p.h \ - $$PWD/qquickninepatchimage_p.h - -SOURCES += \ - $$PWD/qquickimageselector.cpp \ - $$PWD/qquickimaginestyle.cpp \ - $$PWD/qquickimaginetheme.cpp \ - $$PWD/qquickninepatchimage.cpp diff --git a/src/imports/controls/imagine/imagine.pro b/src/imports/controls/imagine/imagine.pro index 66aec543..0dfba717 100644 --- a/src/imports/controls/imagine/imagine.pro +++ b/src/imports/controls/imagine/imagine.pro @@ -5,7 +5,7 @@ IMPORT_NAME = QtQuick.Controls.Imagine IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII @@ -18,13 +18,10 @@ OTHER_FILES += \ SOURCES += \ $$PWD/qtquickcontrols2imaginestyleplugin.cpp -qtquickcontrols2imaginestyle.prefix = qt-project.org/imports/QtQuick/Controls.2/Imagine +qtquickcontrols2imaginestyle.prefix = qt-project.org/imports/QtQuick/Controls/Imagine qtquickcontrols2imaginestyle.files += \ $$files($$PWD/images/*.png) \ - $$files($$PWD/images/*.webp) \ - $$files($$PWD/shaders/OpacityMask.frag) \ - $$files($$PWD/shaders/+glslcore/OpacityMask.frag) \ - $$files($$PWD/shaders/+qsb/OpacityMask.frag) + $$files($$PWD/images/*.webp) RESOURCES += qtquickcontrols2imaginestyle CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler diff --git a/src/imports/controls/imagine/impl/OpacityMask.qml b/src/imports/controls/imagine/impl/OpacityMask.qml new file mode 100644 index 00000000..90175386 --- /dev/null +++ b/src/imports/controls/imagine/impl/OpacityMask.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 + +/* + A cross-graphics API implementation of QtGraphicalEffects' OpacityMask. + */ +Item { + id: rootItem + + property variant source + property variant maskSource + property bool cached: false + + ShaderEffectSource { + id: cacheItem + anchors.fill: parent + visible: rootItem.cached + smooth: true + sourceItem: shaderItem + live: true + hideSource: visible + } + + ShaderEffect { + id: shaderItem + property variant source: rootItem.source + property variant maskSource: rootItem.maskSource + + anchors.fill: parent + + fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls/Imagine/impl/shaders/OpacityMask.frag" + } +} diff --git a/src/imports/controls/imagine/impl/imagine-impl.pro b/src/imports/controls/imagine/impl/imagine-impl.pro new file mode 100644 index 00000000..cb0f7043 --- /dev/null +++ b/src/imports/controls/imagine/impl/imagine-impl.pro @@ -0,0 +1,39 @@ +TARGET = qtquickcontrols2imaginestyleimplplugin +TARGETPATH = QtQuick/Controls.2/Imagine/impl + +QML_IMPORT_NAME = QtQuick.Controls.Imagine.impl +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private +QT_FOR_CONFIG = quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +QML_FILES += \ + $$PWD/OpacityMask.qml + +OTHER_FILES += \ + qmldir \ + $$QML_FILES + +HEADERS += \ + $$PWD/qquickimageselector_p.h \ + $$PWD/qquickninepatchimage_p.h + +SOURCES += \ + $$PWD/qquickimageselector.cpp \ + $$PWD/qquickninepatchimage.cpp \ + $$PWD/qtquickcontrols2imaginestyleimplplugin.cpp + +qtquickcontrols2imaginestyleimpl.prefix = qt-project.org/imports/QtQuick/Controls/Imagine/impl +qtquickcontrols2imaginestyleimpl.files += \ + $$files($$PWD/shaders/OpacityMask.frag) \ + $$files($$PWD/shaders/+glslcore/OpacityMask.frag) \ + $$files($$PWD/shaders/+qsb/OpacityMask.frag) +RESOURCES += qtquickcontrols2imaginestyleimpl + +CONFIG += qmltypes install_qmltypes no_cxx_module builtin_resources qtquickcompiler +load(qml_plugin) + +requires(qtConfig(quickcontrols2-imagine)) diff --git a/src/imports/controls/imagine/impl/qmldir b/src/imports/controls/imagine/impl/qmldir new file mode 100644 index 00000000..9febda6d --- /dev/null +++ b/src/imports/controls/imagine/impl/qmldir @@ -0,0 +1,6 @@ +module QtQuick.Controls.Imagine.impl +plugin qtquickcontrols2imaginestyleimplplugin +classname QtQuickControls2ImagineStyleImplPlugin + +#TODO: update to 6.0 +OpacityMask 2.0 OpacityMask.qml diff --git a/src/imports/controls/imagine/impl/qquickimageselector.cpp b/src/imports/controls/imagine/impl/qquickimageselector.cpp new file mode 100644 index 00000000..dcb7738c --- /dev/null +++ b/src/imports/controls/imagine/impl/qquickimageselector.cpp @@ -0,0 +1,338 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickimageselector_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +Q_LOGGING_CATEGORY(lcQtQuickControlsImagine, "qt.quick.controls.imagine") + +static const int DEFAULT_CACHE = 500; + +static inline int cacheSize() +{ + static bool ok = false; + static const int size = qEnvironmentVariableIntValue("QT_QUICK_CONTROLS_IMAGINE_CACHE", &ok); + return ok ? size : DEFAULT_CACHE; +} + +// input: [focused, pressed] +// => [[focused, pressed], [pressed, focused], [focused], [pressed]] +static QList permutations(const QStringList &input, int count = -1) +{ + if (count == -1) + count = input.count(); + + QList output; + for (int i = 0; i < input.count(); ++i) { + QStringList sub = input.mid(i, count); + + if (count > 1) { + if (i + count > input.count()) + sub += input.mid(0, count - i + 1); + + std::sort(sub.begin(), sub.end()); + do { + if (!sub.isEmpty()) + output += sub; + } while (std::next_permutation(sub.begin(), sub.end())); + } else { + output += sub; + } + + if (count == input.count()) + break; + } + + if (count > 1) + output += permutations(input, --count); + + return output; +} + +static QString findFile(const QDir &dir, const QString &baseName, const QStringList &extensions) +{ + for (const QString &ext : extensions) { + QString filePath = dir.filePath(baseName + QLatin1Char('.') + ext); + if (QFile::exists(filePath)) + return QFileSelector().select(filePath); + } + // return an empty string to indicate that the lookup has been done + // even if no matching asset was found + return QLatin1String(""); +} + +QQuickImageSelector::QQuickImageSelector(QObject *parent) + : QObject(parent), + m_cache(cacheSize() > 0) +{ +} + +QUrl QQuickImageSelector::source() const +{ + return m_source; +} + +void QQuickImageSelector::setSource(const QUrl &source) +{ + if (m_property.isValid()) + QQmlPropertyPrivate::write(m_property, source, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); + if (m_source == source) + return; + + m_source = source; + emit sourceChanged(); +} + +QString QQuickImageSelector::name() const +{ + return m_name; +} + +void QQuickImageSelector::setName(const QString &name) +{ + if (m_name == name) + return; + + m_name = name; + if (m_complete) + updateSource(); +} + +QString QQuickImageSelector::path() const +{ + return m_path; +} + +void QQuickImageSelector::setPath(const QString &path) +{ + if (m_path == path) + return; + + m_path = path; + if (m_complete) + updateSource(); +} + +QVariantList QQuickImageSelector::states() const +{ + return m_allStates; +} + +void QQuickImageSelector::setStates(const QVariantList &states) +{ + if (m_allStates == states) + return; + + m_allStates = states; + if (updateActiveStates() && m_complete) + updateSource(); +} + +QString QQuickImageSelector::separator() const +{ + return m_separator; +} + +void QQuickImageSelector::setSeparator(const QString &separator) +{ + if (m_separator == separator) + return; + + m_separator = separator; + if (m_complete) + updateSource(); +} + +bool QQuickImageSelector::cache() const +{ + return m_cache; +} + +void QQuickImageSelector::setCache(bool cache) +{ + m_cache = cache; +} + +void QQuickImageSelector::write(const QVariant &value) +{ + setUrl(value.toUrl()); +} + +void QQuickImageSelector::setTarget(const QQmlProperty &property) +{ + m_property = property; +} + +void QQuickImageSelector::classBegin() +{ +} + +void QQuickImageSelector::componentComplete() +{ + setUrl(m_property.read().toUrl()); + m_complete = true; + updateSource(); +} + +QStringList QQuickImageSelector::fileExtensions() const +{ + static const QStringList extensions = QStringList() << QStringLiteral("png"); + return extensions; +} + +QString QQuickImageSelector::cacheKey() const +{ + if (!m_cache) + return QString(); + + return m_path + m_name + m_activeStates.join(m_separator); +} + +void QQuickImageSelector::updateSource() +{ + static QCache cache(cacheSize()); + + const QString key = cacheKey(); + + QString bestFilePath; + + if (m_cache) { + QString *cachedPath = cache.object(key); + if (cachedPath) + bestFilePath = *cachedPath; + } + + // note: a cached file path may be empty + if (bestFilePath.isNull()) { + QDir dir(m_path); + int bestScore = -1; + + const QStringList extensions = fileExtensions(); + + const QList statePerms = permutations(m_activeStates); + for (const QStringList &perm : statePerms) { + const QString filePath = findFile(dir, m_name + m_separator + perm.join(m_separator), extensions); + if (!filePath.isEmpty()) { + int score = calculateScore(perm); + if (score > bestScore) { + bestScore = score; + bestFilePath = filePath; + } + } + } + + if (bestFilePath.isEmpty()) + bestFilePath = findFile(dir, m_name, extensions); + + if (m_cache) + cache.insert(key, new QString(bestFilePath)); + } + + qCDebug(lcQtQuickControlsImagine) << m_name << m_activeStates << "->" << bestFilePath; + + if (bestFilePath.startsWith(QLatin1Char(':'))) + setSource(QUrl(QLatin1String("qrc") + bestFilePath)); + else + setSource(QUrl::fromLocalFile(bestFilePath)); +} + +void QQuickImageSelector::setUrl(const QUrl &url) +{ + QFileInfo fileInfo(QQmlFile::urlToLocalFileOrQrc(url)); + setName(fileInfo.fileName()); + setPath(fileInfo.path()); +} + +bool QQuickImageSelector::updateActiveStates() +{ + QStringList active; + for (const QVariant &v : qAsConst(m_allStates)) { + const QVariantMap state = v.toMap(); + if (state.isEmpty()) + continue; + auto it = state.begin(); + if (it.value().toBool()) + active += it.key(); + } + + if (m_activeStates == active) + return false; + + m_activeStates = active; + return true; +} + +int QQuickImageSelector::calculateScore(const QStringList &states) const +{ + int score = 0; + for (int i = 0; i < states.count(); ++i) + score += (m_activeStates.count() - m_activeStates.indexOf(states.at(i))) << 1; + return score; +} + +QQuickNinePatchImageSelector::QQuickNinePatchImageSelector(QObject *parent) + : QQuickImageSelector(parent) +{ +} + +QStringList QQuickNinePatchImageSelector::fileExtensions() const +{ + static const QStringList extensions = QStringList() << QStringLiteral("9.png") << QStringLiteral("png"); + return extensions; +} + +QQuickAnimatedImageSelector::QQuickAnimatedImageSelector(QObject *parent) + : QQuickImageSelector(parent) +{ +} + +QStringList QQuickAnimatedImageSelector::fileExtensions() const +{ + static const QStringList extensions = QStringList() << QStringLiteral("webp") << QStringLiteral("gif"); + return extensions; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/impl/qquickimageselector_p.h b/src/imports/controls/imagine/impl/qquickimageselector_p.h new file mode 100644 index 00000000..351caefb --- /dev/null +++ b/src/imports/controls/imagine/impl/qquickimageselector_p.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKIMAGESELECTOR_P_H +#define QQUICKIMAGESELECTOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickImageSelector : public QObject, public QQmlParserStatus, public QQmlPropertyValueInterceptor +{ + Q_OBJECT + Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged FINAL) + Q_PROPERTY(QString name READ name WRITE setName FINAL) + Q_PROPERTY(QString path READ path WRITE setPath FINAL) + Q_PROPERTY(QVariantList states READ states WRITE setStates FINAL) + Q_PROPERTY(QString separator READ separator WRITE setSeparator FINAL) + Q_PROPERTY(bool cache READ cache WRITE setCache FINAL) + Q_INTERFACES(QQmlParserStatus QQmlPropertyValueInterceptor) + QML_NAMED_ELEMENT(ImageSelector) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickImageSelector(QObject *parent = nullptr); + + QUrl source() const; + void setSource(const QUrl &source); + + QString name() const; + void setName(const QString &name); + + QString path() const; + void setPath(const QString &path); + + QVariantList states() const; + void setStates(const QVariantList &states); + + QString separator() const; + void setSeparator(const QString &separator); + + bool cache() const; + void setCache(bool cache); + + void write(const QVariant &value) override; + void setTarget(const QQmlProperty &property) override; + +Q_SIGNALS: + void sourceChanged(); + +protected: + void classBegin() override; + void componentComplete() override; + + virtual QStringList fileExtensions() const; + + QString cacheKey() const; + void updateSource(); + void setUrl(const QUrl &url); + bool updateActiveStates(); + int calculateScore(const QStringList &states) const; + +private: + bool m_cache = false; + bool m_complete = false; + QUrl m_source; + QString m_path; + QString m_name; + QString m_separator = QLatin1String("-"); + QVariantList m_allStates; + QStringList m_activeStates; + QQmlProperty m_property; +}; + +class QQuickNinePatchImageSelector : public QQuickImageSelector +{ + Q_OBJECT + QML_NAMED_ELEMENT(NinePatchImageSelector) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickNinePatchImageSelector(QObject *parent = nullptr); + +protected: + QStringList fileExtensions() const override; +}; + +class QQuickAnimatedImageSelector : public QQuickImageSelector +{ + Q_OBJECT + QML_NAMED_ELEMENT(AnimatedImageSelector) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickAnimatedImageSelector(QObject *parent = nullptr); + +protected: + QStringList fileExtensions() const override; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickImageSelector) +QML_DECLARE_TYPE(QQuickAnimatedImageSelector) + +#endif // QQUICKIMAGESELECTOR_P_H diff --git a/src/imports/controls/imagine/impl/qquickninepatchimage.cpp b/src/imports/controls/imagine/impl/qquickninepatchimage.cpp new file mode 100644 index 00000000..1d6d60dd --- /dev/null +++ b/src/imports/controls/imagine/impl/qquickninepatchimage.cpp @@ -0,0 +1,457 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickninepatchimage_p.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +struct QQuickNinePatchData +{ + QList coordsForSize(qreal count) const; + + inline bool isNull() const { return data.isEmpty(); } + inline int count() const { return data.size(); } + inline qreal at(int index) const { return data.at(index); } + inline qreal size() const { return data.last(); } + + void fill(const QList &coords, qreal count); + void clear(); + +private: + bool inverted = false; + QList data; +}; + +QList QQuickNinePatchData::coordsForSize(qreal size) const +{ + // n = number of stretchable sections + // We have to compensate when adding 0 and/or + // the source image width to the divs vector. + const int l = data.size(); + const int n = (inverted ? l - 1 : l) / 2; + const qreal stretch = (size - data.last()) / n; + + QList coords; + coords.reserve(l); + coords.append(0); + + bool stretched = !inverted; + for (int i = 1; i < l; ++i) { + qreal advance = data[i] - data[i - 1]; + if (stretched) + advance += stretch; + coords.append(coords.last() + advance); + + stretched = !stretched; + } + + return coords; +} + +void QQuickNinePatchData::fill(const QList &coords, qreal size) +{ + data.clear(); + inverted = coords.isEmpty() || coords.first() != 0; + + // Reserve an extra item in case we need to add the image width/height + if (inverted) { + data.reserve(coords.size() + 2); + data.append(0); + } else { + data.reserve(coords.size() + 1); + } + + data += coords; + data.append(size); +} + +void QQuickNinePatchData::clear() +{ + data.clear(); +} + +class QQuickNinePatchNode : public QSGGeometryNode +{ +public: + QQuickNinePatchNode(); + ~QQuickNinePatchNode(); + + void initialize(QSGTexture *texture, const QSizeF &targetSize, const QSize &sourceSize, + const QQuickNinePatchData &xDivs, const QQuickNinePatchData &yDivs, qreal dpr); + +private: + QSGGeometry m_geometry; + QSGTextureMaterial m_material; +}; + +QQuickNinePatchNode::QQuickNinePatchNode() + : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) +{ + m_geometry.setDrawingMode(QSGGeometry::DrawTriangles); + setGeometry(&m_geometry); + setMaterial(&m_material); +} + +QQuickNinePatchNode::~QQuickNinePatchNode() +{ + delete m_material.texture(); +} + +void QQuickNinePatchNode::initialize(QSGTexture *texture, const QSizeF &targetSize, const QSize &sourceSize, + const QQuickNinePatchData &xDivs, const QQuickNinePatchData &yDivs, qreal dpr) +{ + delete m_material.texture(); + m_material.setTexture(texture); + + const int xlen = xDivs.count(); + const int ylen = yDivs.count(); + + if (xlen > 0 && ylen > 0) { + const int quads = (xlen - 1) * (ylen - 1); + static const int verticesPerQuad = 6; + m_geometry.allocate(xlen * ylen, verticesPerQuad * quads); + + QSGGeometry::TexturedPoint2D *vertices = m_geometry.vertexDataAsTexturedPoint2D(); + QList xCoords = xDivs.coordsForSize(targetSize.width()); + QList yCoords = yDivs.coordsForSize(targetSize.height()); + + for (int y = 0; y < ylen; ++y) { + for (int x = 0; x < xlen; ++x, ++vertices) + vertices->set(xCoords[x] / dpr, yCoords[y] / dpr, + xDivs.at(x) / sourceSize.width(), + yDivs.at(y) / sourceSize.height()); + } + + quint16 *indices = m_geometry.indexDataAsUShort(); + int n = quads; + for (int q = 0; n--; ++q) { + if ((q + 1) % xlen == 0) // next row + ++q; + // Bottom-left half quad triangle + indices[0] = q; + indices[1] = q + xlen; + indices[2] = q + xlen + 1; + + // Top-right half quad triangle + indices[3] = q; + indices[4] = q + xlen + 1; + indices[5] = q + 1; + + indices += verticesPerQuad; + } + } + + markDirty(QSGNode::DirtyGeometry | QSGNode::DirtyMaterial); +} + +class QQuickNinePatchImagePrivate : public QQuickImagePrivate +{ + Q_DECLARE_PUBLIC(QQuickNinePatchImage) + +public: + void updatePatches(); + void updatePaddings(const QSizeF &size, const QList &horizontal, const QList &vertical); + void updateInsets(const QList &horizontal, const QList &vertical); + + bool resetNode = false; + qreal topPadding = 0; + qreal leftPadding = 0; + qreal rightPadding = 0; + qreal bottomPadding = 0; + qreal topInset = 0; + qreal leftInset = 0; + qreal rightInset = 0; + qreal bottomInset = 0; + + QImage ninePatch; + QQuickNinePatchData xDivs; + QQuickNinePatchData yDivs; +}; + +static QList readCoords(const QRgb *data, int from, int count, int offset, QRgb color) +{ + int p1 = -1; + QList coords; + for (int i = 0; i < count; ++i) { + int p2 = from + i * offset; + if (data[p2] == color) { + // colored pixel + if (p1 == -1) + p1 = i; + } else { + // empty pixel + if (p1 != -1) { + coords << p1 << i; + p1 = -1; + } + } + } + return coords; +} + +void QQuickNinePatchImagePrivate::updatePatches() +{ + if (ninePatch.isNull()) + return; + + int w = ninePatch.width(); + int h = ninePatch.height(); + const QRgb *data = reinterpret_cast(ninePatch.constBits()); + + const QRgb black = qRgb(0,0,0); + const QRgb red = qRgb(255,0,0); + + xDivs.fill(readCoords(data, 1, w - 1, 1, black), w - 2); // top left -> top right + yDivs.fill(readCoords(data, w, h - 1, w, black), h - 2); // top left -> bottom left + + QList hInsets = readCoords(data, (h - 1) * w + 1, w - 1, 1, red); // bottom left -> bottom right + QList vInsets = readCoords(data, 2 * w - 1, h - 1, w, red); // top right -> bottom right + updateInsets(hInsets, vInsets); + + const QSizeF sz(w - leftInset - rightInset, h - topInset - bottomInset); + QList hPaddings = readCoords(data, (h - 1) * w + leftInset + 1, sz.width() - 2, 1, black); // bottom left -> bottom right + QList vPaddings = readCoords(data, (2 + topInset) * w - 1, sz.height() - 2, w, black); // top right -> bottom right + updatePaddings(sz, hPaddings, vPaddings); +} + +void QQuickNinePatchImagePrivate::updatePaddings(const QSizeF &size, const QList &horizontal, const QList &vertical) +{ + Q_Q(QQuickNinePatchImage); + qreal oldTopPadding = topPadding; + qreal oldLeftPadding = leftPadding; + qreal oldRightPadding = rightPadding; + qreal oldBottomPadding = bottomPadding; + + if (horizontal.count() >= 2) { + leftPadding = horizontal.first(); + rightPadding = size.width() - horizontal.last() - 2; + } else { + leftPadding = 0; + rightPadding = 0; + } + + if (vertical.count() >= 2) { + topPadding = vertical.first(); + bottomPadding = size.height() - vertical.last() - 2; + } else { + topPadding = 0; + bottomPadding = 0; + } + + if (!qFuzzyCompare(oldTopPadding, topPadding)) + emit q->topPaddingChanged(); + if (!qFuzzyCompare(oldBottomPadding, bottomPadding)) + emit q->bottomPaddingChanged(); + if (!qFuzzyCompare(oldLeftPadding, leftPadding)) + emit q->leftPaddingChanged(); + if (!qFuzzyCompare(oldRightPadding, rightPadding)) + emit q->rightPaddingChanged(); +} + +void QQuickNinePatchImagePrivate::updateInsets(const QList &horizontal, const QList &vertical) +{ + Q_Q(QQuickNinePatchImage); + qreal oldTopInset = topInset; + qreal oldLeftInset = leftInset; + qreal oldRightInset = rightInset; + qreal oldBottomInset = bottomInset; + + if (horizontal.count() >= 2 && horizontal.first() == 0) + leftInset = horizontal.at(1); + else + leftInset = 0; + + if (horizontal.count() == 2 && horizontal.first() > 0) + rightInset = horizontal.last() - horizontal.first(); + else if (horizontal.count() == 4) + rightInset = horizontal.last() - horizontal.at(2); + else + rightInset = 0; + + if (vertical.count() >= 2 && vertical.first() == 0) + topInset = vertical.at(1); + else + topInset = 0; + + if (vertical.count() == 2 && vertical.first() > 0) + bottomInset = vertical.last() - vertical.first(); + else if (vertical.count() == 4) + bottomInset = vertical.last() - vertical.at(2); + else + bottomInset = 0; + + if (!qFuzzyCompare(oldTopInset, topInset)) + emit q->topInsetChanged(); + if (!qFuzzyCompare(oldBottomInset, bottomInset)) + emit q->bottomInsetChanged(); + if (!qFuzzyCompare(oldLeftInset, leftInset)) + emit q->leftInsetChanged(); + if (!qFuzzyCompare(oldRightInset, rightInset)) + emit q->rightInsetChanged(); +} + +QQuickNinePatchImage::QQuickNinePatchImage(QQuickItem *parent) + : QQuickImage(*(new QQuickNinePatchImagePrivate), parent) +{ +} + +qreal QQuickNinePatchImage::topPadding() const +{ + Q_D(const QQuickNinePatchImage); + return d->topPadding / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::leftPadding() const +{ + Q_D(const QQuickNinePatchImage); + return d->leftPadding / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::rightPadding() const +{ + Q_D(const QQuickNinePatchImage); + return d->rightPadding / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::bottomPadding() const +{ + Q_D(const QQuickNinePatchImage); + return d->bottomPadding / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::topInset() const +{ + Q_D(const QQuickNinePatchImage); + return d->topInset / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::leftInset() const +{ + Q_D(const QQuickNinePatchImage); + return d->leftInset / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::rightInset() const +{ + Q_D(const QQuickNinePatchImage); + return d->rightInset / d->devicePixelRatio; +} + +qreal QQuickNinePatchImage::bottomInset() const +{ + Q_D(const QQuickNinePatchImage); + return d->bottomInset / d->devicePixelRatio; +} + +void QQuickNinePatchImage::pixmapChange() +{ + Q_D(QQuickNinePatchImage); + if (QFileInfo(d->url.fileName()).completeSuffix().toLower() == QLatin1String("9.png")) { + d->resetNode = d->ninePatch.isNull(); + d->ninePatch = d->pix.image(); + if (d->ninePatch.depth() != 32) + d->ninePatch = d->ninePatch.convertToFormat(QImage::Format_ARGB32); + + int w = d->ninePatch.width(); + int h = d->ninePatch.height(); + d->pix.setImage(QImage(d->ninePatch.constBits() + 4 * (w + 1), w - 2, h - 2, d->ninePatch.bytesPerLine(), d->ninePatch.format())); + + d->updatePatches(); + } else { + /* + Only change resetNode when it's false; i.e. when no reset is pending. + updatePaintNode() will take care of setting it to false if it's true. + + Consider the following changes in source: + + normal.png => press.9.png => normal.png => focus.png + + If the last two events happen quickly, pixmapChange() can be called + twice with no call to updatePaintNode() inbetween. On the first call, + resetNode will be true (because ninePatch is not null since it is still + in the process of going from a 9-patch image to a regular image), + and on the second call, resetNode would be false if we didn't have this check. + This results in the oldNode never being deleted, and QQuickImage + tries to static_cast a QQuickNinePatchImage to a QSGInternalImageNode. + */ + if (!d->resetNode) + d->resetNode = !d->ninePatch.isNull(); + d->ninePatch = QImage(); + } + QQuickImage::pixmapChange(); +} + +QSGNode *QQuickNinePatchImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) +{ + Q_D(QQuickNinePatchImage); + Q_UNUSED(data); + + if (d->resetNode) { + delete oldNode; + oldNode = nullptr; + d->resetNode = false; + } + + QSizeF sz = size(); + QImage image = d->pix.image(); + if (!sz.isValid() || image.isNull()) { + delete oldNode; + return nullptr; + } + + if (d->ninePatch.isNull()) + return QQuickImage::updatePaintNode(oldNode, data); + + QQuickNinePatchNode *patchNode = static_cast(oldNode); + if (!patchNode) + patchNode = new QQuickNinePatchNode; + +#ifdef QSG_RUNTIME_DESCRIPTION + qsgnode_set_description(patchNode, QString::fromLatin1("QQuickNinePatchImage: '%1'").arg(d->url.toString())); +#endif + + QSGTexture *texture = window()->createTextureFromImage(image); + patchNode->initialize(texture, sz * d->devicePixelRatio, image.size(), d->xDivs, d->yDivs, d->devicePixelRatio); + return patchNode; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/impl/qquickninepatchimage_p.h b/src/imports/controls/imagine/impl/qquickninepatchimage_p.h new file mode 100644 index 00000000..78cc3068 --- /dev/null +++ b/src/imports/controls/imagine/impl/qquickninepatchimage_p.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKNINEPATCHIMAGE_P_H +#define QQUICKNINEPATCHIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QQuickNinePatchImagePrivate; + +class QQuickNinePatchImage : public QQuickImage +{ + Q_OBJECT + Q_PROPERTY(qreal topPadding READ topPadding NOTIFY topPaddingChanged FINAL) + Q_PROPERTY(qreal leftPadding READ leftPadding NOTIFY leftPaddingChanged FINAL) + Q_PROPERTY(qreal rightPadding READ rightPadding NOTIFY rightPaddingChanged FINAL) + Q_PROPERTY(qreal bottomPadding READ bottomPadding NOTIFY bottomPaddingChanged FINAL) + Q_PROPERTY(qreal topInset READ topInset NOTIFY topInsetChanged FINAL) + Q_PROPERTY(qreal leftInset READ leftInset NOTIFY leftInsetChanged FINAL) + Q_PROPERTY(qreal rightInset READ rightInset NOTIFY rightInsetChanged FINAL) + Q_PROPERTY(qreal bottomInset READ bottomInset NOTIFY bottomInsetChanged FINAL) + QML_NAMED_ELEMENT(NinePatchImage) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickNinePatchImage(QQuickItem *parent = nullptr); + + qreal topPadding() const; + qreal leftPadding() const; + qreal rightPadding() const; + qreal bottomPadding() const; + + qreal topInset() const; + qreal leftInset() const; + qreal rightInset() const; + qreal bottomInset() const; + +Q_SIGNALS: + void topPaddingChanged(); + void leftPaddingChanged(); + void rightPaddingChanged(); + void bottomPaddingChanged(); + + void topInsetChanged(); + void leftInsetChanged(); + void rightInsetChanged(); + void bottomInsetChanged(); + +protected: + void pixmapChange() override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override; + +private: + Q_DISABLE_COPY(QQuickNinePatchImage) + Q_DECLARE_PRIVATE(QQuickNinePatchImage) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickNinePatchImage) + +#endif // QQUICKNINEPATCHIMAGE_P_H diff --git a/src/imports/controls/imagine/impl/qtquickcontrols2imaginestyleimplplugin.cpp b/src/imports/controls/imagine/impl/qtquickcontrols2imaginestyleimplplugin.cpp new file mode 100644 index 00000000..514d9ed8 --- /dev/null +++ b/src/imports/controls/imagine/impl/qtquickcontrols2imaginestyleimplplugin.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2ImagineStyleImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2ImagineStyleImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2ImagineStyleImplPlugin::QtQuickControls2ImagineStyleImplPlugin(QObject *parent) + : QQmlEngineExtensionPlugin(parent) +{ +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2imaginestyleimplplugin.moc" diff --git a/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag new file mode 100644 index 00000000..529e2696 --- /dev/null +++ b/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag @@ -0,0 +1,13 @@ +#version 150 + +uniform float qt_Opacity; +uniform sampler2D source; +uniform sampler2D maskSource; + +in vec2 qt_TexCoord0; +out vec4 fragColor; + +void main() +{ + fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity; +} diff --git a/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag new file mode 100644 index 00000000..331b30b8 Binary files /dev/null and b/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag differ diff --git a/src/imports/controls/imagine/impl/shaders/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/OpacityMask.frag new file mode 100644 index 00000000..84f9bc3e --- /dev/null +++ b/src/imports/controls/imagine/impl/shaders/OpacityMask.frag @@ -0,0 +1,7 @@ +varying highp vec2 qt_TexCoord0; +uniform highp float qt_Opacity; +uniform lowp sampler2D source; +uniform lowp sampler2D maskSource; +void main(void) { + gl_FragColor = texture2D(source, qt_TexCoord0.st) * (texture2D(maskSource, qt_TexCoord0.st).a) * qt_Opacity; +} diff --git a/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag b/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag new file mode 100644 index 00000000..9ae32499 --- /dev/null +++ b/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag @@ -0,0 +1,17 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; +} ubuf; + +layout(binding = 1) uniform sampler2D source; +layout(binding = 2) uniform sampler2D maskSource; + +void main() +{ + fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * ubuf.qt_Opacity; +} diff --git a/src/imports/controls/imagine/impl/shaders/compile.bat b/src/imports/controls/imagine/impl/shaders/compile.bat new file mode 100644 index 00000000..8f16d7ac --- /dev/null +++ b/src/imports/controls/imagine/impl/shaders/compile.bat @@ -0,0 +1,40 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2020 The Qt Company Ltd. +:: Contact: https://www.qt.io/licensing/ +:: +:: This file is part of the QtQuick 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$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/OpacityMask.frag OpacityMask_rhi.frag diff --git a/src/imports/controls/imagine/qquickimageselector.cpp b/src/imports/controls/imagine/qquickimageselector.cpp deleted file mode 100644 index 67d3a24b..00000000 --- a/src/imports/controls/imagine/qquickimageselector.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickimageselector_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int DEFAULT_CACHE = 500; - -static inline int cacheSize() -{ - static bool ok = false; - static const int size = qEnvironmentVariableIntValue("QT_QUICK_CONTROLS_IMAGINE_CACHE", &ok); - return ok ? size : DEFAULT_CACHE; -} - -Q_DECLARE_LOGGING_CATEGORY(lcQtQuickControlsImagine) - -// input: [focused, pressed] -// => [[focused, pressed], [pressed, focused], [focused], [pressed]] -static QList permutations(const QStringList &input, int count = -1) -{ - if (count == -1) - count = input.count(); - - QList output; - for (int i = 0; i < input.count(); ++i) { - QStringList sub = input.mid(i, count); - - if (count > 1) { - if (i + count > input.count()) - sub += input.mid(0, count - i + 1); - - std::sort(sub.begin(), sub.end()); - do { - if (!sub.isEmpty()) - output += sub; - } while (std::next_permutation(sub.begin(), sub.end())); - } else { - output += sub; - } - - if (count == input.count()) - break; - } - - if (count > 1) - output += permutations(input, --count); - - return output; -} - -static QString findFile(const QDir &dir, const QString &baseName, const QStringList &extensions) -{ - for (const QString &ext : extensions) { - QString filePath = dir.filePath(baseName + QLatin1Char('.') + ext); - if (QFile::exists(filePath)) - return QFileSelector().select(filePath); - } - // return an empty string to indicate that the lookup has been done - // even if no matching asset was found - return QLatin1String(""); -} - -QQuickImageSelector::QQuickImageSelector(QObject *parent) - : QObject(parent), - m_cache(cacheSize() > 0) -{ -} - -QUrl QQuickImageSelector::source() const -{ - return m_source; -} - -void QQuickImageSelector::setSource(const QUrl &source) -{ - if (m_property.isValid()) - QQmlPropertyPrivate::write(m_property, source, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); - if (m_source == source) - return; - - m_source = source; - emit sourceChanged(); -} - -QString QQuickImageSelector::name() const -{ - return m_name; -} - -void QQuickImageSelector::setName(const QString &name) -{ - if (m_name == name) - return; - - m_name = name; - if (m_complete) - updateSource(); -} - -QString QQuickImageSelector::path() const -{ - return m_path; -} - -void QQuickImageSelector::setPath(const QString &path) -{ - if (m_path == path) - return; - - m_path = path; - if (m_complete) - updateSource(); -} - -QVariantList QQuickImageSelector::states() const -{ - return m_allStates; -} - -void QQuickImageSelector::setStates(const QVariantList &states) -{ - if (m_allStates == states) - return; - - m_allStates = states; - if (updateActiveStates() && m_complete) - updateSource(); -} - -QString QQuickImageSelector::separator() const -{ - return m_separator; -} - -void QQuickImageSelector::setSeparator(const QString &separator) -{ - if (m_separator == separator) - return; - - m_separator = separator; - if (m_complete) - updateSource(); -} - -bool QQuickImageSelector::cache() const -{ - return m_cache; -} - -void QQuickImageSelector::setCache(bool cache) -{ - m_cache = cache; -} - -void QQuickImageSelector::write(const QVariant &value) -{ - setUrl(value.toUrl()); -} - -void QQuickImageSelector::setTarget(const QQmlProperty &property) -{ - m_property = property; -} - -void QQuickImageSelector::classBegin() -{ -} - -void QQuickImageSelector::componentComplete() -{ - setUrl(m_property.read().toUrl()); - m_complete = true; - updateSource(); -} - -QStringList QQuickImageSelector::fileExtensions() const -{ - static const QStringList extensions = QStringList() << QStringLiteral("png"); - return extensions; -} - -QString QQuickImageSelector::cacheKey() const -{ - if (!m_cache) - return QString(); - - return m_path + m_name + m_activeStates.join(m_separator); -} - -void QQuickImageSelector::updateSource() -{ - static QCache cache(cacheSize()); - - const QString key = cacheKey(); - - QString bestFilePath; - - if (m_cache) { - QString *cachedPath = cache.object(key); - if (cachedPath) - bestFilePath = *cachedPath; - } - - // note: a cached file path may be empty - if (bestFilePath.isNull()) { - QDir dir(m_path); - int bestScore = -1; - - const QStringList extensions = fileExtensions(); - - const QList statePerms = permutations(m_activeStates); - for (const QStringList &perm : statePerms) { - const QString filePath = findFile(dir, m_name + m_separator + perm.join(m_separator), extensions); - if (!filePath.isEmpty()) { - int score = calculateScore(perm); - if (score > bestScore) { - bestScore = score; - bestFilePath = filePath; - } - } - } - - if (bestFilePath.isEmpty()) - bestFilePath = findFile(dir, m_name, extensions); - - if (m_cache) - cache.insert(key, new QString(bestFilePath)); - } - - qCDebug(lcQtQuickControlsImagine) << m_name << m_activeStates << "->" << bestFilePath; - - if (bestFilePath.startsWith(QLatin1Char(':'))) - setSource(QUrl(QLatin1String("qrc") + bestFilePath)); - else - setSource(QUrl::fromLocalFile(bestFilePath)); -} - -void QQuickImageSelector::setUrl(const QUrl &url) -{ - QFileInfo fileInfo(QQmlFile::urlToLocalFileOrQrc(url)); - setName(fileInfo.fileName()); - setPath(fileInfo.path()); -} - -bool QQuickImageSelector::updateActiveStates() -{ - QStringList active; - for (const QVariant &v : qAsConst(m_allStates)) { - const QVariantMap state = v.toMap(); - if (state.isEmpty()) - continue; - auto it = state.begin(); - if (it.value().toBool()) - active += it.key(); - } - - if (m_activeStates == active) - return false; - - m_activeStates = active; - return true; -} - -int QQuickImageSelector::calculateScore(const QStringList &states) const -{ - int score = 0; - for (int i = 0; i < states.count(); ++i) - score += (m_activeStates.count() - m_activeStates.indexOf(states.at(i))) << 1; - return score; -} - -QQuickNinePatchImageSelector::QQuickNinePatchImageSelector(QObject *parent) - : QQuickImageSelector(parent) -{ -} - -QStringList QQuickNinePatchImageSelector::fileExtensions() const -{ - static const QStringList extensions = QStringList() << QStringLiteral("9.png") << QStringLiteral("png"); - return extensions; -} - -QQuickAnimatedImageSelector::QQuickAnimatedImageSelector(QObject *parent) - : QQuickImageSelector(parent) -{ -} - -QStringList QQuickAnimatedImageSelector::fileExtensions() const -{ - static const QStringList extensions = QStringList() << QStringLiteral("webp") << QStringLiteral("gif"); - return extensions; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/qquickimageselector_p.h b/src/imports/controls/imagine/qquickimageselector_p.h deleted file mode 100644 index d050707d..00000000 --- a/src/imports/controls/imagine/qquickimageselector_p.h +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKIMAGESELECTOR_P_H -#define QQUICKIMAGESELECTOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickImageSelector : public QObject, public QQmlParserStatus, public QQmlPropertyValueInterceptor -{ - Q_OBJECT - Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged FINAL) - Q_PROPERTY(QString name READ name WRITE setName FINAL) - Q_PROPERTY(QString path READ path WRITE setPath FINAL) - Q_PROPERTY(QVariantList states READ states WRITE setStates FINAL) - Q_PROPERTY(QString separator READ separator WRITE setSeparator FINAL) - Q_PROPERTY(bool cache READ cache WRITE setCache FINAL) - Q_INTERFACES(QQmlParserStatus QQmlPropertyValueInterceptor) - -public: - explicit QQuickImageSelector(QObject *parent = nullptr); - - QUrl source() const; - void setSource(const QUrl &source); - - QString name() const; - void setName(const QString &name); - - QString path() const; - void setPath(const QString &path); - - QVariantList states() const; - void setStates(const QVariantList &states); - - QString separator() const; - void setSeparator(const QString &separator); - - bool cache() const; - void setCache(bool cache); - - void write(const QVariant &value) override; - void setTarget(const QQmlProperty &property) override; - -Q_SIGNALS: - void sourceChanged(); - -protected: - void classBegin() override; - void componentComplete() override; - - virtual QStringList fileExtensions() const; - - QString cacheKey() const; - void updateSource(); - void setUrl(const QUrl &url); - bool updateActiveStates(); - int calculateScore(const QStringList &states) const; - -private: - bool m_cache = false; - bool m_complete = false; - QUrl m_source; - QString m_path; - QString m_name; - QString m_separator = QLatin1String("-"); - QVariantList m_allStates; - QStringList m_activeStates; - QQmlProperty m_property; -}; - -class QQuickNinePatchImageSelector : public QQuickImageSelector -{ - Q_OBJECT - -public: - explicit QQuickNinePatchImageSelector(QObject *parent = nullptr); - -protected: - QStringList fileExtensions() const override; -}; - -class QQuickAnimatedImageSelector : public QQuickImageSelector -{ - Q_OBJECT - -public: - explicit QQuickAnimatedImageSelector(QObject *parent = nullptr); - -protected: - QStringList fileExtensions() const override; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickImageSelector) -QML_DECLARE_TYPE(QQuickAnimatedImageSelector) - -#endif // QQUICKIMAGESELECTOR_P_H diff --git a/src/imports/controls/imagine/qquickimaginestyle.cpp b/src/imports/controls/imagine/qquickimaginestyle.cpp index 745bef10..37e55b61 100644 --- a/src/imports/controls/imagine/qquickimaginestyle.cpp +++ b/src/imports/controls/imagine/qquickimaginestyle.cpp @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC_WITH_ARGS(QString, GlobalPath, (QLatin1String("qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/"))) +Q_GLOBAL_STATIC_WITH_ARGS(QString, GlobalPath, (QLatin1String("qrc:/qt-project.org/imports/QtQuick/Controls/Imagine/images/"))) static QString ensureSlash(const QString &path) { @@ -117,7 +117,7 @@ QUrl QQuickImagineStyle::url() const // // If Imagine.path is set to ":/images" by the user, then the final URL would be: // - // QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls.2/Imagine/:/images/applicationwindow-background") + // QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls/Imagine/:/images/applicationwindow-background") // // To ensure that the correct URL is constructed, we do it ourselves here, // and then the control QML files use the "url" property instead. diff --git a/src/imports/controls/imagine/qquickimaginestyle_p.h b/src/imports/controls/imagine/qquickimaginestyle_p.h index 20a4baf0..212096b9 100644 --- a/src/imports/controls/imagine/qquickimaginestyle_p.h +++ b/src/imports/controls/imagine/qquickimaginestyle_p.h @@ -48,9 +48,9 @@ // We mean it. // -#include #include #include +#include QT_BEGIN_NAMESPACE @@ -59,6 +59,10 @@ class QQuickImagineStyle : public QQuickAttachedObject Q_OBJECT Q_PROPERTY(QString path READ path WRITE setPath RESET resetPath NOTIFY pathChanged FINAL) Q_PROPERTY(QUrl url READ url NOTIFY pathChanged FINAL) + QML_NAMED_ELEMENT(Imagine) + QML_ATTACHED(QQuickImagineStyle) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickImagineStyle(QObject *parent = nullptr); diff --git a/src/imports/controls/imagine/qquickninepatchimage.cpp b/src/imports/controls/imagine/qquickninepatchimage.cpp deleted file mode 100644 index 1d6d60dd..00000000 --- a/src/imports/controls/imagine/qquickninepatchimage.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickninepatchimage_p.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -struct QQuickNinePatchData -{ - QList coordsForSize(qreal count) const; - - inline bool isNull() const { return data.isEmpty(); } - inline int count() const { return data.size(); } - inline qreal at(int index) const { return data.at(index); } - inline qreal size() const { return data.last(); } - - void fill(const QList &coords, qreal count); - void clear(); - -private: - bool inverted = false; - QList data; -}; - -QList QQuickNinePatchData::coordsForSize(qreal size) const -{ - // n = number of stretchable sections - // We have to compensate when adding 0 and/or - // the source image width to the divs vector. - const int l = data.size(); - const int n = (inverted ? l - 1 : l) / 2; - const qreal stretch = (size - data.last()) / n; - - QList coords; - coords.reserve(l); - coords.append(0); - - bool stretched = !inverted; - for (int i = 1; i < l; ++i) { - qreal advance = data[i] - data[i - 1]; - if (stretched) - advance += stretch; - coords.append(coords.last() + advance); - - stretched = !stretched; - } - - return coords; -} - -void QQuickNinePatchData::fill(const QList &coords, qreal size) -{ - data.clear(); - inverted = coords.isEmpty() || coords.first() != 0; - - // Reserve an extra item in case we need to add the image width/height - if (inverted) { - data.reserve(coords.size() + 2); - data.append(0); - } else { - data.reserve(coords.size() + 1); - } - - data += coords; - data.append(size); -} - -void QQuickNinePatchData::clear() -{ - data.clear(); -} - -class QQuickNinePatchNode : public QSGGeometryNode -{ -public: - QQuickNinePatchNode(); - ~QQuickNinePatchNode(); - - void initialize(QSGTexture *texture, const QSizeF &targetSize, const QSize &sourceSize, - const QQuickNinePatchData &xDivs, const QQuickNinePatchData &yDivs, qreal dpr); - -private: - QSGGeometry m_geometry; - QSGTextureMaterial m_material; -}; - -QQuickNinePatchNode::QQuickNinePatchNode() - : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) -{ - m_geometry.setDrawingMode(QSGGeometry::DrawTriangles); - setGeometry(&m_geometry); - setMaterial(&m_material); -} - -QQuickNinePatchNode::~QQuickNinePatchNode() -{ - delete m_material.texture(); -} - -void QQuickNinePatchNode::initialize(QSGTexture *texture, const QSizeF &targetSize, const QSize &sourceSize, - const QQuickNinePatchData &xDivs, const QQuickNinePatchData &yDivs, qreal dpr) -{ - delete m_material.texture(); - m_material.setTexture(texture); - - const int xlen = xDivs.count(); - const int ylen = yDivs.count(); - - if (xlen > 0 && ylen > 0) { - const int quads = (xlen - 1) * (ylen - 1); - static const int verticesPerQuad = 6; - m_geometry.allocate(xlen * ylen, verticesPerQuad * quads); - - QSGGeometry::TexturedPoint2D *vertices = m_geometry.vertexDataAsTexturedPoint2D(); - QList xCoords = xDivs.coordsForSize(targetSize.width()); - QList yCoords = yDivs.coordsForSize(targetSize.height()); - - for (int y = 0; y < ylen; ++y) { - for (int x = 0; x < xlen; ++x, ++vertices) - vertices->set(xCoords[x] / dpr, yCoords[y] / dpr, - xDivs.at(x) / sourceSize.width(), - yDivs.at(y) / sourceSize.height()); - } - - quint16 *indices = m_geometry.indexDataAsUShort(); - int n = quads; - for (int q = 0; n--; ++q) { - if ((q + 1) % xlen == 0) // next row - ++q; - // Bottom-left half quad triangle - indices[0] = q; - indices[1] = q + xlen; - indices[2] = q + xlen + 1; - - // Top-right half quad triangle - indices[3] = q; - indices[4] = q + xlen + 1; - indices[5] = q + 1; - - indices += verticesPerQuad; - } - } - - markDirty(QSGNode::DirtyGeometry | QSGNode::DirtyMaterial); -} - -class QQuickNinePatchImagePrivate : public QQuickImagePrivate -{ - Q_DECLARE_PUBLIC(QQuickNinePatchImage) - -public: - void updatePatches(); - void updatePaddings(const QSizeF &size, const QList &horizontal, const QList &vertical); - void updateInsets(const QList &horizontal, const QList &vertical); - - bool resetNode = false; - qreal topPadding = 0; - qreal leftPadding = 0; - qreal rightPadding = 0; - qreal bottomPadding = 0; - qreal topInset = 0; - qreal leftInset = 0; - qreal rightInset = 0; - qreal bottomInset = 0; - - QImage ninePatch; - QQuickNinePatchData xDivs; - QQuickNinePatchData yDivs; -}; - -static QList readCoords(const QRgb *data, int from, int count, int offset, QRgb color) -{ - int p1 = -1; - QList coords; - for (int i = 0; i < count; ++i) { - int p2 = from + i * offset; - if (data[p2] == color) { - // colored pixel - if (p1 == -1) - p1 = i; - } else { - // empty pixel - if (p1 != -1) { - coords << p1 << i; - p1 = -1; - } - } - } - return coords; -} - -void QQuickNinePatchImagePrivate::updatePatches() -{ - if (ninePatch.isNull()) - return; - - int w = ninePatch.width(); - int h = ninePatch.height(); - const QRgb *data = reinterpret_cast(ninePatch.constBits()); - - const QRgb black = qRgb(0,0,0); - const QRgb red = qRgb(255,0,0); - - xDivs.fill(readCoords(data, 1, w - 1, 1, black), w - 2); // top left -> top right - yDivs.fill(readCoords(data, w, h - 1, w, black), h - 2); // top left -> bottom left - - QList hInsets = readCoords(data, (h - 1) * w + 1, w - 1, 1, red); // bottom left -> bottom right - QList vInsets = readCoords(data, 2 * w - 1, h - 1, w, red); // top right -> bottom right - updateInsets(hInsets, vInsets); - - const QSizeF sz(w - leftInset - rightInset, h - topInset - bottomInset); - QList hPaddings = readCoords(data, (h - 1) * w + leftInset + 1, sz.width() - 2, 1, black); // bottom left -> bottom right - QList vPaddings = readCoords(data, (2 + topInset) * w - 1, sz.height() - 2, w, black); // top right -> bottom right - updatePaddings(sz, hPaddings, vPaddings); -} - -void QQuickNinePatchImagePrivate::updatePaddings(const QSizeF &size, const QList &horizontal, const QList &vertical) -{ - Q_Q(QQuickNinePatchImage); - qreal oldTopPadding = topPadding; - qreal oldLeftPadding = leftPadding; - qreal oldRightPadding = rightPadding; - qreal oldBottomPadding = bottomPadding; - - if (horizontal.count() >= 2) { - leftPadding = horizontal.first(); - rightPadding = size.width() - horizontal.last() - 2; - } else { - leftPadding = 0; - rightPadding = 0; - } - - if (vertical.count() >= 2) { - topPadding = vertical.first(); - bottomPadding = size.height() - vertical.last() - 2; - } else { - topPadding = 0; - bottomPadding = 0; - } - - if (!qFuzzyCompare(oldTopPadding, topPadding)) - emit q->topPaddingChanged(); - if (!qFuzzyCompare(oldBottomPadding, bottomPadding)) - emit q->bottomPaddingChanged(); - if (!qFuzzyCompare(oldLeftPadding, leftPadding)) - emit q->leftPaddingChanged(); - if (!qFuzzyCompare(oldRightPadding, rightPadding)) - emit q->rightPaddingChanged(); -} - -void QQuickNinePatchImagePrivate::updateInsets(const QList &horizontal, const QList &vertical) -{ - Q_Q(QQuickNinePatchImage); - qreal oldTopInset = topInset; - qreal oldLeftInset = leftInset; - qreal oldRightInset = rightInset; - qreal oldBottomInset = bottomInset; - - if (horizontal.count() >= 2 && horizontal.first() == 0) - leftInset = horizontal.at(1); - else - leftInset = 0; - - if (horizontal.count() == 2 && horizontal.first() > 0) - rightInset = horizontal.last() - horizontal.first(); - else if (horizontal.count() == 4) - rightInset = horizontal.last() - horizontal.at(2); - else - rightInset = 0; - - if (vertical.count() >= 2 && vertical.first() == 0) - topInset = vertical.at(1); - else - topInset = 0; - - if (vertical.count() == 2 && vertical.first() > 0) - bottomInset = vertical.last() - vertical.first(); - else if (vertical.count() == 4) - bottomInset = vertical.last() - vertical.at(2); - else - bottomInset = 0; - - if (!qFuzzyCompare(oldTopInset, topInset)) - emit q->topInsetChanged(); - if (!qFuzzyCompare(oldBottomInset, bottomInset)) - emit q->bottomInsetChanged(); - if (!qFuzzyCompare(oldLeftInset, leftInset)) - emit q->leftInsetChanged(); - if (!qFuzzyCompare(oldRightInset, rightInset)) - emit q->rightInsetChanged(); -} - -QQuickNinePatchImage::QQuickNinePatchImage(QQuickItem *parent) - : QQuickImage(*(new QQuickNinePatchImagePrivate), parent) -{ -} - -qreal QQuickNinePatchImage::topPadding() const -{ - Q_D(const QQuickNinePatchImage); - return d->topPadding / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::leftPadding() const -{ - Q_D(const QQuickNinePatchImage); - return d->leftPadding / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::rightPadding() const -{ - Q_D(const QQuickNinePatchImage); - return d->rightPadding / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::bottomPadding() const -{ - Q_D(const QQuickNinePatchImage); - return d->bottomPadding / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::topInset() const -{ - Q_D(const QQuickNinePatchImage); - return d->topInset / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::leftInset() const -{ - Q_D(const QQuickNinePatchImage); - return d->leftInset / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::rightInset() const -{ - Q_D(const QQuickNinePatchImage); - return d->rightInset / d->devicePixelRatio; -} - -qreal QQuickNinePatchImage::bottomInset() const -{ - Q_D(const QQuickNinePatchImage); - return d->bottomInset / d->devicePixelRatio; -} - -void QQuickNinePatchImage::pixmapChange() -{ - Q_D(QQuickNinePatchImage); - if (QFileInfo(d->url.fileName()).completeSuffix().toLower() == QLatin1String("9.png")) { - d->resetNode = d->ninePatch.isNull(); - d->ninePatch = d->pix.image(); - if (d->ninePatch.depth() != 32) - d->ninePatch = d->ninePatch.convertToFormat(QImage::Format_ARGB32); - - int w = d->ninePatch.width(); - int h = d->ninePatch.height(); - d->pix.setImage(QImage(d->ninePatch.constBits() + 4 * (w + 1), w - 2, h - 2, d->ninePatch.bytesPerLine(), d->ninePatch.format())); - - d->updatePatches(); - } else { - /* - Only change resetNode when it's false; i.e. when no reset is pending. - updatePaintNode() will take care of setting it to false if it's true. - - Consider the following changes in source: - - normal.png => press.9.png => normal.png => focus.png - - If the last two events happen quickly, pixmapChange() can be called - twice with no call to updatePaintNode() inbetween. On the first call, - resetNode will be true (because ninePatch is not null since it is still - in the process of going from a 9-patch image to a regular image), - and on the second call, resetNode would be false if we didn't have this check. - This results in the oldNode never being deleted, and QQuickImage - tries to static_cast a QQuickNinePatchImage to a QSGInternalImageNode. - */ - if (!d->resetNode) - d->resetNode = !d->ninePatch.isNull(); - d->ninePatch = QImage(); - } - QQuickImage::pixmapChange(); -} - -QSGNode *QQuickNinePatchImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) -{ - Q_D(QQuickNinePatchImage); - Q_UNUSED(data); - - if (d->resetNode) { - delete oldNode; - oldNode = nullptr; - d->resetNode = false; - } - - QSizeF sz = size(); - QImage image = d->pix.image(); - if (!sz.isValid() || image.isNull()) { - delete oldNode; - return nullptr; - } - - if (d->ninePatch.isNull()) - return QQuickImage::updatePaintNode(oldNode, data); - - QQuickNinePatchNode *patchNode = static_cast(oldNode); - if (!patchNode) - patchNode = new QQuickNinePatchNode; - -#ifdef QSG_RUNTIME_DESCRIPTION - qsgnode_set_description(patchNode, QString::fromLatin1("QQuickNinePatchImage: '%1'").arg(d->url.toString())); -#endif - - QSGTexture *texture = window()->createTextureFromImage(image); - patchNode->initialize(texture, sz * d->devicePixelRatio, image.size(), d->xDivs, d->yDivs, d->devicePixelRatio); - return patchNode; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/qquickninepatchimage_p.h b/src/imports/controls/imagine/qquickninepatchimage_p.h deleted file mode 100644 index 2c29490a..00000000 --- a/src/imports/controls/imagine/qquickninepatchimage_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKNINEPATCHIMAGE_P_H -#define QQUICKNINEPATCHIMAGE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickNinePatchImagePrivate; - -class QQuickNinePatchImage : public QQuickImage -{ - Q_OBJECT - Q_PROPERTY(qreal topPadding READ topPadding NOTIFY topPaddingChanged FINAL) - Q_PROPERTY(qreal leftPadding READ leftPadding NOTIFY leftPaddingChanged FINAL) - Q_PROPERTY(qreal rightPadding READ rightPadding NOTIFY rightPaddingChanged FINAL) - Q_PROPERTY(qreal bottomPadding READ bottomPadding NOTIFY bottomPaddingChanged FINAL) - Q_PROPERTY(qreal topInset READ topInset NOTIFY topInsetChanged FINAL) - Q_PROPERTY(qreal leftInset READ leftInset NOTIFY leftInsetChanged FINAL) - Q_PROPERTY(qreal rightInset READ rightInset NOTIFY rightInsetChanged FINAL) - Q_PROPERTY(qreal bottomInset READ bottomInset NOTIFY bottomInsetChanged FINAL) - -public: - explicit QQuickNinePatchImage(QQuickItem *parent = nullptr); - - qreal topPadding() const; - qreal leftPadding() const; - qreal rightPadding() const; - qreal bottomPadding() const; - - qreal topInset() const; - qreal leftInset() const; - qreal rightInset() const; - qreal bottomInset() const; - -Q_SIGNALS: - void topPaddingChanged(); - void leftPaddingChanged(); - void rightPaddingChanged(); - void bottomPaddingChanged(); - - void topInsetChanged(); - void leftInsetChanged(); - void rightInsetChanged(); - void bottomInsetChanged(); - -protected: - void pixmapChange() override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override; - -private: - Q_DISABLE_COPY(QQuickNinePatchImage) - Q_DECLARE_PRIVATE(QQuickNinePatchImage) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickNinePatchImage) - -#endif // QQUICKNINEPATCHIMAGE_P_H diff --git a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp index dd20c84b..d59cf555 100644 --- a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp +++ b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp @@ -38,16 +38,12 @@ #include #include -#include "qquickimageselector_p.h" #include "qquickimaginestyle_p.h" #include "qquickimaginetheme_p.h" -#include "qquickninepatchimage_p.h" QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQtQuickControlsImagine, "qt.quick.controls.imagine") - -class QtQuickControls2ImagineStylePlugin: public QQuickStylePlugin +class QtQuickControls2ImagineStylePlugin : public QQuickStylePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) @@ -55,8 +51,6 @@ class QtQuickControls2ImagineStylePlugin: public QQuickStylePlugin public: QtQuickControls2ImagineStylePlugin(QObject *parent = nullptr); - void registerTypes(const char *uri) override; - QString name() const override; void initializeTheme(QQuickTheme *theme) override; }; @@ -65,23 +59,6 @@ QtQuickControls2ImagineStylePlugin::QtQuickControls2ImagineStylePlugin(QObject * { } -void QtQuickControls2ImagineStylePlugin::registerTypes(const char *uri) -{ - qmlRegisterModule(uri, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterUncreatableType(uri, 2, 3, "Imagine", tr("Imagine is an attached property")); - - QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - - qmlRegisterType(import, 2, 3, "AnimatedImageSelector"); - qmlRegisterType(import, 2, 3, "ImageSelector"); - qmlRegisterType(import, 2, 3, "NinePatchImage"); - qmlRegisterType(import, 2, 3, "NinePatchImageSelector"); - - // Qt 6.0, import version may need to be updated. - qmlRegisterType(resolvedUrl(QStringLiteral("OpacityMask.qml")), import, 2, 0, "OpacityMask"); -} - QString QtQuickControls2ImagineStylePlugin::name() const { return QStringLiteral("Imagine"); diff --git a/src/imports/controls/imagine/shaders/+glslcore/OpacityMask.frag b/src/imports/controls/imagine/shaders/+glslcore/OpacityMask.frag deleted file mode 100644 index 529e2696..00000000 --- a/src/imports/controls/imagine/shaders/+glslcore/OpacityMask.frag +++ /dev/null @@ -1,13 +0,0 @@ -#version 150 - -uniform float qt_Opacity; -uniform sampler2D source; -uniform sampler2D maskSource; - -in vec2 qt_TexCoord0; -out vec4 fragColor; - -void main() -{ - fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity; -} diff --git a/src/imports/controls/imagine/shaders/+qsb/OpacityMask.frag b/src/imports/controls/imagine/shaders/+qsb/OpacityMask.frag deleted file mode 100644 index 331b30b8..00000000 Binary files a/src/imports/controls/imagine/shaders/+qsb/OpacityMask.frag and /dev/null differ diff --git a/src/imports/controls/imagine/shaders/OpacityMask.frag b/src/imports/controls/imagine/shaders/OpacityMask.frag deleted file mode 100644 index 84f9bc3e..00000000 --- a/src/imports/controls/imagine/shaders/OpacityMask.frag +++ /dev/null @@ -1,7 +0,0 @@ -varying highp vec2 qt_TexCoord0; -uniform highp float qt_Opacity; -uniform lowp sampler2D source; -uniform lowp sampler2D maskSource; -void main(void) { - gl_FragColor = texture2D(source, qt_TexCoord0.st) * (texture2D(maskSource, qt_TexCoord0.st).a) * qt_Opacity; -} diff --git a/src/imports/controls/imagine/shaders/OpacityMask_rhi.frag b/src/imports/controls/imagine/shaders/OpacityMask_rhi.frag deleted file mode 100644 index 9ae32499..00000000 --- a/src/imports/controls/imagine/shaders/OpacityMask_rhi.frag +++ /dev/null @@ -1,17 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; -} ubuf; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * ubuf.qt_Opacity; -} diff --git a/src/imports/controls/imagine/shaders/compile.bat b/src/imports/controls/imagine/shaders/compile.bat deleted file mode 100644 index 8f16d7ac..00000000 --- a/src/imports/controls/imagine/shaders/compile.bat +++ /dev/null @@ -1,40 +0,0 @@ -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Copyright (C) 2020 The Qt Company Ltd. -:: Contact: https://www.qt.io/licensing/ -:: -:: This file is part of the QtQuick 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$ -:: -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/OpacityMask.frag OpacityMask_rhi.frag diff --git a/src/imports/controls/material/.prev_CMakeLists.txt b/src/imports/controls/material/.prev_CMakeLists.txt index 15fe3519..7039271f 100644 --- a/src/imports/controls/material/.prev_CMakeLists.txt +++ b/src/imports/controls/material/.prev_CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### add_qml_module(qtquickcontrols2materialstyleplugin - TARGET_PATH "QtQuick/Controls.2/Material" + TARGET_PATH "QtQuick/Controls/Material" URI "QtQuick.Controls.Material" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2MaterialStylePlugin @@ -58,7 +58,7 @@ set(qtquickcontrols2materialstyleplugin_resource_files add_qt_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialstyleplugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Material" + "/qt-project.org/imports/QtQuick/Controls/Material" FILES ${qtquickcontrols2materialstyleplugin_resource_files} ) @@ -68,7 +68,7 @@ add_qt_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialsty # IMPORT_NAME = "QtQuick.Controls.Material" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Material" +# TARGETPATH = "QtQuick/Controls/Material" # _REQUIREMENTS = "qtConfig(quickcontrols2-material)" set(qml_files diff --git a/src/imports/controls/material/BoxShadow.qml b/src/imports/controls/material/BoxShadow.qml deleted file mode 100644 index 5a746c0f..00000000 --- a/src/imports/controls/material/BoxShadow.qml +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -/* - A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design - elevation shadow effect. - */ -RectangularGlow { - // The 4 properties from CSS box-shadow, plus the inherited color property - property int offsetX - property int offsetY - property int blurRadius - property int spreadRadius - - // The source item the shadow is being applied to, used for correctly - // calculating the corner radious - property Item source - - property bool fullWidth - property bool fullHeight - - x: (parent.width - width)/2 + offsetX - y: (parent.height - height)/2 + offsetY - - implicitWidth: source ? source.width : parent.width - implicitHeight: source ? source.height : parent.height - - width: implicitWidth + 2 * spreadRadius + (fullWidth ? 2 * cornerRadius : 0) - height: implicitHeight + 2 * spreadRadius + (fullHeight ? 2 * cornerRadius : 0) - glowRadius: blurRadius/2 - spread: 0.05 - cornerRadius: blurRadius + (source && source.radius || 0) -} diff --git a/src/imports/controls/material/CMakeLists.txt b/src/imports/controls/material/CMakeLists.txt index 1270bfc6..8bcb9c5d 100644 --- a/src/imports/controls/material/CMakeLists.txt +++ b/src/imports/controls/material/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2materialstyleplugin - TARGET_PATH "QtQuick/Controls.2/Material" + TARGET_PATH "QtQuick/Controls/Material" URI "QtQuick.Controls.Material" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2MaterialStylePlugin @@ -58,7 +58,7 @@ set(qtquickcontrols2materialstyleplugin_resource_files qt_add_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialstyleplugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Material" + "/qt-project.org/imports/QtQuick/Controls/Material" FILES ${qtquickcontrols2materialstyleplugin_resource_files} ) @@ -68,7 +68,7 @@ qt_add_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialsty # IMPORT_NAME = "QtQuick.Controls.Material" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Material" +# TARGETPATH = "QtQuick/Controls/Material" # _REQUIREMENTS = "qtConfig(quickcontrols2-material)" set(qml_files diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml deleted file mode 100644 index 7caf8553..00000000 --- a/src/imports/controls/material/CheckIndicator.qml +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -Rectangle { - id: indicatorItem - implicitWidth: 18 - implicitHeight: 18 - color: "transparent" - border.color: !control.enabled ? control.Material.hintTextColor - : checkState !== Qt.Unchecked ? control.Material.accentColor : control.Material.secondaryTextColor - border.width: checkState !== Qt.Unchecked ? width / 2 : 2 - radius: 2 - - property Item control - property int checkState: control.checkState - - Behavior on border.width { - NumberAnimation { - duration: 100 - easing.type: Easing.OutCubic - } - } - - Behavior on border.color { - ColorAnimation { - duration: 100 - easing.type: Easing.OutCubic - } - } - - // TODO: This needs to be transparent - Image { - id: checkImage - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 14 - height: 14 - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/check.png" - fillMode: Image.PreserveAspectFit - - scale: indicatorItem.checkState === Qt.Checked ? 1 : 0 - Behavior on scale { NumberAnimation { duration: 100 } } - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 12 - height: 3 - - scale: indicatorItem.checkState === Qt.PartiallyChecked ? 1 : 0 - Behavior on scale { NumberAnimation { duration: 100 } } - } - - states: [ - State { - name: "checked" - when: indicatorItem.checkState === Qt.Checked - }, - State { - name: "partiallychecked" - when: indicatorItem.checkState === Qt.PartiallyChecked - } - ] - - transitions: Transition { - SequentialAnimation { - NumberAnimation { - target: indicatorItem - property: "scale" - // Go down 2 pixels in size. - to: 1 - 2 / indicatorItem.width - duration: 120 - } - NumberAnimation { - target: indicatorItem - property: "scale" - to: 1 - duration: 120 - } - } - } -} diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index a9bdd934..791e57ab 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -74,7 +74,7 @@ T.ComboBox { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 color: control.enabled ? control.Material.foreground : control.Material.hintTextColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/drop-indicator.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Material/images/drop-indicator.png" } contentItem: T.TextField { diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml deleted file mode 100644 index fe2d25c6..00000000 --- a/src/imports/controls/material/CursorDelegate.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 - -Rectangle { - id: cursor - - color: parent.Material.accentColor - width: 2 - visible: parent.activeFocus && !parent.readOnly && parent.selectionStart === parent.selectionEnd - - Connections { - target: cursor.parent - function onCursorPositionChanged() { - // keep a moving cursor visible - cursor.opacity = 1 - timer.restart() - } - } - - Timer { - id: timer - running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0 - repeat: true - interval: Qt.styleHints.cursorFlashTime / 2 - onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 - // force the cursor visible when gaining focus - onRunningChanged: cursor.opacity = 1 - } -} diff --git a/src/imports/controls/material/ElevationEffect.qml b/src/imports/controls/material/ElevationEffect.qml deleted file mode 100644 index 73a2a238..00000000 --- a/src/imports/controls/material/ElevationEffect.qml +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -/* - An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect. - */ -Item { - id: effect - - /* - The source the effect is applied to. - */ - property var source - - /* - The elevation of the \l source Item. - */ - property int elevation: 0 - - /* - Set to \c true if the \l source Item is the same width as its parent and the shadow - should be full width instead of rounding around the corner of the Item. - - \sa fullHeight - */ - property bool fullWidth: false - - /* - Set to \c true if the \l source Item is the same height as its parent and the shadow - should be full height instead of rounding around the corner of the Item. - - \sa fullWidth - */ - property bool fullHeight: false - - /* - \internal - - The actual source Item the effect is applied to. - */ - readonly property Item sourceItem: source.sourceItem - - /* - * The following shadow values are taken from Angular Material - * - * The MIT License (MIT) - * - * Copyright (c) 2014-2016 Google, Inc. http://angularjs.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - /* - \internal - - The shadows to use for each possible elevation. There are three shadows that when combined - make up the elevation. - */ - readonly property var _shadows: [ - [{offset: 0, blur: 0, spread: 0}, - {offset: 0, blur: 0, spread: 0}, - {offset: 0, blur: 0, spread: 0}], - - [{offset: 1, blur: 3, spread: 0}, - {offset: 1, blur: 1, spread: 0}, - {offset: 2, blur: 1, spread: -1}], - - [{offset: 1, blur: 5, spread: 0}, - {offset: 2, blur: 2, spread: 0}, - {offset: 3, blur: 1, spread: -2}], - - [{offset: 1, blur: 8, spread: 0}, - {offset: 3, blur: 4, spread: 0}, - {offset: 3, blur: 3, spread: -2}], - - [{offset: 2, blur: 4, spread: -1}, - {offset: 4, blur: 5, spread: 0}, - {offset: 1, blur: 10, spread: 0}], - - [{offset: 3, blur: 5, spread: -1}, - {offset: 5, blur: 8, spread: 0}, - {offset: 1, blur: 14, spread: 0}], - - [{offset: 3, blur: 5, spread: -1}, - {offset: 6, blur: 10, spread: 0}, - {offset: 1, blur: 18, spread: 0}], - - [{offset: 4, blur: 5, spread: -2}, - {offset: 7, blur: 10, spread: 1}, - {offset: 2, blur: 16, spread: 1}], - - [{offset: 5, blur: 5, spread: -3}, - {offset: 8, blur: 10, spread: 1}, - {offset: 3, blur: 14, spread: 2}], - - [{offset: 5, blur: 6, spread: -3}, - {offset: 9, blur: 12, spread: 1}, - {offset: 3, blur: 16, spread: 2}], - - [{offset: 6, blur: 6, spread: -3}, - {offset: 10, blur: 14, spread: 1}, - {offset: 4, blur: 18, spread: 3}], - - [{offset: 6, blur: 7, spread: -4}, - {offset: 11, blur: 15, spread: 1}, - {offset: 4, blur: 20, spread: 3}], - - [{offset: 7, blur: 8, spread: -4}, - {offset: 12, blur: 17, spread: 2}, - {offset: 5, blur: 22, spread: 4}], - - [{offset: 7, blur: 8, spread: -4}, - {offset: 13, blur: 19, spread: 2}, - {offset: 5, blur: 24, spread: 4}], - - [{offset: 7, blur: 9, spread: -4}, - {offset: 14, blur: 21, spread: 2}, - {offset: 5, blur: 26, spread: 4}], - - [{offset: 8, blur: 9, spread: -5}, - {offset: 15, blur: 22, spread: 2}, - {offset: 6, blur: 28, spread: 5}], - - [{offset: 8, blur: 10, spread: -5}, - {offset: 16, blur: 24, spread: 2}, - {offset: 6, blur: 30, spread: 5}], - - [{offset: 8, blur: 11, spread: -5}, - {offset: 17, blur: 26, spread: 2}, - {offset: 6, blur: 32, spread: 5}], - - [{offset: 9, blur: 11, spread: -5}, - {offset: 18, blur: 28, spread: 2}, - {offset: 7, blur: 34, spread: 6}], - - [{offset: 9, blur: 12, spread: -6}, - {offset: 19, blur: 29, spread: 2}, - {offset: 7, blur: 36, spread: 6}], - - [{offset: 10, blur: 13, spread: -6}, - {offset: 20, blur: 31, spread: 3}, - {offset: 8, blur: 38, spread: 7}], - - [{offset: 10, blur: 13, spread: -6}, - {offset: 21, blur: 33, spread: 3}, - {offset: 8, blur: 40, spread: 7}], - - [{offset: 10, blur: 14, spread: -6}, - {offset: 22, blur: 35, spread: 3}, - {offset: 8, blur: 42, spread: 7}], - - [{offset: 11, blur: 14, spread: -7}, - {offset: 23, blur: 36, spread: 3}, - {offset: 9, blur: 44, spread: 8}], - - [{offset: 11, blur: 15, spread: -7}, - {offset: 24, blur: 38, spread: 3}, - {offset: 9, blur: 46, spread: 8}] - ] - - /* - \internal - - The current shadow based on the elevation. - */ - readonly property var _shadow: _shadows[Math.max(0, Math.min(elevation, _shadows.length - 1))] - - // Nest the shadows and source view in two items rendered as a layer - // so the shadow is not clipped by the bounds of the source view - Item { - property int margin: -100 - - x: margin - y: margin - width: parent.width - 2 * margin - height: parent.height - 2 * margin - - // By rendering as a layer, the shadow will never show through the source item, - // even when the source item's opacity is less than 1 - layer.enabled: true - - // The box shadows automatically pick up the size of the source Item and not - // the size of the parent, so we don't need to worry about the extra padding - // in the parent Item - BoxShadow { - offsetY: effect._shadow[0].offset - blurRadius: effect._shadow[0].blur - spreadRadius: effect._shadow[0].spread - color: Qt.rgba(0,0,0, 0.2) - - fullWidth: effect.fullWidth - fullHeight: effect.fullHeight - source: effect.sourceItem - } - - BoxShadow { - offsetY: effect._shadow[1].offset - blurRadius: effect._shadow[1].blur - spreadRadius: effect._shadow[1].spread - color: Qt.rgba(0,0,0, 0.14) - - fullWidth: effect.fullWidth - fullHeight: effect.fullHeight - source: effect.sourceItem - } - - BoxShadow { - offsetY: effect._shadow[2].offset - blurRadius: effect._shadow[2].blur - spreadRadius: effect._shadow[2].spread - color: Qt.rgba(0,0,0, 0.12) - - fullWidth: effect.fullWidth - fullHeight: effect.fullHeight - source: effect.sourceItem - } - - ShaderEffect { - property alias source: effect.source - - x: (parent.width - width)/2 - y: (parent.height - height)/2 - width: effect.sourceItem.width - height: effect.sourceItem.height - } - } -} diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index a5d2f8a1..cb558e4c 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -73,7 +73,7 @@ T.MenuItem { visible: control.subMenu mirror: control.mirrored color: control.enabled ? control.Material.foreground : control.Material.hintTextColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/arrow-indicator.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Material/images/arrow-indicator.png" } contentItem: IconLabel { diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml deleted file mode 100644 index e2c55184..00000000 --- a/src/imports/controls/material/RadioIndicator.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -Rectangle { - id: indicator - implicitWidth: 20 - implicitHeight: 20 - radius: width / 2 - border.width: 2 - border.color: !control.enabled ? control.Material.hintTextColor - : control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor - color: "transparent" - - property Item control - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 10 - height: 10 - radius: width / 2 - color: parent.border.color - visible: indicator.control.checked || indicator.control.down - } -} diff --git a/src/imports/controls/material/RectangularGlow.qml b/src/imports/controls/material/RectangularGlow.qml deleted file mode 100644 index c01e536d..00000000 --- a/src/imports/controls/material/RectangularGlow.qml +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 - -/* - A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow. - */ -Item { - id: rootItem - - /* - This property defines how many pixels outside the item area are reached - by the glow. - - The value ranges from 0.0 (no glow) to inf (infinite glow). By default, - the property is set to \c 0.0. - - \table - \header - \li Output examples with different glowRadius values - \li - \li - \row - \li \image RectangularGlow_glowRadius1.png - \li \image RectangularGlow_glowRadius2.png - \li \image RectangularGlow_glowRadius3.png - \row - \li \b { glowRadius: 10 } - \li \b { glowRadius: 20 } - \li \b { glowRadius: 40 } - \row - \li \l spread: 0 - \li \l spread: 0 - \li \l spread: 0 - \row - \li \l color: #ffffff - \li \l color: #ffffff - \li \l color: #ffffff - \row - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \endtable - - */ - property real glowRadius: 0.0 - - /* - This property defines how large part of the glow color is strenghtened - near the source edges. - - The value ranges from 0.0 (no strenght increase) to 1.0 (maximum - strenght increase). By default, the property is set to \c 0.0. - - \table - \header - \li Output examples with different spread values - \li - \li - \row - \li \image RectangularGlow_spread1.png - \li \image RectangularGlow_spread2.png - \li \image RectangularGlow_spread3.png - \row - \li \b { spread: 0.0 } - \li \b { spread: 0.5 } - \li \b { spread: 1.0 } - \row - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \row - \li \l color: #ffffff - \li \l color: #ffffff - \li \l color: #ffffff - \row - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \endtable - */ - property real spread: 0.0 - - /* - This property defines the RGBA color value which is used for the glow. - - By default, the property is set to \c "white". - - \table - \header - \li Output examples with different color values - \li - \li - \row - \li \image RectangularGlow_color1.png - \li \image RectangularGlow_color2.png - \li \image RectangularGlow_color3.png - \row - \li \b { color: #ffffff } - \li \b { color: #55ff55 } - \li \b { color: #5555ff } - \row - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \row - \li \l spread: 0 - \li \l spread: 0 - \li \l spread: 0 - \row - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \li \l cornerRadius: 25 - \endtable - */ - property color color: "white" - - /* - This property defines the corner radius that is used to draw a glow with - rounded corners. - - The value ranges from 0.0 to half of the effective width or height of - the glow, whichever is smaller. This can be calculated with: \c{ - min(width, height) / 2.0 + glowRadius} - - By default, the property is bound to glowRadius property. The glow - behaves as if the rectangle was blurred when adjusting the glowRadius - property. - - \table - \header - \li Output examples with different cornerRadius values - \li - \li - \row - \li \image RectangularGlow_cornerRadius1.png - \li \image RectangularGlow_cornerRadius2.png - \li \image RectangularGlow_cornerRadius3.png - \row - \li \b { cornerRadius: 0 } - \li \b { cornerRadius: 25 } - \li \b { cornerRadius: 50 } - \row - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \li \l glowRadius: 20 - \row - \li \l spread: 0 - \li \l spread: 0 - \li \l spread: 0 - \row - \li \l color: #ffffff - \li \l color: #ffffff - \li \l color: #ffffff - \endtable - */ - property real cornerRadius: glowRadius - - /* - This property allows the effect output pixels to be cached in order to - improve the rendering performance. - - Every time the source or effect properties are changed, the pixels in - the cache must be updated. Memory consumption is increased, because an - extra buffer of memory is required for storing the effect output. - - It is recommended to disable the cache when the source or the effect - properties are animated. - - By default, the property is set to \c false. - */ - property bool cached: false - - ShaderEffectSource { - id: cacheItem - anchors.fill: shaderItem - visible: rootItem.cached - smooth: true - sourceItem: shaderItem - live: true - hideSource: visible - } - - ShaderEffect { - id: shaderItem - - x: (parent.width - width) / 2.0 - y: (parent.height - height) / 2.0 - width: parent.width + rootItem.glowRadius * 2 + cornerRadius * 2 - height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2 - - function clampedCornerRadius() { - var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + rootItem.glowRadius; - return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius)) - } - - property color color: rootItem.color - property real inverseSpread: 1.0 - rootItem.spread - property real relativeSizeX: ((inverseSpread * inverseSpread) * rootItem.glowRadius + cornerRadius * 2.0) / width - property real relativeSizeY: relativeSizeX * (width / height) - property real spread: rootItem.spread / 2.0 - property real cornerRadius: clampedCornerRadius() - - fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/shaders/RectangularGlow.frag" - } -} diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml deleted file mode 100644 index c9078bc8..00000000 --- a/src/imports/controls/material/SliderHandle.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -Item { - id: root - implicitWidth: initialSize - implicitHeight: initialSize - - property real value: 0 - property bool handleHasFocus: false - property bool handlePressed: false - property bool handleHovered: false - readonly property int initialSize: 13 - readonly property var control: parent - - Rectangle { - id: handleRect - width: parent.width - height: parent.height - radius: width / 2 - scale: root.handlePressed ? 1.5 : 1 - color: control.enabled ? root.control.Material.accentColor : root.control.Material.sliderDisabledColor - - Behavior on scale { - NumberAnimation { - duration: 250 - } - } - } - - Ripple { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 22; height: 22 - pressed: root.handlePressed - active: root.handlePressed || root.handleHasFocus || root.handleHovered - color: root.control.Material.highlightedRippleColor - } -} diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml deleted file mode 100644 index 3034e771..00000000 --- a/src/imports/controls/material/SwitchIndicator.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 - -Item { - id: indicator - implicitWidth: 38 - implicitHeight: 32 - - property Item control - property alias handle: handle - - Material.elevation: 1 - - Rectangle { - width: parent.width - height: 14 - radius: height / 2 - y: parent.height / 2 - height / 2 - color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedTrackColor : indicator.control.Material.switchUncheckedTrackColor) - : indicator.control.Material.switchDisabledTrackColor - } - - Rectangle { - id: handle - x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) - y: (parent.height - height) / 2 - width: 20 - height: 20 - radius: width / 2 - color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedHandleColor : indicator.control.Material.switchUncheckedHandleColor) - : indicator.control.Material.switchDisabledHandleColor - - Behavior on x { - enabled: !indicator.control.pressed - SmoothedAnimation { - duration: 300 - } - } - layer.enabled: indicator.Material.elevation > 0 - layer.effect: ElevationEffect { - elevation: indicator.Material.elevation - } - } -} diff --git a/src/imports/controls/material/impl/BoxShadow.qml b/src/imports/controls/material/impl/BoxShadow.qml new file mode 100644 index 00000000..5a746c0f --- /dev/null +++ b/src/imports/controls/material/impl/BoxShadow.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +/* + A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design + elevation shadow effect. + */ +RectangularGlow { + // The 4 properties from CSS box-shadow, plus the inherited color property + property int offsetX + property int offsetY + property int blurRadius + property int spreadRadius + + // The source item the shadow is being applied to, used for correctly + // calculating the corner radious + property Item source + + property bool fullWidth + property bool fullHeight + + x: (parent.width - width)/2 + offsetX + y: (parent.height - height)/2 + offsetY + + implicitWidth: source ? source.width : parent.width + implicitHeight: source ? source.height : parent.height + + width: implicitWidth + 2 * spreadRadius + (fullWidth ? 2 * cornerRadius : 0) + height: implicitHeight + 2 * spreadRadius + (fullHeight ? 2 * cornerRadius : 0) + glowRadius: blurRadius/2 + spread: 0.05 + cornerRadius: blurRadius + (source && source.radius || 0) +} diff --git a/src/imports/controls/material/impl/CheckIndicator.qml b/src/imports/controls/material/impl/CheckIndicator.qml new file mode 100644 index 00000000..ecaa673d --- /dev/null +++ b/src/imports/controls/material/impl/CheckIndicator.qml @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +Rectangle { + id: indicatorItem + implicitWidth: 18 + implicitHeight: 18 + color: "transparent" + border.color: !control.enabled ? control.Material.hintTextColor + : checkState !== Qt.Unchecked ? control.Material.accentColor : control.Material.secondaryTextColor + border.width: checkState !== Qt.Unchecked ? width / 2 : 2 + radius: 2 + + property Item control + property int checkState: control.checkState + + Behavior on border.width { + NumberAnimation { + duration: 100 + easing.type: Easing.OutCubic + } + } + + Behavior on border.color { + ColorAnimation { + duration: 100 + easing.type: Easing.OutCubic + } + } + + // TODO: This needs to be transparent + Image { + id: checkImage + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 14 + height: 14 + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Material/images/check.png" + fillMode: Image.PreserveAspectFit + + scale: indicatorItem.checkState === Qt.Checked ? 1 : 0 + Behavior on scale { NumberAnimation { duration: 100 } } + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 12 + height: 3 + + scale: indicatorItem.checkState === Qt.PartiallyChecked ? 1 : 0 + Behavior on scale { NumberAnimation { duration: 100 } } + } + + states: [ + State { + name: "checked" + when: indicatorItem.checkState === Qt.Checked + }, + State { + name: "partiallychecked" + when: indicatorItem.checkState === Qt.PartiallyChecked + } + ] + + transitions: Transition { + SequentialAnimation { + NumberAnimation { + target: indicatorItem + property: "scale" + // Go down 2 pixels in size. + to: 1 - 2 / indicatorItem.width + duration: 120 + } + NumberAnimation { + target: indicatorItem + property: "scale" + to: 1 + duration: 120 + } + } + } +} diff --git a/src/imports/controls/material/impl/CursorDelegate.qml b/src/imports/controls/material/impl/CursorDelegate.qml new file mode 100644 index 00000000..fe2d25c6 --- /dev/null +++ b/src/imports/controls/material/impl/CursorDelegate.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 + +Rectangle { + id: cursor + + color: parent.Material.accentColor + width: 2 + visible: parent.activeFocus && !parent.readOnly && parent.selectionStart === parent.selectionEnd + + Connections { + target: cursor.parent + function onCursorPositionChanged() { + // keep a moving cursor visible + cursor.opacity = 1 + timer.restart() + } + } + + Timer { + id: timer + running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0 + repeat: true + interval: Qt.styleHints.cursorFlashTime / 2 + onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 + // force the cursor visible when gaining focus + onRunningChanged: cursor.opacity = 1 + } +} diff --git a/src/imports/controls/material/impl/ElevationEffect.qml b/src/imports/controls/material/impl/ElevationEffect.qml new file mode 100644 index 00000000..73a2a238 --- /dev/null +++ b/src/imports/controls/material/impl/ElevationEffect.qml @@ -0,0 +1,279 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +/* + An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect. + */ +Item { + id: effect + + /* + The source the effect is applied to. + */ + property var source + + /* + The elevation of the \l source Item. + */ + property int elevation: 0 + + /* + Set to \c true if the \l source Item is the same width as its parent and the shadow + should be full width instead of rounding around the corner of the Item. + + \sa fullHeight + */ + property bool fullWidth: false + + /* + Set to \c true if the \l source Item is the same height as its parent and the shadow + should be full height instead of rounding around the corner of the Item. + + \sa fullWidth + */ + property bool fullHeight: false + + /* + \internal + + The actual source Item the effect is applied to. + */ + readonly property Item sourceItem: source.sourceItem + + /* + * The following shadow values are taken from Angular Material + * + * The MIT License (MIT) + * + * Copyright (c) 2014-2016 Google, Inc. http://angularjs.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* + \internal + + The shadows to use for each possible elevation. There are three shadows that when combined + make up the elevation. + */ + readonly property var _shadows: [ + [{offset: 0, blur: 0, spread: 0}, + {offset: 0, blur: 0, spread: 0}, + {offset: 0, blur: 0, spread: 0}], + + [{offset: 1, blur: 3, spread: 0}, + {offset: 1, blur: 1, spread: 0}, + {offset: 2, blur: 1, spread: -1}], + + [{offset: 1, blur: 5, spread: 0}, + {offset: 2, blur: 2, spread: 0}, + {offset: 3, blur: 1, spread: -2}], + + [{offset: 1, blur: 8, spread: 0}, + {offset: 3, blur: 4, spread: 0}, + {offset: 3, blur: 3, spread: -2}], + + [{offset: 2, blur: 4, spread: -1}, + {offset: 4, blur: 5, spread: 0}, + {offset: 1, blur: 10, spread: 0}], + + [{offset: 3, blur: 5, spread: -1}, + {offset: 5, blur: 8, spread: 0}, + {offset: 1, blur: 14, spread: 0}], + + [{offset: 3, blur: 5, spread: -1}, + {offset: 6, blur: 10, spread: 0}, + {offset: 1, blur: 18, spread: 0}], + + [{offset: 4, blur: 5, spread: -2}, + {offset: 7, blur: 10, spread: 1}, + {offset: 2, blur: 16, spread: 1}], + + [{offset: 5, blur: 5, spread: -3}, + {offset: 8, blur: 10, spread: 1}, + {offset: 3, blur: 14, spread: 2}], + + [{offset: 5, blur: 6, spread: -3}, + {offset: 9, blur: 12, spread: 1}, + {offset: 3, blur: 16, spread: 2}], + + [{offset: 6, blur: 6, spread: -3}, + {offset: 10, blur: 14, spread: 1}, + {offset: 4, blur: 18, spread: 3}], + + [{offset: 6, blur: 7, spread: -4}, + {offset: 11, blur: 15, spread: 1}, + {offset: 4, blur: 20, spread: 3}], + + [{offset: 7, blur: 8, spread: -4}, + {offset: 12, blur: 17, spread: 2}, + {offset: 5, blur: 22, spread: 4}], + + [{offset: 7, blur: 8, spread: -4}, + {offset: 13, blur: 19, spread: 2}, + {offset: 5, blur: 24, spread: 4}], + + [{offset: 7, blur: 9, spread: -4}, + {offset: 14, blur: 21, spread: 2}, + {offset: 5, blur: 26, spread: 4}], + + [{offset: 8, blur: 9, spread: -5}, + {offset: 15, blur: 22, spread: 2}, + {offset: 6, blur: 28, spread: 5}], + + [{offset: 8, blur: 10, spread: -5}, + {offset: 16, blur: 24, spread: 2}, + {offset: 6, blur: 30, spread: 5}], + + [{offset: 8, blur: 11, spread: -5}, + {offset: 17, blur: 26, spread: 2}, + {offset: 6, blur: 32, spread: 5}], + + [{offset: 9, blur: 11, spread: -5}, + {offset: 18, blur: 28, spread: 2}, + {offset: 7, blur: 34, spread: 6}], + + [{offset: 9, blur: 12, spread: -6}, + {offset: 19, blur: 29, spread: 2}, + {offset: 7, blur: 36, spread: 6}], + + [{offset: 10, blur: 13, spread: -6}, + {offset: 20, blur: 31, spread: 3}, + {offset: 8, blur: 38, spread: 7}], + + [{offset: 10, blur: 13, spread: -6}, + {offset: 21, blur: 33, spread: 3}, + {offset: 8, blur: 40, spread: 7}], + + [{offset: 10, blur: 14, spread: -6}, + {offset: 22, blur: 35, spread: 3}, + {offset: 8, blur: 42, spread: 7}], + + [{offset: 11, blur: 14, spread: -7}, + {offset: 23, blur: 36, spread: 3}, + {offset: 9, blur: 44, spread: 8}], + + [{offset: 11, blur: 15, spread: -7}, + {offset: 24, blur: 38, spread: 3}, + {offset: 9, blur: 46, spread: 8}] + ] + + /* + \internal + + The current shadow based on the elevation. + */ + readonly property var _shadow: _shadows[Math.max(0, Math.min(elevation, _shadows.length - 1))] + + // Nest the shadows and source view in two items rendered as a layer + // so the shadow is not clipped by the bounds of the source view + Item { + property int margin: -100 + + x: margin + y: margin + width: parent.width - 2 * margin + height: parent.height - 2 * margin + + // By rendering as a layer, the shadow will never show through the source item, + // even when the source item's opacity is less than 1 + layer.enabled: true + + // The box shadows automatically pick up the size of the source Item and not + // the size of the parent, so we don't need to worry about the extra padding + // in the parent Item + BoxShadow { + offsetY: effect._shadow[0].offset + blurRadius: effect._shadow[0].blur + spreadRadius: effect._shadow[0].spread + color: Qt.rgba(0,0,0, 0.2) + + fullWidth: effect.fullWidth + fullHeight: effect.fullHeight + source: effect.sourceItem + } + + BoxShadow { + offsetY: effect._shadow[1].offset + blurRadius: effect._shadow[1].blur + spreadRadius: effect._shadow[1].spread + color: Qt.rgba(0,0,0, 0.14) + + fullWidth: effect.fullWidth + fullHeight: effect.fullHeight + source: effect.sourceItem + } + + BoxShadow { + offsetY: effect._shadow[2].offset + blurRadius: effect._shadow[2].blur + spreadRadius: effect._shadow[2].spread + color: Qt.rgba(0,0,0, 0.12) + + fullWidth: effect.fullWidth + fullHeight: effect.fullHeight + source: effect.sourceItem + } + + ShaderEffect { + property alias source: effect.source + + x: (parent.width - width)/2 + y: (parent.height - height)/2 + width: effect.sourceItem.width + height: effect.sourceItem.height + } + } +} diff --git a/src/imports/controls/material/impl/RadioIndicator.qml b/src/imports/controls/material/impl/RadioIndicator.qml new file mode 100644 index 00000000..e2c55184 --- /dev/null +++ b/src/imports/controls/material/impl/RadioIndicator.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +Rectangle { + id: indicator + implicitWidth: 20 + implicitHeight: 20 + radius: width / 2 + border.width: 2 + border.color: !control.enabled ? control.Material.hintTextColor + : control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor + color: "transparent" + + property Item control + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 10 + height: 10 + radius: width / 2 + color: parent.border.color + visible: indicator.control.checked || indicator.control.down + } +} diff --git a/src/imports/controls/material/impl/RectangularGlow.qml b/src/imports/controls/material/impl/RectangularGlow.qml new file mode 100644 index 00000000..7e09c1a5 --- /dev/null +++ b/src/imports/controls/material/impl/RectangularGlow.qml @@ -0,0 +1,240 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 + +/* + A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow. + */ +Item { + id: rootItem + + /* + This property defines how many pixels outside the item area are reached + by the glow. + + The value ranges from 0.0 (no glow) to inf (infinite glow). By default, + the property is set to \c 0.0. + + \table + \header + \li Output examples with different glowRadius values + \li + \li + \row + \li \image RectangularGlow_glowRadius1.png + \li \image RectangularGlow_glowRadius2.png + \li \image RectangularGlow_glowRadius3.png + \row + \li \b { glowRadius: 10 } + \li \b { glowRadius: 20 } + \li \b { glowRadius: 40 } + \row + \li \l spread: 0 + \li \l spread: 0 + \li \l spread: 0 + \row + \li \l color: #ffffff + \li \l color: #ffffff + \li \l color: #ffffff + \row + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \endtable + + */ + property real glowRadius: 0.0 + + /* + This property defines how large part of the glow color is strenghtened + near the source edges. + + The value ranges from 0.0 (no strenght increase) to 1.0 (maximum + strenght increase). By default, the property is set to \c 0.0. + + \table + \header + \li Output examples with different spread values + \li + \li + \row + \li \image RectangularGlow_spread1.png + \li \image RectangularGlow_spread2.png + \li \image RectangularGlow_spread3.png + \row + \li \b { spread: 0.0 } + \li \b { spread: 0.5 } + \li \b { spread: 1.0 } + \row + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \row + \li \l color: #ffffff + \li \l color: #ffffff + \li \l color: #ffffff + \row + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \endtable + */ + property real spread: 0.0 + + /* + This property defines the RGBA color value which is used for the glow. + + By default, the property is set to \c "white". + + \table + \header + \li Output examples with different color values + \li + \li + \row + \li \image RectangularGlow_color1.png + \li \image RectangularGlow_color2.png + \li \image RectangularGlow_color3.png + \row + \li \b { color: #ffffff } + \li \b { color: #55ff55 } + \li \b { color: #5555ff } + \row + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \row + \li \l spread: 0 + \li \l spread: 0 + \li \l spread: 0 + \row + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \li \l cornerRadius: 25 + \endtable + */ + property color color: "white" + + /* + This property defines the corner radius that is used to draw a glow with + rounded corners. + + The value ranges from 0.0 to half of the effective width or height of + the glow, whichever is smaller. This can be calculated with: \c{ + min(width, height) / 2.0 + glowRadius} + + By default, the property is bound to glowRadius property. The glow + behaves as if the rectangle was blurred when adjusting the glowRadius + property. + + \table + \header + \li Output examples with different cornerRadius values + \li + \li + \row + \li \image RectangularGlow_cornerRadius1.png + \li \image RectangularGlow_cornerRadius2.png + \li \image RectangularGlow_cornerRadius3.png + \row + \li \b { cornerRadius: 0 } + \li \b { cornerRadius: 25 } + \li \b { cornerRadius: 50 } + \row + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \li \l glowRadius: 20 + \row + \li \l spread: 0 + \li \l spread: 0 + \li \l spread: 0 + \row + \li \l color: #ffffff + \li \l color: #ffffff + \li \l color: #ffffff + \endtable + */ + property real cornerRadius: glowRadius + + /* + This property allows the effect output pixels to be cached in order to + improve the rendering performance. + + Every time the source or effect properties are changed, the pixels in + the cache must be updated. Memory consumption is increased, because an + extra buffer of memory is required for storing the effect output. + + It is recommended to disable the cache when the source or the effect + properties are animated. + + By default, the property is set to \c false. + */ + property bool cached: false + + ShaderEffectSource { + id: cacheItem + anchors.fill: shaderItem + visible: rootItem.cached + smooth: true + sourceItem: shaderItem + live: true + hideSource: visible + } + + ShaderEffect { + id: shaderItem + + x: (parent.width - width) / 2.0 + y: (parent.height - height) / 2.0 + width: parent.width + rootItem.glowRadius * 2 + cornerRadius * 2 + height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2 + + function clampedCornerRadius() { + var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + rootItem.glowRadius; + return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius)) + } + + property color color: rootItem.color + property real inverseSpread: 1.0 - rootItem.spread + property real relativeSizeX: ((inverseSpread * inverseSpread) * rootItem.glowRadius + cornerRadius * 2.0) / width + property real relativeSizeY: relativeSizeX * (width / height) + property real spread: rootItem.spread / 2.0 + property real cornerRadius: clampedCornerRadius() + + fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls/Material/shaders/RectangularGlow.frag" + } +} diff --git a/src/imports/controls/material/impl/SliderHandle.qml b/src/imports/controls/material/impl/SliderHandle.qml new file mode 100644 index 00000000..c9078bc8 --- /dev/null +++ b/src/imports/controls/material/impl/SliderHandle.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +Item { + id: root + implicitWidth: initialSize + implicitHeight: initialSize + + property real value: 0 + property bool handleHasFocus: false + property bool handlePressed: false + property bool handleHovered: false + readonly property int initialSize: 13 + readonly property var control: parent + + Rectangle { + id: handleRect + width: parent.width + height: parent.height + radius: width / 2 + scale: root.handlePressed ? 1.5 : 1 + color: control.enabled ? root.control.Material.accentColor : root.control.Material.sliderDisabledColor + + Behavior on scale { + NumberAnimation { + duration: 250 + } + } + } + + Ripple { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 22; height: 22 + pressed: root.handlePressed + active: root.handlePressed || root.handleHasFocus || root.handleHovered + color: root.control.Material.highlightedRippleColor + } +} diff --git a/src/imports/controls/material/impl/SwitchIndicator.qml b/src/imports/controls/material/impl/SwitchIndicator.qml new file mode 100644 index 00000000..3034e771 --- /dev/null +++ b/src/imports/controls/material/impl/SwitchIndicator.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Material.impl 2.12 + +Item { + id: indicator + implicitWidth: 38 + implicitHeight: 32 + + property Item control + property alias handle: handle + + Material.elevation: 1 + + Rectangle { + width: parent.width + height: 14 + radius: height / 2 + y: parent.height / 2 - height / 2 + color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedTrackColor : indicator.control.Material.switchUncheckedTrackColor) + : indicator.control.Material.switchDisabledTrackColor + } + + Rectangle { + id: handle + x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: width / 2 + color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedHandleColor : indicator.control.Material.switchUncheckedHandleColor) + : indicator.control.Material.switchDisabledHandleColor + + Behavior on x { + enabled: !indicator.control.pressed + SmoothedAnimation { + duration: 300 + } + } + layer.enabled: indicator.Material.elevation > 0 + layer.effect: ElevationEffect { + elevation: indicator.Material.elevation + } + } +} diff --git a/src/imports/controls/material/impl/material-impl.pro b/src/imports/controls/material/impl/material-impl.pro new file mode 100644 index 00000000..f0a97b18 --- /dev/null +++ b/src/imports/controls/material/impl/material-impl.pro @@ -0,0 +1,41 @@ +TARGET = qtquickcontrols2materialstyleimplplugin +TARGETPATH = QtQuick/Controls.2/Material/impl + +QML_IMPORT_NAME = QtQuick.Controls.Material.impl +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private +QT_FOR_CONFIG = quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +QML_FILES += \ + $$PWD/BoxShadow.qml \ + $$PWD/CheckIndicator.qml \ + $$PWD/CursorDelegate.qml \ + $$PWD/ElevationEffect.qml \ + $$PWD/RadioIndicator.qml \ + $$PWD/RectangularGlow.qml \ + $$PWD/SliderHandle.qml \ + $$PWD/SwitchIndicator.qml + +OTHER_FILES += \ + qmldir \ + $$QML_FILES + +HEADERS += \ + qquickmaterialbusyindicator_p.h \ + qquickmaterialprogressbar_p.h \ + qquickmaterialripple_p.h + +SOURCES += \ + $$PWD/qquickmaterialbusyindicator.cpp \ + $$PWD/qquickmaterialprogressbar.cpp \ + $$PWD/qquickmaterialripple.cpp \ + $$PWD/qtquickcontrols2materialstyleimplplugin.cpp + +CONFIG += qmltypes install_qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler +load(qml_plugin) + +requires(qtConfig(quickcontrols2-material)) diff --git a/src/imports/controls/material/impl/qmldir b/src/imports/controls/material/impl/qmldir new file mode 100644 index 00000000..4c863d9d --- /dev/null +++ b/src/imports/controls/material/impl/qmldir @@ -0,0 +1,3 @@ +module QtQuick.Controls.Material.impl +plugin qtquickcontrols2materialstyleimplplugin +classname QtQuickControls2MaterialStyleImplPlugin diff --git a/src/imports/controls/material/impl/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/impl/qquickmaterialbusyindicator.cpp new file mode 100644 index 00000000..10bcc035 --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialbusyindicator.cpp @@ -0,0 +1,245 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickmaterialbusyindicator_p.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +/* + Relevant Android code: + + - core/res/res/anim/progress_indeterminate_rotation_material.xml contains + the rotation animation data. + - core/res/res/anim/progress_indeterminate_material.xml contains the trim + animation data. + - core/res/res/interpolator/trim_start_interpolator.xml and + core/res/res/interpolator/trim_end_interpolator.xml contain the start + and end trim path interpolators. + - addCommand() in core/java/android/util/PathParser.java has a list of the + different path commands available. +*/ + +static const int SpanAnimationDuration = 700; +static const int RotationAnimationDuration = SpanAnimationDuration * 6; +static const int TargetRotation = 720; +static const int OneDegree = 16; +static const qreal MinSweepSpan = 10 * OneDegree; +static const qreal MaxSweepSpan = 300 * OneDegree; + +class QQuickMaterialBusyIndicatorNode : public QQuickAnimatedNode +{ +public: + QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item); + + void sync(QQuickItem *item) override; + +protected: + void updateCurrentTime(int time) override; + +private: + int m_lastStartAngle = 0; + int m_lastEndAngle = 0; + qreal m_width = 0; + qreal m_height = 0; + qreal m_devicePixelRatio = 1; + QColor m_color; +}; + +QQuickMaterialBusyIndicatorNode::QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setCurrentTime(item->elapsed()); + setDuration(RotationAnimationDuration); + + QSGImageNode *textureNode = item->window()->createImageNode(); + textureNode->setOwnsTexture(true); + appendChildNode(textureNode); + + // A texture seems to be required here, but we don't have one yet, as we haven't drawn anything, + // so just use a blank image. + QImage blankImage(item->width(), item->height(), QImage::Format_ARGB32_Premultiplied); + blankImage.fill(Qt::transparent); + textureNode->setTexture(item->window()->createTextureFromImage(blankImage)); +} + +void QQuickMaterialBusyIndicatorNode::updateCurrentTime(int time) +{ + const qreal w = m_width; + const qreal h = m_height; + const qreal size = qMin(w, h); + const qreal dx = (w - size) / 2; + const qreal dy = (h - size) / 2; + + QImage image(size * m_devicePixelRatio, size * m_devicePixelRatio, QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::transparent); + + QPainter painter(&image); + painter.setRenderHint(QPainter::Antialiasing); + + QPen pen; + QSGImageNode *textureNode = static_cast(firstChild()); + pen.setColor(m_color); + pen.setWidth(qCeil(size / 12) * m_devicePixelRatio); + painter.setPen(pen); + + const qreal percentageComplete = time / qreal(RotationAnimationDuration); + const qreal spanPercentageComplete = (time % SpanAnimationDuration) / qreal(SpanAnimationDuration); + const int iteration = time / SpanAnimationDuration; + int startAngle = 0; + int endAngle = 0; + + if (iteration % 2 == 0) { + if (m_lastStartAngle > 360 * OneDegree) + m_lastStartAngle -= 360 * OneDegree; + + // The start angle is only affected by the rotation animation for the "grow" phase. + startAngle = m_lastStartAngle; + QEasingCurve angleCurve(QEasingCurve::OutQuad); + const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete); + endAngle = m_lastStartAngle + MinSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan); + m_lastEndAngle = endAngle; + } else { + // Both the start angle *and* the span are affected by the "shrink" phase. + QEasingCurve angleCurve(QEasingCurve::InQuad); + const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete); + startAngle = m_lastEndAngle - MaxSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan); + endAngle = m_lastEndAngle; + m_lastStartAngle = startAngle; + } + + const int halfPen = pen.width() / 2; + const QRectF arcBounds = QRectF(halfPen, halfPen, + m_devicePixelRatio * size - pen.width(), + m_devicePixelRatio * size - pen.width()); + // The current angle of the rotation animation. + const qreal rotation = OneDegree * percentageComplete * -TargetRotation; + startAngle -= rotation; + endAngle -= rotation; + const int angleSpan = endAngle - startAngle; + painter.drawArc(arcBounds, -startAngle, -angleSpan); + painter.end(); + + textureNode->setRect(QRectF(dx, dy, size, size)); + textureNode->setTexture(window()->createTextureFromImage(image)); +} + +void QQuickMaterialBusyIndicatorNode::sync(QQuickItem *item) +{ + QQuickMaterialBusyIndicator *indicator = static_cast(item); + m_color = indicator->color(); + m_width = indicator->width(); + m_height = indicator->height(); + m_devicePixelRatio = indicator->window()->effectiveDevicePixelRatio(); +} + +QQuickMaterialBusyIndicator::QQuickMaterialBusyIndicator(QQuickItem *parent) : + QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +QColor QQuickMaterialBusyIndicator::color() const +{ + return m_color; +} + +void QQuickMaterialBusyIndicator::setColor(const QColor &color) +{ + if (m_color == color) + return; + + m_color = color; + update(); +} + +bool QQuickMaterialBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickMaterialBusyIndicator::setRunning(bool running) +{ + if (running) + setVisible(true); +} + +int QQuickMaterialBusyIndicator::elapsed() const +{ + return m_elapsed; +} + +void QQuickMaterialBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + switch (change) { + case ItemOpacityHasChanged: + if (qFuzzyIsNull(data.realValue)) + setVisible(false); + break; + case ItemVisibleHasChanged: + update(); + break; + default: + break; + } +} + +QSGNode *QQuickMaterialBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) +{ + QQuickMaterialBusyIndicatorNode *node = static_cast(oldNode); + if (isRunning() && width() > 0 && height() > 0) { + if (!node) { + node = new QQuickMaterialBusyIndicatorNode(this); + node->start(); + } + node->sync(this); + } else { + m_elapsed = node ? node->currentTime() : 0; + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/material/impl/qquickmaterialbusyindicator_p.h b/src/imports/controls/material/impl/qquickmaterialbusyindicator_p.h new file mode 100644 index 00000000..72aeaf66 --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialbusyindicator_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKMATERIALBUSYINDICATOR_P_H +#define QQUICKMATERIALBUSYINDICATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickMaterialBusyIndicator : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(bool running READ isRunning WRITE setRunning FINAL) + QML_NAMED_ELEMENT(BusyIndicatorImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + + bool isRunning() const; + void setRunning(bool running); + + int elapsed() const; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + int m_elapsed = 0; + QColor m_color = Qt::black; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickMaterialBusyIndicator) + +#endif // QQUICKMATERIALBUSYINDICATOR_P_H diff --git a/src/imports/controls/material/impl/qquickmaterialprogressbar.cpp b/src/imports/controls/material/impl/qquickmaterialprogressbar.cpp new file mode 100644 index 00000000..8b3dde23 --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialprogressbar.cpp @@ -0,0 +1,245 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickmaterialprogressbar_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int PauseDuration = 520; +static const int SlideDuration = 1240; +static const int TotalDuration = SlideDuration + PauseDuration; + +class QQuickMaterialProgressBarNode : public QQuickAnimatedNode +{ +public: + QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + void moveNode(QSGTransformNode *node, const QRectF &geometry, qreal progress); + + bool m_indeterminate = false; + QEasingCurve m_easing = QEasingCurve::OutCubic; +}; + +QQuickMaterialProgressBarNode::QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); +} + +void QQuickMaterialProgressBarNode::updateCurrentTime(int time) +{ + QSGRectangleNode *geometryNode = static_cast(firstChild()); + Q_ASSERT(geometryNode->type() == QSGNode::GeometryNodeType); + const QRectF geometry = geometryNode->rect(); + + QSGTransformNode *firstNode = static_cast(geometryNode->firstChild()); + if (firstNode) { + Q_ASSERT(firstNode->type() == QSGNode::TransformNodeType); + + const qreal progress = qMin(1.0, static_cast(time) / SlideDuration); + moveNode(static_cast(firstNode), geometry, progress); + } + + QSGTransformNode *secondNode = static_cast(geometryNode->lastChild()); + if (secondNode) { + Q_ASSERT(secondNode->type() == QSGNode::TransformNodeType); + + const qreal progress = qMax(0.0, static_cast(time - PauseDuration) / SlideDuration); + moveNode(static_cast(secondNode), geometry, progress); + } +} + +void QQuickMaterialProgressBarNode::sync(QQuickItem *item) +{ + QQuickMaterialProgressBar *bar = static_cast(item); + if (m_indeterminate != bar->isIndeterminate()) { + m_indeterminate = bar->isIndeterminate(); + if (m_indeterminate) + start(); + else + stop(); + } + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + + QRectF bounds = item->boundingRect(); + bounds.setHeight(item->implicitHeight()); + bounds.moveTop((item->height() - bounds.height()) / 2.0); + + QSGRectangleNode *geometryNode = static_cast(firstChild()); + if (!geometryNode) { + geometryNode = item->window()->createRectangleNode(); + geometryNode->setColor(Qt::transparent); + appendChildNode(geometryNode); + } + geometryNode->setRect(bounds); + + const int count = m_indeterminate ? 2 : 1; + const qreal w = m_indeterminate ? 0 : bar->progress() * item->width(); + const QRectF rect(0, bounds.y(), w, bounds.height()); + + QSGNode *transformNode = geometryNode->firstChild(); + for (int i = 0; i < count; ++i) { + if (!transformNode) { + transformNode = new QSGTransformNode; + geometryNode->appendChildNode(transformNode); + + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + transformNode->appendChildNode(rectNode); + } + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + static_cast(transformNode)->setMatrix(QMatrix4x4()); + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + rectNode->setRect(rect); + rectNode->setColor(bar->color()); + rectNode->update(); + + transformNode = transformNode->nextSibling(); + } + + while (transformNode) { + QSGNode *nextSibling = transformNode->nextSibling(); + delete transformNode; + transformNode = nextSibling; + } +} + +void QQuickMaterialProgressBarNode::moveNode(QSGTransformNode *transformNode, const QRectF &geometry, qreal progress) +{ + const qreal value = m_easing.valueForProgress(progress); + const qreal x = value * geometry.width(); + + QMatrix4x4 matrix; + matrix.translate(x, 0); + transformNode->setMatrix(matrix); + + QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + QRectF r = geometry; + r.setWidth(value * (geometry.width() - x)); + rectNode->setRect(r); + rectNode->update(); +} + +QQuickMaterialProgressBar::QQuickMaterialProgressBar(QQuickItem *parent) + : QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +QColor QQuickMaterialProgressBar::color() const +{ + return m_color; +} + +void QQuickMaterialProgressBar::setColor(const QColor &color) +{ + if (color == m_color) + return; + + m_color = color; + update(); +} + +qreal QQuickMaterialProgressBar::progress() const +{ + return m_progress; +} + +void QQuickMaterialProgressBar::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +bool QQuickMaterialProgressBar::isIndeterminate() const +{ + return m_indeterminate; +} + +void QQuickMaterialProgressBar::setIndeterminate(bool indeterminate) +{ + if (indeterminate == m_indeterminate) + return; + + m_indeterminate = indeterminate; + update(); +} + +void QQuickMaterialProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemVisibleHasChanged) + update(); +} + +QSGNode *QQuickMaterialProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickMaterialProgressBarNode *node = static_cast(oldNode); + if (isVisible() && width() > 0 && height() > 0) { + if (!node) + node = new QQuickMaterialProgressBarNode(this); + node->sync(this); + } else { + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/material/impl/qquickmaterialprogressbar_p.h b/src/imports/controls/material/impl/qquickmaterialprogressbar_p.h new file mode 100644 index 00000000..bf93812d --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialprogressbar_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKMATERIALPROGRESSBAR_P_H +#define QQUICKMATERIALPROGRESSBAR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickMaterialProgressBar : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) + QML_NAMED_ELEMENT(ProgressBarImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickMaterialProgressBar(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + + qreal progress() const; + void setProgress(qreal progress); + + bool isIndeterminate() const; + void setIndeterminate(bool indeterminate); + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + QColor m_color = Qt::black; + qreal m_progress = 0.0; + bool m_indeterminate = false; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickMaterialProgressBar) + +#endif // QQUICKMATERIALPROGRESSBAR_P_H diff --git a/src/imports/controls/material/impl/qquickmaterialripple.cpp b/src/imports/controls/material/impl/qquickmaterialripple.cpp new file mode 100644 index 00000000..a39a115b --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialripple.cpp @@ -0,0 +1,442 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickmaterialripple_p.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace { + enum WavePhase { WaveEnter, WaveExit }; +} + +static const int RIPPLE_ENTER_DELAY = 80; +static const int OPACITY_ENTER_DURATION_FAST = 120; +static const int WAVE_OPACITY_DECAY_DURATION = 333; +static const qreal WAVE_TOUCH_DOWN_ACCELERATION = 1024.0; + +class QQuickMaterialRippleWaveNode : public QQuickAnimatedNode +{ +public: + QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple); + + void exit(); + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + qreal m_from = 0; + qreal m_to = 0; + qreal m_value = 0; + WavePhase m_phase = WaveEnter; + QPointF m_anchor; + QRectF m_bounds; +}; + +QQuickMaterialRippleWaveNode::QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple) + : QQuickAnimatedNode(ripple) +{ + start(qRound(1000.0 * qSqrt(ripple->diameter() / 2.0 / WAVE_TOUCH_DOWN_ACCELERATION))); + + QSGOpacityNode *opacityNode = new QSGOpacityNode; + appendChildNode(opacityNode); + + QQuickItemPrivate *d = QQuickItemPrivate::get(ripple); + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + opacityNode->appendChildNode(rectNode); +} + +void QQuickMaterialRippleWaveNode::exit() +{ + m_phase = WaveExit; + m_from = m_value; + setDuration(WAVE_OPACITY_DECAY_DURATION); + restart(); + connect(this, &QQuickAnimatedNode::stopped, this, &QObject::deleteLater); +} + +void QQuickMaterialRippleWaveNode::updateCurrentTime(int time) +{ + qreal p = 1.0; + if (duration() > 0) + p = time / static_cast(duration()); + + m_value = m_from + (m_to - m_from) * p; + p = m_value / m_to; + + const qreal dx = (1.0 - p) * (m_anchor.x() - m_bounds.width() / 2); + const qreal dy = (1.0 - p) * (m_anchor.y() - m_bounds.height() / 2); + + QMatrix4x4 m; + m.translate(qRound((m_bounds.width() - m_value) / 2 + dx), + qRound((m_bounds.height() - m_value) / 2 + dy)); + setMatrix(m); + + QSGOpacityNode *opacityNode = static_cast(firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + qreal opacity = 1.0; + if (m_phase == WaveExit) + opacity -= static_cast(time) / WAVE_OPACITY_DECAY_DURATION; + opacityNode->setOpacity(opacity); + + QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + rectNode->setRect(QRectF(0, 0, m_value, m_value)); + rectNode->setRadius(m_value / 2); + rectNode->update(); +} + +void QQuickMaterialRippleWaveNode::sync(QQuickItem *item) +{ + QQuickMaterialRipple *ripple = static_cast(item); + m_to = ripple->diameter(); + m_anchor = ripple->anchorPoint(); + m_bounds = ripple->boundingRect(); + + QSGOpacityNode *opacityNode = static_cast(firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + rectNode->setColor(ripple->color()); +} + +class QQuickMaterialRippleBackgroundNode : public QQuickAnimatedNode +{ + Q_OBJECT + +public: + QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + bool m_active = false; +}; + +QQuickMaterialRippleBackgroundNode::QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple) + : QQuickAnimatedNode(ripple) +{ + setDuration(OPACITY_ENTER_DURATION_FAST); + + QSGOpacityNode *opacityNode = new QSGOpacityNode; + opacityNode->setOpacity(0.0); + appendChildNode(opacityNode); + + QQuickItemPrivate *d = QQuickItemPrivate::get(ripple); + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + opacityNode->appendChildNode(rectNode); +} + +void QQuickMaterialRippleBackgroundNode::updateCurrentTime(int time) +{ + qreal opacity = time / static_cast(duration()); + if (!m_active) + opacity = 1.0 - opacity; + + QSGOpacityNode *opacityNode = static_cast(firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + opacityNode->setOpacity(opacity); +} + +void QQuickMaterialRippleBackgroundNode::sync(QQuickItem *item) +{ + QQuickMaterialRipple *ripple = static_cast(item); + if (m_active != ripple->isActive()) { + m_active = ripple->isActive(); + setDuration(m_active ? OPACITY_ENTER_DURATION_FAST : WAVE_OPACITY_DECAY_DURATION); + restart(); + } + + QSGOpacityNode *opacityNode = static_cast(firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + const qreal w = ripple->width(); + const qreal h = ripple->height(); + const qreal sz = qSqrt(w * w + h * h); + + QMatrix4x4 matrix; + if (qFuzzyIsNull(ripple->clipRadius())) { + matrix.translate(qRound((w - sz) / 2), qRound((h - sz) / 2)); + rectNode->setRect(QRectF(0, 0, sz, sz)); + rectNode->setRadius(sz / 2); + } else { + rectNode->setRect(QRectF(0, 0, w, h)); + rectNode->setRadius(ripple->clipRadius()); + } + + setMatrix(matrix); + rectNode->setColor(ripple->color()); + rectNode->update(); +} + +QQuickMaterialRipple::QQuickMaterialRipple(QQuickItem *parent) + : QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +bool QQuickMaterialRipple::isActive() const +{ + return m_active; +} + +void QQuickMaterialRipple::setActive(bool active) +{ + if (active == m_active) + return; + + m_active = active; + update(); +} + +QColor QQuickMaterialRipple::color() const +{ + return m_color; +} + +void QQuickMaterialRipple::setColor(const QColor &color) +{ + if (m_color == color) + return; + + m_color = color; + update(); +} + +qreal QQuickMaterialRipple::clipRadius() const +{ + return m_clipRadius; +} + +void QQuickMaterialRipple::setClipRadius(qreal radius) +{ + if (qFuzzyCompare(m_clipRadius, radius)) + return; + + m_clipRadius = radius; + setClip(!qFuzzyIsNull(radius)); + update(); +} + +bool QQuickMaterialRipple::isPressed() const +{ + return m_pressed; +} + +void QQuickMaterialRipple::setPressed(bool pressed) +{ + if (pressed == m_pressed) + return; + + m_pressed = pressed; + + if (!isEnabled()) { + exitWave(); + return; + } + + if (pressed) { + if (m_trigger == Press) + prepareWave(); + else + exitWave(); + } else { + if (m_trigger == Release) + enterWave(); + else + exitWave(); + } +} + +QQuickMaterialRipple::Trigger QQuickMaterialRipple::trigger() const +{ + return m_trigger; +} + +void QQuickMaterialRipple::setTrigger(Trigger trigger) +{ + m_trigger = trigger; +} + +QPointF QQuickMaterialRipple::anchorPoint() const +{ + const QRectF bounds = boundingRect(); + const QPointF center = bounds.center(); + if (!m_anchor) + return center; + + QPointF anchorPoint = bounds.center(); + if (QQuickAbstractButton *button = qobject_cast(m_anchor)) + anchorPoint = QQuickAbstractButtonPrivate::get(button)->pressPoint; + anchorPoint = mapFromItem(m_anchor, anchorPoint); + + // calculate whether the anchor point is within the ripple circle bounds, + // that is, whether waves should start expanding from the anchor point + const qreal r = qSqrt(bounds.width() * bounds.width() + bounds.height() * bounds.height()) / 2; + if (QLineF(center, anchorPoint).length() < r) + return anchorPoint; + + // if the anchor point is outside the ripple circle bounds, start expanding + // from the intersection point of the ripple circle and a line from its center + // to the the anchor point + const qreal p = qAtan2(anchorPoint.y() - center.y(), anchorPoint.x() - center.x()); + return QPointF(center.x() + r * qCos(p), center.y() + r * qSin(p)); +} + +QQuickItem *QQuickMaterialRipple::anchor() const +{ + return m_anchor; +} + +void QQuickMaterialRipple::setAnchor(QQuickItem *item) +{ + m_anchor = item; +} + +qreal QQuickMaterialRipple::diameter() const +{ + const qreal w = width(); + const qreal h = height(); + return qSqrt(w * w + h * h); +} + +void QQuickMaterialRipple::itemChange(ItemChange change, const ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); +} + +QSGNode *QQuickMaterialRipple::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) +{ + QQuickItemPrivate *d = QQuickItemPrivate::get(this); + QQuickDefaultClipNode *clipNode = d->clipNode(); + if (clipNode) { + // TODO: QTBUG-51894 + // clipNode->setRadius(m_clipRadius); + clipNode->setRect(boundingRect()); + clipNode->update(); + } + + QSGNode *container = oldNode; + if (!container) + container = new QSGNode; + + QQuickMaterialRippleBackgroundNode *backgroundNode = static_cast(container->firstChild()); + if (!backgroundNode) { + backgroundNode = new QQuickMaterialRippleBackgroundNode(this); + backgroundNode->setObjectName(objectName()); + container->appendChildNode(backgroundNode); + } + backgroundNode->sync(this); + + // enter new waves + int i = m_waves; + QQuickMaterialRippleWaveNode *enterNode = static_cast(backgroundNode->nextSibling()); + while (i-- > 0) { + if (!enterNode) { + enterNode = new QQuickMaterialRippleWaveNode(this); + container->appendChildNode(enterNode); + } + enterNode->sync(this); + enterNode = static_cast(enterNode->nextSibling()); + } + + // exit old waves + int j = container->childCount() - 1 - m_waves; + while (j-- > 0) { + QQuickMaterialRippleWaveNode *exitNode = static_cast(backgroundNode->nextSibling()); + if (exitNode) { + exitNode->exit(); + exitNode->sync(this); + } + } + + return container; +} + +void QQuickMaterialRipple::timerEvent(QTimerEvent *event) +{ + QQuickItem::timerEvent(event); + + if (event->timerId() == m_enterDelay) + enterWave(); +} + +void QQuickMaterialRipple::prepareWave() +{ + if (m_enterDelay <= 0) + m_enterDelay = startTimer(RIPPLE_ENTER_DELAY); +} + +void QQuickMaterialRipple::enterWave() +{ + if (m_enterDelay > 0) { + killTimer(m_enterDelay); + m_enterDelay = 0; + } + + ++m_waves; + update(); +} + +void QQuickMaterialRipple::exitWave() +{ + if (m_enterDelay > 0) { + killTimer(m_enterDelay); + m_enterDelay = 0; + } + + if (m_waves > 0) { + --m_waves; + update(); + } +} + +QT_END_NAMESPACE + +#include "qquickmaterialripple.moc" diff --git a/src/imports/controls/material/impl/qquickmaterialripple_p.h b/src/imports/controls/material/impl/qquickmaterialripple_p.h new file mode 100644 index 00000000..51728389 --- /dev/null +++ b/src/imports/controls/material/impl/qquickmaterialripple_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKMATERIALRIPPLE_P_H +#define QQUICKMATERIALRIPPLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickMaterialRipple : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(qreal clipRadius READ clipRadius WRITE setClipRadius FINAL) + Q_PROPERTY(bool pressed READ isPressed WRITE setPressed FINAL) + Q_PROPERTY(bool active READ isActive WRITE setActive FINAL) + Q_PROPERTY(QQuickItem *anchor READ anchor WRITE setAnchor FINAL) + Q_PROPERTY(Trigger trigger READ trigger WRITE setTrigger FINAL) + QML_NAMED_ELEMENT(Ripple) + QML_ADDED_IN_VERSION(2, 0) + +public: + QQuickMaterialRipple(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + + qreal clipRadius() const; + void setClipRadius(qreal radius); + + bool isActive() const; + void setActive(bool active); + + bool isPressed() const; + void setPressed(bool pressed); + + enum Trigger { Press, Release }; + Q_ENUM (Trigger) + + Trigger trigger() const; + void setTrigger(Trigger trigger); + + QPointF anchorPoint() const; + + QQuickItem *anchor() const; + void setAnchor(QQuickItem *anchor); + + qreal diameter() const; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + void timerEvent(QTimerEvent *event) override; + + void prepareWave(); + void enterWave(); + void exitWave(); + +private: + bool m_active = false; + bool m_pressed = false; + int m_waves = 0; + int m_enterDelay = 0; + Trigger m_trigger = Press; + qreal m_clipRadius = 0.0; + QColor m_color; + QQuickItem *m_anchor = nullptr; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickMaterialRipple) + +#endif // QQUICKMATERIALRIPPLE_P_H diff --git a/src/imports/controls/material/impl/qtquickcontrols2materialstyleimplplugin.cpp b/src/imports/controls/material/impl/qtquickcontrols2materialstyleimplplugin.cpp new file mode 100644 index 00000000..258ea2b6 --- /dev/null +++ b/src/imports/controls/material/impl/qtquickcontrols2materialstyleimplplugin.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2MaterialStyleImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2MaterialStyleImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2MaterialStyleImplPlugin::QtQuickControls2MaterialStyleImplPlugin(QObject *parent) + : QQmlEngineExtensionPlugin(parent) +{ +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2materialstyleimplplugin.moc" diff --git a/src/imports/controls/material/material.pri b/src/imports/controls/material/material.pri index 457a8df1..8cffdabb 100644 --- a/src/imports/controls/material/material.pri +++ b/src/imports/controls/material/material.pri @@ -1,33 +1,23 @@ HEADERS += \ - $$PWD/qquickmaterialbusyindicator_p.h \ - $$PWD/qquickmaterialprogressbar_p.h \ - $$PWD/qquickmaterialripple_p.h \ $$PWD/qquickmaterialstyle_p.h \ $$PWD/qquickmaterialtheme_p.h SOURCES += \ - $$PWD/qquickmaterialbusyindicator.cpp \ - $$PWD/qquickmaterialprogressbar.cpp \ - $$PWD/qquickmaterialripple.cpp \ $$PWD/qquickmaterialstyle.cpp \ $$PWD/qquickmaterialtheme.cpp QML_FILES += \ $$PWD/ApplicationWindow.qml \ - $$PWD/BoxShadow.qml \ $$PWD/BusyIndicator.qml \ $$PWD/Button.qml \ $$PWD/CheckBox.qml \ $$PWD/CheckDelegate.qml \ - $$PWD/CheckIndicator.qml \ $$PWD/ComboBox.qml \ - $$PWD/CursorDelegate.qml \ $$PWD/DelayButton.qml \ $$PWD/Dial.qml \ $$PWD/Dialog.qml \ $$PWD/DialogButtonBox.qml \ $$PWD/Drawer.qml \ - $$PWD/ElevationEffect.qml \ $$PWD/Frame.qml \ $$PWD/GroupBox.qml \ $$PWD/HorizontalHeaderView.qml \ @@ -45,14 +35,11 @@ QML_FILES += \ $$PWD/ProgressBar.qml \ $$PWD/RadioButton.qml \ $$PWD/RadioDelegate.qml \ - $$PWD/RadioIndicator.qml \ $$PWD/RangeSlider.qml \ $$PWD/RoundButton.qml \ - $$PWD/RectangularGlow.qml \ $$PWD/ScrollBar.qml \ $$PWD/ScrollIndicator.qml \ $$PWD/Slider.qml \ - $$PWD/SliderHandle.qml \ $$PWD/SpinBox.qml \ $$PWD/SplitView.qml \ $$PWD/StackView.qml \ @@ -60,7 +47,6 @@ QML_FILES += \ $$PWD/SwipeView.qml \ $$PWD/Switch.qml \ $$PWD/SwitchDelegate.qml \ - $$PWD/SwitchIndicator.qml \ $$PWD/TabBar.qml \ $$PWD/TabButton.qml \ $$PWD/TextArea.qml \ diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index cf08b925..269f704d 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -5,7 +5,7 @@ IMPORT_NAME = QtQuick.Controls.Material IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/src/imports/controls/material/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/qquickmaterialbusyindicator.cpp deleted file mode 100644 index 58c1fd8c..00000000 --- a/src/imports/controls/material/qquickmaterialbusyindicator.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickmaterialbusyindicator_p.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -/* - Relevant Android code: - - - core/res/res/anim/progress_indeterminate_rotation_material.xml contains - the rotation animation data. - - core/res/res/anim/progress_indeterminate_material.xml contains the trim - animation data. - - core/res/res/interpolator/trim_start_interpolator.xml and - core/res/res/interpolator/trim_end_interpolator.xml contain the start - and end trim path interpolators. - - addCommand() in core/java/android/util/PathParser.java has a list of the - different path commands available. -*/ - -static const int SpanAnimationDuration = 700; -static const int RotationAnimationDuration = SpanAnimationDuration * 6; -static const int TargetRotation = 720; -static const int OneDegree = 16; -static const qreal MinSweepSpan = 10 * OneDegree; -static const qreal MaxSweepSpan = 300 * OneDegree; - -class QQuickMaterialBusyIndicatorNode : public QQuickAnimatedNode -{ -public: - QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item); - - void sync(QQuickItem *item) override; - -protected: - void updateCurrentTime(int time) override; - -private: - int m_lastStartAngle = 0; - int m_lastEndAngle = 0; - qreal m_width = 0; - qreal m_height = 0; - qreal m_devicePixelRatio = 1; - QColor m_color; -}; - -QQuickMaterialBusyIndicatorNode::QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setCurrentTime(item->elapsed()); - setDuration(RotationAnimationDuration); - - QSGImageNode *textureNode = item->window()->createImageNode(); - textureNode->setOwnsTexture(true); - appendChildNode(textureNode); - - // A texture seems to be required here, but we don't have one yet, as we haven't drawn anything, - // so just use a blank image. - QImage blankImage(item->width(), item->height(), QImage::Format_ARGB32_Premultiplied); - blankImage.fill(Qt::transparent); - textureNode->setTexture(item->window()->createTextureFromImage(blankImage)); -} - -void QQuickMaterialBusyIndicatorNode::updateCurrentTime(int time) -{ - const qreal w = m_width; - const qreal h = m_height; - const qreal size = qMin(w, h); - const qreal dx = (w - size) / 2; - const qreal dy = (h - size) / 2; - - QImage image(size * m_devicePixelRatio, size * m_devicePixelRatio, QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::transparent); - - QPainter painter(&image); - painter.setRenderHint(QPainter::Antialiasing); - - QPen pen; - QSGImageNode *textureNode = static_cast(firstChild()); - pen.setColor(m_color); - pen.setWidth(qCeil(size / 12) * m_devicePixelRatio); - painter.setPen(pen); - - const qreal percentageComplete = time / qreal(RotationAnimationDuration); - const qreal spanPercentageComplete = (time % SpanAnimationDuration) / qreal(SpanAnimationDuration); - const int iteration = time / SpanAnimationDuration; - int startAngle = 0; - int endAngle = 0; - - if (iteration % 2 == 0) { - if (m_lastStartAngle > 360 * OneDegree) - m_lastStartAngle -= 360 * OneDegree; - - // The start angle is only affected by the rotation animation for the "grow" phase. - startAngle = m_lastStartAngle; - QEasingCurve angleCurve(QEasingCurve::OutQuad); - const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete); - endAngle = m_lastStartAngle + MinSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan); - m_lastEndAngle = endAngle; - } else { - // Both the start angle *and* the span are affected by the "shrink" phase. - QEasingCurve angleCurve(QEasingCurve::InQuad); - const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete); - startAngle = m_lastEndAngle - MaxSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan); - endAngle = m_lastEndAngle; - m_lastStartAngle = startAngle; - } - - const int halfPen = pen.width() / 2; - const QRectF arcBounds = QRectF(halfPen, halfPen, - m_devicePixelRatio * size - pen.width(), - m_devicePixelRatio * size - pen.width()); - // The current angle of the rotation animation. - const qreal rotation = OneDegree * percentageComplete * -TargetRotation; - startAngle -= rotation; - endAngle -= rotation; - const int angleSpan = endAngle - startAngle; - painter.drawArc(arcBounds, -startAngle, -angleSpan); - painter.end(); - - textureNode->setRect(QRectF(dx, dy, size, size)); - textureNode->setTexture(window()->createTextureFromImage(image)); -} - -void QQuickMaterialBusyIndicatorNode::sync(QQuickItem *item) -{ - QQuickMaterialBusyIndicator *indicator = static_cast(item); - m_color = indicator->color(); - m_width = indicator->width(); - m_height = indicator->height(); - m_devicePixelRatio = indicator->window()->effectiveDevicePixelRatio(); -} - -QQuickMaterialBusyIndicator::QQuickMaterialBusyIndicator(QQuickItem *parent) : - QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -QColor QQuickMaterialBusyIndicator::color() const -{ - return m_color; -} - -void QQuickMaterialBusyIndicator::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - update(); -} - -bool QQuickMaterialBusyIndicator::isRunning() const -{ - return isVisible(); -} - -void QQuickMaterialBusyIndicator::setRunning(bool running) -{ - if (running) - setVisible(true); -} - -int QQuickMaterialBusyIndicator::elapsed() const -{ - return m_elapsed; -} - -void QQuickMaterialBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - switch (change) { - case ItemOpacityHasChanged: - if (qFuzzyIsNull(data.realValue)) - setVisible(false); - break; - case ItemVisibleHasChanged: - update(); - break; - default: - break; - } -} - -QSGNode *QQuickMaterialBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) -{ - QQuickMaterialBusyIndicatorNode *node = static_cast(oldNode); - if (isRunning() && width() > 0 && height() > 0) { - if (!node) { - node = new QQuickMaterialBusyIndicatorNode(this); - node->start(); - } - node->sync(this); - } else { - m_elapsed = node ? node->currentTime() : 0; - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/material/qquickmaterialbusyindicator_p.h b/src/imports/controls/material/qquickmaterialbusyindicator_p.h deleted file mode 100644 index ad7bc002..00000000 --- a/src/imports/controls/material/qquickmaterialbusyindicator_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKMATERIALBUSYINDICATOR_P_H -#define QQUICKMATERIALBUSYINDICATOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickMaterialBusyIndicator : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(bool running READ isRunning WRITE setRunning FINAL) - -public: - explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - bool isRunning() const; - void setRunning(bool running); - - int elapsed() const; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - int m_elapsed = 0; - QColor m_color = Qt::black; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickMaterialBusyIndicator) - -#endif // QQUICKMATERIALBUSYINDICATOR_P_H diff --git a/src/imports/controls/material/qquickmaterialprogressbar.cpp b/src/imports/controls/material/qquickmaterialprogressbar.cpp deleted file mode 100644 index 4635c57b..00000000 --- a/src/imports/controls/material/qquickmaterialprogressbar.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickmaterialprogressbar_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int PauseDuration = 520; -static const int SlideDuration = 1240; -static const int TotalDuration = SlideDuration + PauseDuration; - -class QQuickMaterialProgressBarNode : public QQuickAnimatedNode -{ -public: - QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - void moveNode(QSGTransformNode *node, const QRectF &geometry, qreal progress); - - bool m_indeterminate = false; - QEasingCurve m_easing = QEasingCurve::OutCubic; -}; - -QQuickMaterialProgressBarNode::QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); -} - -void QQuickMaterialProgressBarNode::updateCurrentTime(int time) -{ - QSGRectangleNode *geometryNode = static_cast(firstChild()); - Q_ASSERT(geometryNode->type() == QSGNode::GeometryNodeType); - const QRectF geometry = geometryNode->rect(); - - QSGTransformNode *firstNode = static_cast(geometryNode->firstChild()); - if (firstNode) { - Q_ASSERT(firstNode->type() == QSGNode::TransformNodeType); - - const qreal progress = qMin(1.0, static_cast(time) / SlideDuration); - moveNode(static_cast(firstNode), geometry, progress); - } - - QSGTransformNode *secondNode = static_cast(geometryNode->lastChild()); - if (secondNode) { - Q_ASSERT(secondNode->type() == QSGNode::TransformNodeType); - - const qreal progress = qMax(0.0, static_cast(time - PauseDuration) / SlideDuration); - moveNode(static_cast(secondNode), geometry, progress); - } -} - -void QQuickMaterialProgressBarNode::sync(QQuickItem *item) -{ - QQuickMaterialProgressBar *bar = static_cast(item); - if (m_indeterminate != bar->isIndeterminate()) { - m_indeterminate = bar->isIndeterminate(); - if (m_indeterminate) - start(); - else - stop(); - } - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - - QRectF bounds = item->boundingRect(); - bounds.setHeight(item->implicitHeight()); - bounds.moveTop((item->height() - bounds.height()) / 2.0); - - QSGRectangleNode *geometryNode = static_cast(firstChild()); - if (!geometryNode) { - geometryNode = item->window()->createRectangleNode(); - geometryNode->setColor(Qt::transparent); - appendChildNode(geometryNode); - } - geometryNode->setRect(bounds); - - const int count = m_indeterminate ? 2 : 1; - const qreal w = m_indeterminate ? 0 : bar->progress() * item->width(); - const QRectF rect(0, bounds.y(), w, bounds.height()); - - QSGNode *transformNode = geometryNode->firstChild(); - for (int i = 0; i < count; ++i) { - if (!transformNode) { - transformNode = new QSGTransformNode; - geometryNode->appendChildNode(transformNode); - - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - transformNode->appendChildNode(rectNode); - } - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - static_cast(transformNode)->setMatrix(QMatrix4x4()); - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - rectNode->setRect(rect); - rectNode->setColor(bar->color()); - rectNode->update(); - - transformNode = transformNode->nextSibling(); - } - - while (transformNode) { - QSGNode *nextSibling = transformNode->nextSibling(); - delete transformNode; - transformNode = nextSibling; - } -} - -void QQuickMaterialProgressBarNode::moveNode(QSGTransformNode *transformNode, const QRectF &geometry, qreal progress) -{ - const qreal value = m_easing.valueForProgress(progress); - const qreal x = value * geometry.width(); - - QMatrix4x4 matrix; - matrix.translate(x, 0); - transformNode->setMatrix(matrix); - - QSGInternalRectangleNode *rectNode = static_cast(transformNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - QRectF r = geometry; - r.setWidth(value * (geometry.width() - x)); - rectNode->setRect(r); - rectNode->update(); -} - -QQuickMaterialProgressBar::QQuickMaterialProgressBar(QQuickItem *parent) - : QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -QColor QQuickMaterialProgressBar::color() const -{ - return m_color; -} - -void QQuickMaterialProgressBar::setColor(const QColor &color) -{ - if (color == m_color) - return; - - m_color = color; - update(); -} - -qreal QQuickMaterialProgressBar::progress() const -{ - return m_progress; -} - -void QQuickMaterialProgressBar::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -bool QQuickMaterialProgressBar::isIndeterminate() const -{ - return m_indeterminate; -} - -void QQuickMaterialProgressBar::setIndeterminate(bool indeterminate) -{ - if (indeterminate == m_indeterminate) - return; - - m_indeterminate = indeterminate; - update(); -} - -void QQuickMaterialProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) - update(); -} - -QSGNode *QQuickMaterialProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickMaterialProgressBarNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { - if (!node) - node = new QQuickMaterialProgressBarNode(this); - node->sync(this); - } else { - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/material/qquickmaterialprogressbar_p.h b/src/imports/controls/material/qquickmaterialprogressbar_p.h deleted file mode 100644 index 680f36a4..00000000 --- a/src/imports/controls/material/qquickmaterialprogressbar_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKMATERIALPROGRESSBAR_P_H -#define QQUICKMATERIALPROGRESSBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickMaterialProgressBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) - -public: - explicit QQuickMaterialProgressBar(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - qreal progress() const; - void setProgress(qreal progress); - - bool isIndeterminate() const; - void setIndeterminate(bool indeterminate); - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - QColor m_color = Qt::black; - qreal m_progress = 0.0; - bool m_indeterminate = false; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickMaterialProgressBar) - -#endif // QQUICKMATERIALPROGRESSBAR_P_H diff --git a/src/imports/controls/material/qquickmaterialripple.cpp b/src/imports/controls/material/qquickmaterialripple.cpp deleted file mode 100644 index e6287ff9..00000000 --- a/src/imports/controls/material/qquickmaterialripple.cpp +++ /dev/null @@ -1,442 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickmaterialripple_p.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace { - enum WavePhase { WaveEnter, WaveExit }; -} - -static const int RIPPLE_ENTER_DELAY = 80; -static const int OPACITY_ENTER_DURATION_FAST = 120; -static const int WAVE_OPACITY_DECAY_DURATION = 333; -static const qreal WAVE_TOUCH_DOWN_ACCELERATION = 1024.0; - -class QQuickMaterialRippleWaveNode : public QQuickAnimatedNode -{ -public: - QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple); - - void exit(); - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - qreal m_from = 0; - qreal m_to = 0; - qreal m_value = 0; - WavePhase m_phase = WaveEnter; - QPointF m_anchor; - QRectF m_bounds; -}; - -QQuickMaterialRippleWaveNode::QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple) - : QQuickAnimatedNode(ripple) -{ - start(qRound(1000.0 * qSqrt(ripple->diameter() / 2.0 / WAVE_TOUCH_DOWN_ACCELERATION))); - - QSGOpacityNode *opacityNode = new QSGOpacityNode; - appendChildNode(opacityNode); - - QQuickItemPrivate *d = QQuickItemPrivate::get(ripple); - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - opacityNode->appendChildNode(rectNode); -} - -void QQuickMaterialRippleWaveNode::exit() -{ - m_phase = WaveExit; - m_from = m_value; - setDuration(WAVE_OPACITY_DECAY_DURATION); - restart(); - connect(this, &QQuickAnimatedNode::stopped, this, &QObject::deleteLater); -} - -void QQuickMaterialRippleWaveNode::updateCurrentTime(int time) -{ - qreal p = 1.0; - if (duration() > 0) - p = time / static_cast(duration()); - - m_value = m_from + (m_to - m_from) * p; - p = m_value / m_to; - - const qreal dx = (1.0 - p) * (m_anchor.x() - m_bounds.width() / 2); - const qreal dy = (1.0 - p) * (m_anchor.y() - m_bounds.height() / 2); - - QMatrix4x4 m; - m.translate(qRound((m_bounds.width() - m_value) / 2 + dx), - qRound((m_bounds.height() - m_value) / 2 + dy)); - setMatrix(m); - - QSGOpacityNode *opacityNode = static_cast(firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - qreal opacity = 1.0; - if (m_phase == WaveExit) - opacity -= static_cast(time) / WAVE_OPACITY_DECAY_DURATION; - opacityNode->setOpacity(opacity); - - QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - rectNode->setRect(QRectF(0, 0, m_value, m_value)); - rectNode->setRadius(m_value / 2); - rectNode->update(); -} - -void QQuickMaterialRippleWaveNode::sync(QQuickItem *item) -{ - QQuickMaterialRipple *ripple = static_cast(item); - m_to = ripple->diameter(); - m_anchor = ripple->anchorPoint(); - m_bounds = ripple->boundingRect(); - - QSGOpacityNode *opacityNode = static_cast(firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - rectNode->setColor(ripple->color()); -} - -class QQuickMaterialRippleBackgroundNode : public QQuickAnimatedNode -{ - Q_OBJECT - -public: - QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - bool m_active = false; -}; - -QQuickMaterialRippleBackgroundNode::QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple) - : QQuickAnimatedNode(ripple) -{ - setDuration(OPACITY_ENTER_DURATION_FAST); - - QSGOpacityNode *opacityNode = new QSGOpacityNode; - opacityNode->setOpacity(0.0); - appendChildNode(opacityNode); - - QQuickItemPrivate *d = QQuickItemPrivate::get(ripple); - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - opacityNode->appendChildNode(rectNode); -} - -void QQuickMaterialRippleBackgroundNode::updateCurrentTime(int time) -{ - qreal opacity = time / static_cast(duration()); - if (!m_active) - opacity = 1.0 - opacity; - - QSGOpacityNode *opacityNode = static_cast(firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - opacityNode->setOpacity(opacity); -} - -void QQuickMaterialRippleBackgroundNode::sync(QQuickItem *item) -{ - QQuickMaterialRipple *ripple = static_cast(item); - if (m_active != ripple->isActive()) { - m_active = ripple->isActive(); - setDuration(m_active ? OPACITY_ENTER_DURATION_FAST : WAVE_OPACITY_DECAY_DURATION); - restart(); - } - - QSGOpacityNode *opacityNode = static_cast(firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - const qreal w = ripple->width(); - const qreal h = ripple->height(); - const qreal sz = qSqrt(w * w + h * h); - - QMatrix4x4 matrix; - if (qFuzzyIsNull(ripple->clipRadius())) { - matrix.translate(qRound((w - sz) / 2), qRound((h - sz) / 2)); - rectNode->setRect(QRectF(0, 0, sz, sz)); - rectNode->setRadius(sz / 2); - } else { - rectNode->setRect(QRectF(0, 0, w, h)); - rectNode->setRadius(ripple->clipRadius()); - } - - setMatrix(matrix); - rectNode->setColor(ripple->color()); - rectNode->update(); -} - -QQuickMaterialRipple::QQuickMaterialRipple(QQuickItem *parent) - : QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -bool QQuickMaterialRipple::isActive() const -{ - return m_active; -} - -void QQuickMaterialRipple::setActive(bool active) -{ - if (active == m_active) - return; - - m_active = active; - update(); -} - -QColor QQuickMaterialRipple::color() const -{ - return m_color; -} - -void QQuickMaterialRipple::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - update(); -} - -qreal QQuickMaterialRipple::clipRadius() const -{ - return m_clipRadius; -} - -void QQuickMaterialRipple::setClipRadius(qreal radius) -{ - if (qFuzzyCompare(m_clipRadius, radius)) - return; - - m_clipRadius = radius; - setClip(!qFuzzyIsNull(radius)); - update(); -} - -bool QQuickMaterialRipple::isPressed() const -{ - return m_pressed; -} - -void QQuickMaterialRipple::setPressed(bool pressed) -{ - if (pressed == m_pressed) - return; - - m_pressed = pressed; - - if (!isEnabled()) { - exitWave(); - return; - } - - if (pressed) { - if (m_trigger == Press) - prepareWave(); - else - exitWave(); - } else { - if (m_trigger == Release) - enterWave(); - else - exitWave(); - } -} - -QQuickMaterialRipple::Trigger QQuickMaterialRipple::trigger() const -{ - return m_trigger; -} - -void QQuickMaterialRipple::setTrigger(Trigger trigger) -{ - m_trigger = trigger; -} - -QPointF QQuickMaterialRipple::anchorPoint() const -{ - const QRectF bounds = boundingRect(); - const QPointF center = bounds.center(); - if (!m_anchor) - return center; - - QPointF anchorPoint = bounds.center(); - if (QQuickAbstractButton *button = qobject_cast(m_anchor)) - anchorPoint = QQuickAbstractButtonPrivate::get(button)->pressPoint; - anchorPoint = mapFromItem(m_anchor, anchorPoint); - - // calculate whether the anchor point is within the ripple circle bounds, - // that is, whether waves should start expanding from the anchor point - const qreal r = qSqrt(bounds.width() * bounds.width() + bounds.height() * bounds.height()) / 2; - if (QLineF(center, anchorPoint).length() < r) - return anchorPoint; - - // if the anchor point is outside the ripple circle bounds, start expanding - // from the intersection point of the ripple circle and a line from its center - // to the the anchor point - const qreal p = qAtan2(anchorPoint.y() - center.y(), anchorPoint.x() - center.x()); - return QPointF(center.x() + r * qCos(p), center.y() + r * qSin(p)); -} - -QQuickItem *QQuickMaterialRipple::anchor() const -{ - return m_anchor; -} - -void QQuickMaterialRipple::setAnchor(QQuickItem *item) -{ - m_anchor = item; -} - -qreal QQuickMaterialRipple::diameter() const -{ - const qreal w = width(); - const qreal h = height(); - return qSqrt(w * w + h * h); -} - -void QQuickMaterialRipple::itemChange(ItemChange change, const ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); -} - -QSGNode *QQuickMaterialRipple::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) -{ - QQuickItemPrivate *d = QQuickItemPrivate::get(this); - QQuickDefaultClipNode *clipNode = d->clipNode(); - if (clipNode) { - // TODO: QTBUG-51894 - // clipNode->setRadius(m_clipRadius); - clipNode->setRect(boundingRect()); - clipNode->update(); - } - - QSGNode *container = oldNode; - if (!container) - container = new QSGNode; - - QQuickMaterialRippleBackgroundNode *backgroundNode = static_cast(container->firstChild()); - if (!backgroundNode) { - backgroundNode = new QQuickMaterialRippleBackgroundNode(this); - backgroundNode->setObjectName(objectName()); - container->appendChildNode(backgroundNode); - } - backgroundNode->sync(this); - - // enter new waves - int i = m_waves; - QQuickMaterialRippleWaveNode *enterNode = static_cast(backgroundNode->nextSibling()); - while (i-- > 0) { - if (!enterNode) { - enterNode = new QQuickMaterialRippleWaveNode(this); - container->appendChildNode(enterNode); - } - enterNode->sync(this); - enterNode = static_cast(enterNode->nextSibling()); - } - - // exit old waves - int j = container->childCount() - 1 - m_waves; - while (j-- > 0) { - QQuickMaterialRippleWaveNode *exitNode = static_cast(backgroundNode->nextSibling()); - if (exitNode) { - exitNode->exit(); - exitNode->sync(this); - } - } - - return container; -} - -void QQuickMaterialRipple::timerEvent(QTimerEvent *event) -{ - QQuickItem::timerEvent(event); - - if (event->timerId() == m_enterDelay) - enterWave(); -} - -void QQuickMaterialRipple::prepareWave() -{ - if (m_enterDelay <= 0) - m_enterDelay = startTimer(RIPPLE_ENTER_DELAY); -} - -void QQuickMaterialRipple::enterWave() -{ - if (m_enterDelay > 0) { - killTimer(m_enterDelay); - m_enterDelay = 0; - } - - ++m_waves; - update(); -} - -void QQuickMaterialRipple::exitWave() -{ - if (m_enterDelay > 0) { - killTimer(m_enterDelay); - m_enterDelay = 0; - } - - if (m_waves > 0) { - --m_waves; - update(); - } -} - -QT_END_NAMESPACE - -#include "qquickmaterialripple.moc" diff --git a/src/imports/controls/material/qquickmaterialripple_p.h b/src/imports/controls/material/qquickmaterialripple_p.h deleted file mode 100644 index 8a80113b..00000000 --- a/src/imports/controls/material/qquickmaterialripple_p.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKMATERIALRIPPLE_P_H -#define QQUICKMATERIALRIPPLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickMaterialRipple : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(qreal clipRadius READ clipRadius WRITE setClipRadius FINAL) - Q_PROPERTY(bool pressed READ isPressed WRITE setPressed FINAL) - Q_PROPERTY(bool active READ isActive WRITE setActive FINAL) - Q_PROPERTY(QQuickItem *anchor READ anchor WRITE setAnchor FINAL) - Q_PROPERTY(Trigger trigger READ trigger WRITE setTrigger FINAL) - -public: - QQuickMaterialRipple(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - qreal clipRadius() const; - void setClipRadius(qreal radius); - - bool isActive() const; - void setActive(bool active); - - bool isPressed() const; - void setPressed(bool pressed); - - enum Trigger { Press, Release }; - Q_ENUM (Trigger) - - Trigger trigger() const; - void setTrigger(Trigger trigger); - - QPointF anchorPoint() const; - - QQuickItem *anchor() const; - void setAnchor(QQuickItem *anchor); - - qreal diameter() const; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - void timerEvent(QTimerEvent *event) override; - - void prepareWave(); - void enterWave(); - void exitWave(); - -private: - bool m_active = false; - bool m_pressed = false; - int m_waves = 0; - int m_enterDelay = 0; - Trigger m_trigger = Press; - qreal m_clipRadius = 0.0; - QColor m_color; - QQuickItem *m_anchor = nullptr; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickMaterialRipple) - -#endif // QQUICKMATERIALRIPPLE_P_H diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h index fa980efc..557a4434 100644 --- a/src/imports/controls/material/qquickmaterialstyle_p.h +++ b/src/imports/controls/material/qquickmaterialstyle_p.h @@ -49,7 +49,7 @@ // #include -#include +#include QT_BEGIN_NAMESPACE @@ -109,6 +109,11 @@ class QQuickMaterialStyle : public QQuickAttachedObject Q_PROPERTY(int switchDelegateVerticalPadding READ switchDelegateVerticalPadding CONSTANT FINAL) Q_PROPERTY(int tooltipHeight READ tooltipHeight CONSTANT FINAL) + QML_NAMED_ELEMENT(Material) + QML_ATTACHED(QQuickMaterialStyle) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 0) + public: enum Theme { Light, diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index 88f6cd1e..c0dc5721 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -38,11 +38,8 @@ #include "qquickmaterialstyle_p.h" #include "qquickmaterialtheme_p.h" -#include "qquickmaterialbusyindicator_p.h" -#include "qquickmaterialprogressbar_p.h" -#include "qquickmaterialripple_p.h" -#include +#include QT_BEGIN_NAMESPACE @@ -67,15 +64,9 @@ QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) { - qmlRegisterModule(uri, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterUncreatableType(uri, 2, 0, "Material", tr("Material is an attached property")); - QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); - qmlRegisterType(import, 2, 0, "ProgressBarImpl"); - qmlRegisterType(import, 2, 0, "Ripple"); qmlRegisterType(resolvedUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow"); qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); qmlRegisterType(resolvedUrl(QStringLiteral("CursorDelegate.qml")), import, 2, 0, "CursorDelegate"); diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc index 71f9563b..981960c4 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc @@ -1,5 +1,5 @@ - + images/arrow-indicator.png images/arrow-indicator@2x.png images/arrow-indicator@3x.png diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 55a03c36..483e6d0c 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -44,22 +44,22 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) -#include +#include #endif #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/imports/controls/universal/.prev_CMakeLists.txt b/src/imports/controls/universal/.prev_CMakeLists.txt index f78b6e49..45c15169 100644 --- a/src/imports/controls/universal/.prev_CMakeLists.txt +++ b/src/imports/controls/universal/.prev_CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### add_qml_module(qtquickcontrols2universalstyleplugin - TARGET_PATH "QtQuick/Controls.2/Universal" + TARGET_PATH "QtQuick/Controls/Universal" URI "QtQuick.Controls.Universal" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2UniversalStylePlugin @@ -58,7 +58,7 @@ set(qtquickcontrols2universalstyleplugin_resource_files add_qt_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universalstyleplugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Universal" + "/qt-project.org/imports/QtQuick/Controls/Universal" FILES ${qtquickcontrols2universalstyleplugin_resource_files} ) @@ -68,7 +68,7 @@ add_qt_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universals # IMPORT_NAME = "QtQuick.Controls.Universal" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Universal" +# TARGETPATH = "QtQuick/Controls/Universal" # _REQUIREMENTS = "qtConfig(quickcontrols2-universal)" set(qml_files diff --git a/src/imports/controls/universal/CMakeLists.txt b/src/imports/controls/universal/CMakeLists.txt index cf0464f3..53a3c9d0 100644 --- a/src/imports/controls/universal/CMakeLists.txt +++ b/src/imports/controls/universal/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2universalstyleplugin - TARGET_PATH "QtQuick/Controls.2/Universal" + TARGET_PATH "QtQuick/Controls/Universal" URI "QtQuick.Controls.Universal" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickControls2UniversalStylePlugin @@ -58,7 +58,7 @@ set(qtquickcontrols2universalstyleplugin_resource_files qt_add_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universalstyleplugin" PREFIX - "/qt-project.org/imports/QtQuick/Controls.2/Universal" + "/qt-project.org/imports/QtQuick/Controls/Universal" FILES ${qtquickcontrols2universalstyleplugin_resource_files} ) @@ -68,7 +68,7 @@ qt_add_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universals # IMPORT_NAME = "QtQuick.Controls.Universal" # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" -# TARGETPATH = "QtQuick/Controls.2/Universal" +# TARGETPATH = "QtQuick/Controls/Universal" # _REQUIREMENTS = "qtConfig(quickcontrols2-universal)" set(qml_files diff --git a/src/imports/controls/universal/CheckIndicator.qml b/src/imports/controls/universal/CheckIndicator.qml deleted file mode 100644 index 8f41617a..00000000 --- a/src/imports/controls/universal/CheckIndicator.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 - -Rectangle { - id: indicator - implicitWidth: 20 - implicitHeight: 20 - - color: !control.enabled ? "transparent" : - control.down && !partiallyChecked ? control.Universal.baseMediumColor : - control.checkState === Qt.Checked ? control.Universal.accent : "transparent" - border.color: !control.enabled ? control.Universal.baseLowColor : - control.down ? control.Universal.baseMediumColor : - control.checked ? control.Universal.accent : control.Universal.baseMediumHighColor - border.width: 2 // CheckBoxBorderThemeThickness - - property Item control - readonly property bool partiallyChecked: control.checkState === Qt.PartiallyChecked - - ColorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - - visible: indicator.control.checkState === Qt.Checked - color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : indicator.control.Universal.chromeWhiteColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/checkmark.png" - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: indicator.partiallyChecked ? parent.width / 2 : parent.width - height: indicator.partiallyChecked ? parent.height / 2 : parent.height - - visible: !indicator.control.pressed && indicator.control.hovered || indicator.partiallyChecked - color: !indicator.partiallyChecked ? "transparent" : - !indicator.control.enabled ? indicator.control.Universal.baseLowColor : - indicator.control.down ? indicator.control.Universal.baseMediumColor : - indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor - border.width: indicator.partiallyChecked ? 0 : 2 // CheckBoxBorderThemeThickness - border.color: indicator.control.Universal.baseMediumLowColor - } -} diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 9b88ccf9..eb7fb09d 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -67,7 +67,7 @@ T.ComboBox { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 color: !control.enabled ? control.Universal.baseLowColor : control.Universal.baseMediumHighColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/downarrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/downarrow.png" Rectangle { z: -1 diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index 23d0ee3c..872f1eba 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -82,7 +82,7 @@ T.MenuItem { visible: control.subMenu mirror: control.mirrored color: !enabled ? control.Universal.baseLowColor : control.Universal.baseHighColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/rightarrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/rightarrow.png" } indicator: ColorImage { @@ -91,7 +91,7 @@ T.MenuItem { visible: control.checked color: !control.enabled ? control.Universal.baseLowColor : control.down ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor - source: !control.checkable ? "" : "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/checkmark.png" + source: !control.checkable ? "" : "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/checkmark.png" } background: Rectangle { diff --git a/src/imports/controls/universal/RadioIndicator.qml b/src/imports/controls/universal/RadioIndicator.qml deleted file mode 100644 index 1a32decb..00000000 --- a/src/imports/controls/universal/RadioIndicator.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls.Universal 2.12 - -Rectangle { - id: indicator - implicitWidth: 20 - implicitHeight: 20 - radius: width / 2 - color: "transparent" - border.width: 2 // RadioButtonBorderThemeThickness - border.color: control.checked ? "transparent" : - !control.enabled ? control.Universal.baseLowColor : - control.down ? control.Universal.baseMediumColor : - control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor - - property var control - - Rectangle { - id: checkOuterEllipse - width: parent.width - height: parent.height - - radius: width / 2 - opacity: indicator.control.checked ? 1 : 0 - color: "transparent" - border.width: 2 // RadioButtonBorderThemeThickness - border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : - indicator.control.down ? indicator.control.Universal.baseMediumColor : indicator.control.Universal.accent - } - - Rectangle { - id: checkGlyph - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 2 - height: parent.height / 2 - - radius: width / 2 - opacity: indicator.control.checked ? 1 : 0 - color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : - indicator.control.down ? indicator.control.Universal.baseMediumColor : - indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor - } -} diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml index dfe927f5..56fdffdf 100644 --- a/src/imports/controls/universal/SpinBox.qml +++ b/src/imports/controls/universal/SpinBox.qml @@ -105,7 +105,7 @@ T.SpinBox { y: (parent.height - height) / 2 color: !enabled ? control.Universal.chromeDisabledLowColor : control.activeFocus ? control.Universal.chromeBlackHighColor : control.Universal.baseHighColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/" + (control.mirrored ? "left" : "right") + "arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/" + (control.mirrored ? "left" : "right") + "arrow.png" } } @@ -131,7 +131,7 @@ T.SpinBox { y: (parent.height - height) / 2 color: !enabled ? control.Universal.chromeDisabledLowColor : control.activeFocus ? control.Universal.chromeBlackHighColor : control.Universal.baseHighColor - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/" + (control.mirrored ? "right" : "left") + "arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/" + (control.mirrored ? "right" : "left") + "arrow.png" } } diff --git a/src/imports/controls/universal/SwitchIndicator.qml b/src/imports/controls/universal/SwitchIndicator.qml deleted file mode 100644 index 10f39515..00000000 --- a/src/imports/controls/universal/SwitchIndicator.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 - -Item { - id: indicator - implicitWidth: 44 - implicitHeight: 20 - - Rectangle { - width: parent.width - height: parent.height - - radius: 10 - color: !indicator.control.enabled ? "transparent" : - indicator.control.pressed ? indicator.control.Universal.baseMediumColor : - indicator.control.checked ? indicator.control.Universal.accent : "transparent" - border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : - indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.accent : - indicator.control.hovered && !indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumColor - opacity: indicator.control.hovered && indicator.control.checked && !indicator.control.pressed ? (indicator.control.Universal.theme === Universal.Light ? 0.7 : 0.9) : 1.0 - border.width: 2 - } - - property Item control - - Rectangle { - width: 10 - height: 10 - radius: 5 - - color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : - indicator.control.pressed || indicator.control.checked ? indicator.control.Universal.chromeWhiteColor : - indicator.control.hovered && !indicator.control.checked ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor - - x: Math.max(5, Math.min(parent.width - width - 5, - indicator.control.visualPosition * parent.width - (width / 2))) - y: (parent.height - height) / 2 - - Behavior on x { - enabled: !indicator.control.pressed - SmoothedAnimation { velocity: 200 } - } - } -} diff --git a/src/imports/controls/universal/impl/CheckIndicator.qml b/src/imports/controls/universal/impl/CheckIndicator.qml new file mode 100644 index 00000000..7e8d9327 --- /dev/null +++ b/src/imports/controls/universal/impl/CheckIndicator.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls 2.12 +import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Universal 2.12 + +Rectangle { + id: indicator + implicitWidth: 20 + implicitHeight: 20 + + color: !control.enabled ? "transparent" : + control.down && !partiallyChecked ? control.Universal.baseMediumColor : + control.checkState === Qt.Checked ? control.Universal.accent : "transparent" + border.color: !control.enabled ? control.Universal.baseLowColor : + control.down ? control.Universal.baseMediumColor : + control.checked ? control.Universal.accent : control.Universal.baseMediumHighColor + border.width: 2 // CheckBoxBorderThemeThickness + + property Item control + readonly property bool partiallyChecked: control.checkState === Qt.PartiallyChecked + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + + visible: indicator.control.checkState === Qt.Checked + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : indicator.control.Universal.chromeWhiteColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Universal/images/checkmark.png" + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: indicator.partiallyChecked ? parent.width / 2 : parent.width + height: indicator.partiallyChecked ? parent.height / 2 : parent.height + + visible: !indicator.control.pressed && indicator.control.hovered || indicator.partiallyChecked + color: !indicator.partiallyChecked ? "transparent" : + !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : + indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor + border.width: indicator.partiallyChecked ? 0 : 2 // CheckBoxBorderThemeThickness + border.color: indicator.control.Universal.baseMediumLowColor + } +} diff --git a/src/imports/controls/universal/impl/RadioIndicator.qml b/src/imports/controls/universal/impl/RadioIndicator.qml new file mode 100644 index 00000000..1a32decb --- /dev/null +++ b/src/imports/controls/universal/impl/RadioIndicator.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls.Universal 2.12 + +Rectangle { + id: indicator + implicitWidth: 20 + implicitHeight: 20 + radius: width / 2 + color: "transparent" + border.width: 2 // RadioButtonBorderThemeThickness + border.color: control.checked ? "transparent" : + !control.enabled ? control.Universal.baseLowColor : + control.down ? control.Universal.baseMediumColor : + control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor + + property var control + + Rectangle { + id: checkOuterEllipse + width: parent.width + height: parent.height + + radius: width / 2 + opacity: indicator.control.checked ? 1 : 0 + color: "transparent" + border.width: 2 // RadioButtonBorderThemeThickness + border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : indicator.control.Universal.accent + } + + Rectangle { + id: checkGlyph + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 2 + height: parent.height / 2 + + radius: width / 2 + opacity: indicator.control.checked ? 1 : 0 + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : + indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor + } +} diff --git a/src/imports/controls/universal/impl/SwitchIndicator.qml b/src/imports/controls/universal/impl/SwitchIndicator.qml new file mode 100644 index 00000000..10f39515 --- /dev/null +++ b/src/imports/controls/universal/impl/SwitchIndicator.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import QtQuick.Controls.Universal 2.12 + +Item { + id: indicator + implicitWidth: 44 + implicitHeight: 20 + + Rectangle { + width: parent.width + height: parent.height + + radius: 10 + color: !indicator.control.enabled ? "transparent" : + indicator.control.pressed ? indicator.control.Universal.baseMediumColor : + indicator.control.checked ? indicator.control.Universal.accent : "transparent" + border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.accent : + indicator.control.hovered && !indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumColor + opacity: indicator.control.hovered && indicator.control.checked && !indicator.control.pressed ? (indicator.control.Universal.theme === Universal.Light ? 0.7 : 0.9) : 1.0 + border.width: 2 + } + + property Item control + + Rectangle { + width: 10 + height: 10 + radius: 5 + + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.pressed || indicator.control.checked ? indicator.control.Universal.chromeWhiteColor : + indicator.control.hovered && !indicator.control.checked ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor + + x: Math.max(5, Math.min(parent.width - width - 5, + indicator.control.visualPosition * parent.width - (width / 2))) + y: (parent.height - height) / 2 + + Behavior on x { + enabled: !indicator.control.pressed + SmoothedAnimation { velocity: 200 } + } + } +} diff --git a/src/imports/controls/universal/impl/qmldir b/src/imports/controls/universal/impl/qmldir new file mode 100644 index 00000000..26bbd8bf --- /dev/null +++ b/src/imports/controls/universal/impl/qmldir @@ -0,0 +1,3 @@ +module QtQuick.Controls.Universal.impl +plugin qtquickcontrols2universalstyleimplplugin +classname QtQuickControls2UniversalStyleImplPlugin diff --git a/src/imports/controls/universal/impl/qquickuniversalbusyindicator.cpp b/src/imports/controls/universal/impl/qquickuniversalbusyindicator.cpp new file mode 100644 index 00000000..2f0ada49 --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalbusyindicator.cpp @@ -0,0 +1,251 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickuniversalbusyindicator_p.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int PhaseCount = 6; +static const int Interval = 167; +static const int TotalDuration = 4052; + +class QQuickUniversalBusyIndicatorNode : public QQuickAnimatedNode +{ +public: + QQuickUniversalBusyIndicatorNode(QQuickUniversalBusyIndicator *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + struct Phase { + Phase() = default; + Phase(int d, qreal f, qreal t, QEasingCurve::Type c) : duration(d), from(f), to(t), curve(c) { } + int duration = 0; + qreal from = 0; + qreal to = 0; + QEasingCurve curve = QEasingCurve::Linear; + }; + + Phase m_phases[PhaseCount]; +}; + +QQuickUniversalBusyIndicatorNode::QQuickUniversalBusyIndicatorNode(QQuickUniversalBusyIndicator *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); + setCurrentTime(item->elapsed()); + + m_phases[0] = Phase(433, -110, 10, QEasingCurve::BezierSpline); + m_phases[1] = Phase(767, 10, 93, QEasingCurve::Linear ); + m_phases[2] = Phase(417, 93, 205, QEasingCurve::BezierSpline); + m_phases[3] = Phase(400, 205, 357, QEasingCurve::BezierSpline); + m_phases[4] = Phase(766, 357, 439, QEasingCurve::Linear ); + m_phases[5] = Phase(434, 439, 585, QEasingCurve::BezierSpline); + + m_phases[0].curve.addCubicBezierSegment(QPointF(0.02, 0.33), QPointF(0.38, 0.77), QPointF(1.00, 1.00)); + m_phases[2].curve.addCubicBezierSegment(QPointF(0.57, 0.17), QPointF(0.95, 0.75), QPointF(1.00, 1.00)); + m_phases[3].curve.addCubicBezierSegment(QPointF(0.00, 0.19), QPointF(0.07, 0.72), QPointF(1.00, 1.00)); + m_phases[5].curve.addCubicBezierSegment(QPointF(0.00, 0.00), QPointF(0.95, 0.37), QPointF(1.00, 1.00)); +} + +void QQuickUniversalBusyIndicatorNode::updateCurrentTime(int time) +{ + int nodeIndex = 0; + int count = childCount(); + QSGTransformNode *transformNode = static_cast(firstChild()); + while (transformNode) { + Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); + + QSGOpacityNode *opacityNode = static_cast(transformNode->firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + int begin = nodeIndex * Interval; + int end = TotalDuration - (PhaseCount - nodeIndex - 1) * Interval; + + bool visible = time >= begin && time <= end; + opacityNode->setOpacity(visible ? 1.0 : 0.0); + + if (visible) { + int phaseIndex, remain = time, elapsed = 0; + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { + if (remain <= m_phases[phaseIndex].duration + begin) + break; + remain -= m_phases[phaseIndex].duration; + elapsed += m_phases[phaseIndex].duration; + } + + const Phase &phase = m_phases[phaseIndex]; + + qreal from = phase.from - nodeIndex * count; + qreal to = phase.to - nodeIndex * count; + qreal pos = time - elapsed - begin; + + qreal value = phase.curve.valueForProgress(pos / phase.duration); + qreal rotation = from + (to - from) * value; + + QMatrix4x4 matrix; + matrix.rotate(rotation, 0, 0, 1); + transformNode->setMatrix(matrix); + } + + transformNode = static_cast(transformNode->nextSibling()); + ++nodeIndex; + } +} + +void QQuickUniversalBusyIndicatorNode::sync(QQuickItem *item) +{ + QQuickUniversalBusyIndicator *indicator = static_cast(item); + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + + QMatrix4x4 matrix; + matrix.translate(item->width() / 2, item->height() / 2); + setMatrix(matrix); + + qreal size = qMin(item->width(), item->height()); + qreal diameter = size / 10.0; + qreal radius = diameter / 2; + qreal offset = (size - diameter * 2) / M_PI; + const QRectF rect(offset, offset, diameter, diameter); + + int count = indicator->count(); + QSGNode *transformNode = firstChild(); + for (int i = 0; i < count; ++i) { + if (!transformNode) { + transformNode = new QSGTransformNode; + appendChildNode(transformNode); + + QSGOpacityNode *opacityNode = new QSGOpacityNode; + transformNode->appendChildNode(opacityNode); + + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + opacityNode->appendChildNode(rectNode); + } + + QSGNode *opacityNode = transformNode->firstChild(); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + rectNode->setRect(rect); + rectNode->setColor(indicator->color()); + rectNode->setRadius(radius); + rectNode->update(); + + transformNode = transformNode->nextSibling(); + } + + while (transformNode) { + QSGNode *nextSibling = transformNode->nextSibling(); + delete transformNode; + transformNode = nextSibling; + } +} + +QQuickUniversalBusyIndicator::QQuickUniversalBusyIndicator(QQuickItem *parent) + : QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +int QQuickUniversalBusyIndicator::count() const +{ + return m_count; +} + +void QQuickUniversalBusyIndicator::setCount(int count) +{ + if (m_count == count) + return; + + m_count = count; + update(); +} + +QColor QQuickUniversalBusyIndicator::color() const +{ + return m_color; +} + +void QQuickUniversalBusyIndicator::setColor(const QColor &color) +{ + if (m_color == color) + return; + + m_color = color; + update(); +} + +int QQuickUniversalBusyIndicator::elapsed() const +{ + return m_elapsed; +} + +void QQuickUniversalBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemVisibleHasChanged) + update(); +} + +QSGNode *QQuickUniversalBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) +{ + QQuickUniversalBusyIndicatorNode *node = static_cast(oldNode); + if (isVisible() && width() > 0 && height() > 0) { + if (!node) { + node = new QQuickUniversalBusyIndicatorNode(this); + node->start(); + } + node->sync(this); + } else { + m_elapsed = node ? node->currentTime() : 0; + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/universal/impl/qquickuniversalbusyindicator_p.h b/src/imports/controls/universal/impl/qquickuniversalbusyindicator_p.h new file mode 100644 index 00000000..6d3ebb84 --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalbusyindicator_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKUNIVERSALBUSYINDICATOR_P_H +#define QQUICKUNIVERSALBUSYINDICATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickUniversalBusyIndicator : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(int count READ count WRITE setCount FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + QML_NAMED_ELEMENT(BusyIndicatorImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickUniversalBusyIndicator(QQuickItem *parent = nullptr); + + int count() const; + void setCount(int count); + + QColor color() const; + void setColor(const QColor &color); + + int elapsed() const; + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + int m_count = 5; + int m_elapsed = 0; + QColor m_color = Qt::black; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickUniversalBusyIndicator) + +#endif // QQUICKUNIVERSALBUSYINDICATOR_P_H diff --git a/src/imports/controls/universal/impl/qquickuniversalfocusrectangle.cpp b/src/imports/controls/universal/impl/qquickuniversalfocusrectangle.cpp new file mode 100644 index 00000000..51508c6f --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalfocusrectangle.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickuniversalfocusrectangle_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickUniversalFocusRectangle::QQuickUniversalFocusRectangle(QQuickItem *parent) + : QQuickPaintedItem(parent) +{ + QQuickItemPrivate::get(this)->setTransparentForPositioner(true); +} + +void QQuickUniversalFocusRectangle::paint(QPainter *painter) +{ + if (!isVisible() || width() <= 0 || height() <= 0) + return; + + QRect bounds = boundingRect().toAlignedRect(); + const int boundsWidth = bounds.width(); + const int boundsHeight = bounds.width(); + const QString key = QStringLiteral("qquickuniversalfocusrectangle_%1_%2").arg(QString::number(boundsWidth), QString::number(boundsHeight)); + + QPixmap pixmap(boundsWidth, boundsHeight); + if (!QPixmapCache::find(key, &pixmap)) { + bounds.adjust(0, 0, -1, -1); + pixmap.fill(Qt::transparent); + QPainter p(&pixmap); + + QPen pen; + pen.setWidth(1); + pen.setColor(Qt::white); + p.setPen(pen); + p.drawRect(bounds); + + pen.setColor(Qt::black); + pen.setDashPattern(QList(2, 1)); + p.setPen(pen); + p.drawRect(bounds); + + QPixmapCache::insert(key, pixmap); + } + painter->drawPixmap(0, 0, pixmap); +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/universal/impl/qquickuniversalfocusrectangle_p.h b/src/imports/controls/universal/impl/qquickuniversalfocusrectangle_p.h new file mode 100644 index 00000000..f309b512 --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalfocusrectangle_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKUNIVERSALFOCUSRECTANGLE_P_H +#define QQUICKUNIVERSALFOCUSRECTANGLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QQuickUniversalFocusRectangle : public QQuickPaintedItem +{ + Q_OBJECT + QML_NAMED_ELEMENT(FocusRectangle) + QML_ADDED_IN_VERSION(2, 0) + +public: + QQuickUniversalFocusRectangle(QQuickItem *parent = nullptr); + + void paint(QPainter *painter) override; +}; + +QT_END_NAMESPACE + +#endif // QQUICKUNIVERSALFOCUSRECTANGLE_P_H diff --git a/src/imports/controls/universal/impl/qquickuniversalprogressbar.cpp b/src/imports/controls/universal/impl/qquickuniversalprogressbar.cpp new file mode 100644 index 00000000..8f907b75 --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalprogressbar.cpp @@ -0,0 +1,338 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickuniversalprogressbar_p.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static const int PhaseCount = 4; +static const int EllipseCount = 5; +static const int Interval = 167; +static const int TotalDuration = 3917; +static const int VisibleDuration = 3000; +static const qreal EllipseDiameter = 4; +static const qreal EllipseOffset = 4; +static const qreal ContainerAnimationStartPosition = -34; // absolute +static const qreal ContainerAnimationEndPosition = 0.435222; // relative +static const qreal EllipseAnimationWellPosition = 0.333333333333333; // relative +static const qreal EllipseAnimationEndPosition = 0.666666666666667; // relative + +class QQuickUniversalProgressBarNode : public QQuickAnimatedNode +{ +public: + QQuickUniversalProgressBarNode(QQuickUniversalProgressBar *item); + + void updateCurrentTime(int time) override; + void sync(QQuickItem *item) override; + +private: + struct Phase { + Phase() = default; + Phase(int d, qreal f, qreal t) : duration(d), from(f), to(t) { } + int duration = 0; + qreal from = 0; + qreal to = 0; + }; + + bool m_indeterminate = false; + Phase m_borderPhases[PhaseCount]; + Phase m_ellipsePhases[PhaseCount]; +}; + +QQuickUniversalProgressBarNode::QQuickUniversalProgressBarNode(QQuickUniversalProgressBar *item) + : QQuickAnimatedNode(item) +{ + setLoopCount(Infinite); + setDuration(TotalDuration); + + m_borderPhases[0] = Phase( 500, -50, 0); + m_borderPhases[1] = Phase(1500, 0, 0); + m_borderPhases[2] = Phase(1000, 0, 100); + m_borderPhases[3] = Phase( 917, 100, 100); + + m_ellipsePhases[0] = Phase(1000, 0, EllipseAnimationWellPosition); + m_ellipsePhases[1] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationWellPosition); + m_ellipsePhases[2] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationEndPosition); + m_ellipsePhases[3] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationEndPosition); +} + +void QQuickUniversalProgressBarNode::updateCurrentTime(int time) +{ + QSGRectangleNode *geometryNode = static_cast(firstChild()); + Q_ASSERT(!geometryNode || geometryNode->type() == QSGNode::GeometryNodeType); + if (!geometryNode) + return; + + QSGTransformNode *gridNode = static_cast(geometryNode->firstChild()); + Q_ASSERT(!gridNode || gridNode->type() == QSGNode::TransformNodeType); + if (!gridNode) + return; + + qreal width = geometryNode->rect().width(); + { + qreal from = ContainerAnimationStartPosition; + qreal to = from + ContainerAnimationEndPosition * width; + qreal progress = static_cast(time) / TotalDuration; + qreal dx = from + (to - from) * progress; + + QMatrix4x4 matrix; + matrix.translate(dx, 0); + gridNode->setMatrix(matrix); + } + + int nodeIndex = 0; + QSGTransformNode *borderNode = static_cast(gridNode->firstChild()); + while (borderNode) { + Q_ASSERT(borderNode->type() == QSGNode::TransformNodeType); + + QSGTransformNode *ellipseNode = static_cast(borderNode->firstChild()); + Q_ASSERT(ellipseNode->type() == QSGNode::TransformNodeType); + + QSGOpacityNode *opacityNode = static_cast(ellipseNode->firstChild()); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + int begin = nodeIndex * Interval; + int end = VisibleDuration + nodeIndex * Interval; + + bool visible = time >= begin && time <= end; + opacityNode->setOpacity(visible ? 1.0 : 0.0); + + if (visible) { + { + int phaseIndex, remain = time, elapsed = 0; + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { + if (remain <= m_borderPhases[phaseIndex].duration + begin) + break; + remain -= m_borderPhases[phaseIndex].duration; + elapsed += m_borderPhases[phaseIndex].duration; + } + + const Phase &phase = m_borderPhases[phaseIndex]; + + qreal pos = time - elapsed - begin; + qreal progress = pos / phase.duration; + qreal dx = phase.from + (phase.to - phase.from) * progress; + + QMatrix4x4 matrix; + matrix.translate(dx, 0); + borderNode->setMatrix(matrix); + } + + { + QEasingCurve curve(QEasingCurve::BezierSpline); + curve.addCubicBezierSegment(QPointF(0.4, 0.0), QPointF(0.6, 1.0), QPointF(1.0, 1.0)); + + int phaseIndex, remain = time, elapsed = 0; + for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { + if (remain <= m_ellipsePhases[phaseIndex].duration + begin) + break; + remain -= m_ellipsePhases[phaseIndex].duration; + elapsed += m_ellipsePhases[phaseIndex].duration; + } + + const Phase &phase = m_ellipsePhases[phaseIndex]; + + qreal from = phase.from * width; + qreal to = phase.to * width; + qreal pos = time - elapsed - begin; + qreal progress = curve.valueForProgress(pos / phase.duration); + qreal dx = from + (to - from) * progress; + + QMatrix4x4 matrix; + matrix.translate(dx, 0); + ellipseNode->setMatrix(matrix); + } + } + + borderNode = static_cast(borderNode->nextSibling()); + ++nodeIndex; + } +} + +void QQuickUniversalProgressBarNode::sync(QQuickItem *item) +{ + QQuickUniversalProgressBar *bar = static_cast(item); + if (m_indeterminate != bar->isIndeterminate()) { + m_indeterminate = bar->isIndeterminate(); + if (m_indeterminate) + start(); + else + stop(); + } + + QQuickItemPrivate *d = QQuickItemPrivate::get(item); + + QRectF bounds = item->boundingRect(); + bounds.setHeight(item->implicitHeight()); + bounds.moveTop((item->height() - bounds.height()) / 2.0); + if (!m_indeterminate) + bounds.setWidth(bar->progress() * bounds.width()); + + QSGRectangleNode *geometryNode = static_cast(firstChild()); + if (!geometryNode) { + geometryNode = item->window()->createRectangleNode(); + appendChildNode(geometryNode); + } + geometryNode->setRect(bounds); + geometryNode->setColor(m_indeterminate ? Qt::transparent : bar->color()); + + if (!m_indeterminate) { + while (QSGNode *node = geometryNode->firstChild()) + delete node; + return; + } + + QSGTransformNode *gridNode = static_cast(geometryNode->firstChild()); + if (!gridNode) { + gridNode = new QSGTransformNode; + geometryNode->appendChildNode(gridNode); + } + Q_ASSERT(gridNode->type() == QSGNode::TransformNodeType); + + QSGNode *borderNode = gridNode->firstChild(); + for (int i = 0; i < EllipseCount; ++i) { + if (!borderNode) { + borderNode = new QSGTransformNode; + gridNode->appendChildNode(borderNode); + + QSGTransformNode *ellipseNode = new QSGTransformNode; + borderNode->appendChildNode(ellipseNode); + + QSGOpacityNode *opacityNode = new QSGOpacityNode; + ellipseNode->appendChildNode(opacityNode); + + QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); + rectNode->setAntialiasing(true); + rectNode->setRadius(EllipseDiameter / 2); + opacityNode->appendChildNode(rectNode); + } + Q_ASSERT(borderNode->type() == QSGNode::TransformNodeType); + + QSGNode *ellipseNode = borderNode->firstChild(); + Q_ASSERT(ellipseNode->type() == QSGNode::TransformNodeType); + + QSGNode *opacityNode = ellipseNode->firstChild(); + Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); + + QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); + Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); + + rectNode->setRect(QRectF((EllipseCount - i - 1) * (EllipseDiameter + EllipseOffset), (item->height() - EllipseDiameter) / 2, EllipseDiameter, EllipseDiameter)); + rectNode->setColor(bar->color()); + rectNode->update(); + + borderNode = borderNode->nextSibling(); + } +} + +QQuickUniversalProgressBar::QQuickUniversalProgressBar(QQuickItem *parent) + : QQuickItem(parent) +{ + setFlag(ItemHasContents); +} + +QColor QQuickUniversalProgressBar::color() const +{ + return m_color; +} + +void QQuickUniversalProgressBar::setColor(const QColor &color) +{ + if (m_color == color) + return; + + m_color = color; + update(); +} + +qreal QQuickUniversalProgressBar::progress() const +{ + return m_progress; +} + +void QQuickUniversalProgressBar::setProgress(qreal progress) +{ + if (progress == m_progress) + return; + + m_progress = progress; + update(); +} + +bool QQuickUniversalProgressBar::isIndeterminate() const +{ + return m_indeterminate; +} + +void QQuickUniversalProgressBar::setIndeterminate(bool indeterminate) +{ + if (indeterminate == m_indeterminate) + return; + + m_indeterminate = indeterminate; + setClip(m_indeterminate); + update(); +} + +void QQuickUniversalProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + if (change == ItemVisibleHasChanged) + update(); +} + +QSGNode *QQuickUniversalProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) +{ + QQuickUniversalProgressBarNode *node = static_cast(oldNode); + if (isVisible() && width() > 0 && height() > 0) { + if (!node) + node = new QQuickUniversalProgressBarNode(this); + node->sync(this); + } else { + delete node; + node = nullptr; + } + return node; +} + +QT_END_NAMESPACE diff --git a/src/imports/controls/universal/impl/qquickuniversalprogressbar_p.h b/src/imports/controls/universal/impl/qquickuniversalprogressbar_p.h new file mode 100644 index 00000000..31cb4a32 --- /dev/null +++ b/src/imports/controls/universal/impl/qquickuniversalprogressbar_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKUNIVERSALPROGRESSBAR_P_H +#define QQUICKUNIVERSALPROGRESSBAR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickUniversalProgressBar : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) + Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) + QML_NAMED_ELEMENT(ProgressBarImpl) + QML_ADDED_IN_VERSION(2, 0) + +public: + explicit QQuickUniversalProgressBar(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + + qreal progress() const; + void setProgress(qreal progress); + + bool isIndeterminate() const; + void setIndeterminate(bool indeterminate); + +protected: + void itemChange(ItemChange change, const ItemChangeData &data) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; + +private: + QColor m_color = Qt::black; + qreal m_progress = 0.0; + bool m_indeterminate = false; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickUniversalProgressBar) + +#endif // QQUICKUNIVERSALPROGRESSBAR_P_H diff --git a/src/imports/controls/universal/impl/qtquickcontrols2universalstyleimplplugin.cpp b/src/imports/controls/universal/impl/qtquickcontrols2universalstyleimplplugin.cpp new file mode 100644 index 00000000..bc36be44 --- /dev/null +++ b/src/imports/controls/universal/impl/qtquickcontrols2universalstyleimplplugin.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2UniversalStyleImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2UniversalStyleImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2UniversalStyleImplPlugin::QtQuickControls2UniversalStyleImplPlugin(QObject *parent) + : QQmlEngineExtensionPlugin(parent) +{ +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2universalstyleimplplugin.moc" diff --git a/src/imports/controls/universal/impl/universal-impl.pro b/src/imports/controls/universal/impl/universal-impl.pro new file mode 100644 index 00000000..520f3243 --- /dev/null +++ b/src/imports/controls/universal/impl/universal-impl.pro @@ -0,0 +1,36 @@ +TARGET = qtquickcontrols2universalstyleimplplugin +TARGETPATH = QtQuick/Controls.2/Universal/impl + +QML_IMPORT_NAME = QtQuick.Controls.Universal.impl +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private +QT_FOR_CONFIG = quickcontrols2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +QML_FILES += \ + $$PWD/CheckIndicator.qml \ + $$PWD/RadioIndicator.qml \ + $$PWD/SwitchIndicator.qml + +OTHER_FILES += \ + qmldir \ + $$QML_FILES + +HEADERS += \ + $$PWD/qquickuniversalbusyindicator_p.h \ + $$PWD/qquickuniversalfocusrectangle_p.h \ + $$PWD/qquickuniversalprogressbar_p.h + +SOURCES += \ + $$PWD/qquickuniversalbusyindicator.cpp \ + $$PWD/qquickuniversalfocusrectangle.cpp \ + $$PWD/qquickuniversalprogressbar.cpp \ + $$PWD/qtquickcontrols2universalstyleimplplugin.cpp + +CONFIG += qmltypes install_qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler +load(qml_plugin) + +requires(qtConfig(quickcontrols2-universal)) diff --git a/src/imports/controls/universal/qquickuniversalbusyindicator.cpp b/src/imports/controls/universal/qquickuniversalbusyindicator.cpp deleted file mode 100644 index 70170296..00000000 --- a/src/imports/controls/universal/qquickuniversalbusyindicator.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickuniversalbusyindicator_p.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int PhaseCount = 6; -static const int Interval = 167; -static const int TotalDuration = 4052; - -class QQuickUniversalBusyIndicatorNode : public QQuickAnimatedNode -{ -public: - QQuickUniversalBusyIndicatorNode(QQuickUniversalBusyIndicator *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - struct Phase { - Phase() = default; - Phase(int d, qreal f, qreal t, QEasingCurve::Type c) : duration(d), from(f), to(t), curve(c) { } - int duration = 0; - qreal from = 0; - qreal to = 0; - QEasingCurve curve = QEasingCurve::Linear; - }; - - Phase m_phases[PhaseCount]; -}; - -QQuickUniversalBusyIndicatorNode::QQuickUniversalBusyIndicatorNode(QQuickUniversalBusyIndicator *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); - setCurrentTime(item->elapsed()); - - m_phases[0] = Phase(433, -110, 10, QEasingCurve::BezierSpline); - m_phases[1] = Phase(767, 10, 93, QEasingCurve::Linear ); - m_phases[2] = Phase(417, 93, 205, QEasingCurve::BezierSpline); - m_phases[3] = Phase(400, 205, 357, QEasingCurve::BezierSpline); - m_phases[4] = Phase(766, 357, 439, QEasingCurve::Linear ); - m_phases[5] = Phase(434, 439, 585, QEasingCurve::BezierSpline); - - m_phases[0].curve.addCubicBezierSegment(QPointF(0.02, 0.33), QPointF(0.38, 0.77), QPointF(1.00, 1.00)); - m_phases[2].curve.addCubicBezierSegment(QPointF(0.57, 0.17), QPointF(0.95, 0.75), QPointF(1.00, 1.00)); - m_phases[3].curve.addCubicBezierSegment(QPointF(0.00, 0.19), QPointF(0.07, 0.72), QPointF(1.00, 1.00)); - m_phases[5].curve.addCubicBezierSegment(QPointF(0.00, 0.00), QPointF(0.95, 0.37), QPointF(1.00, 1.00)); -} - -void QQuickUniversalBusyIndicatorNode::updateCurrentTime(int time) -{ - int nodeIndex = 0; - int count = childCount(); - QSGTransformNode *transformNode = static_cast(firstChild()); - while (transformNode) { - Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType); - - QSGOpacityNode *opacityNode = static_cast(transformNode->firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - int begin = nodeIndex * Interval; - int end = TotalDuration - (PhaseCount - nodeIndex - 1) * Interval; - - bool visible = time >= begin && time <= end; - opacityNode->setOpacity(visible ? 1.0 : 0.0); - - if (visible) { - int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { - if (remain <= m_phases[phaseIndex].duration + begin) - break; - remain -= m_phases[phaseIndex].duration; - elapsed += m_phases[phaseIndex].duration; - } - - const Phase &phase = m_phases[phaseIndex]; - - qreal from = phase.from - nodeIndex * count; - qreal to = phase.to - nodeIndex * count; - qreal pos = time - elapsed - begin; - - qreal value = phase.curve.valueForProgress(pos / phase.duration); - qreal rotation = from + (to - from) * value; - - QMatrix4x4 matrix; - matrix.rotate(rotation, 0, 0, 1); - transformNode->setMatrix(matrix); - } - - transformNode = static_cast(transformNode->nextSibling()); - ++nodeIndex; - } -} - -void QQuickUniversalBusyIndicatorNode::sync(QQuickItem *item) -{ - QQuickUniversalBusyIndicator *indicator = static_cast(item); - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - - QMatrix4x4 matrix; - matrix.translate(item->width() / 2, item->height() / 2); - setMatrix(matrix); - - qreal size = qMin(item->width(), item->height()); - qreal diameter = size / 10.0; - qreal radius = diameter / 2; - qreal offset = (size - diameter * 2) / M_PI; - const QRectF rect(offset, offset, diameter, diameter); - - int count = indicator->count(); - QSGNode *transformNode = firstChild(); - for (int i = 0; i < count; ++i) { - if (!transformNode) { - transformNode = new QSGTransformNode; - appendChildNode(transformNode); - - QSGOpacityNode *opacityNode = new QSGOpacityNode; - transformNode->appendChildNode(opacityNode); - - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - opacityNode->appendChildNode(rectNode); - } - - QSGNode *opacityNode = transformNode->firstChild(); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - rectNode->setRect(rect); - rectNode->setColor(indicator->color()); - rectNode->setRadius(radius); - rectNode->update(); - - transformNode = transformNode->nextSibling(); - } - - while (transformNode) { - QSGNode *nextSibling = transformNode->nextSibling(); - delete transformNode; - transformNode = nextSibling; - } -} - -QQuickUniversalBusyIndicator::QQuickUniversalBusyIndicator(QQuickItem *parent) - : QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -int QQuickUniversalBusyIndicator::count() const -{ - return m_count; -} - -void QQuickUniversalBusyIndicator::setCount(int count) -{ - if (m_count == count) - return; - - m_count = count; - update(); -} - -QColor QQuickUniversalBusyIndicator::color() const -{ - return m_color; -} - -void QQuickUniversalBusyIndicator::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - update(); -} - -int QQuickUniversalBusyIndicator::elapsed() const -{ - return m_elapsed; -} - -void QQuickUniversalBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) - update(); -} - -QSGNode *QQuickUniversalBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) -{ - QQuickUniversalBusyIndicatorNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { - if (!node) { - node = new QQuickUniversalBusyIndicatorNode(this); - node->start(); - } - node->sync(this); - } else { - m_elapsed = node ? node->currentTime() : 0; - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversalbusyindicator_p.h b/src/imports/controls/universal/qquickuniversalbusyindicator_p.h deleted file mode 100644 index 119091b5..00000000 --- a/src/imports/controls/universal/qquickuniversalbusyindicator_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKUNIVERSALBUSYINDICATOR_P_H -#define QQUICKUNIVERSALBUSYINDICATOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickUniversalBusyIndicator : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(int count READ count WRITE setCount FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - -public: - explicit QQuickUniversalBusyIndicator(QQuickItem *parent = nullptr); - - int count() const; - void setCount(int count); - - QColor color() const; - void setColor(const QColor &color); - - int elapsed() const; - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - int m_count = 5; - int m_elapsed = 0; - QColor m_color = Qt::black; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickUniversalBusyIndicator) - -#endif // QQUICKUNIVERSALBUSYINDICATOR_P_H diff --git a/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp b/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp deleted file mode 100644 index 51508c6f..00000000 --- a/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickuniversalfocusrectangle_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickUniversalFocusRectangle::QQuickUniversalFocusRectangle(QQuickItem *parent) - : QQuickPaintedItem(parent) -{ - QQuickItemPrivate::get(this)->setTransparentForPositioner(true); -} - -void QQuickUniversalFocusRectangle::paint(QPainter *painter) -{ - if (!isVisible() || width() <= 0 || height() <= 0) - return; - - QRect bounds = boundingRect().toAlignedRect(); - const int boundsWidth = bounds.width(); - const int boundsHeight = bounds.width(); - const QString key = QStringLiteral("qquickuniversalfocusrectangle_%1_%2").arg(QString::number(boundsWidth), QString::number(boundsHeight)); - - QPixmap pixmap(boundsWidth, boundsHeight); - if (!QPixmapCache::find(key, &pixmap)) { - bounds.adjust(0, 0, -1, -1); - pixmap.fill(Qt::transparent); - QPainter p(&pixmap); - - QPen pen; - pen.setWidth(1); - pen.setColor(Qt::white); - p.setPen(pen); - p.drawRect(bounds); - - pen.setColor(Qt::black); - pen.setDashPattern(QList(2, 1)); - p.setPen(pen); - p.drawRect(bounds); - - QPixmapCache::insert(key, pixmap); - } - painter->drawPixmap(0, 0, pixmap); -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversalfocusrectangle_p.h b/src/imports/controls/universal/qquickuniversalfocusrectangle_p.h deleted file mode 100644 index 6bae3b13..00000000 --- a/src/imports/controls/universal/qquickuniversalfocusrectangle_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKUNIVERSALFOCUSRECTANGLE_P_H -#define QQUICKUNIVERSALFOCUSRECTANGLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QQuickUniversalFocusRectangle : public QQuickPaintedItem -{ - Q_OBJECT - -public: - QQuickUniversalFocusRectangle(QQuickItem *parent = nullptr); - - void paint(QPainter *painter) override; -}; - -QT_END_NAMESPACE - -#endif // QQUICKUNIVERSALFOCUSRECTANGLE_P_H diff --git a/src/imports/controls/universal/qquickuniversalprogressbar.cpp b/src/imports/controls/universal/qquickuniversalprogressbar.cpp deleted file mode 100644 index 7d4642c5..00000000 --- a/src/imports/controls/universal/qquickuniversalprogressbar.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickuniversalprogressbar_p.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int PhaseCount = 4; -static const int EllipseCount = 5; -static const int Interval = 167; -static const int TotalDuration = 3917; -static const int VisibleDuration = 3000; -static const qreal EllipseDiameter = 4; -static const qreal EllipseOffset = 4; -static const qreal ContainerAnimationStartPosition = -34; // absolute -static const qreal ContainerAnimationEndPosition = 0.435222; // relative -static const qreal EllipseAnimationWellPosition = 0.333333333333333; // relative -static const qreal EllipseAnimationEndPosition = 0.666666666666667; // relative - -class QQuickUniversalProgressBarNode : public QQuickAnimatedNode -{ -public: - QQuickUniversalProgressBarNode(QQuickUniversalProgressBar *item); - - void updateCurrentTime(int time) override; - void sync(QQuickItem *item) override; - -private: - struct Phase { - Phase() = default; - Phase(int d, qreal f, qreal t) : duration(d), from(f), to(t) { } - int duration = 0; - qreal from = 0; - qreal to = 0; - }; - - bool m_indeterminate = false; - Phase m_borderPhases[PhaseCount]; - Phase m_ellipsePhases[PhaseCount]; -}; - -QQuickUniversalProgressBarNode::QQuickUniversalProgressBarNode(QQuickUniversalProgressBar *item) - : QQuickAnimatedNode(item) -{ - setLoopCount(Infinite); - setDuration(TotalDuration); - - m_borderPhases[0] = Phase( 500, -50, 0); - m_borderPhases[1] = Phase(1500, 0, 0); - m_borderPhases[2] = Phase(1000, 0, 100); - m_borderPhases[3] = Phase( 917, 100, 100); - - m_ellipsePhases[0] = Phase(1000, 0, EllipseAnimationWellPosition); - m_ellipsePhases[1] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationWellPosition); - m_ellipsePhases[2] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationEndPosition); - m_ellipsePhases[3] = Phase(1000, EllipseAnimationWellPosition, EllipseAnimationEndPosition); -} - -void QQuickUniversalProgressBarNode::updateCurrentTime(int time) -{ - QSGRectangleNode *geometryNode = static_cast(firstChild()); - Q_ASSERT(!geometryNode || geometryNode->type() == QSGNode::GeometryNodeType); - if (!geometryNode) - return; - - QSGTransformNode *gridNode = static_cast(geometryNode->firstChild()); - Q_ASSERT(!gridNode || gridNode->type() == QSGNode::TransformNodeType); - if (!gridNode) - return; - - qreal width = geometryNode->rect().width(); - { - qreal from = ContainerAnimationStartPosition; - qreal to = from + ContainerAnimationEndPosition * width; - qreal progress = static_cast(time) / TotalDuration; - qreal dx = from + (to - from) * progress; - - QMatrix4x4 matrix; - matrix.translate(dx, 0); - gridNode->setMatrix(matrix); - } - - int nodeIndex = 0; - QSGTransformNode *borderNode = static_cast(gridNode->firstChild()); - while (borderNode) { - Q_ASSERT(borderNode->type() == QSGNode::TransformNodeType); - - QSGTransformNode *ellipseNode = static_cast(borderNode->firstChild()); - Q_ASSERT(ellipseNode->type() == QSGNode::TransformNodeType); - - QSGOpacityNode *opacityNode = static_cast(ellipseNode->firstChild()); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - int begin = nodeIndex * Interval; - int end = VisibleDuration + nodeIndex * Interval; - - bool visible = time >= begin && time <= end; - opacityNode->setOpacity(visible ? 1.0 : 0.0); - - if (visible) { - { - int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { - if (remain <= m_borderPhases[phaseIndex].duration + begin) - break; - remain -= m_borderPhases[phaseIndex].duration; - elapsed += m_borderPhases[phaseIndex].duration; - } - - const Phase &phase = m_borderPhases[phaseIndex]; - - qreal pos = time - elapsed - begin; - qreal progress = pos / phase.duration; - qreal dx = phase.from + (phase.to - phase.from) * progress; - - QMatrix4x4 matrix; - matrix.translate(dx, 0); - borderNode->setMatrix(matrix); - } - - { - QEasingCurve curve(QEasingCurve::BezierSpline); - curve.addCubicBezierSegment(QPointF(0.4, 0.0), QPointF(0.6, 1.0), QPointF(1.0, 1.0)); - - int phaseIndex, remain = time, elapsed = 0; - for (phaseIndex = 0; phaseIndex < PhaseCount - 1; ++phaseIndex) { - if (remain <= m_ellipsePhases[phaseIndex].duration + begin) - break; - remain -= m_ellipsePhases[phaseIndex].duration; - elapsed += m_ellipsePhases[phaseIndex].duration; - } - - const Phase &phase = m_ellipsePhases[phaseIndex]; - - qreal from = phase.from * width; - qreal to = phase.to * width; - qreal pos = time - elapsed - begin; - qreal progress = curve.valueForProgress(pos / phase.duration); - qreal dx = from + (to - from) * progress; - - QMatrix4x4 matrix; - matrix.translate(dx, 0); - ellipseNode->setMatrix(matrix); - } - } - - borderNode = static_cast(borderNode->nextSibling()); - ++nodeIndex; - } -} - -void QQuickUniversalProgressBarNode::sync(QQuickItem *item) -{ - QQuickUniversalProgressBar *bar = static_cast(item); - if (m_indeterminate != bar->isIndeterminate()) { - m_indeterminate = bar->isIndeterminate(); - if (m_indeterminate) - start(); - else - stop(); - } - - QQuickItemPrivate *d = QQuickItemPrivate::get(item); - - QRectF bounds = item->boundingRect(); - bounds.setHeight(item->implicitHeight()); - bounds.moveTop((item->height() - bounds.height()) / 2.0); - if (!m_indeterminate) - bounds.setWidth(bar->progress() * bounds.width()); - - QSGRectangleNode *geometryNode = static_cast(firstChild()); - if (!geometryNode) { - geometryNode = item->window()->createRectangleNode(); - appendChildNode(geometryNode); - } - geometryNode->setRect(bounds); - geometryNode->setColor(m_indeterminate ? Qt::transparent : bar->color()); - - if (!m_indeterminate) { - while (QSGNode *node = geometryNode->firstChild()) - delete node; - return; - } - - QSGTransformNode *gridNode = static_cast(geometryNode->firstChild()); - if (!gridNode) { - gridNode = new QSGTransformNode; - geometryNode->appendChildNode(gridNode); - } - Q_ASSERT(gridNode->type() == QSGNode::TransformNodeType); - - QSGNode *borderNode = gridNode->firstChild(); - for (int i = 0; i < EllipseCount; ++i) { - if (!borderNode) { - borderNode = new QSGTransformNode; - gridNode->appendChildNode(borderNode); - - QSGTransformNode *ellipseNode = new QSGTransformNode; - borderNode->appendChildNode(ellipseNode); - - QSGOpacityNode *opacityNode = new QSGOpacityNode; - ellipseNode->appendChildNode(opacityNode); - - QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode(); - rectNode->setAntialiasing(true); - rectNode->setRadius(EllipseDiameter / 2); - opacityNode->appendChildNode(rectNode); - } - Q_ASSERT(borderNode->type() == QSGNode::TransformNodeType); - - QSGNode *ellipseNode = borderNode->firstChild(); - Q_ASSERT(ellipseNode->type() == QSGNode::TransformNodeType); - - QSGNode *opacityNode = ellipseNode->firstChild(); - Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType); - - QSGInternalRectangleNode *rectNode = static_cast(opacityNode->firstChild()); - Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - - rectNode->setRect(QRectF((EllipseCount - i - 1) * (EllipseDiameter + EllipseOffset), (item->height() - EllipseDiameter) / 2, EllipseDiameter, EllipseDiameter)); - rectNode->setColor(bar->color()); - rectNode->update(); - - borderNode = borderNode->nextSibling(); - } -} - -QQuickUniversalProgressBar::QQuickUniversalProgressBar(QQuickItem *parent) - : QQuickItem(parent) -{ - setFlag(ItemHasContents); -} - -QColor QQuickUniversalProgressBar::color() const -{ - return m_color; -} - -void QQuickUniversalProgressBar::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - update(); -} - -qreal QQuickUniversalProgressBar::progress() const -{ - return m_progress; -} - -void QQuickUniversalProgressBar::setProgress(qreal progress) -{ - if (progress == m_progress) - return; - - m_progress = progress; - update(); -} - -bool QQuickUniversalProgressBar::isIndeterminate() const -{ - return m_indeterminate; -} - -void QQuickUniversalProgressBar::setIndeterminate(bool indeterminate) -{ - if (indeterminate == m_indeterminate) - return; - - m_indeterminate = indeterminate; - setClip(m_indeterminate); - update(); -} - -void QQuickUniversalProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) - update(); -} - -QSGNode *QQuickUniversalProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) -{ - QQuickUniversalProgressBarNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { - if (!node) - node = new QQuickUniversalProgressBarNode(this); - node->sync(this); - } else { - delete node; - node = nullptr; - } - return node; -} - -QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversalprogressbar_p.h b/src/imports/controls/universal/qquickuniversalprogressbar_p.h deleted file mode 100644 index 449f7965..00000000 --- a/src/imports/controls/universal/qquickuniversalprogressbar_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKUNIVERSALPROGRESSBAR_P_H -#define QQUICKUNIVERSALPROGRESSBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickUniversalProgressBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(qreal progress READ progress WRITE setProgress FINAL) - Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL) - -public: - explicit QQuickUniversalProgressBar(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - qreal progress() const; - void setProgress(qreal progress); - - bool isIndeterminate() const; - void setIndeterminate(bool indeterminate); - -protected: - void itemChange(ItemChange change, const ItemChangeData &data) override; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; - -private: - QColor m_color = Qt::black; - qreal m_progress = 0.0; - bool m_indeterminate = false; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickUniversalProgressBar) - -#endif // QQUICKUNIVERSALPROGRESSBAR_P_H diff --git a/src/imports/controls/universal/qquickuniversalstyle_p.h b/src/imports/controls/universal/qquickuniversalstyle_p.h index 429621d7..50b07071 100644 --- a/src/imports/controls/universal/qquickuniversalstyle_p.h +++ b/src/imports/controls/universal/qquickuniversalstyle_p.h @@ -49,7 +49,7 @@ // #include -#include +#include QT_BEGIN_NAMESPACE @@ -88,6 +88,11 @@ class QQuickUniversalStyle : public QQuickAttachedObject Q_PROPERTY(QColor listLowColor READ listLowColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor listMediumColor READ listMediumColor NOTIFY paletteChanged FINAL) + QML_NAMED_ELEMENT(Universal) + QML_ATTACHED(QQuickUniversalStyle) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 0) + public: explicit QQuickUniversalStyle(QObject *parent = nullptr); diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index 08cd5001..bc0e6bb8 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -36,15 +36,12 @@ #include -#include "qquickuniversalbusyindicator_p.h" -#include "qquickuniversalfocusrectangle_p.h" -#include "qquickuniversalprogressbar_p.h" #include "qquickuniversalstyle_p.h" #include "qquickuniversaltheme_p.h" QT_BEGIN_NAMESPACE -class QtQuickControls2UniversalStylePlugin: public QQuickStylePlugin +class QtQuickControls2UniversalStylePlugin : public QQuickStylePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) @@ -65,16 +62,9 @@ QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObje void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri) { - qmlRegisterModule(uri, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterUncreatableType(uri, 2, 0, "Universal", tr("Universal is an attached property")); - QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - qmlRegisterType(import, 2, 0, "FocusRectangle"); - qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); - qmlRegisterType(import, 2, 0, "ProgressBarImpl"); - qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.qrc b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.qrc index cd9ea61f..bfcb0974 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.qrc +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.qrc @@ -1,5 +1,5 @@ - + images/checkmark.png images/checkmark@2x.png images/checkmark@3x.png diff --git a/src/imports/controls/universal/universal.pri b/src/imports/controls/universal/universal.pri index 8f1b905c..983fcf10 100644 --- a/src/imports/controls/universal/universal.pri +++ b/src/imports/controls/universal/universal.pri @@ -1,10 +1,17 @@ +HEADERS += \ + $$PWD/qquickuniversalstyle_p.h \ + $$PWD/qquickuniversaltheme_p.h + +SOURCES += \ + $$PWD/qquickuniversalstyle.cpp \ + $$PWD/qquickuniversaltheme.cpp + QML_FILES += \ $$PWD/ApplicationWindow.qml \ $$PWD/BusyIndicator.qml \ $$PWD/Button.qml \ $$PWD/CheckBox.qml \ $$PWD/CheckDelegate.qml \ - $$PWD/CheckIndicator.qml \ $$PWD/ComboBox.qml \ $$PWD/DelayButton.qml \ $$PWD/Dial.qml \ @@ -28,7 +35,6 @@ QML_FILES += \ $$PWD/ProgressBar.qml \ $$PWD/RadioButton.qml \ $$PWD/RadioDelegate.qml \ - $$PWD/RadioIndicator.qml \ $$PWD/RangeSlider.qml \ $$PWD/RoundButton.qml \ $$PWD/ScrollBar.qml \ @@ -39,7 +45,6 @@ QML_FILES += \ $$PWD/StackView.qml \ $$PWD/SwipeDelegate.qml \ $$PWD/SwitchDelegate.qml \ - $$PWD/SwitchIndicator.qml \ $$PWD/Switch.qml \ $$PWD/TabBar.qml \ $$PWD/TabButton.qml \ @@ -51,17 +56,3 @@ QML_FILES += \ $$PWD/ToolTip.qml \ $$PWD/Tumbler.qml \ $$PWD/VerticalHeaderView.qml - -HEADERS += \ - $$PWD/qquickuniversalbusyindicator_p.h \ - $$PWD/qquickuniversalfocusrectangle_p.h \ - $$PWD/qquickuniversalprogressbar_p.h \ - $$PWD/qquickuniversalstyle_p.h \ - $$PWD/qquickuniversaltheme_p.h - -SOURCES += \ - $$PWD/qquickuniversalbusyindicator.cpp \ - $$PWD/qquickuniversalfocusrectangle.cpp \ - $$PWD/qquickuniversalprogressbar.cpp \ - $$PWD/qquickuniversalstyle.cpp \ - $$PWD/qquickuniversaltheme.cpp diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index 99bad4da..9065936c 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -5,7 +5,7 @@ IMPORT_NAME = QtQuick.Controls.Universal IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/src/imports/controlsimpl/controlsimpl.pro b/src/imports/controlsimpl/controlsimpl.pro new file mode 100644 index 00000000..70f3e170 --- /dev/null +++ b/src/imports/controlsimpl/controlsimpl.pro @@ -0,0 +1,17 @@ +TARGET = qtquickcontrols2implplugin +TARGETPATH = QtQuick/Controls.2/impl +IMPORT_VERSION = 2.$$QT_MINOR_VERSION + +QT += qml quick +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +OTHER_FILES += \ + qmldir + +SOURCES += \ + $$PWD/qtquickcontrols2implplugin.cpp + +CONFIG += no_cxx_module +load(qml_plugin) diff --git a/src/imports/controlsimpl/qmldir b/src/imports/controlsimpl/qmldir new file mode 100644 index 00000000..e7097d82 --- /dev/null +++ b/src/imports/controlsimpl/qmldir @@ -0,0 +1,4 @@ +module QtQuick.Controls.impl +plugin qtquickcontrols2implplugin +classname QtQuickControls2ImplPlugin +depends QtQuick.Templates 2.5 diff --git a/src/imports/controlsimpl/qtquickcontrols2implplugin.cpp b/src/imports/controlsimpl/qtquickcontrols2implplugin.cpp new file mode 100644 index 00000000..d5f29f5c --- /dev/null +++ b/src/imports/controlsimpl/qtquickcontrols2implplugin.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +QT_BEGIN_NAMESPACE + +class QtQuickControls2ImplPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtQuickControls2ImplPlugin(QObject *parent = nullptr); +}; + +QtQuickControls2ImplPlugin::QtQuickControls2ImplPlugin(QObject *parent) : QQmlEngineExtensionPlugin(parent) +{ + volatile auto registration = &qml_register_types_QtQuick_Controls_impl; + Q_UNUSED(registration) +} + +QT_END_NAMESPACE + +#include "qtquickcontrols2implplugin.moc" diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 387418de..b461f162 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,12 +1,18 @@ TEMPLATE = subdirs SUBDIRS += \ controls \ + controlsimpl \ platform \ templates SUBDIRS += \ controls/default/default.pro \ + controls/default/impl/default-impl.pro \ controls/fusion/fusion.pro \ + controls/fusion/impl/fusion-impl.pro \ controls/imagine/imagine.pro \ + controls/imagine/impl/imagine-impl.pro \ controls/material/material.pro \ - controls/universal/universal.pro + controls/material/impl/material-impl.pro \ + controls/universal/universal.pro \ + controls/universal/impl/universal-impl.pro diff --git a/src/imports/platform/qquickplatformmenu_p.h b/src/imports/platform/qquickplatformmenu_p.h index 089e1f89..b573b0d4 100644 --- a/src/imports/platform/qquickplatformmenu_p.h +++ b/src/imports/platform/qquickplatformmenu_p.h @@ -86,7 +86,7 @@ class QQuickPlatformMenu : public QObject, public QQmlParserStatus Q_PROPERTY(QPlatformMenu::MenuType type READ type WRITE setType NOTIFY typeChanged FINAL) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) - Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1) + Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1)) Q_ENUMS(QPlatformMenu::MenuType) Q_CLASSINFO("DefaultProperty", "data") @@ -162,7 +162,7 @@ Q_SIGNALS: void minimumWidthChanged(); void fontChanged(); void typeChanged(); - Q_REVISION(1) void iconChanged(); + Q_REVISION(2, 1) void iconChanged(); protected: void classBegin() override; diff --git a/src/imports/platform/qquickplatformmenuitem_p.h b/src/imports/platform/qquickplatformmenuitem_p.h index c1e6cc30..01b7482d 100644 --- a/src/imports/platform/qquickplatformmenuitem_p.h +++ b/src/imports/platform/qquickplatformmenuitem_p.h @@ -80,7 +80,7 @@ class QQuickPlatformMenuItem : public QObject, public QQmlParserStatus Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) - Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1) + Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1)) Q_ENUMS(QPlatformMenuItem::MenuRole) public: @@ -149,7 +149,7 @@ Q_SIGNALS: void textChanged(); void shortcutChanged(); void fontChanged(); - Q_REVISION(1) void iconChanged(); + Q_REVISION(2, 1) void iconChanged(); protected: void classBegin() override; diff --git a/src/imports/platform/qquickplatformsystemtrayicon_p.h b/src/imports/platform/qquickplatformsystemtrayicon_p.h index 0216aee3..d7cc46c0 100644 --- a/src/imports/platform/qquickplatformsystemtrayicon_p.h +++ b/src/imports/platform/qquickplatformsystemtrayicon_p.h @@ -72,8 +72,8 @@ class QQuickPlatformSystemTrayIcon : public QObject, public QQmlParserStatus Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged FINAL) Q_PROPERTY(QQuickPlatformMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL) - Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged FINAL REVISION 1) - Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1) + Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged FINAL REVISION(1, 1)) + Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1)) Q_ENUMS(QPlatformSystemTrayIcon::ActivationReason QPlatformSystemTrayIcon::MessageIcon) public: @@ -112,8 +112,8 @@ Q_SIGNALS: void visibleChanged(); void tooltipChanged(); void menuChanged(); - Q_REVISION(1) void geometryChanged(); - Q_REVISION(1) void iconChanged(); + Q_REVISION(2, 1) void geometryChanged(); + Q_REVISION(2, 1) void iconChanged(); protected: void init(); diff --git a/src/imports/templates/CMakeLists.txt b/src/imports/templates/CMakeLists.txt index 4e6a80c4..a1d95e94 100644 --- a/src/imports/templates/CMakeLists.txt +++ b/src/imports/templates/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_qml_module(qtquicktemplates2plugin - TARGET_PATH "QtQuick/Templates.2" + TARGET_PATH "QtQuick/Templates" URI "QtQuick.Templates" VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" CLASSNAME QtQuickTemplates2Plugin @@ -33,4 +33,4 @@ qt_add_qml_module(qtquicktemplates2plugin #### Keys ignored in scope 1:.:.:templates.pro:: # IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" -# TARGETPATH = "QtQuick/Templates.2" +# TARGETPATH = "QtQuick/Templates" diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp index 28ce0bf0..e2a15213 100644 --- a/src/imports/templates/qtquicktemplates2plugin.cpp +++ b/src/imports/templates/qtquicktemplates2plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. @@ -37,73 +37,9 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#if QT_CONFIG(shortcut) #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) -#include -#endif - -#include -#if QT_CONFIG(shortcut) // qtdeclarative/src/quick/util/qquickshortcut.cpp typedef bool (*ShortcutContextMatcher)(QObject *, Qt::ShortcutContext); extern ShortcutContextMatcher qt_quick_shortcut_context_matcher(); @@ -112,7 +48,7 @@ extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher QT_BEGIN_NAMESPACE -class QtQuickTemplates2Plugin: public QQmlExtensionPlugin +class QtQuickTemplates2Plugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) @@ -134,6 +70,8 @@ private: QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensionPlugin(parent), registered(false) { + volatile auto registration = &qml_register_types_QtQuick_Templates; + Q_UNUSED(registration) } QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin() @@ -142,7 +80,7 @@ QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin() // initialization and cleanup, as plugins are not unloaded on macOS. } -void QtQuickTemplates2Plugin::registerTypes(const char *uri) +void QtQuickTemplates2Plugin::registerTypes(const char */*uri*/) { #if QT_CONFIG(shortcut) originalContextMatcher = qt_quick_shortcut_context_matcher(); @@ -150,212 +88,6 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) #endif registered = true; - - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 2, 15); - - // QtQuick.Templates 2.0 (originally introduced in Qt 5.7) - qmlRegisterType(uri, 2, 0, "AbstractButton"); - qmlRegisterType(uri, 2, 0, "ApplicationWindow"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "BusyIndicator"); - qmlRegisterType(uri, 2, 0, "Button"); - qmlRegisterType(uri, 2, 0, "ButtonGroup"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "CheckBox"); - qmlRegisterType(uri, 2, 0, "CheckDelegate"); - qmlRegisterType(uri, 2, 0, "ComboBox"); - qmlRegisterType(uri, 2, 0, "Container"); - qmlRegisterType(uri, 2, 0, "Control"); - qmlRegisterType(uri, 2, 0, "Dial"); - qmlRegisterType(uri, 2, 0, "Drawer"); - qmlRegisterType(uri, 2, 0, "Frame"); - qmlRegisterType(uri, 2, 0, "GroupBox"); - qmlRegisterType(uri, 2, 0, "ItemDelegate"); - qmlRegisterType(uri, 2, 0, "Label"); - qmlRegisterType(uri, 2, 0, "Menu"); - qmlRegisterType(uri, 2, 0, "MenuItem"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "Page"); - qmlRegisterType(uri, 2, 0, "PageIndicator"); - qmlRegisterType(uri, 2, 0, "Pane"); - qmlRegisterType(uri, 2, 0, "Popup"); - qmlRegisterType(uri, 2, 0, "ProgressBar"); - qmlRegisterType(uri, 2, 0, "RadioButton"); - qmlRegisterType(uri, 2, 0, "RadioDelegate"); - qmlRegisterType(uri, 2, 0, "RangeSlider"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "ScrollBar"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "ScrollIndicator"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "Slider"); - qmlRegisterType(uri, 2, 0, "SpinBox"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "StackView"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "SwipeDelegate"); - qmlRegisterType(uri, 2, 0, "SwipeView"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "Switch"); - qmlRegisterType(uri, 2, 0, "SwitchDelegate"); - qmlRegisterType(uri, 2, 0, "TabBar"); - qmlRegisterType(uri, 2, 0, "TabButton"); - qmlRegisterType(uri, 2, 0, "TextArea"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "TextField"); - qmlRegisterType(uri, 2, 0, "ToolBar"); - qmlRegisterType(uri, 2, 0, "ToolButton"); - qmlRegisterType(uri, 2, 0, "ToolTip"); - qmlRegisterAnonymousType(uri, 2); -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 0, "Tumbler"); -#endif - - // NOTE: register the latest revisions of all template/control base classes to - // make revisioned properties available to their subclasses (synced with Qt 5.7) - qmlRegisterRevision(uri, 2, 0); - qmlRegisterRevision(uri, 2, 0); - qmlRegisterRevision(uri, 2, 0); - qmlRegisterRevision(uri, 2, 0); - qmlRegisterRevision(uri, 2, 0); - qmlRegisterRevision(uri, 2, 0); - - // QtQuick.Templates 2.1 (new types and revisions in Qt 5.8) - qmlRegisterType(uri, 2, 1, "ButtonGroup"); - qmlRegisterType(uri, 2, 1, "ComboBox"); - qmlRegisterType(uri, 2, 1, "Container"); - qmlRegisterType(uri, 2, 1, "Dialog"); - qmlRegisterType(uri, 2, 1, "DialogButtonBox"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 1, "MenuSeparator"); - qmlRegisterType(uri, 2, 1, "Page"); - qmlRegisterType(uri, 2, 1, "Popup"); - qmlRegisterType(uri, 2, 1, "RangeSlider"); - qmlRegisterType(uri, 2, 1, "RoundButton"); - qmlRegisterType(uri, 2, 1, "Slider"); - qmlRegisterType(uri, 2, 1, "SpinBox"); - qmlRegisterType(uri, 2, 1, "StackView"); - qmlRegisterType(uri, 2, 1, "SwipeDelegate"); - qmlRegisterType(uri, 2, 1, "SwipeView"); - qmlRegisterType(uri, 2, 1, "TextArea"); - qmlRegisterType(uri, 2, 1, "TextField"); - qmlRegisterType(uri, 2, 1, "ToolSeparator"); -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(uri, 2, 1, "Tumbler"); -#endif - - // QtQuick.Templates 2.2 (new types and revisions in Qt 5.9) - qmlRegisterType(uri, 2, 2, "AbstractButton"); - qmlRegisterType(uri, 2, 2, "ComboBox"); - qmlRegisterType(uri, 2, 2, "DelayButton"); - qmlRegisterType(uri, 2, 2, "Dial"); - qmlRegisterType(uri, 2, 2, "Drawer"); - qmlRegisterType(uri, 2, 2, "RangeSlider"); - qmlRegisterType(uri, 2, 2, "ScrollBar"); - qmlRegisterType(uri, 2, 2, "ScrollView"); - qmlRegisterType(uri, 2, 2, "Slider"); - qmlRegisterType(uri, 2, 2, "SpinBox"); - qmlRegisterType(uri, 2, 2, "SwipeDelegate"); - qmlRegisterType(uri, 2, 2, "SwipeView"); - qmlRegisterType(uri, 2, 2, "TabBar"); -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(uri, 2, 2, "Tumbler"); -#endif - - // NOTE: register the latest revisions of all template/control base classes to - // make revisioned properties available to their subclasses (synced with Qt 5.9) - qmlRegisterRevision(uri, 2, 2); - qmlRegisterRevision(uri, 2, 2); - qmlRegisterRevision(uri, 2, 2); - qmlRegisterRevision(uri, 2, 3); - qmlRegisterRevision(uri, 2, 3); - qmlRegisterRevision(uri, 2, 3); - - // QtQuick.Templates 2.3 (new types and revisions in Qt 5.10) - qmlRegisterType(uri, 2, 3, "AbstractButton"); - qmlRegisterType(uri, 2, 3, "Action"); - qmlRegisterType(uri, 2, 3, "ActionGroup"); - qmlRegisterType(uri, 2, 3, "ApplicationWindow"); - qmlRegisterType(uri, 2, 3, "ButtonGroup"); - qmlRegisterType(uri, 2, 3, "Control"); - qmlRegisterType(uri, 2, 3, "Container"); - qmlRegisterType(uri, 2, 3, "Dialog"); - qmlRegisterType(uri, 2, 3, "DialogButtonBox"); - qmlRegisterAnonymousType(uri, 2); - qRegisterMetaType(); - qmlRegisterType(uri, 2, 3, "Label"); - qmlRegisterType(uri, 2, 3, "Menu"); - qmlRegisterType(uri, 2, 3, "MenuBar"); - qmlRegisterType(uri, 2, 3, "MenuBarItem"); - qmlRegisterType(uri, 2, 3, "MenuItem"); - qmlRegisterUncreatableType(uri, 2, 3, "Overlay", QStringLiteral("Overlay is only available as an attached property.")); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 3, "Popup"); - qmlRegisterType(uri, 2, 3, "RangeSlider"); - qmlRegisterType(uri, 2, 3, "ScrollBar"); - qmlRegisterType(uri, 2, 3, "ScrollIndicator"); - qmlRegisterType(uri, 2, 3, "Slider"); - qmlRegisterType(uri, 2, 3, "SpinBox"); - qmlRegisterType(uri, 2, 3, "TextArea"); - qmlRegisterType(uri, 2, 3, "TextField"); - - // NOTE: register the latest revisions of all template/control base classes to - // make revisioned properties available to their subclasses (synced with Qt 5.10) - qmlRegisterRevision(uri, 2, 3); - qmlRegisterRevision(uri, 2, 3); - // For backward compatibility - qmlRegisterType(uri, 2, 13, "ColorGroup"); - qmlRegisterType(uri, 2, 13, "Palette"); - - // QtQuick.Templates 2.4 (new types and revisions in Qt 5.11) - qmlRegisterType(uri, 2, 4, "AbstractButton"); - qmlRegisterType(uri, 2, 4, "ButtonGroup"); - qmlRegisterType(uri, 2, 4, "CheckBox"); - qmlRegisterType(uri, 2, 4, "CheckDelegate"); - qmlRegisterType(uri, 2, 4, "ScrollBar"); - qmlRegisterType(uri, 2, 4, "ScrollIndicator"); - qmlRegisterType(uri, 2, 4, "SpinBox"); - - // QtQuick.Templates 2.5 (new types and revisions in Qt 5.12) - qmlRegisterType(uri, 2, 5, "AbstractButton"); - qmlRegisterType(uri, 2, 5, "DialogButtonBox"); - qmlRegisterType(uri, 2, 5, "ComboBox"); - qmlRegisterType(uri, 2, 5, "Control"); - qmlRegisterType(uri, 2, 5, "Container"); - qmlRegisterType(uri, 2, 5, "Dial"); - qmlRegisterType(uri, 2, 5, "Dialog"); - qmlRegisterType(uri, 2, 5, "GroupBox"); - qmlRegisterType(uri, 2, 5, "Label"); - qmlRegisterType(uri, 2, 5, "Page"); - qmlRegisterType(uri, 2, 5, "Popup"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterType(uri, 2, 5, "RangeSlider"); - qmlRegisterType(uri, 2, 5, "Slider"); - qmlRegisterType(uri, 2, 5, "SpinBox"); - qmlRegisterType(uri, 2, 5, "TextArea"); - qmlRegisterType(uri, 2, 5, "TextField"); - qmlRegisterType(uri, 2, 5, "ToolTip"); - - // QtQuick.Templates 2.13 (new types and revisions in Qt 5.13) - qmlRegisterType(uri, 2, 13, "SplitView"); - qmlRegisterAnonymousType(uri, 2); - qmlRegisterUncreatableType(uri, 2, 13, "SplitHandle", - QStringLiteral("SplitHandle is only available as an attached property.")); - qmlRegisterAnonymousType(uri, 2); - - // QtQuick.Templates 2.14 (new types and revisions in Qt 5.14) - qmlRegisterType(uri, 2, 14, "ComboBox"); - - // QtQuick.Templates 2.15 (new types and revisions in Qt 5.15) - qmlRegisterType(uri, 2, 15, "ComboBox"); - // Register QQuickTableView here to expose headerView's base, with a irregular type name to 'hide' it. - qmlRegisterType(uri, 2, 15, "__TableView__"); - qmlRegisterType(uri, 2, 15, "HorizontalHeaderView"); - qmlRegisterType(uri, 2, 15, "VerticalHeaderView"); } void QtQuickTemplates2Plugin::unregisterTypes() diff --git a/src/imports/templates/templates.pro b/src/imports/templates/templates.pro index 3447ef90..72e32c47 100644 --- a/src/imports/templates/templates.pro +++ b/src/imports/templates/templates.pro @@ -1,6 +1,6 @@ TARGET = qtquicktemplates2plugin -TARGETPATH = QtQuick/Templates.2 -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +TARGETPATH = QtQuick/Templates +IMPORT_VERSION = 2.15 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private diff --git a/src/quickcontrols2/qquickanimatednode.cpp b/src/quickcontrols2/qquickanimatednode.cpp deleted file mode 100644 index b4e665de..00000000 --- a/src/quickcontrols2/qquickanimatednode.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickanimatednode_p.h" - -#include -#include - -// based on qtdeclarative/examples/quick/scenegraph/threadedanimation - -QT_BEGIN_NAMESPACE - -QQuickAnimatedNode::QQuickAnimatedNode(QQuickItem *target) - : m_window(target->window()) -{ -} - -bool QQuickAnimatedNode::isRunning() const -{ - return m_running; -} - -int QQuickAnimatedNode::currentTime() const -{ - int time = m_currentTime; - if (m_running) - time += m_timer.elapsed(); - return time; -} - -void QQuickAnimatedNode::setCurrentTime(int time) -{ - m_currentTime = time; - m_timer.restart(); -} - -int QQuickAnimatedNode::duration() const -{ - return m_duration; -} - -void QQuickAnimatedNode::setDuration(int duration) -{ - m_duration = duration; -} - -int QQuickAnimatedNode::loopCount() const -{ - return m_loopCount; -} - -void QQuickAnimatedNode::setLoopCount(int count) -{ - m_loopCount = count; -} - -void QQuickAnimatedNode::sync(QQuickItem *target) -{ - Q_UNUSED(target); -} - -QQuickWindow *QQuickAnimatedNode::window() const -{ - return m_window; -} - -void QQuickAnimatedNode::start(int duration) -{ - if (m_running) - return; - - m_running = true; - m_currentLoop = 0; - m_timer.restart(); - if (duration > 0) - m_duration = duration; - - connect(m_window, &QQuickWindow::beforeRendering, this, &QQuickAnimatedNode::advance, Qt::DirectConnection); - connect(m_window, &QQuickWindow::frameSwapped, this, &QQuickAnimatedNode::update, Qt::DirectConnection); - - // If we're inside a QQuickWidget, this call is necessary to ensure the widget - // gets updated for the first time. - m_window->update(); - - emit started(); -} - -void QQuickAnimatedNode::restart() -{ - stop(); - start(); -} - -void QQuickAnimatedNode::stop() -{ - if (!m_running) - return; - - m_running = false; - disconnect(m_window, &QQuickWindow::beforeRendering, this, &QQuickAnimatedNode::advance); - disconnect(m_window, &QQuickWindow::frameSwapped, this, &QQuickAnimatedNode::update); - emit stopped(); -} - -void QQuickAnimatedNode::updateCurrentTime(int time) -{ - Q_UNUSED(time); -} - -void QQuickAnimatedNode::advance() -{ - int time = currentTime(); - if (time > m_duration) { - time = 0; - setCurrentTime(0); - - if (m_loopCount > 0 && ++m_currentLoop >= m_loopCount) { - time = m_duration; // complete - stop(); - } - } - updateCurrentTime(time); - - // If we're inside a QQuickWidget, this call is necessary to ensure the widget gets updated. - m_window->update(); -} - -void QQuickAnimatedNode::update() -{ - if (m_running) - m_window->update(); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickanimatednode_p.h b/src/quickcontrols2/qquickanimatednode_p.h deleted file mode 100644 index d42d9319..00000000 --- a/src/quickcontrols2/qquickanimatednode_p.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKANIMATEDNODE_P_H -#define QQUICKANIMATEDNODE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickItem; -class QQuickWindow; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickAnimatedNode : public QObject, public QSGTransformNode -{ - Q_OBJECT - -public: - explicit QQuickAnimatedNode(QQuickItem *target); - - bool isRunning() const; - - int currentTime() const; - void setCurrentTime(int time); - - int duration() const; - void setDuration(int duration); - - enum LoopCount { Infinite = -1 }; - - int loopCount() const; - void setLoopCount(int count); - - virtual void sync(QQuickItem *target); - - QQuickWindow *window() const; - - // must be called from sync() or updatePaintNode() - void start(int duration = 0); - void restart(); - void stop(); - -Q_SIGNALS: - void started(); - void stopped(); - -protected: - virtual void updateCurrentTime(int time); - -private Q_SLOTS: - void advance(); - void update(); - -private: - bool m_running = false; - int m_duration = 0; - int m_loopCount = 1; - int m_currentTime = 0; - int m_currentLoop = 0; - QElapsedTimer m_timer; - QQuickWindow *m_window = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QQUICKANIMATEDNODE_P_H diff --git a/src/quickcontrols2/qquickattachedobject.cpp b/src/quickcontrols2/qquickattachedobject.cpp deleted file mode 100644 index 722f22f9..00000000 --- a/src/quickcontrols2/qquickattachedobject.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickattachedobject_p.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static QQuickAttachedObject *attachedObject(const QMetaObject *type, QObject *object, bool create = false) -{ - if (!object) - return nullptr; - auto func = qmlAttachedPropertiesFunction(object, type); - return qobject_cast(qmlAttachedPropertiesObject(object, func, create)); -} - -static QQuickAttachedObject *findAttachedParent(const QMetaObject *type, QObject *object) -{ - QQuickItem *item = qobject_cast(object); - if (item) { - // lookup parent items and popups - QQuickItem *parent = item->parentItem(); - while (parent) { - QQuickAttachedObject *attached = attachedObject(type, parent); - if (attached) - return attached; - - QQuickPopup *popup = qobject_cast(parent->parent()); - if (popup) - return attachedObject(type, popup); - - parent = parent->parentItem(); - } - - // fallback to item's window - QQuickAttachedObject *attached = attachedObject(type, item->window()); - if (attached) - return attached; - } else { - // lookup popup's window - QQuickPopup *popup = qobject_cast(object); - if (popup) - return attachedObject(type, popup->popupItem()->window()); - } - - // lookup parent window - QQuickWindow *window = qobject_cast(object); - if (window) { - QQuickWindow *parentWindow = qobject_cast(window->parent()); - if (parentWindow) { - QQuickAttachedObject *attached = attachedObject(type, window); - if (attached) - return attached; - } - } - - // fallback to engine (global) - if (object) { - QQmlEngine *engine = qmlEngine(object); - if (engine) { - QByteArray name = QByteArray("_q_") + type->className(); - QQuickAttachedObject *attached = engine->property(name).value(); - if (!attached) { - attached = attachedObject(type, engine, true); - engine->setProperty(name, QVariant::fromValue(attached)); - } - return attached; - } - } - - return nullptr; -} - -static QList findAttachedChildren(const QMetaObject *type, QObject *object) -{ - QList children; - - QQuickItem *item = qobject_cast(object); - if (!item) { - QQuickWindow *window = qobject_cast(object); - if (window) { - item = window->contentItem(); - - const auto &windowChildren = window->children(); - for (QObject *child : windowChildren) { - QQuickWindow *childWindow = qobject_cast(child); - if (childWindow) { - QQuickAttachedObject *attached = attachedObject(type, childWindow); - if (attached) - children += attached; - } - } - } - } - - if (item) { - const auto childItems = item->childItems(); - for (QQuickItem *child : childItems) { - QQuickAttachedObject *attached = attachedObject(type, child); - if (attached) - children += attached; - else - children += findAttachedChildren(type, child); - } - } - - return children; -} - -static QQuickItem *findAttachedItem(QObject *parent) -{ - QQuickItem *item = qobject_cast(parent); - if (!item) { - QQuickPopup *popup = qobject_cast(parent); - if (popup) - item = popup->popupItem(); - } - return item; -} - -class QQuickAttachedObjectPrivate : public QObjectPrivate, public QQuickItemChangeListener -{ - Q_DECLARE_PUBLIC(QQuickAttachedObject) - -public: - static QQuickAttachedObjectPrivate *get(QQuickAttachedObject *attachedObject) - { - return attachedObject->d_func(); - } - - void attachTo(QObject *object); - void detachFrom(QObject *object); - - void itemWindowChanged(QQuickWindow *window); - void itemParentChanged(QQuickItem *item, QQuickItem *parent) override; - - QList attachedChildren; - QPointer attachedParent; -}; - -void QQuickAttachedObjectPrivate::attachTo(QObject *object) -{ - QQuickItem *item = findAttachedItem(object); - if (item) { - connect(item, &QQuickItem::windowChanged, this, &QQuickAttachedObjectPrivate::itemWindowChanged); - QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Parent); - } -} - -void QQuickAttachedObjectPrivate::detachFrom(QObject *object) -{ - QQuickItem *item = findAttachedItem(object); - if (item) { - disconnect(item, &QQuickItem::windowChanged, this, &QQuickAttachedObjectPrivate::itemWindowChanged); - QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Parent); - } -} - -void QQuickAttachedObjectPrivate::itemWindowChanged(QQuickWindow *window) -{ - Q_Q(QQuickAttachedObject); - QQuickAttachedObject *attachedParent = nullptr; - QQuickItem *item = qobject_cast(q->sender()); - if (item) - attachedParent = findAttachedParent(q->metaObject(), item); - if (!attachedParent) - attachedParent = attachedObject(q->metaObject(), window); - q->setAttachedParent(attachedParent); -} - -void QQuickAttachedObjectPrivate::itemParentChanged(QQuickItem *item, QQuickItem *parent) -{ - Q_Q(QQuickAttachedObject); - Q_UNUSED(parent); - q->setAttachedParent(findAttachedParent(q->metaObject(), item)); -} - -QQuickAttachedObject::QQuickAttachedObject(QObject *parent) - : QObject(*(new QQuickAttachedObjectPrivate), parent) -{ - Q_D(QQuickAttachedObject); - d->attachTo(parent); -} - -QQuickAttachedObject::~QQuickAttachedObject() -{ - Q_D(QQuickAttachedObject); - d->detachFrom(parent()); - setAttachedParent(nullptr); -} - -QList QQuickAttachedObject::attachedChildren() const -{ - Q_D(const QQuickAttachedObject); - return d->attachedChildren; -} - -QQuickAttachedObject *QQuickAttachedObject::attachedParent() const -{ - Q_D(const QQuickAttachedObject); - return d->attachedParent; -} - -void QQuickAttachedObject::setAttachedParent(QQuickAttachedObject *parent) -{ - Q_D(QQuickAttachedObject); - if (d->attachedParent == parent) - return; - - QQuickAttachedObject *oldParent = d->attachedParent; - if (d->attachedParent) - QQuickAttachedObjectPrivate::get(d->attachedParent)->attachedChildren.removeOne(this); - d->attachedParent = parent; - if (parent) - QQuickAttachedObjectPrivate::get(parent)->attachedChildren.append(this); - attachedParentChange(parent, oldParent); -} - -void QQuickAttachedObject::init() -{ - QQuickAttachedObject *attachedParent = findAttachedParent(metaObject(), parent()); - if (attachedParent) - setAttachedParent(attachedParent); - - const QList attachedChildren = findAttachedChildren(metaObject(), parent()); - for (QQuickAttachedObject *child : attachedChildren) - child->setAttachedParent(this); -} - -void QQuickAttachedObject::attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) -{ - Q_UNUSED(newParent); - Q_UNUSED(oldParent); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickattachedobject_p.h b/src/quickcontrols2/qquickattachedobject_p.h deleted file mode 100644 index 1e90c082..00000000 --- a/src/quickcontrols2/qquickattachedobject_p.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKATTACHEDOBJECT_P_H -#define QQUICKATTACHEDOBJECT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickAttachedObjectPrivate; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickAttachedObject : public QObject -{ - Q_OBJECT - -public: - explicit QQuickAttachedObject(QObject *parent = nullptr); - ~QQuickAttachedObject(); - - QList attachedChildren() const; - - QQuickAttachedObject *attachedParent() const; - void setAttachedParent(QQuickAttachedObject *parent); - -protected: - void init(); - - virtual void attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent); - -private: - Q_DISABLE_COPY(QQuickAttachedObject) - Q_DECLARE_PRIVATE(QQuickAttachedObject) -}; - -QT_END_NAMESPACE - -#endif // QQUICKATTACHEDOBJECT_P_H diff --git a/src/quickcontrols2/qquickchecklabel.cpp b/src/quickcontrols2/qquickchecklabel.cpp deleted file mode 100644 index dccbf77f..00000000 --- a/src/quickcontrols2/qquickchecklabel.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickchecklabel_p.h" - -QT_BEGIN_NAMESPACE - -QQuickCheckLabel::QQuickCheckLabel(QQuickItem *parent) : - QQuickText(parent) -{ - setHAlign(AlignLeft); - setVAlign(AlignVCenter); - setElideMode(ElideRight); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickchecklabel_p.h b/src/quickcontrols2/qquickchecklabel_p.h deleted file mode 100644 index 100ef48f..00000000 --- a/src/quickcontrols2/qquickchecklabel_p.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKCHECKLABEL_P_H -#define QQUICKCHECKLABEL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickCheckLabel : public QQuickText -{ - Q_OBJECT - -public: - explicit QQuickCheckLabel(QQuickItem *parent = nullptr); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickCheckLabel) - -#endif // QQUICKCHECKLABEL_P_H diff --git a/src/quickcontrols2/qquickclippedtext.cpp b/src/quickcontrols2/qquickclippedtext.cpp deleted file mode 100644 index 862197f3..00000000 --- a/src/quickcontrols2/qquickclippedtext.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickclippedtext_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickClippedText::QQuickClippedText(QQuickItem *parent) - : QQuickText(parent) -{ -} - -qreal QQuickClippedText::clipX() const -{ - return m_clipX; -} - -void QQuickClippedText::setClipX(qreal x) -{ - if (qFuzzyCompare(x, m_clipX)) - return; - - m_clipX = x; - markClipDirty(); -} - -qreal QQuickClippedText::clipY() const -{ - return m_clipY; -} - -void QQuickClippedText::setClipY(qreal y) -{ - if (qFuzzyCompare(y, m_clipY)) - return; - - m_clipY = y; - markClipDirty(); -} - -qreal QQuickClippedText::clipWidth() const -{ - return m_clipWidth ? m_clipWidth : width(); -} - -void QQuickClippedText::setClipWidth(qreal width) -{ - m_hasClipWidth = true; - if (qFuzzyCompare(width, m_clipWidth)) - return; - - m_clipWidth = width; - markClipDirty(); -} - -qreal QQuickClippedText::clipHeight() const -{ - return m_clipHeight ? m_clipHeight : height(); -} - -void QQuickClippedText::setClipHeight(qreal height) -{ - m_hasClipHeight = true; - if (qFuzzyCompare(height, m_clipHeight)) - return; - - m_clipHeight = height; - markClipDirty(); -} - -QRectF QQuickClippedText::clipRect() const -{ - return QRectF(clipX(), clipY(), clipWidth(), clipHeight()); -} - -void QQuickClippedText::markClipDirty() -{ - QQuickItemPrivate::get(this)->dirty(QQuickItemPrivate::Size); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickclippedtext_p.h b/src/quickcontrols2/qquickclippedtext_p.h deleted file mode 100644 index 486ac7c4..00000000 --- a/src/quickcontrols2/qquickclippedtext_p.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKCLIPPEDTEXT_P_H -#define QQUICKCLIPPEDTEXT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickClippedText : public QQuickText -{ - Q_OBJECT - Q_PROPERTY(qreal clipX READ clipX WRITE setClipX FINAL) - Q_PROPERTY(qreal clipY READ clipY WRITE setClipY FINAL) - Q_PROPERTY(qreal clipWidth READ clipWidth WRITE setClipWidth FINAL) - Q_PROPERTY(qreal clipHeight READ clipHeight WRITE setClipHeight FINAL) - -public: - explicit QQuickClippedText(QQuickItem *parent = nullptr); - - qreal clipX() const; - void setClipX(qreal x); - - qreal clipY() const; - void setClipY(qreal y); - - qreal clipWidth() const; - void setClipWidth(qreal width); - - qreal clipHeight() const; - void setClipHeight(qreal height); - - QRectF clipRect() const override; - -private: - void markClipDirty(); - - bool m_hasClipWidth = false; - bool m_hasClipHeight = false; - qreal m_clipX = 0; - qreal m_clipY = 0; - qreal m_clipWidth = 0; - qreal m_clipHeight = 0; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickClippedText) - -#endif // QQUICKCLIPPEDTEXT_P_H diff --git a/src/quickcontrols2/qquickcolor.cpp b/src/quickcontrols2/qquickcolor.cpp deleted file mode 100644 index 8ae568fc..00000000 --- a/src/quickcontrols2/qquickcolor.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickcolor_p.h" - -QT_BEGIN_NAMESPACE - -QQuickColor::QQuickColor(QObject *parent) : - QObject(parent) -{ -} - -QColor QQuickColor::transparent(const QColor &color, qreal opacity) const -{ - return QColor(color.red(), color.green(), color.blue(), - int(qreal(255) * qBound(qreal(0), opacity, qreal(1)))); -} - -QColor QQuickColor::blend(const QColor &a, const QColor &b, qreal factor) const -{ - if (factor <= 0.0) - return a; - if (factor >= 1.0) - return b; - - QColor color; - color.setRedF(a.redF() * (1.0 - factor) + b.redF() * factor); - color.setGreenF(a.greenF() * (1.0 - factor) + b.greenF() * factor); - color.setBlueF(a.blueF() * (1.0 - factor) + b.blueF() * factor); - return color; -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickcolor_p.h b/src/quickcontrols2/qquickcolor_p.h deleted file mode 100644 index 657a9fa4..00000000 --- a/src/quickcontrols2/qquickcolor_p.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKCOLOR_P_H -#define QQUICKCOLOR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickColor : public QObject -{ - Q_OBJECT - -public: - explicit QQuickColor(QObject *parent = nullptr); - - Q_INVOKABLE QColor transparent(const QColor &color, qreal opacity) const; - Q_INVOKABLE QColor blend(const QColor &a, const QColor &b, qreal factor) const; -}; - -QT_END_NAMESPACE - -#endif // QQUICKCOLOR_P_H diff --git a/src/quickcontrols2/qquickcolorimage.cpp b/src/quickcontrols2/qquickcolorimage.cpp deleted file mode 100644 index 3afcef7e..00000000 --- a/src/quickcontrols2/qquickcolorimage.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickcolorimage_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickColorImage::QQuickColorImage(QQuickItem *parent) - : QQuickImage(parent) -{ -} - -QColor QQuickColorImage::color() const -{ - return m_color; -} - -void QQuickColorImage::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - if (isComponentComplete()) - load(); - emit colorChanged(); -} - -void QQuickColorImage::resetColor() -{ - setColor(Qt::transparent); -} - -QColor QQuickColorImage::defaultColor() const -{ - return m_defaultColor; -} - -void QQuickColorImage::setDefaultColor(const QColor &color) -{ - if (m_defaultColor == color) - return; - - m_defaultColor = color; - emit defaultColorChanged(); -} - -void QQuickColorImage::resetDefaultColor() -{ - setDefaultColor(Qt::transparent); -} - -void QQuickColorImage::pixmapChange() -{ - QQuickImage::pixmapChange(); - if (m_color.alpha() > 0 && m_color != m_defaultColor) { - QQuickImageBasePrivate *d = static_cast(QQuickItemPrivate::get(this)); - QImage image = d->pix.image(); - if (!image.isNull()) { - QPainter painter(&image); - painter.setCompositionMode(QPainter::CompositionMode_SourceIn); - painter.fillRect(image.rect(), m_color); - d->pix.setImage(image); - } - } -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickcolorimage_p.h b/src/quickcontrols2/qquickcolorimage_p.h deleted file mode 100644 index 8227d068..00000000 --- a/src/quickcontrols2/qquickcolorimage_p.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKCOLORIMAGE_P_H -#define QQUICKCOLORIMAGE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickColorImage : public QQuickImage -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor NOTIFY colorChanged FINAL) - Q_PROPERTY(QColor defaultColor READ defaultColor WRITE setDefaultColor RESET resetDefaultColor NOTIFY defaultColorChanged FINAL) - -public: - explicit QQuickColorImage(QQuickItem *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - void resetColor(); - - QColor defaultColor() const; - void setDefaultColor(const QColor &color); - void resetDefaultColor(); - -Q_SIGNALS: - void colorChanged(); - void defaultColorChanged(); - -protected: - void pixmapChange() override; - -private: - QColor m_color = Qt::transparent; - QColor m_defaultColor = Qt::transparent; -}; - -QT_END_NAMESPACE - -#endif // QQUICKCOLORIMAGE_P_H diff --git a/src/quickcontrols2/qquickiconimage.cpp b/src/quickcontrols2/qquickiconimage.cpp deleted file mode 100644 index 1fc3abfc..00000000 --- a/src/quickcontrols2/qquickiconimage.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickiconimage_p.h" -#include "qquickiconimage_p_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -bool QQuickIconImagePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio) -{ - if (isThemeIcon) { - devicePixelRatio = calculateDevicePixelRatio(); - return true; - } - - return QQuickImagePrivate::updateDevicePixelRatio(targetDevicePixelRatio); -} - -void QQuickIconImagePrivate::updateIcon() -{ - Q_Q(QQuickIconImage); - // Both geometryChange() and QQuickImageBase::sourceSizeChanged() - // (which we connect to updateIcon() in the constructor) can be called as a result - // of updateIcon() changing the various sizes, so we must check that we're not recursing. - if (updatingIcon) - return; - - updatingIcon = true; - - QSize size = sourcesize; - // If no size is specified for theme icons, it will use the smallest available size. - if (size.width() <= 0) - size.setWidth(q->width()); - if (size.height() <= 0) - size.setHeight(q->height()); - - const qreal dpr = calculateDevicePixelRatio(); - const QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(icon, size * dpr, qCeil(dpr)); - - if (entry) { - QQmlContext *context = qmlContext(q); - const QUrl entryUrl = QUrl::fromLocalFile(entry->filename); - url = context ? context->resolvedUrl(entryUrl) : entryUrl; - isThemeIcon = true; - } else { - url = source; - isThemeIcon = false; - } - q->load(); - - updatingIcon = false; -} - -void QQuickIconImagePrivate::updateFillMode() -{ - Q_Q(QQuickIconImage); - // If we start with a sourceSize of 28x28 and then set sourceSize.width to 24, the fillMode - // will change to PreserveAspectFit (because pixmapSize.width() > width()), which causes the - // pixmap to be reloaded at its original size of 28x28, which causes the fillMode to change - // to Pad (because pixmapSize.width() <= width()), and so on. - if (updatingFillMode) - return; - - updatingFillMode = true; - - const QSize pixmapSize = QSize(pix.width(), pix.height()) / calculateDevicePixelRatio(); - if (pixmapSize.width() > q->width() || pixmapSize.height() > q->height()) - q->setFillMode(QQuickImage::PreserveAspectFit); - else - q->setFillMode(QQuickImage::Pad); - - updatingFillMode = false; -} - -qreal QQuickIconImagePrivate::calculateDevicePixelRatio() const -{ - Q_Q(const QQuickIconImage); - return q->window() ? q->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); -} - -QQuickIconImage::QQuickIconImage(QQuickItem *parent) - : QQuickImage(*(new QQuickIconImagePrivate), parent) -{ - setFillMode(Pad); -} - -QString QQuickIconImage::name() const -{ - Q_D(const QQuickIconImage); - return d->icon.iconName; -} - -void QQuickIconImage::setName(const QString &name) -{ - Q_D(QQuickIconImage); - if (d->icon.iconName == name) - return; - - d->icon = QIconLoader::instance()->loadIcon(name); - if (isComponentComplete()) - d->updateIcon(); - emit nameChanged(); -} - -QColor QQuickIconImage::color() const -{ - Q_D(const QQuickIconImage); - return d->color; -} - -void QQuickIconImage::setColor(const QColor &color) -{ - Q_D(QQuickIconImage); - if (d->color == color) - return; - - d->color = color; - if (isComponentComplete()) - d->updateIcon(); - emit colorChanged(); -} - -void QQuickIconImage::setSource(const QUrl &source) -{ - Q_D(QQuickIconImage); - if (d->source == source) - return; - - d->source = source; - if (isComponentComplete()) - d->updateIcon(); - emit sourceChanged(source); -} - -void QQuickIconImage::componentComplete() -{ - Q_D(QQuickIconImage); - QQuickImage::componentComplete(); - d->updateIcon(); - QObjectPrivate::connect(this, &QQuickImageBase::sourceSizeChanged, d, &QQuickIconImagePrivate::updateIcon); -} - -void QQuickIconImage::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - Q_D(QQuickIconImage); - QQuickImage::geometryChange(newGeometry, oldGeometry); - if (isComponentComplete() && newGeometry.size() != oldGeometry.size()) - d->updateIcon(); -} - -void QQuickIconImage::itemChange(ItemChange change, const ItemChangeData &value) -{ - Q_D(QQuickIconImage); - if (change == ItemDevicePixelRatioHasChanged) - d->updateIcon(); - QQuickImage::itemChange(change, value); -} - -void QQuickIconImage::pixmapChange() -{ - Q_D(QQuickIconImage); - QQuickImage::pixmapChange(); - d->updateFillMode(); - - // Don't apply the color if we're recursing (updateFillMode() can cause us to recurse). - if (!d->updatingFillMode && d->color.alpha() > 0) { - QImage image = d->pix.image(); - if (!image.isNull()) { - QPainter painter(&image); - painter.setCompositionMode(QPainter::CompositionMode_SourceIn); - painter.fillRect(image.rect(), d->color); - d->pix.setImage(image); - } - } -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickiconimage_p.h b/src/quickcontrols2/qquickiconimage_p.h deleted file mode 100644 index 0aac08e6..00000000 --- a/src/quickcontrols2/qquickiconimage_p.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKICONIMAGE_P_H -#define QQUICKICONIMAGE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickIconImagePrivate; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconImage : public QQuickImage -{ - Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL) - -public: - explicit QQuickIconImage(QQuickItem *parent = nullptr); - - QString name() const; - void setName(const QString &name); - - QColor color() const; - void setColor(const QColor &color); - - void setSource(const QUrl &url) override; - -Q_SIGNALS: - void nameChanged(); - void colorChanged(); - -protected: - void componentComplete() override; - void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; - void itemChange(ItemChange change, const ItemChangeData &value) override; - void pixmapChange() override; - -private: - Q_DISABLE_COPY(QQuickIconImage) - Q_DECLARE_PRIVATE(QQuickIconImage) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickIconImage) - -#endif // QQUICKICONIMAGE_P_H diff --git a/src/quickcontrols2/qquickiconimage_p_p.h b/src/quickcontrols2/qquickiconimage_p_p.h deleted file mode 100644 index 0c755ff6..00000000 --- a/src/quickcontrols2/qquickiconimage_p_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKICONIMAGE_P_P_H -#define QQUICKICONIMAGE_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconImagePrivate : public QQuickImagePrivate -{ - Q_DECLARE_PUBLIC(QQuickIconImage) - -public: - void updateIcon(); - void updateFillMode(); - qreal calculateDevicePixelRatio() const; - bool updateDevicePixelRatio(qreal targetDevicePixelRatio) override; - - QUrl source; - QColor color = Qt::transparent; - QThemeIconInfo icon; - bool updatingIcon = false; - bool isThemeIcon = false; - bool updatingFillMode = false; -}; - -QT_END_NAMESPACE - -#endif // QQUICKICONIMAGE_P_P_H diff --git a/src/quickcontrols2/qquickiconlabel.cpp b/src/quickcontrols2/qquickiconlabel.cpp deleted file mode 100644 index d76da28f..00000000 --- a/src/quickcontrols2/qquickiconlabel.cpp +++ /dev/null @@ -1,642 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickiconlabel_p.h" -#include "qquickiconlabel_p_p.h" -#include "qquickiconimage_p.h" -#include "qquickmnemoniclabel_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static void beginClass(QQuickItem *item) -{ - if (QQmlParserStatus *parserStatus = qobject_cast(item)) - parserStatus->classBegin(); -} - -static void completeComponent(QQuickItem *item) -{ - if (QQmlParserStatus *parserStatus = qobject_cast(item)) - parserStatus->componentComplete(); -} - -bool QQuickIconLabelPrivate::hasIcon() const -{ - return display != QQuickIconLabel::TextOnly && !icon.isEmpty(); -} - -bool QQuickIconLabelPrivate::hasText() const -{ - return display != QQuickIconLabel::IconOnly && !text.isEmpty(); -} - -bool QQuickIconLabelPrivate::createImage() -{ - Q_Q(QQuickIconLabel); - if (image) - return false; - - image = new QQuickIconImage(q); - watchChanges(image); - beginClass(image); - image->setObjectName(QStringLiteral("image")); - image->setName(icon.name()); - image->setSource(icon.source()); - image->setSourceSize(QSize(icon.width(), icon.height())); - image->setColor(icon.color()); - image->setCache(icon.cache()); - QQmlEngine::setContextForObject(image, qmlContext(q)); - if (componentComplete) - completeComponent(image); - return true; -} - -bool QQuickIconLabelPrivate::destroyImage() -{ - if (!image) - return false; - - unwatchChanges(image); - delete image; - image = nullptr; - return true; -} - -bool QQuickIconLabelPrivate::updateImage() -{ - if (!hasIcon()) - return destroyImage(); - return createImage(); -} - -void QQuickIconLabelPrivate::syncImage() -{ - if (!image || icon.isEmpty()) - return; - - image->setName(icon.name()); - image->setSource(icon.source()); - image->setSourceSize(QSize(icon.width(), icon.height())); - image->setColor(icon.color()); - image->setCache(icon.cache()); - const int valign = alignment & Qt::AlignVertical_Mask; - image->setVerticalAlignment(static_cast(valign)); - const int halign = alignment & Qt::AlignHorizontal_Mask; - image->setHorizontalAlignment(static_cast(halign)); -} - -void QQuickIconLabelPrivate::updateOrSyncImage() -{ - if (updateImage()) { - if (componentComplete) { - updateImplicitSize(); - layout(); - } - } else { - syncImage(); - } -} - -bool QQuickIconLabelPrivate::createLabel() -{ - Q_Q(QQuickIconLabel); - if (label) - return false; - - label = new QQuickMnemonicLabel(q); - watchChanges(label); - beginClass(label); - label->setObjectName(QStringLiteral("label")); - label->setFont(font); - label->setColor(color); - label->setElideMode(QQuickText::ElideRight); - const int valign = alignment & Qt::AlignVertical_Mask; - label->setVAlign(static_cast(valign)); - const int halign = alignment & Qt::AlignHorizontal_Mask; - label->setHAlign(static_cast(halign)); - label->setText(text); - if (componentComplete) - completeComponent(label); - return true; -} - -bool QQuickIconLabelPrivate::destroyLabel() -{ - if (!label) - return false; - - unwatchChanges(label); - delete label; - label = nullptr; - return true; -} - -bool QQuickIconLabelPrivate::updateLabel() -{ - if (!hasText()) - return destroyLabel(); - return createLabel(); -} - -void QQuickIconLabelPrivate::syncLabel() -{ - if (!label) - return; - - label->setText(text); -} - -void QQuickIconLabelPrivate::updateOrSyncLabel() -{ - if (updateLabel()) { - if (componentComplete) { - updateImplicitSize(); - layout(); - } - } else { - syncLabel(); - } -} - -void QQuickIconLabelPrivate::updateImplicitSize() -{ - Q_Q(QQuickIconLabel); - const bool showIcon = image && hasIcon(); - const bool showText = label && hasText(); - const qreal horizontalPadding = leftPadding + rightPadding; - const qreal verticalPadding = topPadding + bottomPadding; - const qreal iconImplicitWidth = showIcon ? image->implicitWidth() : 0; - const qreal iconImplicitHeight = showIcon ? image->implicitHeight() : 0; - const qreal textImplicitWidth = showText ? label->implicitWidth() : 0; - const qreal textImplicitHeight = showText ? label->implicitHeight() : 0; - const qreal effectiveSpacing = showText && showIcon && image->implicitWidth() > 0 ? spacing : 0; - const qreal implicitWidth = display == QQuickIconLabel::TextBesideIcon ? iconImplicitWidth + textImplicitWidth + effectiveSpacing - : qMax(iconImplicitWidth, textImplicitWidth); - const qreal implicitHeight = display == QQuickIconLabel::TextUnderIcon ? iconImplicitHeight + textImplicitHeight + effectiveSpacing - : qMax(iconImplicitHeight, textImplicitHeight); - q->setImplicitSize(implicitWidth + horizontalPadding, implicitHeight + verticalPadding); -} - -// adapted from QStyle::alignedRect() -static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &size, const QRectF &rectangle) -{ - alignment = QGuiApplicationPrivate::visualAlignment(mirrored ? Qt::RightToLeft : Qt::LeftToRight, alignment); - qreal x = rectangle.x(); - qreal y = rectangle.y(); - const qreal w = size.width(); - const qreal h = size.height(); - if ((alignment & Qt::AlignVCenter) == Qt::AlignVCenter) - y += rectangle.height() / 2 - h / 2; - else if ((alignment & Qt::AlignBottom) == Qt::AlignBottom) - y += rectangle.height() - h; - if ((alignment & Qt::AlignRight) == Qt::AlignRight) - x += rectangle.width() - w; - else if ((alignment & Qt::AlignHCenter) == Qt::AlignHCenter) - x += rectangle.width() / 2 - w / 2; - return QRectF(x, y, w, h); -} - -void QQuickIconLabelPrivate::layout() -{ - Q_Q(QQuickIconLabel); - if (!componentComplete) - return; - - const qreal availableWidth = width - leftPadding - rightPadding; - const qreal availableHeight = height - topPadding - bottomPadding; - - switch (display) { - case QQuickIconLabel::IconOnly: - if (image) { - const QRectF iconRect = alignedRect(mirrored, alignment, - QSizeF(qMin(image->implicitWidth(), availableWidth), - qMin(image->implicitHeight(), availableHeight)), - QRectF(leftPadding, topPadding, availableWidth, availableHeight)); - image->setSize(iconRect.size()); - image->setPosition(iconRect.topLeft()); - } - break; - case QQuickIconLabel::TextOnly: - if (label) { - const QRectF textRect = alignedRect(mirrored, alignment, - QSizeF(qMin(label->implicitWidth(), availableWidth), - qMin(label->implicitHeight(), availableHeight)), - QRectF(leftPadding, topPadding, availableWidth, availableHeight)); - label->setSize(textRect.size()); - label->setPosition(textRect.topLeft()); - } - break; - - case QQuickIconLabel::TextUnderIcon: { - // Work out the sizes first, as the positions depend on them. - QSizeF iconSize; - QSizeF textSize; - if (image) { - iconSize.setWidth(qMin(image->implicitWidth(), availableWidth)); - iconSize.setHeight(qMin(image->implicitHeight(), availableHeight)); - } - qreal effectiveSpacing = 0; - if (label) { - if (!iconSize.isEmpty()) - effectiveSpacing = spacing; - textSize.setWidth(qMin(label->implicitWidth(), availableWidth)); - textSize.setHeight(qMin(label->implicitHeight(), availableHeight - iconSize.height() - effectiveSpacing)); - } - - QRectF combinedRect = alignedRect(mirrored, alignment, - QSizeF(qMax(iconSize.width(), textSize.width()), - iconSize.height() + effectiveSpacing + textSize.height()), - QRectF(leftPadding, topPadding, availableWidth, availableHeight)); - if (image) { - QRectF iconRect = alignedRect(mirrored, Qt::AlignHCenter | Qt::AlignTop, iconSize, combinedRect); - image->setSize(iconRect.size()); - image->setPosition(iconRect.topLeft()); - } - if (label) { - QRectF textRect = alignedRect(mirrored, Qt::AlignHCenter | Qt::AlignBottom, textSize, combinedRect); - label->setSize(textRect.size()); - label->setPosition(textRect.topLeft()); - } - break; - } - - case QQuickIconLabel::TextBesideIcon: - default: - // Work out the sizes first, as the positions depend on them. - QSizeF iconSize(0, 0); - QSizeF textSize(0, 0); - if (image) { - iconSize.setWidth(qMin(image->implicitWidth(), availableWidth)); - iconSize.setHeight(qMin(image->implicitHeight(), availableHeight)); - } - qreal effectiveSpacing = 0; - if (label) { - if (!iconSize.isEmpty()) - effectiveSpacing = spacing; - textSize.setWidth(qMin(label->implicitWidth(), availableWidth - iconSize.width() - effectiveSpacing)); - textSize.setHeight(qMin(label->implicitHeight(), availableHeight)); - } - - const QRectF combinedRect = alignedRect(mirrored, alignment, - QSizeF(iconSize.width() + effectiveSpacing + textSize.width(), - qMax(iconSize.height(), textSize.height())), - QRectF(leftPadding, topPadding, availableWidth, availableHeight)); - if (image) { - const QRectF iconRect = alignedRect(mirrored, Qt::AlignLeft | Qt::AlignVCenter, iconSize, combinedRect); - image->setSize(iconRect.size()); - image->setPosition(iconRect.topLeft()); - } - if (label) { - const QRectF textRect = alignedRect(mirrored, Qt::AlignRight | Qt::AlignVCenter, textSize, combinedRect); - label->setSize(textRect.size()); - label->setPosition(textRect.topLeft()); - } - break; - } - - q->setBaselineOffset(label ? label->y() + label->baselineOffset() : 0); -} - -static const QQuickItemPrivate::ChangeTypes itemChangeTypes = - QQuickItemPrivate::ImplicitWidth - | QQuickItemPrivate::ImplicitHeight - | QQuickItemPrivate::Destroyed; - -void QQuickIconLabelPrivate::watchChanges(QQuickItem *item) -{ - QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); - itemPrivate->addItemChangeListener(this, itemChangeTypes); -} - -void QQuickIconLabelPrivate::unwatchChanges(QQuickItem* item) -{ - QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); - itemPrivate->removeItemChangeListener(this, itemChangeTypes); -} - -void QQuickIconLabelPrivate::itemImplicitWidthChanged(QQuickItem *) -{ - updateImplicitSize(); - layout(); -} - -void QQuickIconLabelPrivate::itemImplicitHeightChanged(QQuickItem *) -{ - updateImplicitSize(); - layout(); -} - -void QQuickIconLabelPrivate::itemDestroyed(QQuickItem *item) -{ - unwatchChanges(item); - if (item == image) - image = nullptr; - else if (item == label) - label = nullptr; -} - -QQuickIconLabel::QQuickIconLabel(QQuickItem *parent) - : QQuickItem(*(new QQuickIconLabelPrivate), parent) -{ -} - -QQuickIconLabel::~QQuickIconLabel() -{ - Q_D(QQuickIconLabel); - if (d->image) - d->unwatchChanges(d->image); - if (d->label) - d->unwatchChanges(d->label); -} - -QQuickIcon QQuickIconLabel::icon() const -{ - Q_D(const QQuickIconLabel); - return d->icon; -} - -void QQuickIconLabel::setIcon(const QQuickIcon &icon) -{ - Q_D(QQuickIconLabel); - if (d->icon == icon) - return; - - d->icon = icon; - d->updateOrSyncImage(); -} - -QString QQuickIconLabel::text() const -{ - Q_D(const QQuickIconLabel); - return d->text; -} - -void QQuickIconLabel::setText(const QString &text) -{ - Q_D(QQuickIconLabel); - if (d->text == text) - return; - - d->text = text; - d->updateOrSyncLabel(); -} - -QFont QQuickIconLabel::font() const -{ - Q_D(const QQuickIconLabel); - return d->font; -} - -void QQuickIconLabel::setFont(const QFont &font) -{ - Q_D(QQuickIconLabel); - if (d->font == font) - return; - - d->font = font; - if (d->label) - d->label->setFont(font); -} - -QColor QQuickIconLabel::color() const -{ - Q_D(const QQuickIconLabel); - return d->color; -} - -void QQuickIconLabel::setColor(const QColor &color) -{ - Q_D(QQuickIconLabel); - if (d->color == color) - return; - - d->color = color; - if (d->label) - d->label->setColor(color); -} - -QQuickIconLabel::Display QQuickIconLabel::display() const -{ - Q_D(const QQuickIconLabel); - return d->display; -} - -void QQuickIconLabel::setDisplay(Display display) -{ - Q_D(QQuickIconLabel); - if (d->display == display) - return; - - d->display = display; - d->updateImage(); - d->updateLabel(); - d->updateImplicitSize(); - d->layout(); -} - -qreal QQuickIconLabel::spacing() const -{ - Q_D(const QQuickIconLabel); - return d->spacing; -} - -void QQuickIconLabel::setSpacing(qreal spacing) -{ - Q_D(QQuickIconLabel); - if (qFuzzyCompare(d->spacing, spacing)) - return; - - d->spacing = spacing; - if (d->image && d->label) { - d->updateImplicitSize(); - d->layout(); - } -} - -bool QQuickIconLabel::isMirrored() const -{ - Q_D(const QQuickIconLabel); - return d->mirrored; -} - -void QQuickIconLabel::setMirrored(bool mirrored) -{ - Q_D(QQuickIconLabel); - if (d->mirrored == mirrored) - return; - - d->mirrored = mirrored; - d->layout(); -} - -Qt::Alignment QQuickIconLabel::alignment() const -{ - Q_D(const QQuickIconLabel); - return d->alignment; -} - -void QQuickIconLabel::setAlignment(Qt::Alignment alignment) -{ - Q_D(QQuickIconLabel); - const int valign = alignment & Qt::AlignVertical_Mask; - const int halign = alignment & Qt::AlignHorizontal_Mask; - const uint align = (valign ? valign : Qt::AlignVCenter) | (halign ? halign : Qt::AlignHCenter); - if (d->alignment == align) - return; - - d->alignment = static_cast(align); - if (d->label) { - d->label->setVAlign(static_cast(valign)); - d->label->setHAlign(static_cast(halign)); - } - if (d->image) { - d->image->setVerticalAlignment(static_cast(valign)); - d->image->setHorizontalAlignment(static_cast(halign)); - } - d->layout(); -} - -qreal QQuickIconLabel::topPadding() const -{ - Q_D(const QQuickIconLabel); - return d->topPadding; -} - -void QQuickIconLabel::setTopPadding(qreal padding) -{ - Q_D(QQuickIconLabel); - if (qFuzzyCompare(d->topPadding, padding)) - return; - - d->topPadding = padding; - d->updateImplicitSize(); - d->layout(); -} - -void QQuickIconLabel::resetTopPadding() -{ - setTopPadding(0); -} - -qreal QQuickIconLabel::leftPadding() const -{ - Q_D(const QQuickIconLabel); - return d->leftPadding; -} - -void QQuickIconLabel::setLeftPadding(qreal padding) -{ - Q_D(QQuickIconLabel); - if (qFuzzyCompare(d->leftPadding, padding)) - return; - - d->leftPadding = padding; - d->updateImplicitSize(); - d->layout(); -} - -void QQuickIconLabel::resetLeftPadding() -{ - setLeftPadding(0); -} - -qreal QQuickIconLabel::rightPadding() const -{ - Q_D(const QQuickIconLabel); - return d->rightPadding; -} - -void QQuickIconLabel::setRightPadding(qreal padding) -{ - Q_D(QQuickIconLabel); - if (qFuzzyCompare(d->rightPadding, padding)) - return; - - d->rightPadding = padding; - d->updateImplicitSize(); - d->layout(); -} - -void QQuickIconLabel::resetRightPadding() -{ - setRightPadding(0); -} - -qreal QQuickIconLabel::bottomPadding() const -{ - Q_D(const QQuickIconLabel); - return d->bottomPadding; -} - -void QQuickIconLabel::setBottomPadding(qreal padding) -{ - Q_D(QQuickIconLabel); - if (qFuzzyCompare(d->bottomPadding, padding)) - return; - - d->bottomPadding = padding; - d->updateImplicitSize(); - d->layout(); -} - -void QQuickIconLabel::resetBottomPadding() -{ - setBottomPadding(0); -} - -void QQuickIconLabel::componentComplete() -{ - Q_D(QQuickIconLabel); - if (d->image) - completeComponent(d->image); - if (d->label) - completeComponent(d->label); - QQuickItem::componentComplete(); - d->layout(); -} - -void QQuickIconLabel::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - Q_D(QQuickIconLabel); - QQuickItem::geometryChange(newGeometry, oldGeometry); - d->layout(); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickiconlabel_p.h b/src/quickcontrols2/qquickiconlabel_p.h deleted file mode 100644 index ecf2336e..00000000 --- a/src/quickcontrols2/qquickiconlabel_p.h +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKICONLABEL_P_H -#define QQUICKICONLABEL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickIconLabelPrivate; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconLabel : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon FINAL) - Q_PROPERTY(QString text READ text WRITE setText FINAL) - Q_PROPERTY(QFont font READ font WRITE setFont FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor FINAL) - Q_PROPERTY(Display display READ display WRITE setDisplay FINAL) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing FINAL) - Q_PROPERTY(bool mirrored READ isMirrored WRITE setMirrored FINAL) - Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment FINAL) - Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding FINAL) - Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding FINAL) - Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding FINAL) - Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding FINAL) - -public: - enum Display { - IconOnly, - TextOnly, - TextBesideIcon, - TextUnderIcon - }; - Q_ENUM(Display) - - explicit QQuickIconLabel(QQuickItem *parent = nullptr); - ~QQuickIconLabel(); - - QQuickIcon icon() const; - void setIcon(const QQuickIcon &icon); - - QString text() const; - void setText(const QString &text); - - QFont font() const; - void setFont(const QFont &font); - - QColor color() const; - void setColor(const QColor &color); - - Display display() const; - void setDisplay(Display display); - - qreal spacing() const; - void setSpacing(qreal spacing); - - bool isMirrored() const; - void setMirrored(bool mirrored); - - Qt::Alignment alignment() const; - void setAlignment(Qt::Alignment alignment); - - qreal topPadding() const; - void setTopPadding(qreal padding); - void resetTopPadding(); - - qreal leftPadding() const; - void setLeftPadding(qreal padding); - void resetLeftPadding(); - - qreal rightPadding() const; - void setRightPadding(qreal padding); - void resetRightPadding(); - - qreal bottomPadding() const; - void setBottomPadding(qreal padding); - void resetBottomPadding(); - -protected: - void componentComplete() override; - void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; - -private: - Q_DISABLE_COPY(QQuickIconLabel) - Q_DECLARE_PRIVATE(QQuickIconLabel) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickIconLabel) - -#endif // QQUICKICONLABEL_P_H diff --git a/src/quickcontrols2/qquickiconlabel_p_p.h b/src/quickcontrols2/qquickiconlabel_p_p.h deleted file mode 100644 index 6a2a0f58..00000000 --- a/src/quickcontrols2/qquickiconlabel_p_p.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKICONLABEL_P_P_H -#define QQUICKICONLABEL_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickIconImage; -class QQuickMnemonicLabel; - -class QQuickIconLabelPrivate : public QQuickItemPrivate, public QQuickItemChangeListener -{ - Q_DECLARE_PUBLIC(QQuickIconLabel) - -public: - bool hasIcon() const; - bool hasText() const; - - bool createImage(); - bool destroyImage(); - bool updateImage(); - void syncImage(); - void updateOrSyncImage(); - - bool createLabel(); - bool destroyLabel(); - bool updateLabel(); - void syncLabel(); - void updateOrSyncLabel(); - - void updateImplicitSize(); - void layout(); - - void watchChanges(QQuickItem *item); - void unwatchChanges(QQuickItem *item); - void setPositioningDirty(); - - bool isLeftToRight() const; - - void itemImplicitWidthChanged(QQuickItem *) override; - void itemImplicitHeightChanged(QQuickItem *) override; - void itemDestroyed(QQuickItem *item) override; - - bool mirrored = false; - QQuickIconLabel::Display display = QQuickIconLabel::TextBesideIcon; - Qt::Alignment alignment = Qt::AlignCenter; - qreal spacing = 0; - qreal topPadding = 0; - qreal leftPadding = 0; - qreal rightPadding = 0; - qreal bottomPadding = 0; - QFont font; - QColor color; - QString text; - QQuickIcon icon; - QQuickIconImage *image = nullptr; - QQuickMnemonicLabel *label = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QQUICKICONLABEL_P_P_H diff --git a/src/quickcontrols2/qquickitemgroup.cpp b/src/quickcontrols2/qquickitemgroup.cpp deleted file mode 100644 index c4307001..00000000 --- a/src/quickcontrols2/qquickitemgroup.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickitemgroup_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickItemGroup::QQuickItemGroup(QQuickItem *parent) - : QQuickImplicitSizeItem(*(new QQuickImplicitSizeItemPrivate), parent) -{ -} - -QQuickItemGroup::~QQuickItemGroup() -{ - const auto children = childItems(); - for (QQuickItem *child : children) - unwatch(child); -} - -void QQuickItemGroup::watch(QQuickItem *item) -{ - QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); -} - -void QQuickItemGroup::unwatch(QQuickItem *item) -{ - QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); -} - -QSizeF QQuickItemGroup::calculateImplicitSize() const -{ - qreal width = 0; - qreal height = 0; - const auto children = childItems(); - for (QQuickItem *child : children) { - width = qMax(width, child->implicitWidth()); - height = qMax(height, child->implicitHeight()); - } - return QSizeF(width, height); -} - -void QQuickItemGroup::updateImplicitSize() -{ - QSizeF size = calculateImplicitSize(); - setImplicitSize(size.width(), size.height()); -} - -void QQuickItemGroup::itemChange(ItemChange change, const ItemChangeData &data) -{ - QQuickImplicitSizeItem::itemChange(change, data); - switch (change) { - case ItemChildAddedChange: - watch(data.item); - data.item->setSize(QSizeF(width(), height())); - updateImplicitSize(); - break; - case ItemChildRemovedChange: - unwatch(data.item); - updateImplicitSize(); - break; - default: - break; - } -} - -void QQuickItemGroup::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - QQuickImplicitSizeItem::geometryChange(newGeometry, oldGeometry); - - if (newGeometry.size() != oldGeometry.size()) { - const auto children = childItems(); - for (QQuickItem *child : children) - child->setSize(newGeometry.size()); - } -} - -void QQuickItemGroup::itemImplicitWidthChanged(QQuickItem *) -{ - setImplicitWidth(calculateImplicitSize().width()); -} - -void QQuickItemGroup::itemImplicitHeightChanged(QQuickItem *) -{ - setImplicitHeight(calculateImplicitSize().height()); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickitemgroup_p.h b/src/quickcontrols2/qquickitemgroup_p.h deleted file mode 100644 index ab6306b4..00000000 --- a/src/quickcontrols2/qquickitemgroup_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKITEMGROUP_P_H -#define QQUICKITEMGROUP_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickItemGroup : public QQuickImplicitSizeItem, protected QQuickItemChangeListener -{ - Q_OBJECT - -public: - explicit QQuickItemGroup(QQuickItem *parent = nullptr); - ~QQuickItemGroup(); - -protected: - void watch(QQuickItem *item); - void unwatch(QQuickItem *item); - - QSizeF calculateImplicitSize() const; - void updateImplicitSize(); - - void itemChange(ItemChange change, const ItemChangeData &data) override; - void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; - - void itemImplicitWidthChanged(QQuickItem *item) override; - void itemImplicitHeightChanged(QQuickItem *item) override; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickItemGroup) - -#endif // QQUICKITEMGROUP_P_H diff --git a/src/quickcontrols2/qquickmnemoniclabel.cpp b/src/quickcontrols2/qquickmnemoniclabel.cpp deleted file mode 100644 index 309d076a..00000000 --- a/src/quickcontrols2/qquickmnemoniclabel.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickmnemoniclabel_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickMnemonicLabel::QQuickMnemonicLabel(QQuickItem *parent) - : QQuickText(parent) -{ -} - -QString QQuickMnemonicLabel::text() const -{ - return m_fullText; -} - -void QQuickMnemonicLabel::setText(const QString &text) -{ - if (m_fullText == text) - return; - - m_fullText = text; - updateMnemonic(); -} - -bool QQuickMnemonicLabel::isMnemonicVisible() const -{ - return m_mnemonicVisible; -} - -void QQuickMnemonicLabel::setMnemonicVisible(bool visible) -{ - if (m_mnemonicVisible == visible) - return; - - m_mnemonicVisible = visible; - updateMnemonic(); - - if (isComponentComplete()) - forceLayout(); -} - -static QTextLayout::FormatRange underlineRange(int start, int length = 1) -{ - QTextLayout::FormatRange range; - range.start = start; - range.length = length; - range.format.setFontUnderline(true); - return range; -} - -// based on QPlatformTheme::removeMnemonics() -void QQuickMnemonicLabel::updateMnemonic() -{ - QString text(m_fullText.size(), QChar::Null); - int idx = 0; - int pos = 0; - int len = m_fullText.length(); - QList formats; - while (len) { - if (m_fullText.at(pos) == QLatin1Char('&') && (len == 1 || m_fullText.at(pos + 1) != QLatin1Char('&'))) { - if (m_mnemonicVisible && (pos == 0 || m_fullText.at(pos - 1) != QLatin1Char('&'))) - formats += underlineRange(pos); - ++pos; - --len; - if (len == 0) - break; - } else if (m_fullText.at(pos) == QLatin1Char('(') && len >= 4 && - m_fullText.at(pos + 1) == QLatin1Char('&') && - m_fullText.at(pos + 2) != QLatin1Char('&') && - m_fullText.at(pos + 3) == QLatin1Char(')')) { - // a mnemonic with format "\s*(&X)" - if (m_mnemonicVisible) { - formats += underlineRange(pos + 1); - } else { - int n = 0; - while (idx > n && text.at(idx - n - 1).isSpace()) - ++n; - idx -= n; - pos += 4; - len -= 4; - continue; - } - } - text[idx] = m_fullText.at(pos); - ++pos; - ++idx; - --len; - } - text.truncate(idx); - - QQuickTextPrivate::get(this)->layout.setFormats(formats); - QQuickText::setText(text); -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickmnemoniclabel_p.h b/src/quickcontrols2/qquickmnemoniclabel_p.h deleted file mode 100644 index da5a83db..00000000 --- a/src/quickcontrols2/qquickmnemoniclabel_p.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKMNEMONICLABEL_P_H -#define QQUICKMNEMONICLABEL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickMnemonicLabel : public QQuickText -{ - Q_OBJECT - Q_PROPERTY(QString text READ text WRITE setText FINAL) - Q_PROPERTY(bool mnemonicVisible READ isMnemonicVisible WRITE setMnemonicVisible FINAL) - -public: - explicit QQuickMnemonicLabel(QQuickItem *parent = nullptr); - - QString text() const; - void setText(const QString &text); - - bool isMnemonicVisible() const; - void setMnemonicVisible(bool visible); - -private: - void updateMnemonic(); - - bool m_mnemonicVisible = true; - QString m_fullText; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickMnemonicLabel) - -#endif // QQUICKMNEMONICLABEL_P_H diff --git a/src/quickcontrols2/qquickpaddedrectangle.cpp b/src/quickcontrols2/qquickpaddedrectangle.cpp deleted file mode 100644 index fd9e9d90..00000000 --- a/src/quickcontrols2/qquickpaddedrectangle.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickpaddedrectangle_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QQuickPaddedRectangle::QQuickPaddedRectangle(QQuickItem *parent) : - QQuickRectangle(parent) -{ -} - -qreal QQuickPaddedRectangle::padding() const -{ - return m_padding; -} - -void QQuickPaddedRectangle::setPadding(qreal padding) -{ - if (!qFuzzyCompare(m_padding, padding)) { - m_padding = padding; - update(); - emit paddingChanged(); - if (m_hasTopPadding) - emit topPaddingChanged(); - if (!m_hasLeftPadding) - emit leftPaddingChanged(); - if (!m_hasRightPadding) - emit rightPaddingChanged(); - if (!m_hasBottomPadding) - emit bottomPaddingChanged(); - } -} - -void QQuickPaddedRectangle::resetPadding() -{ - setPadding(0); -} - -qreal QQuickPaddedRectangle::topPadding() const -{ - return m_hasTopPadding ? m_topPadding : m_padding; -} - -void QQuickPaddedRectangle::setTopPadding(qreal padding) -{ - setTopPadding(padding, true); -} - -void QQuickPaddedRectangle::resetTopPadding() -{ - setTopPadding(0, false); -} - -qreal QQuickPaddedRectangle::leftPadding() const -{ - return m_hasLeftPadding ? m_leftPadding : m_padding; -} - -void QQuickPaddedRectangle::setLeftPadding(qreal padding) -{ - setLeftPadding(padding, true); -} - -void QQuickPaddedRectangle::resetLeftPadding() -{ - setLeftPadding(0, false); -} - -qreal QQuickPaddedRectangle::rightPadding() const -{ - return m_hasRightPadding ? m_rightPadding : m_padding; -} - -void QQuickPaddedRectangle::setRightPadding(qreal padding) -{ - setRightPadding(padding, true); -} - -void QQuickPaddedRectangle::resetRightPadding() -{ - setRightPadding(0, false); -} - -qreal QQuickPaddedRectangle::bottomPadding() const -{ - return m_hasBottomPadding ? m_bottomPadding : m_padding; -} - -void QQuickPaddedRectangle::setBottomPadding(qreal padding) -{ - setBottomPadding(padding, true); -} - -void QQuickPaddedRectangle::resetBottomPadding() -{ - setBottomPadding(0, false); -} - -void QQuickPaddedRectangle::setTopPadding(qreal padding, bool has) -{ - qreal oldPadding = topPadding(); - m_hasTopPadding = has; - m_topPadding = padding; - if (!qFuzzyCompare(oldPadding, padding)) { - update(); - emit topPaddingChanged(); - } -} - -void QQuickPaddedRectangle::setLeftPadding(qreal padding, bool has) -{ - qreal oldPadding = leftPadding(); - m_hasLeftPadding = has; - m_leftPadding = padding; - if (!qFuzzyCompare(oldPadding, padding)) { - update(); - emit leftPaddingChanged(); - } -} - -void QQuickPaddedRectangle::setRightPadding(qreal padding, bool has) -{ - qreal oldPadding = rightPadding(); - m_hasRightPadding = has; - m_rightPadding = padding; - if (!qFuzzyCompare(oldPadding, padding)) { - update(); - emit rightPaddingChanged(); - } -} - -void QQuickPaddedRectangle::setBottomPadding(qreal padding, bool has) -{ - qreal oldPadding = bottomPadding(); - m_hasBottomPadding = has; - m_bottomPadding = padding; - if (!qFuzzyCompare(oldPadding, padding)) { - update(); - emit bottomPaddingChanged(); - } -} - -QSGNode *QQuickPaddedRectangle::updatePaintNode(QSGNode *node, UpdatePaintNodeData *data) -{ - QSGTransformNode *transformNode = static_cast(node); - if (!transformNode) - transformNode = new QSGTransformNode; - - QSGInternalRectangleNode *rectNode = static_cast(QQuickRectangle::updatePaintNode(transformNode->firstChild(), data)); - - if (rectNode) { - if (!transformNode->firstChild()) - transformNode->appendChildNode(rectNode); - - qreal top = topPadding(); - qreal left = leftPadding(); - qreal right = rightPadding(); - qreal bottom = bottomPadding(); - - if (!qFuzzyIsNull(top) || !qFuzzyIsNull(left) || !qFuzzyIsNull(right) || !qFuzzyIsNull(bottom)) { - QMatrix4x4 m; - m.translate(left, top); - transformNode->setMatrix(m); - - qreal w = qMax(0.0, width() -left-right); - qreal h = qMax(0.0, height() -top-bottom); - - rectNode->setRect(QRectF(0, 0, w, h)); - rectNode->update(); - } - } - return transformNode; -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickpaddedrectangle_p.h b/src/quickcontrols2/qquickpaddedrectangle_p.h deleted file mode 100644 index c2e0ddef..00000000 --- a/src/quickcontrols2/qquickpaddedrectangle_p.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKPADDEDRECTANGLE_P_H -#define QQUICKPADDEDRECTANGLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickPaddedRectangle : public QQuickRectangle -{ - Q_OBJECT - Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged FINAL) - Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged FINAL) - Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged FINAL) - Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged FINAL) - Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged FINAL) - -public: - QQuickPaddedRectangle(QQuickItem *parent = nullptr); - - qreal padding() const; - void setPadding(qreal padding); - void resetPadding(); - - qreal topPadding() const; - void setTopPadding(qreal padding); - void resetTopPadding(); - - qreal leftPadding() const; - void setLeftPadding(qreal padding); - void resetLeftPadding(); - - qreal rightPadding() const; - void setRightPadding(qreal padding); - void resetRightPadding(); - - qreal bottomPadding() const; - void setBottomPadding(qreal padding); - void resetBottomPadding(); - -Q_SIGNALS: - void paddingChanged(); - void topPaddingChanged(); - void leftPaddingChanged(); - void rightPaddingChanged(); - void bottomPaddingChanged(); - -protected: - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; - -private: - void setTopPadding(qreal padding, bool has); - void setLeftPadding(qreal padding, bool has); - void setRightPadding(qreal padding, bool has); - void setBottomPadding(qreal padding, bool has); - - qreal m_padding = 0; - qreal m_topPadding = 0; - qreal m_leftPadding = 0; - qreal m_rightPadding = 0; - qreal m_bottomPadding = 0; - bool m_hasTopPadding = false; - bool m_hasLeftPadding = false; - bool m_hasRightPadding = false; - bool m_hasBottomPadding = false; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickPaddedRectangle) - -#endif // QQUICKPADDEDRECTANGLE_P_H diff --git a/src/quickcontrols2/qquickplaceholdertext.cpp b/src/quickcontrols2/qquickplaceholdertext.cpp deleted file mode 100644 index 2fe6be07..00000000 --- a/src/quickcontrols2/qquickplaceholdertext.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickplaceholdertext_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickPlaceholderText::QQuickPlaceholderText(QQuickItem *parent) : QQuickText(parent) -{ -} - -void QQuickPlaceholderText::componentComplete() -{ - QQuickText::componentComplete(); - connect(parentItem(), SIGNAL(effectiveHorizontalAlignmentChanged()), this, SLOT(updateAlignment())); - updateAlignment(); -} - -void QQuickPlaceholderText::updateAlignment() -{ - if (QQuickTextInput *input = qobject_cast(parentItem())) { - if (QQuickTextInputPrivate::get(input)->hAlignImplicit) - resetHAlign(); - else - setHAlign(static_cast(input->hAlign())); - } else if (QQuickTextEdit *edit = qobject_cast(parentItem())) { - if (QQuickTextEditPrivate::get(edit)->hAlignImplicit) - resetHAlign(); - else - setHAlign(static_cast(edit->hAlign())); - } else { - resetHAlign(); - } -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickplaceholdertext_p.h b/src/quickcontrols2/qquickplaceholdertext_p.h deleted file mode 100644 index 1e49286c..00000000 --- a/src/quickcontrols2/qquickplaceholdertext_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKPLACEHOLDERTEXT_P_H -#define QQUICKPLACEHOLDERTEXT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickPlaceholderText : public QQuickText -{ - Q_OBJECT - -public: - explicit QQuickPlaceholderText(QQuickItem *parent = nullptr); - -protected: - void componentComplete() override; - -private Q_SLOTS: - void updateAlignment(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickPlaceholderText) - -#endif // QQUICKPLACEHOLDERTEXT_P_H diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index 6e1f17b1..836eb2f4 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -378,7 +378,7 @@ QStringList QQuickStylePrivate::stylePaths(bool resolve) paths += envPathList("QT_QUICK_CONTROLS_STYLE_PATH"); // built-in import paths - const QString targetPath = QStringLiteral("QtQuick/Controls.2"); + const QString targetPath = QStringLiteral("QtQuick/Controls"); const QStringList importPaths = defaultImportPathList(); for (const QString &importPath : importPaths) { QDir dir(importPath); @@ -648,7 +648,7 @@ QStringList QQuickStyle::availableStyles() Returns the list of directories where Qt Quick Controls 2 searches for available styles. By default, the list contains paths specified in the \c QT_QUICK_CONTROLS_STYLE_PATH - environment variable, and any existing \c QtQuick/Controls.2 sub-directories in + environment variable, and any existing \c QtQuick/Controls sub-directories in \l QQmlEngine::importPathList(). \sa addStylePath(), availableStyles() diff --git a/src/quickcontrols2/qquickstyle_p.h b/src/quickcontrols2/qquickstyle_p.h index 205a4a11..7c837423 100644 --- a/src/quickcontrols2/qquickstyle_p.h +++ b/src/quickcontrols2/qquickstyle_p.h @@ -50,13 +50,13 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE class QSettings; -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickStylePrivate +class Q_QUICKCONTROLS2_EXPORT QQuickStylePrivate { public: static QStringList stylePaths(bool resolve = false); diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp index b387b378..18f0d485 100644 --- a/src/quickcontrols2/qquickstyleplugin.cpp +++ b/src/quickcontrols2/qquickstyleplugin.cpp @@ -34,9 +34,8 @@ ** ****************************************************************************/ -#include "qquickstyleplugin_p.h" -#include "qquickstyle.h" #include "qquickstyle_p.h" +#include "qquickstyleplugin_p.h" #include #include diff --git a/src/quickcontrols2/qquickstyleplugin_p.h b/src/quickcontrols2/qquickstyleplugin_p.h index f5c5705c..7ae129d9 100644 --- a/src/quickcontrols2/qquickstyleplugin_p.h +++ b/src/quickcontrols2/qquickstyleplugin_p.h @@ -49,13 +49,13 @@ // #include -#include +#include QT_BEGIN_NAMESPACE class QQuickTheme; -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickStylePlugin : public QQmlExtensionPlugin +class Q_QUICKCONTROLS2_EXPORT QQuickStylePlugin : public QQmlExtensionPlugin { Q_OBJECT diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp deleted file mode 100644 index 911e2ae8..00000000 --- a/src/quickcontrols2/qquicktumblerview.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquicktumblerview_p.h" - -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -Q_LOGGING_CATEGORY(lcTumblerView, "qt.quick.controls.tumblerview") - -QQuickTumblerView::QQuickTumblerView(QQuickItem *parent) : - QQuickItem(parent) -{ - // We don't call createView() here because we don't know what the wrap flag is set to - // yet, and we don't want to create a view that might never get used. -} - -QVariant QQuickTumblerView::model() const -{ - return m_model; -} - -void QQuickTumblerView::setModel(const QVariant &model) -{ - qCDebug(lcTumblerView) << "setting model to:" << model << "on" - << (m_pathView ? static_cast(m_pathView) : static_cast(m_listView)); - if (model == m_model) - return; - - m_model = model; - - if (m_pathView) { - m_pathView->setModel(m_model); - } else if (m_listView) { - // QQuickItemView::setModel() resets the current index, - // but if we're still creating the Tumbler, it should be maintained. - const int oldCurrentIndex = m_listView->currentIndex(); - m_listView->setModel(m_model); - if (!isComponentComplete()) - m_listView->setCurrentIndex(oldCurrentIndex); - } - - emit modelChanged(); -} - -QQmlComponent *QQuickTumblerView::delegate() const -{ - return m_delegate; -} - -void QQuickTumblerView::setDelegate(QQmlComponent *delegate) -{ - qCDebug(lcTumblerView) << "setting delegate to:" << delegate << "on" - << (m_pathView ? static_cast(m_pathView) : static_cast(m_listView)); - if (delegate == m_delegate) - return; - - m_delegate = delegate; - - if (m_pathView) - m_pathView->setDelegate(m_delegate); - else if (m_listView) - m_listView->setDelegate(m_delegate); - - emit delegateChanged(); -} - -QQuickPath *QQuickTumblerView::path() const -{ - return m_path; -} - -void QQuickTumblerView::setPath(QQuickPath *path) -{ - if (path == m_path) - return; - - m_path = path; - emit pathChanged(); -} - -void QQuickTumblerView::createView() -{ - Q_ASSERT(m_tumbler); - - // We create a view regardless of whether or not we know - // the count yet, because we rely on the view to tell us the count. - if (m_tumbler->wrap()) { - if (m_listView) { - // It's necessary to call deleteLater() rather than delete, - // as this code is most likely being run in rensponse to a signal - // emission somewhere in the list view's internals, so we need to - // wait until that has finished. - m_listView->deleteLater(); - QQml_setParent_noEvent(m_listView, nullptr); - // The auto tests pass with unparenting the list view alone, but - // just to be sure, we unset some other things as well. - m_listView->setParentItem(nullptr); - m_listView->setVisible(false); - m_listView->setModel(QVariant()); - m_listView = nullptr; - } - - if (!m_pathView) { - qCDebug(lcTumblerView) << "creating PathView"; - - m_pathView = new QQuickPathView; - QQmlEngine::setContextForObject(m_pathView, qmlContext(this)); - QQml_setParent_noEvent(m_pathView, this); - m_pathView->setParentItem(this); - m_pathView->setPath(m_path); - m_pathView->setDelegate(m_delegate); - m_pathView->setPreferredHighlightBegin(0.5); - m_pathView->setPreferredHighlightEnd(0.5); - m_pathView->setHighlightMoveDuration(1000); - m_pathView->setClip(true); - - // Give the view a size. - updateView(); - // Set the model. - updateModel(); - - qCDebug(lcTumblerView) << "finished creating PathView"; - } - } else { - if (m_pathView) { - m_pathView->deleteLater(); - QQml_setParent_noEvent(m_pathView, nullptr); - m_pathView->setParentItem(nullptr); - m_pathView->setVisible(false); - m_pathView->setModel(QVariant()); - m_pathView = nullptr; - } - - if (!m_listView) { - qCDebug(lcTumblerView) << "creating ListView"; - - m_listView = new QQuickListView; - QQmlEngine::setContextForObject(m_listView, qmlContext(this)); - QQml_setParent_noEvent(m_listView, this); - m_listView->setParentItem(this); - m_listView->setSnapMode(QQuickListView::SnapToItem); - m_listView->setClip(true); - - // Give the view a size. - updateView(); - // Set the model. - updateModel(); - - // Set these after the model is set so that the currentItem animation - // happens instantly on startup/after switching models. If we set them too early, - // the view animates any potential currentIndex change over one second, - // which we don't want when the contentItem has just been created. - m_listView->setDelegate(m_delegate); - // Set this after setting the delegate to avoid unexpected currentIndex changes: QTBUG-79150 - m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); - m_listView->setHighlightMoveDuration(1000); - - qCDebug(lcTumblerView) << "finished creating ListView"; - } - } -} - -// Called whenever the size or visibleItemCount changes. -void QQuickTumblerView::updateView() -{ - QQuickItem *theView = view(); - if (!theView) - return; - - theView->setSize(QSizeF(width(), height())); - - // Can be called in geometryChange when it might not have a parent item yet. - if (!m_tumbler) - return; - - // Set view-specific properties that have a dependency on the size, etc. - if (m_pathView) { - m_pathView->setPathItemCount(m_tumbler->visibleItemCount() + 1); - m_pathView->setDragMargin(width() / 2); - } else { - m_listView->setPreferredHighlightBegin(height() / 2 - (height() / m_tumbler->visibleItemCount() / 2)); - m_listView->setPreferredHighlightEnd(height() / 2 + (height() / m_tumbler->visibleItemCount() / 2)); - } -} - -void QQuickTumblerView::updateModel() -{ - if (m_pathView && !m_pathView->model().isValid() && m_model.isValid()) { - // QQuickPathView::setPathItemCount() resets the offset animation, - // so we just skip the animation while constructing the view. - const int oldHighlightMoveDuration = m_pathView->highlightMoveDuration(); - m_pathView->setHighlightMoveDuration(0); - - // Setting model can change the count, which can affect the wrap, which can cause - // the current view to be deleted before setModel() is finished, which causes a crash. - // Since QQuickTumbler can't know about QQuickTumblerView, we use its private API to - // inform it that it should delay setting wrap. - QQuickTumblerPrivate *tumblerPrivate = QQuickTumblerPrivate::get(m_tumbler); - tumblerPrivate->beginSetModel(); - m_pathView->setModel(m_model); - tumblerPrivate->endSetModel(); - - // The count-depends-on-wrap behavior could cause wrap to change after - // the call above, so we must check that we're still using a PathView. - if (m_pathView) - m_pathView->setHighlightMoveDuration(oldHighlightMoveDuration); - } else if (m_listView && !m_listView->model().isValid() && m_model.isValid()) { - const int currentIndex = m_tumbler->currentIndex(); - QQuickTumblerPrivate *tumblerPrivate = QQuickTumblerPrivate::get(m_tumbler); - - // setModel() causes QQuickTumblerPrivate::_q_onViewCountChanged() to - // be called, which calls QQuickTumbler::setCurrentIndex(), - // which results in QQuickItemViewPrivate::createHighlightItem() being - // called. When the highlight item is created, - // QQuickTumblerPrivate::itemChildAdded() is notified and - // QQuickTumblerPrivate::_q_updateItemHeights() is called, which causes - // a geometry change in the item and createHighlight() is called again. - // However, since the highlight item hadn't been assigned yet in the - // previous call frame, the "if (highlight) { delete highlight; }" - // check doesn't succeed, so the item is never deleted. - // - // To avoid this, we tell QQuickTumblerPrivate to ignore signals while - // setting the model, and manually call _q_onViewCountChanged() to - // ensure the correct sequence of calls happens (_q_onViewCountChanged() - // has to be within the ignoreSignals scope, because it also generates - // recursion otherwise). - tumblerPrivate->ignoreSignals = true; - m_listView->setModel(m_model); - m_listView->setCurrentIndex(currentIndex); - - tumblerPrivate->_q_onViewCountChanged(); - tumblerPrivate->ignoreSignals = false; - } -} - -void QQuickTumblerView::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - QQuickItem::geometryChange(newGeometry, oldGeometry); - updateView(); -} - -void QQuickTumblerView::componentComplete() -{ - QQuickItem::componentComplete(); - updateView(); -} - -void QQuickTumblerView::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - QQuickItem::itemChange(change, data); - - if (change == QQuickItem::ItemParentHasChanged && data.item) { - if (m_tumbler) - m_tumbler->disconnect(this); - - m_tumbler = qobject_cast(parentItem()); - - if (m_tumbler) { - // We assume that the parentChanged() signal of the tumbler will be emitted before its wrap property is set... - connect(m_tumbler, &QQuickTumbler::wrapChanged, this, &QQuickTumblerView::createView); - connect(m_tumbler, &QQuickTumbler::visibleItemCountChanged, this, &QQuickTumblerView::updateView); - } - } -} - -QQuickItem *QQuickTumblerView::view() -{ - if (!m_tumbler) - return nullptr; - - if (m_tumbler->wrap()) - return m_pathView; - - return m_listView; -} - -QT_END_NAMESPACE - -#include "moc_qquicktumblerview_p.cpp" diff --git a/src/quickcontrols2/qquicktumblerview_p.h b/src/quickcontrols2/qquicktumblerview_p.h deleted file mode 100644 index 4e67e69b..00000000 --- a/src/quickcontrols2/qquicktumblerview_p.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKTUMBLERVIEW_P_H -#define QQUICKTUMBLERVIEW_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QQuickListView; -class QQuickPath; -class QQuickPathView; - -class QQuickTumbler; - -class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickTumblerView : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) - Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged) - -public: - QQuickTumblerView(QQuickItem *parent = nullptr); - - QVariant model() const; - void setModel(const QVariant &model); - - QQmlComponent *delegate() const; - void setDelegate(QQmlComponent *delegate); - - QQuickPath *path() const; - void setPath(QQuickPath *path); - -Q_SIGNALS: - void modelChanged(); - void delegateChanged(); - void pathChanged(); - -protected: - void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; - void componentComplete() override; - void itemChange(ItemChange change, const ItemChangeData &data) override; - -private: - QQuickItem *view(); - void createView(); - void updateView(); - void updateModel(); - - void wrapChange(); - - QQuickTumbler *m_tumbler = nullptr; - QVariant m_model; - QQmlComponent *m_delegate = nullptr; - QQuickPathView *m_pathView = nullptr; - QQuickListView *m_listView = nullptr; - QQuickPath *m_path = nullptr; -}; - -QT_END_NAMESPACE - -#endif // TUMBLERVIEW_H diff --git a/src/quickcontrols2/qtquickcontrols2global_p.h b/src/quickcontrols2/qtquickcontrols2global_p.h deleted file mode 100644 index 7a54849e..00000000 --- a/src/quickcontrols2/qtquickcontrols2global_p.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTQUICKCONTROLS2GLOBAL_P_H -#define QTQUICKCONTROLS2GLOBAL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#define Q_QUICKCONTROLS2_PRIVATE_EXPORT Q_QUICKCONTROLS2_EXPORT - -#endif // QTQUICKCONTROLS2GLOBAL_P_H diff --git a/src/quickcontrols2/quickcontrols2.pri b/src/quickcontrols2/quickcontrols2.pri deleted file mode 100644 index 2c28038f..00000000 --- a/src/quickcontrols2/quickcontrols2.pri +++ /dev/null @@ -1,41 +0,0 @@ -HEADERS += \ - $$PWD/qquickanimatednode_p.h \ - $$PWD/qquickattachedobject_p.h \ - $$PWD/qquickchecklabel_p.h \ - $$PWD/qquickclippedtext_p.h \ - $$PWD/qquickcolor_p.h \ - $$PWD/qquickcolorimage_p.h \ - $$PWD/qquickiconimage_p.h \ - $$PWD/qquickiconimage_p_p.h \ - $$PWD/qquickiconlabel_p.h \ - $$PWD/qquickiconlabel_p_p.h \ - $$PWD/qquickitemgroup_p.h \ - $$PWD/qquickmnemoniclabel_p.h \ - $$PWD/qquickpaddedrectangle_p.h \ - $$PWD/qquickplaceholdertext_p.h \ - $$PWD/qquickstyle.h \ - $$PWD/qquickstyle_p.h \ - $$PWD/qquickstyleplugin_p.h - -SOURCES += \ - $$PWD/qquickanimatednode.cpp \ - $$PWD/qquickattachedobject.cpp \ - $$PWD/qquickchecklabel.cpp \ - $$PWD/qquickclippedtext.cpp \ - $$PWD/qquickcolor.cpp \ - $$PWD/qquickcolorimage.cpp \ - $$PWD/qquickiconimage.cpp \ - $$PWD/qquickiconlabel.cpp \ - $$PWD/qquickitemgroup.cpp \ - $$PWD/qquickmnemoniclabel.cpp \ - $$PWD/qquickpaddedrectangle.cpp \ - $$PWD/qquickplaceholdertext.cpp \ - $$PWD/qquickstyle.cpp \ - $$PWD/qquickstyleplugin.cpp - -qtConfig(quick-listview):qtConfig(quick-pathview) { - HEADERS += \ - $$PWD/qquicktumblerview_p.h - SOURCES += \ - $$PWD/qquicktumblerview.cpp -} diff --git a/src/quickcontrols2/quickcontrols2.pro b/src/quickcontrols2/quickcontrols2.pro index 5a11dcd2..8c2f9cba 100644 --- a/src/quickcontrols2/quickcontrols2.pro +++ b/src/quickcontrols2/quickcontrols2.pro @@ -8,12 +8,16 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII HEADERS += \ $$PWD/qtquickcontrols2global.h \ - $$PWD/qtquickcontrols2global_p.h + $$PWD/qquickstyle.h \ + $$PWD/qquickstyle_p.h \ + $$PWD/qquickstyleplugin_p.h -include(quickcontrols2.pri) +SOURCES += \ + $$PWD/qquickstyle.cpp \ + $$PWD/qquickstyleplugin.cpp QMLTYPES_FILENAME = plugins.qmltypes -QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls.2 +QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls QML_IMPORT_NAME = QtQuick.Controls QML_IMPORT_VERSION = 2.15 CONFIG += qmltypes install_qmltypes install_metatypes diff --git a/src/quickcontrols2impl/qquickanimatednode.cpp b/src/quickcontrols2impl/qquickanimatednode.cpp new file mode 100644 index 00000000..b4e665de --- /dev/null +++ b/src/quickcontrols2impl/qquickanimatednode.cpp @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickanimatednode_p.h" + +#include +#include + +// based on qtdeclarative/examples/quick/scenegraph/threadedanimation + +QT_BEGIN_NAMESPACE + +QQuickAnimatedNode::QQuickAnimatedNode(QQuickItem *target) + : m_window(target->window()) +{ +} + +bool QQuickAnimatedNode::isRunning() const +{ + return m_running; +} + +int QQuickAnimatedNode::currentTime() const +{ + int time = m_currentTime; + if (m_running) + time += m_timer.elapsed(); + return time; +} + +void QQuickAnimatedNode::setCurrentTime(int time) +{ + m_currentTime = time; + m_timer.restart(); +} + +int QQuickAnimatedNode::duration() const +{ + return m_duration; +} + +void QQuickAnimatedNode::setDuration(int duration) +{ + m_duration = duration; +} + +int QQuickAnimatedNode::loopCount() const +{ + return m_loopCount; +} + +void QQuickAnimatedNode::setLoopCount(int count) +{ + m_loopCount = count; +} + +void QQuickAnimatedNode::sync(QQuickItem *target) +{ + Q_UNUSED(target); +} + +QQuickWindow *QQuickAnimatedNode::window() const +{ + return m_window; +} + +void QQuickAnimatedNode::start(int duration) +{ + if (m_running) + return; + + m_running = true; + m_currentLoop = 0; + m_timer.restart(); + if (duration > 0) + m_duration = duration; + + connect(m_window, &QQuickWindow::beforeRendering, this, &QQuickAnimatedNode::advance, Qt::DirectConnection); + connect(m_window, &QQuickWindow::frameSwapped, this, &QQuickAnimatedNode::update, Qt::DirectConnection); + + // If we're inside a QQuickWidget, this call is necessary to ensure the widget + // gets updated for the first time. + m_window->update(); + + emit started(); +} + +void QQuickAnimatedNode::restart() +{ + stop(); + start(); +} + +void QQuickAnimatedNode::stop() +{ + if (!m_running) + return; + + m_running = false; + disconnect(m_window, &QQuickWindow::beforeRendering, this, &QQuickAnimatedNode::advance); + disconnect(m_window, &QQuickWindow::frameSwapped, this, &QQuickAnimatedNode::update); + emit stopped(); +} + +void QQuickAnimatedNode::updateCurrentTime(int time) +{ + Q_UNUSED(time); +} + +void QQuickAnimatedNode::advance() +{ + int time = currentTime(); + if (time > m_duration) { + time = 0; + setCurrentTime(0); + + if (m_loopCount > 0 && ++m_currentLoop >= m_loopCount) { + time = m_duration; // complete + stop(); + } + } + updateCurrentTime(time); + + // If we're inside a QQuickWidget, this call is necessary to ensure the widget gets updated. + m_window->update(); +} + +void QQuickAnimatedNode::update() +{ + if (m_running) + m_window->update(); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickanimatednode_p.h b/src/quickcontrols2impl/qquickanimatednode_p.h new file mode 100644 index 00000000..e403f0bf --- /dev/null +++ b/src/quickcontrols2impl/qquickanimatednode_p.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKANIMATEDNODE_P_H +#define QQUICKANIMATEDNODE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickItem; +class QQuickWindow; + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickAnimatedNode : public QObject, public QSGTransformNode +{ + Q_OBJECT + +public: + explicit QQuickAnimatedNode(QQuickItem *target); + + bool isRunning() const; + + int currentTime() const; + void setCurrentTime(int time); + + int duration() const; + void setDuration(int duration); + + enum LoopCount { Infinite = -1 }; + + int loopCount() const; + void setLoopCount(int count); + + virtual void sync(QQuickItem *target); + + QQuickWindow *window() const; + + // must be called from sync() or updatePaintNode() + void start(int duration = 0); + void restart(); + void stop(); + +Q_SIGNALS: + void started(); + void stopped(); + +protected: + virtual void updateCurrentTime(int time); + +private Q_SLOTS: + void advance(); + void update(); + +private: + bool m_running = false; + int m_duration = 0; + int m_loopCount = 1; + int m_currentTime = 0; + int m_currentLoop = 0; + QElapsedTimer m_timer; + QQuickWindow *m_window = nullptr; +}; + +QT_END_NAMESPACE + +#endif // QQUICKANIMATEDNODE_P_H diff --git a/src/quickcontrols2impl/qquickattachedobject.cpp b/src/quickcontrols2impl/qquickattachedobject.cpp new file mode 100644 index 00000000..722f22f9 --- /dev/null +++ b/src/quickcontrols2impl/qquickattachedobject.cpp @@ -0,0 +1,274 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickattachedobject_p.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static QQuickAttachedObject *attachedObject(const QMetaObject *type, QObject *object, bool create = false) +{ + if (!object) + return nullptr; + auto func = qmlAttachedPropertiesFunction(object, type); + return qobject_cast(qmlAttachedPropertiesObject(object, func, create)); +} + +static QQuickAttachedObject *findAttachedParent(const QMetaObject *type, QObject *object) +{ + QQuickItem *item = qobject_cast(object); + if (item) { + // lookup parent items and popups + QQuickItem *parent = item->parentItem(); + while (parent) { + QQuickAttachedObject *attached = attachedObject(type, parent); + if (attached) + return attached; + + QQuickPopup *popup = qobject_cast(parent->parent()); + if (popup) + return attachedObject(type, popup); + + parent = parent->parentItem(); + } + + // fallback to item's window + QQuickAttachedObject *attached = attachedObject(type, item->window()); + if (attached) + return attached; + } else { + // lookup popup's window + QQuickPopup *popup = qobject_cast(object); + if (popup) + return attachedObject(type, popup->popupItem()->window()); + } + + // lookup parent window + QQuickWindow *window = qobject_cast(object); + if (window) { + QQuickWindow *parentWindow = qobject_cast(window->parent()); + if (parentWindow) { + QQuickAttachedObject *attached = attachedObject(type, window); + if (attached) + return attached; + } + } + + // fallback to engine (global) + if (object) { + QQmlEngine *engine = qmlEngine(object); + if (engine) { + QByteArray name = QByteArray("_q_") + type->className(); + QQuickAttachedObject *attached = engine->property(name).value(); + if (!attached) { + attached = attachedObject(type, engine, true); + engine->setProperty(name, QVariant::fromValue(attached)); + } + return attached; + } + } + + return nullptr; +} + +static QList findAttachedChildren(const QMetaObject *type, QObject *object) +{ + QList children; + + QQuickItem *item = qobject_cast(object); + if (!item) { + QQuickWindow *window = qobject_cast(object); + if (window) { + item = window->contentItem(); + + const auto &windowChildren = window->children(); + for (QObject *child : windowChildren) { + QQuickWindow *childWindow = qobject_cast(child); + if (childWindow) { + QQuickAttachedObject *attached = attachedObject(type, childWindow); + if (attached) + children += attached; + } + } + } + } + + if (item) { + const auto childItems = item->childItems(); + for (QQuickItem *child : childItems) { + QQuickAttachedObject *attached = attachedObject(type, child); + if (attached) + children += attached; + else + children += findAttachedChildren(type, child); + } + } + + return children; +} + +static QQuickItem *findAttachedItem(QObject *parent) +{ + QQuickItem *item = qobject_cast(parent); + if (!item) { + QQuickPopup *popup = qobject_cast(parent); + if (popup) + item = popup->popupItem(); + } + return item; +} + +class QQuickAttachedObjectPrivate : public QObjectPrivate, public QQuickItemChangeListener +{ + Q_DECLARE_PUBLIC(QQuickAttachedObject) + +public: + static QQuickAttachedObjectPrivate *get(QQuickAttachedObject *attachedObject) + { + return attachedObject->d_func(); + } + + void attachTo(QObject *object); + void detachFrom(QObject *object); + + void itemWindowChanged(QQuickWindow *window); + void itemParentChanged(QQuickItem *item, QQuickItem *parent) override; + + QList attachedChildren; + QPointer attachedParent; +}; + +void QQuickAttachedObjectPrivate::attachTo(QObject *object) +{ + QQuickItem *item = findAttachedItem(object); + if (item) { + connect(item, &QQuickItem::windowChanged, this, &QQuickAttachedObjectPrivate::itemWindowChanged); + QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Parent); + } +} + +void QQuickAttachedObjectPrivate::detachFrom(QObject *object) +{ + QQuickItem *item = findAttachedItem(object); + if (item) { + disconnect(item, &QQuickItem::windowChanged, this, &QQuickAttachedObjectPrivate::itemWindowChanged); + QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Parent); + } +} + +void QQuickAttachedObjectPrivate::itemWindowChanged(QQuickWindow *window) +{ + Q_Q(QQuickAttachedObject); + QQuickAttachedObject *attachedParent = nullptr; + QQuickItem *item = qobject_cast(q->sender()); + if (item) + attachedParent = findAttachedParent(q->metaObject(), item); + if (!attachedParent) + attachedParent = attachedObject(q->metaObject(), window); + q->setAttachedParent(attachedParent); +} + +void QQuickAttachedObjectPrivate::itemParentChanged(QQuickItem *item, QQuickItem *parent) +{ + Q_Q(QQuickAttachedObject); + Q_UNUSED(parent); + q->setAttachedParent(findAttachedParent(q->metaObject(), item)); +} + +QQuickAttachedObject::QQuickAttachedObject(QObject *parent) + : QObject(*(new QQuickAttachedObjectPrivate), parent) +{ + Q_D(QQuickAttachedObject); + d->attachTo(parent); +} + +QQuickAttachedObject::~QQuickAttachedObject() +{ + Q_D(QQuickAttachedObject); + d->detachFrom(parent()); + setAttachedParent(nullptr); +} + +QList QQuickAttachedObject::attachedChildren() const +{ + Q_D(const QQuickAttachedObject); + return d->attachedChildren; +} + +QQuickAttachedObject *QQuickAttachedObject::attachedParent() const +{ + Q_D(const QQuickAttachedObject); + return d->attachedParent; +} + +void QQuickAttachedObject::setAttachedParent(QQuickAttachedObject *parent) +{ + Q_D(QQuickAttachedObject); + if (d->attachedParent == parent) + return; + + QQuickAttachedObject *oldParent = d->attachedParent; + if (d->attachedParent) + QQuickAttachedObjectPrivate::get(d->attachedParent)->attachedChildren.removeOne(this); + d->attachedParent = parent; + if (parent) + QQuickAttachedObjectPrivate::get(parent)->attachedChildren.append(this); + attachedParentChange(parent, oldParent); +} + +void QQuickAttachedObject::init() +{ + QQuickAttachedObject *attachedParent = findAttachedParent(metaObject(), parent()); + if (attachedParent) + setAttachedParent(attachedParent); + + const QList attachedChildren = findAttachedChildren(metaObject(), parent()); + for (QQuickAttachedObject *child : attachedChildren) + child->setAttachedParent(this); +} + +void QQuickAttachedObject::attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) +{ + Q_UNUSED(newParent); + Q_UNUSED(oldParent); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickattachedobject_p.h b/src/quickcontrols2impl/qquickattachedobject_p.h new file mode 100644 index 00000000..cd2404c2 --- /dev/null +++ b/src/quickcontrols2impl/qquickattachedobject_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKATTACHEDOBJECT_P_H +#define QQUICKATTACHEDOBJECT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickAttachedObjectPrivate; + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickAttachedObject : public QObject +{ + Q_OBJECT + +public: + explicit QQuickAttachedObject(QObject *parent = nullptr); + ~QQuickAttachedObject(); + + QList attachedChildren() const; + + QQuickAttachedObject *attachedParent() const; + void setAttachedParent(QQuickAttachedObject *parent); + +protected: + void init(); + + virtual void attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent); + +private: + Q_DISABLE_COPY(QQuickAttachedObject) + Q_DECLARE_PRIVATE(QQuickAttachedObject) +}; + +QT_END_NAMESPACE + +#endif // QQUICKATTACHEDOBJECT_P_H diff --git a/src/quickcontrols2impl/qquickchecklabel.cpp b/src/quickcontrols2impl/qquickchecklabel.cpp new file mode 100644 index 00000000..dccbf77f --- /dev/null +++ b/src/quickcontrols2impl/qquickchecklabel.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickchecklabel_p.h" + +QT_BEGIN_NAMESPACE + +QQuickCheckLabel::QQuickCheckLabel(QQuickItem *parent) : + QQuickText(parent) +{ + setHAlign(AlignLeft); + setVAlign(AlignVCenter); + setElideMode(ElideRight); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickchecklabel_p.h b/src/quickcontrols2impl/qquickchecklabel_p.h new file mode 100644 index 00000000..823ce9df --- /dev/null +++ b/src/quickcontrols2impl/qquickchecklabel_p.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKCHECKLABEL_P_H +#define QQUICKCHECKLABEL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickCheckLabel : public QQuickText +{ + Q_OBJECT + QML_NAMED_ELEMENT(CheckLabel) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickCheckLabel(QQuickItem *parent = nullptr); +}; + +struct QQuickTextForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickText) + QML_ADDED_IN_VERSION(2, 3) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickCheckLabel) + +#endif // QQUICKCHECKLABEL_P_H diff --git a/src/quickcontrols2impl/qquickclippedtext.cpp b/src/quickcontrols2impl/qquickclippedtext.cpp new file mode 100644 index 00000000..862197f3 --- /dev/null +++ b/src/quickcontrols2impl/qquickclippedtext.cpp @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickclippedtext_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickClippedText::QQuickClippedText(QQuickItem *parent) + : QQuickText(parent) +{ +} + +qreal QQuickClippedText::clipX() const +{ + return m_clipX; +} + +void QQuickClippedText::setClipX(qreal x) +{ + if (qFuzzyCompare(x, m_clipX)) + return; + + m_clipX = x; + markClipDirty(); +} + +qreal QQuickClippedText::clipY() const +{ + return m_clipY; +} + +void QQuickClippedText::setClipY(qreal y) +{ + if (qFuzzyCompare(y, m_clipY)) + return; + + m_clipY = y; + markClipDirty(); +} + +qreal QQuickClippedText::clipWidth() const +{ + return m_clipWidth ? m_clipWidth : width(); +} + +void QQuickClippedText::setClipWidth(qreal width) +{ + m_hasClipWidth = true; + if (qFuzzyCompare(width, m_clipWidth)) + return; + + m_clipWidth = width; + markClipDirty(); +} + +qreal QQuickClippedText::clipHeight() const +{ + return m_clipHeight ? m_clipHeight : height(); +} + +void QQuickClippedText::setClipHeight(qreal height) +{ + m_hasClipHeight = true; + if (qFuzzyCompare(height, m_clipHeight)) + return; + + m_clipHeight = height; + markClipDirty(); +} + +QRectF QQuickClippedText::clipRect() const +{ + return QRectF(clipX(), clipY(), clipWidth(), clipHeight()); +} + +void QQuickClippedText::markClipDirty() +{ + QQuickItemPrivate::get(this)->dirty(QQuickItemPrivate::Size); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickclippedtext_p.h b/src/quickcontrols2impl/qquickclippedtext_p.h new file mode 100644 index 00000000..f3b011fd --- /dev/null +++ b/src/quickcontrols2impl/qquickclippedtext_p.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKCLIPPEDTEXT_P_H +#define QQUICKCLIPPEDTEXT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickClippedText : public QQuickText +{ + Q_OBJECT + Q_PROPERTY(qreal clipX READ clipX WRITE setClipX FINAL) + Q_PROPERTY(qreal clipY READ clipY WRITE setClipY FINAL) + Q_PROPERTY(qreal clipWidth READ clipWidth WRITE setClipWidth FINAL) + Q_PROPERTY(qreal clipHeight READ clipHeight WRITE setClipHeight FINAL) + QML_NAMED_ELEMENT(ClippedText) + QML_ADDED_IN_VERSION(2, 2) + +public: + explicit QQuickClippedText(QQuickItem *parent = nullptr); + + qreal clipX() const; + void setClipX(qreal x); + + qreal clipY() const; + void setClipY(qreal y); + + qreal clipWidth() const; + void setClipWidth(qreal width); + + qreal clipHeight() const; + void setClipHeight(qreal height); + + QRectF clipRect() const override; + +private: + void markClipDirty(); + + bool m_hasClipWidth = false; + bool m_hasClipHeight = false; + qreal m_clipX = 0; + qreal m_clipY = 0; + qreal m_clipWidth = 0; + qreal m_clipHeight = 0; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickClippedText) + +#endif // QQUICKCLIPPEDTEXT_P_H diff --git a/src/quickcontrols2impl/qquickcolor.cpp b/src/quickcontrols2impl/qquickcolor.cpp new file mode 100644 index 00000000..8ae568fc --- /dev/null +++ b/src/quickcontrols2impl/qquickcolor.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickcolor_p.h" + +QT_BEGIN_NAMESPACE + +QQuickColor::QQuickColor(QObject *parent) : + QObject(parent) +{ +} + +QColor QQuickColor::transparent(const QColor &color, qreal opacity) const +{ + return QColor(color.red(), color.green(), color.blue(), + int(qreal(255) * qBound(qreal(0), opacity, qreal(1)))); +} + +QColor QQuickColor::blend(const QColor &a, const QColor &b, qreal factor) const +{ + if (factor <= 0.0) + return a; + if (factor >= 1.0) + return b; + + QColor color; + color.setRedF(a.redF() * (1.0 - factor) + b.redF() * factor); + color.setGreenF(a.greenF() * (1.0 - factor) + b.greenF() * factor); + color.setBlueF(a.blueF() * (1.0 - factor) + b.blueF() * factor); + return color; +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickcolor_p.h b/src/quickcontrols2impl/qquickcolor_p.h new file mode 100644 index 00000000..cd69d0d8 --- /dev/null +++ b/src/quickcontrols2impl/qquickcolor_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKCOLOR_P_H +#define QQUICKCOLOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickColor : public QObject +{ + Q_OBJECT + QML_NAMED_ELEMENT(Color) + QML_SINGLETON + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickColor(QObject *parent = nullptr); + + Q_INVOKABLE QColor transparent(const QColor &color, qreal opacity) const; + Q_INVOKABLE QColor blend(const QColor &a, const QColor &b, qreal factor) const; +}; + +QT_END_NAMESPACE + +#endif // QQUICKCOLOR_P_H diff --git a/src/quickcontrols2impl/qquickcolorimage.cpp b/src/quickcontrols2impl/qquickcolorimage.cpp new file mode 100644 index 00000000..3afcef7e --- /dev/null +++ b/src/quickcontrols2impl/qquickcolorimage.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickcolorimage_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickColorImage::QQuickColorImage(QQuickItem *parent) + : QQuickImage(parent) +{ +} + +QColor QQuickColorImage::color() const +{ + return m_color; +} + +void QQuickColorImage::setColor(const QColor &color) +{ + if (m_color == color) + return; + + m_color = color; + if (isComponentComplete()) + load(); + emit colorChanged(); +} + +void QQuickColorImage::resetColor() +{ + setColor(Qt::transparent); +} + +QColor QQuickColorImage::defaultColor() const +{ + return m_defaultColor; +} + +void QQuickColorImage::setDefaultColor(const QColor &color) +{ + if (m_defaultColor == color) + return; + + m_defaultColor = color; + emit defaultColorChanged(); +} + +void QQuickColorImage::resetDefaultColor() +{ + setDefaultColor(Qt::transparent); +} + +void QQuickColorImage::pixmapChange() +{ + QQuickImage::pixmapChange(); + if (m_color.alpha() > 0 && m_color != m_defaultColor) { + QQuickImageBasePrivate *d = static_cast(QQuickItemPrivate::get(this)); + QImage image = d->pix.image(); + if (!image.isNull()) { + QPainter painter(&image); + painter.setCompositionMode(QPainter::CompositionMode_SourceIn); + painter.fillRect(image.rect(), m_color); + d->pix.setImage(image); + } + } +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickcolorimage_p.h b/src/quickcontrols2impl/qquickcolorimage_p.h new file mode 100644 index 00000000..faa2e42c --- /dev/null +++ b/src/quickcontrols2impl/qquickcolorimage_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKCOLORIMAGE_P_H +#define QQUICKCOLORIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickColorImage : public QQuickImage +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor NOTIFY colorChanged FINAL) + Q_PROPERTY(QColor defaultColor READ defaultColor WRITE setDefaultColor RESET resetDefaultColor NOTIFY defaultColorChanged FINAL) + QML_NAMED_ELEMENT(ColorImage) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickColorImage(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + void resetColor(); + + QColor defaultColor() const; + void setDefaultColor(const QColor &color); + void resetDefaultColor(); + +Q_SIGNALS: + void colorChanged(); + void defaultColorChanged(); + +protected: + void pixmapChange() override; + +private: + QColor m_color = Qt::transparent; + QColor m_defaultColor = Qt::transparent; +}; + +QT_END_NAMESPACE + +#endif // QQUICKCOLORIMAGE_P_H diff --git a/src/quickcontrols2impl/qquickiconimage.cpp b/src/quickcontrols2impl/qquickiconimage.cpp new file mode 100644 index 00000000..1fc3abfc --- /dev/null +++ b/src/quickcontrols2impl/qquickiconimage.cpp @@ -0,0 +1,213 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickiconimage_p.h" +#include "qquickiconimage_p_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +bool QQuickIconImagePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio) +{ + if (isThemeIcon) { + devicePixelRatio = calculateDevicePixelRatio(); + return true; + } + + return QQuickImagePrivate::updateDevicePixelRatio(targetDevicePixelRatio); +} + +void QQuickIconImagePrivate::updateIcon() +{ + Q_Q(QQuickIconImage); + // Both geometryChange() and QQuickImageBase::sourceSizeChanged() + // (which we connect to updateIcon() in the constructor) can be called as a result + // of updateIcon() changing the various sizes, so we must check that we're not recursing. + if (updatingIcon) + return; + + updatingIcon = true; + + QSize size = sourcesize; + // If no size is specified for theme icons, it will use the smallest available size. + if (size.width() <= 0) + size.setWidth(q->width()); + if (size.height() <= 0) + size.setHeight(q->height()); + + const qreal dpr = calculateDevicePixelRatio(); + const QIconLoaderEngineEntry *entry = QIconLoaderEngine::entryForSize(icon, size * dpr, qCeil(dpr)); + + if (entry) { + QQmlContext *context = qmlContext(q); + const QUrl entryUrl = QUrl::fromLocalFile(entry->filename); + url = context ? context->resolvedUrl(entryUrl) : entryUrl; + isThemeIcon = true; + } else { + url = source; + isThemeIcon = false; + } + q->load(); + + updatingIcon = false; +} + +void QQuickIconImagePrivate::updateFillMode() +{ + Q_Q(QQuickIconImage); + // If we start with a sourceSize of 28x28 and then set sourceSize.width to 24, the fillMode + // will change to PreserveAspectFit (because pixmapSize.width() > width()), which causes the + // pixmap to be reloaded at its original size of 28x28, which causes the fillMode to change + // to Pad (because pixmapSize.width() <= width()), and so on. + if (updatingFillMode) + return; + + updatingFillMode = true; + + const QSize pixmapSize = QSize(pix.width(), pix.height()) / calculateDevicePixelRatio(); + if (pixmapSize.width() > q->width() || pixmapSize.height() > q->height()) + q->setFillMode(QQuickImage::PreserveAspectFit); + else + q->setFillMode(QQuickImage::Pad); + + updatingFillMode = false; +} + +qreal QQuickIconImagePrivate::calculateDevicePixelRatio() const +{ + Q_Q(const QQuickIconImage); + return q->window() ? q->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); +} + +QQuickIconImage::QQuickIconImage(QQuickItem *parent) + : QQuickImage(*(new QQuickIconImagePrivate), parent) +{ + setFillMode(Pad); +} + +QString QQuickIconImage::name() const +{ + Q_D(const QQuickIconImage); + return d->icon.iconName; +} + +void QQuickIconImage::setName(const QString &name) +{ + Q_D(QQuickIconImage); + if (d->icon.iconName == name) + return; + + d->icon = QIconLoader::instance()->loadIcon(name); + if (isComponentComplete()) + d->updateIcon(); + emit nameChanged(); +} + +QColor QQuickIconImage::color() const +{ + Q_D(const QQuickIconImage); + return d->color; +} + +void QQuickIconImage::setColor(const QColor &color) +{ + Q_D(QQuickIconImage); + if (d->color == color) + return; + + d->color = color; + if (isComponentComplete()) + d->updateIcon(); + emit colorChanged(); +} + +void QQuickIconImage::setSource(const QUrl &source) +{ + Q_D(QQuickIconImage); + if (d->source == source) + return; + + d->source = source; + if (isComponentComplete()) + d->updateIcon(); + emit sourceChanged(source); +} + +void QQuickIconImage::componentComplete() +{ + Q_D(QQuickIconImage); + QQuickImage::componentComplete(); + d->updateIcon(); + QObjectPrivate::connect(this, &QQuickImageBase::sourceSizeChanged, d, &QQuickIconImagePrivate::updateIcon); +} + +void QQuickIconImage::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + Q_D(QQuickIconImage); + QQuickImage::geometryChange(newGeometry, oldGeometry); + if (isComponentComplete() && newGeometry.size() != oldGeometry.size()) + d->updateIcon(); +} + +void QQuickIconImage::itemChange(ItemChange change, const ItemChangeData &value) +{ + Q_D(QQuickIconImage); + if (change == ItemDevicePixelRatioHasChanged) + d->updateIcon(); + QQuickImage::itemChange(change, value); +} + +void QQuickIconImage::pixmapChange() +{ + Q_D(QQuickIconImage); + QQuickImage::pixmapChange(); + d->updateFillMode(); + + // Don't apply the color if we're recursing (updateFillMode() can cause us to recurse). + if (!d->updatingFillMode && d->color.alpha() > 0) { + QImage image = d->pix.image(); + if (!image.isNull()) { + QPainter painter(&image); + painter.setCompositionMode(QPainter::CompositionMode_SourceIn); + painter.fillRect(image.rect(), d->color); + d->pix.setImage(image); + } + } +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickiconimage_p.h b/src/quickcontrols2impl/qquickiconimage_p.h new file mode 100644 index 00000000..37891476 --- /dev/null +++ b/src/quickcontrols2impl/qquickiconimage_p.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKICONIMAGE_P_H +#define QQUICKICONIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickIconImagePrivate; + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconImage : public QQuickImage +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL) + QML_NAMED_ELEMENT(IconImage) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickIconImage(QQuickItem *parent = nullptr); + + QString name() const; + void setName(const QString &name); + + QColor color() const; + void setColor(const QColor &color); + + void setSource(const QUrl &url) override; + +Q_SIGNALS: + void nameChanged(); + void colorChanged(); + +protected: + void componentComplete() override; + void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void itemChange(ItemChange change, const ItemChangeData &value) override; + void pixmapChange() override; + +private: + Q_DISABLE_COPY(QQuickIconImage) + Q_DECLARE_PRIVATE(QQuickIconImage) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickIconImage) + +#endif // QQUICKICONIMAGE_P_H diff --git a/src/quickcontrols2impl/qquickiconimage_p_p.h b/src/quickcontrols2impl/qquickiconimage_p_p.h new file mode 100644 index 00000000..cec5956a --- /dev/null +++ b/src/quickcontrols2impl/qquickiconimage_p_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKICONIMAGE_P_P_H +#define QQUICKICONIMAGE_P_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconImagePrivate : public QQuickImagePrivate +{ + Q_DECLARE_PUBLIC(QQuickIconImage) + +public: + void updateIcon(); + void updateFillMode(); + qreal calculateDevicePixelRatio() const; + bool updateDevicePixelRatio(qreal targetDevicePixelRatio) override; + + QUrl source; + QColor color = Qt::transparent; + QThemeIconInfo icon; + bool updatingIcon = false; + bool isThemeIcon = false; + bool updatingFillMode = false; +}; + +QT_END_NAMESPACE + +#endif // QQUICKICONIMAGE_P_P_H diff --git a/src/quickcontrols2impl/qquickiconlabel.cpp b/src/quickcontrols2impl/qquickiconlabel.cpp new file mode 100644 index 00000000..d76da28f --- /dev/null +++ b/src/quickcontrols2impl/qquickiconlabel.cpp @@ -0,0 +1,642 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickiconlabel_p.h" +#include "qquickiconlabel_p_p.h" +#include "qquickiconimage_p.h" +#include "qquickmnemoniclabel_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static void beginClass(QQuickItem *item) +{ + if (QQmlParserStatus *parserStatus = qobject_cast(item)) + parserStatus->classBegin(); +} + +static void completeComponent(QQuickItem *item) +{ + if (QQmlParserStatus *parserStatus = qobject_cast(item)) + parserStatus->componentComplete(); +} + +bool QQuickIconLabelPrivate::hasIcon() const +{ + return display != QQuickIconLabel::TextOnly && !icon.isEmpty(); +} + +bool QQuickIconLabelPrivate::hasText() const +{ + return display != QQuickIconLabel::IconOnly && !text.isEmpty(); +} + +bool QQuickIconLabelPrivate::createImage() +{ + Q_Q(QQuickIconLabel); + if (image) + return false; + + image = new QQuickIconImage(q); + watchChanges(image); + beginClass(image); + image->setObjectName(QStringLiteral("image")); + image->setName(icon.name()); + image->setSource(icon.source()); + image->setSourceSize(QSize(icon.width(), icon.height())); + image->setColor(icon.color()); + image->setCache(icon.cache()); + QQmlEngine::setContextForObject(image, qmlContext(q)); + if (componentComplete) + completeComponent(image); + return true; +} + +bool QQuickIconLabelPrivate::destroyImage() +{ + if (!image) + return false; + + unwatchChanges(image); + delete image; + image = nullptr; + return true; +} + +bool QQuickIconLabelPrivate::updateImage() +{ + if (!hasIcon()) + return destroyImage(); + return createImage(); +} + +void QQuickIconLabelPrivate::syncImage() +{ + if (!image || icon.isEmpty()) + return; + + image->setName(icon.name()); + image->setSource(icon.source()); + image->setSourceSize(QSize(icon.width(), icon.height())); + image->setColor(icon.color()); + image->setCache(icon.cache()); + const int valign = alignment & Qt::AlignVertical_Mask; + image->setVerticalAlignment(static_cast(valign)); + const int halign = alignment & Qt::AlignHorizontal_Mask; + image->setHorizontalAlignment(static_cast(halign)); +} + +void QQuickIconLabelPrivate::updateOrSyncImage() +{ + if (updateImage()) { + if (componentComplete) { + updateImplicitSize(); + layout(); + } + } else { + syncImage(); + } +} + +bool QQuickIconLabelPrivate::createLabel() +{ + Q_Q(QQuickIconLabel); + if (label) + return false; + + label = new QQuickMnemonicLabel(q); + watchChanges(label); + beginClass(label); + label->setObjectName(QStringLiteral("label")); + label->setFont(font); + label->setColor(color); + label->setElideMode(QQuickText::ElideRight); + const int valign = alignment & Qt::AlignVertical_Mask; + label->setVAlign(static_cast(valign)); + const int halign = alignment & Qt::AlignHorizontal_Mask; + label->setHAlign(static_cast(halign)); + label->setText(text); + if (componentComplete) + completeComponent(label); + return true; +} + +bool QQuickIconLabelPrivate::destroyLabel() +{ + if (!label) + return false; + + unwatchChanges(label); + delete label; + label = nullptr; + return true; +} + +bool QQuickIconLabelPrivate::updateLabel() +{ + if (!hasText()) + return destroyLabel(); + return createLabel(); +} + +void QQuickIconLabelPrivate::syncLabel() +{ + if (!label) + return; + + label->setText(text); +} + +void QQuickIconLabelPrivate::updateOrSyncLabel() +{ + if (updateLabel()) { + if (componentComplete) { + updateImplicitSize(); + layout(); + } + } else { + syncLabel(); + } +} + +void QQuickIconLabelPrivate::updateImplicitSize() +{ + Q_Q(QQuickIconLabel); + const bool showIcon = image && hasIcon(); + const bool showText = label && hasText(); + const qreal horizontalPadding = leftPadding + rightPadding; + const qreal verticalPadding = topPadding + bottomPadding; + const qreal iconImplicitWidth = showIcon ? image->implicitWidth() : 0; + const qreal iconImplicitHeight = showIcon ? image->implicitHeight() : 0; + const qreal textImplicitWidth = showText ? label->implicitWidth() : 0; + const qreal textImplicitHeight = showText ? label->implicitHeight() : 0; + const qreal effectiveSpacing = showText && showIcon && image->implicitWidth() > 0 ? spacing : 0; + const qreal implicitWidth = display == QQuickIconLabel::TextBesideIcon ? iconImplicitWidth + textImplicitWidth + effectiveSpacing + : qMax(iconImplicitWidth, textImplicitWidth); + const qreal implicitHeight = display == QQuickIconLabel::TextUnderIcon ? iconImplicitHeight + textImplicitHeight + effectiveSpacing + : qMax(iconImplicitHeight, textImplicitHeight); + q->setImplicitSize(implicitWidth + horizontalPadding, implicitHeight + verticalPadding); +} + +// adapted from QStyle::alignedRect() +static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &size, const QRectF &rectangle) +{ + alignment = QGuiApplicationPrivate::visualAlignment(mirrored ? Qt::RightToLeft : Qt::LeftToRight, alignment); + qreal x = rectangle.x(); + qreal y = rectangle.y(); + const qreal w = size.width(); + const qreal h = size.height(); + if ((alignment & Qt::AlignVCenter) == Qt::AlignVCenter) + y += rectangle.height() / 2 - h / 2; + else if ((alignment & Qt::AlignBottom) == Qt::AlignBottom) + y += rectangle.height() - h; + if ((alignment & Qt::AlignRight) == Qt::AlignRight) + x += rectangle.width() - w; + else if ((alignment & Qt::AlignHCenter) == Qt::AlignHCenter) + x += rectangle.width() / 2 - w / 2; + return QRectF(x, y, w, h); +} + +void QQuickIconLabelPrivate::layout() +{ + Q_Q(QQuickIconLabel); + if (!componentComplete) + return; + + const qreal availableWidth = width - leftPadding - rightPadding; + const qreal availableHeight = height - topPadding - bottomPadding; + + switch (display) { + case QQuickIconLabel::IconOnly: + if (image) { + const QRectF iconRect = alignedRect(mirrored, alignment, + QSizeF(qMin(image->implicitWidth(), availableWidth), + qMin(image->implicitHeight(), availableHeight)), + QRectF(leftPadding, topPadding, availableWidth, availableHeight)); + image->setSize(iconRect.size()); + image->setPosition(iconRect.topLeft()); + } + break; + case QQuickIconLabel::TextOnly: + if (label) { + const QRectF textRect = alignedRect(mirrored, alignment, + QSizeF(qMin(label->implicitWidth(), availableWidth), + qMin(label->implicitHeight(), availableHeight)), + QRectF(leftPadding, topPadding, availableWidth, availableHeight)); + label->setSize(textRect.size()); + label->setPosition(textRect.topLeft()); + } + break; + + case QQuickIconLabel::TextUnderIcon: { + // Work out the sizes first, as the positions depend on them. + QSizeF iconSize; + QSizeF textSize; + if (image) { + iconSize.setWidth(qMin(image->implicitWidth(), availableWidth)); + iconSize.setHeight(qMin(image->implicitHeight(), availableHeight)); + } + qreal effectiveSpacing = 0; + if (label) { + if (!iconSize.isEmpty()) + effectiveSpacing = spacing; + textSize.setWidth(qMin(label->implicitWidth(), availableWidth)); + textSize.setHeight(qMin(label->implicitHeight(), availableHeight - iconSize.height() - effectiveSpacing)); + } + + QRectF combinedRect = alignedRect(mirrored, alignment, + QSizeF(qMax(iconSize.width(), textSize.width()), + iconSize.height() + effectiveSpacing + textSize.height()), + QRectF(leftPadding, topPadding, availableWidth, availableHeight)); + if (image) { + QRectF iconRect = alignedRect(mirrored, Qt::AlignHCenter | Qt::AlignTop, iconSize, combinedRect); + image->setSize(iconRect.size()); + image->setPosition(iconRect.topLeft()); + } + if (label) { + QRectF textRect = alignedRect(mirrored, Qt::AlignHCenter | Qt::AlignBottom, textSize, combinedRect); + label->setSize(textRect.size()); + label->setPosition(textRect.topLeft()); + } + break; + } + + case QQuickIconLabel::TextBesideIcon: + default: + // Work out the sizes first, as the positions depend on them. + QSizeF iconSize(0, 0); + QSizeF textSize(0, 0); + if (image) { + iconSize.setWidth(qMin(image->implicitWidth(), availableWidth)); + iconSize.setHeight(qMin(image->implicitHeight(), availableHeight)); + } + qreal effectiveSpacing = 0; + if (label) { + if (!iconSize.isEmpty()) + effectiveSpacing = spacing; + textSize.setWidth(qMin(label->implicitWidth(), availableWidth - iconSize.width() - effectiveSpacing)); + textSize.setHeight(qMin(label->implicitHeight(), availableHeight)); + } + + const QRectF combinedRect = alignedRect(mirrored, alignment, + QSizeF(iconSize.width() + effectiveSpacing + textSize.width(), + qMax(iconSize.height(), textSize.height())), + QRectF(leftPadding, topPadding, availableWidth, availableHeight)); + if (image) { + const QRectF iconRect = alignedRect(mirrored, Qt::AlignLeft | Qt::AlignVCenter, iconSize, combinedRect); + image->setSize(iconRect.size()); + image->setPosition(iconRect.topLeft()); + } + if (label) { + const QRectF textRect = alignedRect(mirrored, Qt::AlignRight | Qt::AlignVCenter, textSize, combinedRect); + label->setSize(textRect.size()); + label->setPosition(textRect.topLeft()); + } + break; + } + + q->setBaselineOffset(label ? label->y() + label->baselineOffset() : 0); +} + +static const QQuickItemPrivate::ChangeTypes itemChangeTypes = + QQuickItemPrivate::ImplicitWidth + | QQuickItemPrivate::ImplicitHeight + | QQuickItemPrivate::Destroyed; + +void QQuickIconLabelPrivate::watchChanges(QQuickItem *item) +{ + QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); + itemPrivate->addItemChangeListener(this, itemChangeTypes); +} + +void QQuickIconLabelPrivate::unwatchChanges(QQuickItem* item) +{ + QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); + itemPrivate->removeItemChangeListener(this, itemChangeTypes); +} + +void QQuickIconLabelPrivate::itemImplicitWidthChanged(QQuickItem *) +{ + updateImplicitSize(); + layout(); +} + +void QQuickIconLabelPrivate::itemImplicitHeightChanged(QQuickItem *) +{ + updateImplicitSize(); + layout(); +} + +void QQuickIconLabelPrivate::itemDestroyed(QQuickItem *item) +{ + unwatchChanges(item); + if (item == image) + image = nullptr; + else if (item == label) + label = nullptr; +} + +QQuickIconLabel::QQuickIconLabel(QQuickItem *parent) + : QQuickItem(*(new QQuickIconLabelPrivate), parent) +{ +} + +QQuickIconLabel::~QQuickIconLabel() +{ + Q_D(QQuickIconLabel); + if (d->image) + d->unwatchChanges(d->image); + if (d->label) + d->unwatchChanges(d->label); +} + +QQuickIcon QQuickIconLabel::icon() const +{ + Q_D(const QQuickIconLabel); + return d->icon; +} + +void QQuickIconLabel::setIcon(const QQuickIcon &icon) +{ + Q_D(QQuickIconLabel); + if (d->icon == icon) + return; + + d->icon = icon; + d->updateOrSyncImage(); +} + +QString QQuickIconLabel::text() const +{ + Q_D(const QQuickIconLabel); + return d->text; +} + +void QQuickIconLabel::setText(const QString &text) +{ + Q_D(QQuickIconLabel); + if (d->text == text) + return; + + d->text = text; + d->updateOrSyncLabel(); +} + +QFont QQuickIconLabel::font() const +{ + Q_D(const QQuickIconLabel); + return d->font; +} + +void QQuickIconLabel::setFont(const QFont &font) +{ + Q_D(QQuickIconLabel); + if (d->font == font) + return; + + d->font = font; + if (d->label) + d->label->setFont(font); +} + +QColor QQuickIconLabel::color() const +{ + Q_D(const QQuickIconLabel); + return d->color; +} + +void QQuickIconLabel::setColor(const QColor &color) +{ + Q_D(QQuickIconLabel); + if (d->color == color) + return; + + d->color = color; + if (d->label) + d->label->setColor(color); +} + +QQuickIconLabel::Display QQuickIconLabel::display() const +{ + Q_D(const QQuickIconLabel); + return d->display; +} + +void QQuickIconLabel::setDisplay(Display display) +{ + Q_D(QQuickIconLabel); + if (d->display == display) + return; + + d->display = display; + d->updateImage(); + d->updateLabel(); + d->updateImplicitSize(); + d->layout(); +} + +qreal QQuickIconLabel::spacing() const +{ + Q_D(const QQuickIconLabel); + return d->spacing; +} + +void QQuickIconLabel::setSpacing(qreal spacing) +{ + Q_D(QQuickIconLabel); + if (qFuzzyCompare(d->spacing, spacing)) + return; + + d->spacing = spacing; + if (d->image && d->label) { + d->updateImplicitSize(); + d->layout(); + } +} + +bool QQuickIconLabel::isMirrored() const +{ + Q_D(const QQuickIconLabel); + return d->mirrored; +} + +void QQuickIconLabel::setMirrored(bool mirrored) +{ + Q_D(QQuickIconLabel); + if (d->mirrored == mirrored) + return; + + d->mirrored = mirrored; + d->layout(); +} + +Qt::Alignment QQuickIconLabel::alignment() const +{ + Q_D(const QQuickIconLabel); + return d->alignment; +} + +void QQuickIconLabel::setAlignment(Qt::Alignment alignment) +{ + Q_D(QQuickIconLabel); + const int valign = alignment & Qt::AlignVertical_Mask; + const int halign = alignment & Qt::AlignHorizontal_Mask; + const uint align = (valign ? valign : Qt::AlignVCenter) | (halign ? halign : Qt::AlignHCenter); + if (d->alignment == align) + return; + + d->alignment = static_cast(align); + if (d->label) { + d->label->setVAlign(static_cast(valign)); + d->label->setHAlign(static_cast(halign)); + } + if (d->image) { + d->image->setVerticalAlignment(static_cast(valign)); + d->image->setHorizontalAlignment(static_cast(halign)); + } + d->layout(); +} + +qreal QQuickIconLabel::topPadding() const +{ + Q_D(const QQuickIconLabel); + return d->topPadding; +} + +void QQuickIconLabel::setTopPadding(qreal padding) +{ + Q_D(QQuickIconLabel); + if (qFuzzyCompare(d->topPadding, padding)) + return; + + d->topPadding = padding; + d->updateImplicitSize(); + d->layout(); +} + +void QQuickIconLabel::resetTopPadding() +{ + setTopPadding(0); +} + +qreal QQuickIconLabel::leftPadding() const +{ + Q_D(const QQuickIconLabel); + return d->leftPadding; +} + +void QQuickIconLabel::setLeftPadding(qreal padding) +{ + Q_D(QQuickIconLabel); + if (qFuzzyCompare(d->leftPadding, padding)) + return; + + d->leftPadding = padding; + d->updateImplicitSize(); + d->layout(); +} + +void QQuickIconLabel::resetLeftPadding() +{ + setLeftPadding(0); +} + +qreal QQuickIconLabel::rightPadding() const +{ + Q_D(const QQuickIconLabel); + return d->rightPadding; +} + +void QQuickIconLabel::setRightPadding(qreal padding) +{ + Q_D(QQuickIconLabel); + if (qFuzzyCompare(d->rightPadding, padding)) + return; + + d->rightPadding = padding; + d->updateImplicitSize(); + d->layout(); +} + +void QQuickIconLabel::resetRightPadding() +{ + setRightPadding(0); +} + +qreal QQuickIconLabel::bottomPadding() const +{ + Q_D(const QQuickIconLabel); + return d->bottomPadding; +} + +void QQuickIconLabel::setBottomPadding(qreal padding) +{ + Q_D(QQuickIconLabel); + if (qFuzzyCompare(d->bottomPadding, padding)) + return; + + d->bottomPadding = padding; + d->updateImplicitSize(); + d->layout(); +} + +void QQuickIconLabel::resetBottomPadding() +{ + setBottomPadding(0); +} + +void QQuickIconLabel::componentComplete() +{ + Q_D(QQuickIconLabel); + if (d->image) + completeComponent(d->image); + if (d->label) + completeComponent(d->label); + QQuickItem::componentComplete(); + d->layout(); +} + +void QQuickIconLabel::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + Q_D(QQuickIconLabel); + QQuickItem::geometryChange(newGeometry, oldGeometry); + d->layout(); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickiconlabel_p.h b/src/quickcontrols2impl/qquickiconlabel_p.h new file mode 100644 index 00000000..1ea0affb --- /dev/null +++ b/src/quickcontrols2impl/qquickiconlabel_p.h @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKICONLABEL_P_H +#define QQUICKICONLABEL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickIconLabelPrivate; + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconLabel : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon FINAL) + Q_PROPERTY(QString text READ text WRITE setText FINAL) + Q_PROPERTY(QFont font READ font WRITE setFont FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(Display display READ display WRITE setDisplay FINAL) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing FINAL) + Q_PROPERTY(bool mirrored READ isMirrored WRITE setMirrored FINAL) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment FINAL) + Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding FINAL) + Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding FINAL) + Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding FINAL) + Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding FINAL) + QML_NAMED_ELEMENT(IconLabel) + QML_ADDED_IN_VERSION(2, 3) + +public: + enum Display { + IconOnly, + TextOnly, + TextBesideIcon, + TextUnderIcon + }; + Q_ENUM(Display) + + explicit QQuickIconLabel(QQuickItem *parent = nullptr); + ~QQuickIconLabel(); + + QQuickIcon icon() const; + void setIcon(const QQuickIcon &icon); + + QString text() const; + void setText(const QString &text); + + QFont font() const; + void setFont(const QFont &font); + + QColor color() const; + void setColor(const QColor &color); + + Display display() const; + void setDisplay(Display display); + + qreal spacing() const; + void setSpacing(qreal spacing); + + bool isMirrored() const; + void setMirrored(bool mirrored); + + Qt::Alignment alignment() const; + void setAlignment(Qt::Alignment alignment); + + qreal topPadding() const; + void setTopPadding(qreal padding); + void resetTopPadding(); + + qreal leftPadding() const; + void setLeftPadding(qreal padding); + void resetLeftPadding(); + + qreal rightPadding() const; + void setRightPadding(qreal padding); + void resetRightPadding(); + + qreal bottomPadding() const; + void setBottomPadding(qreal padding); + void resetBottomPadding(); + +protected: + void componentComplete() override; + void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; + +private: + Q_DISABLE_COPY(QQuickIconLabel) + Q_DECLARE_PRIVATE(QQuickIconLabel) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickIconLabel) + +#endif // QQUICKICONLABEL_P_H diff --git a/src/quickcontrols2impl/qquickiconlabel_p_p.h b/src/quickcontrols2impl/qquickiconlabel_p_p.h new file mode 100644 index 00000000..18cefe53 --- /dev/null +++ b/src/quickcontrols2impl/qquickiconlabel_p_p.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKICONLABEL_P_P_H +#define QQUICKICONLABEL_P_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickIconImage; +class QQuickMnemonicLabel; + +class QQuickIconLabelPrivate : public QQuickItemPrivate, public QQuickItemChangeListener +{ + Q_DECLARE_PUBLIC(QQuickIconLabel) + +public: + bool hasIcon() const; + bool hasText() const; + + bool createImage(); + bool destroyImage(); + bool updateImage(); + void syncImage(); + void updateOrSyncImage(); + + bool createLabel(); + bool destroyLabel(); + bool updateLabel(); + void syncLabel(); + void updateOrSyncLabel(); + + void updateImplicitSize(); + void layout(); + + void watchChanges(QQuickItem *item); + void unwatchChanges(QQuickItem *item); + void setPositioningDirty(); + + bool isLeftToRight() const; + + void itemImplicitWidthChanged(QQuickItem *) override; + void itemImplicitHeightChanged(QQuickItem *) override; + void itemDestroyed(QQuickItem *item) override; + + bool mirrored = false; + QQuickIconLabel::Display display = QQuickIconLabel::TextBesideIcon; + Qt::Alignment alignment = Qt::AlignCenter; + qreal spacing = 0; + qreal topPadding = 0; + qreal leftPadding = 0; + qreal rightPadding = 0; + qreal bottomPadding = 0; + QFont font; + QColor color; + QString text; + QQuickIcon icon; + QQuickIconImage *image = nullptr; + QQuickMnemonicLabel *label = nullptr; +}; + +QT_END_NAMESPACE + +#endif // QQUICKICONLABEL_P_P_H diff --git a/src/quickcontrols2impl/qquickitemgroup.cpp b/src/quickcontrols2impl/qquickitemgroup.cpp new file mode 100644 index 00000000..c4307001 --- /dev/null +++ b/src/quickcontrols2impl/qquickitemgroup.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickitemgroup_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickItemGroup::QQuickItemGroup(QQuickItem *parent) + : QQuickImplicitSizeItem(*(new QQuickImplicitSizeItemPrivate), parent) +{ +} + +QQuickItemGroup::~QQuickItemGroup() +{ + const auto children = childItems(); + for (QQuickItem *child : children) + unwatch(child); +} + +void QQuickItemGroup::watch(QQuickItem *item) +{ + QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); +} + +void QQuickItemGroup::unwatch(QQuickItem *item) +{ + QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); +} + +QSizeF QQuickItemGroup::calculateImplicitSize() const +{ + qreal width = 0; + qreal height = 0; + const auto children = childItems(); + for (QQuickItem *child : children) { + width = qMax(width, child->implicitWidth()); + height = qMax(height, child->implicitHeight()); + } + return QSizeF(width, height); +} + +void QQuickItemGroup::updateImplicitSize() +{ + QSizeF size = calculateImplicitSize(); + setImplicitSize(size.width(), size.height()); +} + +void QQuickItemGroup::itemChange(ItemChange change, const ItemChangeData &data) +{ + QQuickImplicitSizeItem::itemChange(change, data); + switch (change) { + case ItemChildAddedChange: + watch(data.item); + data.item->setSize(QSizeF(width(), height())); + updateImplicitSize(); + break; + case ItemChildRemovedChange: + unwatch(data.item); + updateImplicitSize(); + break; + default: + break; + } +} + +void QQuickItemGroup::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + QQuickImplicitSizeItem::geometryChange(newGeometry, oldGeometry); + + if (newGeometry.size() != oldGeometry.size()) { + const auto children = childItems(); + for (QQuickItem *child : children) + child->setSize(newGeometry.size()); + } +} + +void QQuickItemGroup::itemImplicitWidthChanged(QQuickItem *) +{ + setImplicitWidth(calculateImplicitSize().width()); +} + +void QQuickItemGroup::itemImplicitHeightChanged(QQuickItem *) +{ + setImplicitHeight(calculateImplicitSize().height()); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickitemgroup_p.h b/src/quickcontrols2impl/qquickitemgroup_p.h new file mode 100644 index 00000000..9c04a990 --- /dev/null +++ b/src/quickcontrols2impl/qquickitemgroup_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKITEMGROUP_P_H +#define QQUICKITEMGROUP_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickItemGroup : public QQuickImplicitSizeItem, protected QQuickItemChangeListener +{ + Q_OBJECT + QML_NAMED_ELEMENT(ItemGroup) + QML_ADDED_IN_VERSION(2, 2) + +public: + explicit QQuickItemGroup(QQuickItem *parent = nullptr); + ~QQuickItemGroup(); + +protected: + void watch(QQuickItem *item); + void unwatch(QQuickItem *item); + + QSizeF calculateImplicitSize() const; + void updateImplicitSize(); + + void itemChange(ItemChange change, const ItemChangeData &data) override; + void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; + + void itemImplicitWidthChanged(QQuickItem *item) override; + void itemImplicitHeightChanged(QQuickItem *item) override; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickItemGroup) + +#endif // QQUICKITEMGROUP_P_H diff --git a/src/quickcontrols2impl/qquickmnemoniclabel.cpp b/src/quickcontrols2impl/qquickmnemoniclabel.cpp new file mode 100644 index 00000000..309d076a --- /dev/null +++ b/src/quickcontrols2impl/qquickmnemoniclabel.cpp @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickmnemoniclabel_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickMnemonicLabel::QQuickMnemonicLabel(QQuickItem *parent) + : QQuickText(parent) +{ +} + +QString QQuickMnemonicLabel::text() const +{ + return m_fullText; +} + +void QQuickMnemonicLabel::setText(const QString &text) +{ + if (m_fullText == text) + return; + + m_fullText = text; + updateMnemonic(); +} + +bool QQuickMnemonicLabel::isMnemonicVisible() const +{ + return m_mnemonicVisible; +} + +void QQuickMnemonicLabel::setMnemonicVisible(bool visible) +{ + if (m_mnemonicVisible == visible) + return; + + m_mnemonicVisible = visible; + updateMnemonic(); + + if (isComponentComplete()) + forceLayout(); +} + +static QTextLayout::FormatRange underlineRange(int start, int length = 1) +{ + QTextLayout::FormatRange range; + range.start = start; + range.length = length; + range.format.setFontUnderline(true); + return range; +} + +// based on QPlatformTheme::removeMnemonics() +void QQuickMnemonicLabel::updateMnemonic() +{ + QString text(m_fullText.size(), QChar::Null); + int idx = 0; + int pos = 0; + int len = m_fullText.length(); + QList formats; + while (len) { + if (m_fullText.at(pos) == QLatin1Char('&') && (len == 1 || m_fullText.at(pos + 1) != QLatin1Char('&'))) { + if (m_mnemonicVisible && (pos == 0 || m_fullText.at(pos - 1) != QLatin1Char('&'))) + formats += underlineRange(pos); + ++pos; + --len; + if (len == 0) + break; + } else if (m_fullText.at(pos) == QLatin1Char('(') && len >= 4 && + m_fullText.at(pos + 1) == QLatin1Char('&') && + m_fullText.at(pos + 2) != QLatin1Char('&') && + m_fullText.at(pos + 3) == QLatin1Char(')')) { + // a mnemonic with format "\s*(&X)" + if (m_mnemonicVisible) { + formats += underlineRange(pos + 1); + } else { + int n = 0; + while (idx > n && text.at(idx - n - 1).isSpace()) + ++n; + idx -= n; + pos += 4; + len -= 4; + continue; + } + } + text[idx] = m_fullText.at(pos); + ++pos; + ++idx; + --len; + } + text.truncate(idx); + + QQuickTextPrivate::get(this)->layout.setFormats(formats); + QQuickText::setText(text); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickmnemoniclabel_p.h b/src/quickcontrols2impl/qquickmnemoniclabel_p.h new file mode 100644 index 00000000..69ddbfb1 --- /dev/null +++ b/src/quickcontrols2impl/qquickmnemoniclabel_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKMNEMONICLABEL_P_H +#define QQUICKMNEMONICLABEL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickMnemonicLabel : public QQuickText +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText FINAL) + Q_PROPERTY(bool mnemonicVisible READ isMnemonicVisible WRITE setMnemonicVisible FINAL) + QML_NAMED_ELEMENT(MnemonicLabel) + QML_ADDED_IN_VERSION(2, 3) + +public: + explicit QQuickMnemonicLabel(QQuickItem *parent = nullptr); + + QString text() const; + void setText(const QString &text); + + bool isMnemonicVisible() const; + void setMnemonicVisible(bool visible); + +private: + void updateMnemonic(); + + bool m_mnemonicVisible = true; + QString m_fullText; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickMnemonicLabel) + +#endif // QQUICKMNEMONICLABEL_P_H diff --git a/src/quickcontrols2impl/qquickpaddedrectangle.cpp b/src/quickcontrols2impl/qquickpaddedrectangle.cpp new file mode 100644 index 00000000..fd9e9d90 --- /dev/null +++ b/src/quickcontrols2impl/qquickpaddedrectangle.cpp @@ -0,0 +1,211 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickpaddedrectangle_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickPaddedRectangle::QQuickPaddedRectangle(QQuickItem *parent) : + QQuickRectangle(parent) +{ +} + +qreal QQuickPaddedRectangle::padding() const +{ + return m_padding; +} + +void QQuickPaddedRectangle::setPadding(qreal padding) +{ + if (!qFuzzyCompare(m_padding, padding)) { + m_padding = padding; + update(); + emit paddingChanged(); + if (m_hasTopPadding) + emit topPaddingChanged(); + if (!m_hasLeftPadding) + emit leftPaddingChanged(); + if (!m_hasRightPadding) + emit rightPaddingChanged(); + if (!m_hasBottomPadding) + emit bottomPaddingChanged(); + } +} + +void QQuickPaddedRectangle::resetPadding() +{ + setPadding(0); +} + +qreal QQuickPaddedRectangle::topPadding() const +{ + return m_hasTopPadding ? m_topPadding : m_padding; +} + +void QQuickPaddedRectangle::setTopPadding(qreal padding) +{ + setTopPadding(padding, true); +} + +void QQuickPaddedRectangle::resetTopPadding() +{ + setTopPadding(0, false); +} + +qreal QQuickPaddedRectangle::leftPadding() const +{ + return m_hasLeftPadding ? m_leftPadding : m_padding; +} + +void QQuickPaddedRectangle::setLeftPadding(qreal padding) +{ + setLeftPadding(padding, true); +} + +void QQuickPaddedRectangle::resetLeftPadding() +{ + setLeftPadding(0, false); +} + +qreal QQuickPaddedRectangle::rightPadding() const +{ + return m_hasRightPadding ? m_rightPadding : m_padding; +} + +void QQuickPaddedRectangle::setRightPadding(qreal padding) +{ + setRightPadding(padding, true); +} + +void QQuickPaddedRectangle::resetRightPadding() +{ + setRightPadding(0, false); +} + +qreal QQuickPaddedRectangle::bottomPadding() const +{ + return m_hasBottomPadding ? m_bottomPadding : m_padding; +} + +void QQuickPaddedRectangle::setBottomPadding(qreal padding) +{ + setBottomPadding(padding, true); +} + +void QQuickPaddedRectangle::resetBottomPadding() +{ + setBottomPadding(0, false); +} + +void QQuickPaddedRectangle::setTopPadding(qreal padding, bool has) +{ + qreal oldPadding = topPadding(); + m_hasTopPadding = has; + m_topPadding = padding; + if (!qFuzzyCompare(oldPadding, padding)) { + update(); + emit topPaddingChanged(); + } +} + +void QQuickPaddedRectangle::setLeftPadding(qreal padding, bool has) +{ + qreal oldPadding = leftPadding(); + m_hasLeftPadding = has; + m_leftPadding = padding; + if (!qFuzzyCompare(oldPadding, padding)) { + update(); + emit leftPaddingChanged(); + } +} + +void QQuickPaddedRectangle::setRightPadding(qreal padding, bool has) +{ + qreal oldPadding = rightPadding(); + m_hasRightPadding = has; + m_rightPadding = padding; + if (!qFuzzyCompare(oldPadding, padding)) { + update(); + emit rightPaddingChanged(); + } +} + +void QQuickPaddedRectangle::setBottomPadding(qreal padding, bool has) +{ + qreal oldPadding = bottomPadding(); + m_hasBottomPadding = has; + m_bottomPadding = padding; + if (!qFuzzyCompare(oldPadding, padding)) { + update(); + emit bottomPaddingChanged(); + } +} + +QSGNode *QQuickPaddedRectangle::updatePaintNode(QSGNode *node, UpdatePaintNodeData *data) +{ + QSGTransformNode *transformNode = static_cast(node); + if (!transformNode) + transformNode = new QSGTransformNode; + + QSGInternalRectangleNode *rectNode = static_cast(QQuickRectangle::updatePaintNode(transformNode->firstChild(), data)); + + if (rectNode) { + if (!transformNode->firstChild()) + transformNode->appendChildNode(rectNode); + + qreal top = topPadding(); + qreal left = leftPadding(); + qreal right = rightPadding(); + qreal bottom = bottomPadding(); + + if (!qFuzzyIsNull(top) || !qFuzzyIsNull(left) || !qFuzzyIsNull(right) || !qFuzzyIsNull(bottom)) { + QMatrix4x4 m; + m.translate(left, top); + transformNode->setMatrix(m); + + qreal w = qMax(0.0, width() -left-right); + qreal h = qMax(0.0, height() -top-bottom); + + rectNode->setRect(QRectF(0, 0, w, h)); + rectNode->update(); + } + } + return transformNode; +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickpaddedrectangle_p.h b/src/quickcontrols2impl/qquickpaddedrectangle_p.h new file mode 100644 index 00000000..27743270 --- /dev/null +++ b/src/quickcontrols2impl/qquickpaddedrectangle_p.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKPADDEDRECTANGLE_P_H +#define QQUICKPADDEDRECTANGLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickPaddedRectangle : public QQuickRectangle +{ + Q_OBJECT + Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged FINAL) + Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged FINAL) + Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged FINAL) + Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged FINAL) + Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged FINAL) + QML_NAMED_ELEMENT(PaddedRectangle) + QML_ADDED_IN_VERSION(2, 0) + +public: + QQuickPaddedRectangle(QQuickItem *parent = nullptr); + + qreal padding() const; + void setPadding(qreal padding); + void resetPadding(); + + qreal topPadding() const; + void setTopPadding(qreal padding); + void resetTopPadding(); + + qreal leftPadding() const; + void setLeftPadding(qreal padding); + void resetLeftPadding(); + + qreal rightPadding() const; + void setRightPadding(qreal padding); + void resetRightPadding(); + + qreal bottomPadding() const; + void setBottomPadding(qreal padding); + void resetBottomPadding(); + +Q_SIGNALS: + void paddingChanged(); + void topPaddingChanged(); + void leftPaddingChanged(); + void rightPaddingChanged(); + void bottomPaddingChanged(); + +protected: + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; + +private: + void setTopPadding(qreal padding, bool has); + void setLeftPadding(qreal padding, bool has); + void setRightPadding(qreal padding, bool has); + void setBottomPadding(qreal padding, bool has); + + qreal m_padding = 0; + qreal m_topPadding = 0; + qreal m_leftPadding = 0; + qreal m_rightPadding = 0; + qreal m_bottomPadding = 0; + bool m_hasTopPadding = false; + bool m_hasLeftPadding = false; + bool m_hasRightPadding = false; + bool m_hasBottomPadding = false; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickPaddedRectangle) + +#endif // QQUICKPADDEDRECTANGLE_P_H diff --git a/src/quickcontrols2impl/qquickplaceholdertext.cpp b/src/quickcontrols2impl/qquickplaceholdertext.cpp new file mode 100644 index 00000000..2fe6be07 --- /dev/null +++ b/src/quickcontrols2impl/qquickplaceholdertext.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickplaceholdertext_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QQuickPlaceholderText::QQuickPlaceholderText(QQuickItem *parent) : QQuickText(parent) +{ +} + +void QQuickPlaceholderText::componentComplete() +{ + QQuickText::componentComplete(); + connect(parentItem(), SIGNAL(effectiveHorizontalAlignmentChanged()), this, SLOT(updateAlignment())); + updateAlignment(); +} + +void QQuickPlaceholderText::updateAlignment() +{ + if (QQuickTextInput *input = qobject_cast(parentItem())) { + if (QQuickTextInputPrivate::get(input)->hAlignImplicit) + resetHAlign(); + else + setHAlign(static_cast(input->hAlign())); + } else if (QQuickTextEdit *edit = qobject_cast(parentItem())) { + if (QQuickTextEditPrivate::get(edit)->hAlignImplicit) + resetHAlign(); + else + setHAlign(static_cast(edit->hAlign())); + } else { + resetHAlign(); + } +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qquickplaceholdertext_p.h b/src/quickcontrols2impl/qquickplaceholdertext_p.h new file mode 100644 index 00000000..0beccd72 --- /dev/null +++ b/src/quickcontrols2impl/qquickplaceholdertext_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKPLACEHOLDERTEXT_P_H +#define QQUICKPLACEHOLDERTEXT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickPlaceholderText : public QQuickText +{ + Q_OBJECT + QML_NAMED_ELEMENT(PlaceholderText) + QML_ADDED_IN_VERSION(2, 2) + +public: + explicit QQuickPlaceholderText(QQuickItem *parent = nullptr); + +protected: + void componentComplete() override; + +private Q_SLOTS: + void updateAlignment(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickPlaceholderText) + +#endif // QQUICKPLACEHOLDERTEXT_P_H diff --git a/src/quickcontrols2impl/qquicktumblerview.cpp b/src/quickcontrols2impl/qquicktumblerview.cpp new file mode 100644 index 00000000..911e2ae8 --- /dev/null +++ b/src/quickcontrols2impl/qquicktumblerview.cpp @@ -0,0 +1,320 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquicktumblerview_p.h" + +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +Q_LOGGING_CATEGORY(lcTumblerView, "qt.quick.controls.tumblerview") + +QQuickTumblerView::QQuickTumblerView(QQuickItem *parent) : + QQuickItem(parent) +{ + // We don't call createView() here because we don't know what the wrap flag is set to + // yet, and we don't want to create a view that might never get used. +} + +QVariant QQuickTumblerView::model() const +{ + return m_model; +} + +void QQuickTumblerView::setModel(const QVariant &model) +{ + qCDebug(lcTumblerView) << "setting model to:" << model << "on" + << (m_pathView ? static_cast(m_pathView) : static_cast(m_listView)); + if (model == m_model) + return; + + m_model = model; + + if (m_pathView) { + m_pathView->setModel(m_model); + } else if (m_listView) { + // QQuickItemView::setModel() resets the current index, + // but if we're still creating the Tumbler, it should be maintained. + const int oldCurrentIndex = m_listView->currentIndex(); + m_listView->setModel(m_model); + if (!isComponentComplete()) + m_listView->setCurrentIndex(oldCurrentIndex); + } + + emit modelChanged(); +} + +QQmlComponent *QQuickTumblerView::delegate() const +{ + return m_delegate; +} + +void QQuickTumblerView::setDelegate(QQmlComponent *delegate) +{ + qCDebug(lcTumblerView) << "setting delegate to:" << delegate << "on" + << (m_pathView ? static_cast(m_pathView) : static_cast(m_listView)); + if (delegate == m_delegate) + return; + + m_delegate = delegate; + + if (m_pathView) + m_pathView->setDelegate(m_delegate); + else if (m_listView) + m_listView->setDelegate(m_delegate); + + emit delegateChanged(); +} + +QQuickPath *QQuickTumblerView::path() const +{ + return m_path; +} + +void QQuickTumblerView::setPath(QQuickPath *path) +{ + if (path == m_path) + return; + + m_path = path; + emit pathChanged(); +} + +void QQuickTumblerView::createView() +{ + Q_ASSERT(m_tumbler); + + // We create a view regardless of whether or not we know + // the count yet, because we rely on the view to tell us the count. + if (m_tumbler->wrap()) { + if (m_listView) { + // It's necessary to call deleteLater() rather than delete, + // as this code is most likely being run in rensponse to a signal + // emission somewhere in the list view's internals, so we need to + // wait until that has finished. + m_listView->deleteLater(); + QQml_setParent_noEvent(m_listView, nullptr); + // The auto tests pass with unparenting the list view alone, but + // just to be sure, we unset some other things as well. + m_listView->setParentItem(nullptr); + m_listView->setVisible(false); + m_listView->setModel(QVariant()); + m_listView = nullptr; + } + + if (!m_pathView) { + qCDebug(lcTumblerView) << "creating PathView"; + + m_pathView = new QQuickPathView; + QQmlEngine::setContextForObject(m_pathView, qmlContext(this)); + QQml_setParent_noEvent(m_pathView, this); + m_pathView->setParentItem(this); + m_pathView->setPath(m_path); + m_pathView->setDelegate(m_delegate); + m_pathView->setPreferredHighlightBegin(0.5); + m_pathView->setPreferredHighlightEnd(0.5); + m_pathView->setHighlightMoveDuration(1000); + m_pathView->setClip(true); + + // Give the view a size. + updateView(); + // Set the model. + updateModel(); + + qCDebug(lcTumblerView) << "finished creating PathView"; + } + } else { + if (m_pathView) { + m_pathView->deleteLater(); + QQml_setParent_noEvent(m_pathView, nullptr); + m_pathView->setParentItem(nullptr); + m_pathView->setVisible(false); + m_pathView->setModel(QVariant()); + m_pathView = nullptr; + } + + if (!m_listView) { + qCDebug(lcTumblerView) << "creating ListView"; + + m_listView = new QQuickListView; + QQmlEngine::setContextForObject(m_listView, qmlContext(this)); + QQml_setParent_noEvent(m_listView, this); + m_listView->setParentItem(this); + m_listView->setSnapMode(QQuickListView::SnapToItem); + m_listView->setClip(true); + + // Give the view a size. + updateView(); + // Set the model. + updateModel(); + + // Set these after the model is set so that the currentItem animation + // happens instantly on startup/after switching models. If we set them too early, + // the view animates any potential currentIndex change over one second, + // which we don't want when the contentItem has just been created. + m_listView->setDelegate(m_delegate); + // Set this after setting the delegate to avoid unexpected currentIndex changes: QTBUG-79150 + m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); + m_listView->setHighlightMoveDuration(1000); + + qCDebug(lcTumblerView) << "finished creating ListView"; + } + } +} + +// Called whenever the size or visibleItemCount changes. +void QQuickTumblerView::updateView() +{ + QQuickItem *theView = view(); + if (!theView) + return; + + theView->setSize(QSizeF(width(), height())); + + // Can be called in geometryChange when it might not have a parent item yet. + if (!m_tumbler) + return; + + // Set view-specific properties that have a dependency on the size, etc. + if (m_pathView) { + m_pathView->setPathItemCount(m_tumbler->visibleItemCount() + 1); + m_pathView->setDragMargin(width() / 2); + } else { + m_listView->setPreferredHighlightBegin(height() / 2 - (height() / m_tumbler->visibleItemCount() / 2)); + m_listView->setPreferredHighlightEnd(height() / 2 + (height() / m_tumbler->visibleItemCount() / 2)); + } +} + +void QQuickTumblerView::updateModel() +{ + if (m_pathView && !m_pathView->model().isValid() && m_model.isValid()) { + // QQuickPathView::setPathItemCount() resets the offset animation, + // so we just skip the animation while constructing the view. + const int oldHighlightMoveDuration = m_pathView->highlightMoveDuration(); + m_pathView->setHighlightMoveDuration(0); + + // Setting model can change the count, which can affect the wrap, which can cause + // the current view to be deleted before setModel() is finished, which causes a crash. + // Since QQuickTumbler can't know about QQuickTumblerView, we use its private API to + // inform it that it should delay setting wrap. + QQuickTumblerPrivate *tumblerPrivate = QQuickTumblerPrivate::get(m_tumbler); + tumblerPrivate->beginSetModel(); + m_pathView->setModel(m_model); + tumblerPrivate->endSetModel(); + + // The count-depends-on-wrap behavior could cause wrap to change after + // the call above, so we must check that we're still using a PathView. + if (m_pathView) + m_pathView->setHighlightMoveDuration(oldHighlightMoveDuration); + } else if (m_listView && !m_listView->model().isValid() && m_model.isValid()) { + const int currentIndex = m_tumbler->currentIndex(); + QQuickTumblerPrivate *tumblerPrivate = QQuickTumblerPrivate::get(m_tumbler); + + // setModel() causes QQuickTumblerPrivate::_q_onViewCountChanged() to + // be called, which calls QQuickTumbler::setCurrentIndex(), + // which results in QQuickItemViewPrivate::createHighlightItem() being + // called. When the highlight item is created, + // QQuickTumblerPrivate::itemChildAdded() is notified and + // QQuickTumblerPrivate::_q_updateItemHeights() is called, which causes + // a geometry change in the item and createHighlight() is called again. + // However, since the highlight item hadn't been assigned yet in the + // previous call frame, the "if (highlight) { delete highlight; }" + // check doesn't succeed, so the item is never deleted. + // + // To avoid this, we tell QQuickTumblerPrivate to ignore signals while + // setting the model, and manually call _q_onViewCountChanged() to + // ensure the correct sequence of calls happens (_q_onViewCountChanged() + // has to be within the ignoreSignals scope, because it also generates + // recursion otherwise). + tumblerPrivate->ignoreSignals = true; + m_listView->setModel(m_model); + m_listView->setCurrentIndex(currentIndex); + + tumblerPrivate->_q_onViewCountChanged(); + tumblerPrivate->ignoreSignals = false; + } +} + +void QQuickTumblerView::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + QQuickItem::geometryChange(newGeometry, oldGeometry); + updateView(); +} + +void QQuickTumblerView::componentComplete() +{ + QQuickItem::componentComplete(); + updateView(); +} + +void QQuickTumblerView::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) +{ + QQuickItem::itemChange(change, data); + + if (change == QQuickItem::ItemParentHasChanged && data.item) { + if (m_tumbler) + m_tumbler->disconnect(this); + + m_tumbler = qobject_cast(parentItem()); + + if (m_tumbler) { + // We assume that the parentChanged() signal of the tumbler will be emitted before its wrap property is set... + connect(m_tumbler, &QQuickTumbler::wrapChanged, this, &QQuickTumblerView::createView); + connect(m_tumbler, &QQuickTumbler::visibleItemCountChanged, this, &QQuickTumblerView::updateView); + } + } +} + +QQuickItem *QQuickTumblerView::view() +{ + if (!m_tumbler) + return nullptr; + + if (m_tumbler->wrap()) + return m_pathView; + + return m_listView; +} + +QT_END_NAMESPACE + +#include "moc_qquicktumblerview_p.cpp" diff --git a/src/quickcontrols2impl/qquicktumblerview_p.h b/src/quickcontrols2impl/qquicktumblerview_p.h new file mode 100644 index 00000000..44ce5fa6 --- /dev/null +++ b/src/quickcontrols2impl/qquicktumblerview_p.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKTUMBLERVIEW_P_H +#define QQUICKTUMBLERVIEW_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QQuickListView; +class QQuickPath; +class QQuickPathView; + +class QQuickTumbler; + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickTumblerView : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged) + QML_NAMED_ELEMENT(TumblerView) + QML_ADDED_IN_VERSION(2, 1) + +public: + QQuickTumblerView(QQuickItem *parent = nullptr); + + QVariant model() const; + void setModel(const QVariant &model); + + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *delegate); + + QQuickPath *path() const; + void setPath(QQuickPath *path); + +Q_SIGNALS: + void modelChanged(); + void delegateChanged(); + void pathChanged(); + +protected: + void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void componentComplete() override; + void itemChange(ItemChange change, const ItemChangeData &data) override; + +private: + QQuickItem *view(); + void createView(); + void updateView(); + void updateModel(); + + void wrapChange(); + + QQuickTumbler *m_tumbler = nullptr; + QVariant m_model; + QQmlComponent *m_delegate = nullptr; + QQuickPathView *m_pathView = nullptr; + QQuickListView *m_listView = nullptr; + QQuickPath *m_path = nullptr; +}; + +QT_END_NAMESPACE + +#endif // TUMBLERVIEW_H diff --git a/src/quickcontrols2impl/qtquickcontrols2foreign_p.h b/src/quickcontrols2impl/qtquickcontrols2foreign_p.h new file mode 100644 index 00000000..6285e43c --- /dev/null +++ b/src/quickcontrols2impl/qtquickcontrols2foreign_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +// These are necessary in order to use C++ types in a file where only QtQuick.Controls has been imported. +// Control types like Button don't need this done for them, as each style module provides a Button type, +// and QtQuick.Controls is a sort of alias for the active style import. + +struct QQuickOverlayAttachedForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(Overlay) + QML_FOREIGN(QQuickOverlay) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 3) +}; + +struct QQuickSplitHandleAttachedForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(SplitHandle) + QML_FOREIGN(QQuickSplitHandleAttached) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 13) +}; + +QT_END_NAMESPACE diff --git a/src/quickcontrols2impl/qtquickcontrols2implglobal_p.h b/src/quickcontrols2impl/qtquickcontrols2implglobal_p.h new file mode 100644 index 00000000..9ff27a3b --- /dev/null +++ b/src/quickcontrols2impl/qtquickcontrols2implglobal_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTQUICKCONTROLS2IMPLGLOBAL_H +#define QTQUICKCONTROLS2IMPLGLOBAL_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +#ifndef QT_STATIC +# if defined(QT_BUILD_QUICKCONTROLS2IMPL_LIB) +# define Q_QUICKCONTROLS2IMPL_EXPORT Q_DECL_EXPORT +# else +# define Q_QUICKCONTROLS2IMPL_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_QUICKCONTROLS2IMPL_EXPORT +#endif + +#define Q_QUICKCONTROLS2_PRIVATE_EXPORT Q_QUICKCONTROLS2IMPL_EXPORT + +Q_QUICKCONTROLS2_PRIVATE_EXPORT void qml_register_types_QtQuick_Controls_impl(); + +#endif // QTQUICKCONTROLS2IMPLGLOBAL_H diff --git a/src/quickcontrols2impl/quickcontrols2impl.pro b/src/quickcontrols2impl/quickcontrols2impl.pro new file mode 100644 index 00000000..7a7d2862 --- /dev/null +++ b/src/quickcontrols2impl/quickcontrols2impl.pro @@ -0,0 +1,54 @@ +TARGET = QtQuickControls2Impl +MODULE = quickcontrols2impl + +QT += quick +QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + +HEADERS += \ + $$PWD/qtquickcontrols2implglobal_p.h \ + $$PWD/qquickanimatednode_p.h \ + $$PWD/qquickattachedobject_p.h \ + $$PWD/qquickchecklabel_p.h \ + $$PWD/qquickclippedtext_p.h \ + $$PWD/qquickcolor_p.h \ + $$PWD/qquickcolorimage_p.h \ + $$PWD/qquickiconimage_p.h \ + $$PWD/qquickiconimage_p_p.h \ + $$PWD/qquickiconlabel_p.h \ + $$PWD/qquickiconlabel_p_p.h \ + $$PWD/qquickitemgroup_p.h \ + $$PWD/qquickmnemoniclabel_p.h \ + $$PWD/qquickpaddedrectangle_p.h \ + $$PWD/qquickplaceholdertext_p.h \ + $$PWD/qtquickcontrols2foreign_p.h + +SOURCES += \ + $$PWD/qquickanimatednode.cpp \ + $$PWD/qquickattachedobject.cpp \ + $$PWD/qquickchecklabel.cpp \ + $$PWD/qquickclippedtext.cpp \ + $$PWD/qquickcolor.cpp \ + $$PWD/qquickcolorimage.cpp \ + $$PWD/qquickiconimage.cpp \ + $$PWD/qquickiconlabel.cpp \ + $$PWD/qquickitemgroup.cpp \ + $$PWD/qquickmnemoniclabel.cpp \ + $$PWD/qquickpaddedrectangle.cpp \ + $$PWD/qquickplaceholdertext.cpp + +qtConfig(quick-listview):qtConfig(quick-pathview) { + HEADERS += \ + $$PWD/qquicktumblerview_p.h + SOURCES += \ + $$PWD/qquicktumblerview.cpp +} + +QMLTYPES_FILENAME = plugins.qmltypes +QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls/impl +QML_IMPORT_NAME = QtQuick.Controls.impl +QML_IMPORT_VERSION = 2.15 +CONFIG += qmltypes install_qmltypes install_metatypes + +load(qt_module) diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h index 0fa48980..a5dbd733 100644 --- a/src/quicktemplates2/qquickabstractbutton_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p.h @@ -68,18 +68,20 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButton : public QQuickContr Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY autoRepeatChanged FINAL) Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 3) - Q_PROPERTY(Display display READ display WRITE setDisplay NOTIFY displayChanged FINAL REVISION 3) - Q_PROPERTY(QQuickAction *action READ action WRITE setAction NOTIFY actionChanged FINAL REVISION 3) + Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(2, 3)) + Q_PROPERTY(Display display READ display WRITE setDisplay NOTIFY displayChanged FINAL REVISION(2, 3)) + Q_PROPERTY(QQuickAction *action READ action WRITE setAction NOTIFY actionChanged FINAL REVISION(2, 3)) // 2.4 (Qt 5.11) - Q_PROPERTY(int autoRepeatDelay READ autoRepeatDelay WRITE setAutoRepeatDelay NOTIFY autoRepeatDelayChanged FINAL REVISION 4) - Q_PROPERTY(int autoRepeatInterval READ autoRepeatInterval WRITE setAutoRepeatInterval NOTIFY autoRepeatIntervalChanged FINAL REVISION 4) - Q_PROPERTY(qreal pressX READ pressX NOTIFY pressXChanged FINAL REVISION 4) - Q_PROPERTY(qreal pressY READ pressY NOTIFY pressYChanged FINAL REVISION 4) + Q_PROPERTY(int autoRepeatDelay READ autoRepeatDelay WRITE setAutoRepeatDelay NOTIFY autoRepeatDelayChanged FINAL REVISION(2, 4)) + Q_PROPERTY(int autoRepeatInterval READ autoRepeatInterval WRITE setAutoRepeatInterval NOTIFY autoRepeatIntervalChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal pressX READ pressX NOTIFY pressXChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal pressY READ pressY NOTIFY pressYChanged FINAL REVISION(2, 4)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,contentItem,indicator") + QML_NAMED_ELEMENT(AbstractButton) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickAbstractButton(QQuickItem *parent = nullptr); @@ -167,19 +169,19 @@ Q_SIGNALS: void autoRepeatChanged(); void indicatorChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void toggled(); + Q_REVISION(2, 2) void toggled(); // 2.3 (Qt 5.10) - Q_REVISION(3) void iconChanged(); - Q_REVISION(3) void displayChanged(); - Q_REVISION(3) void actionChanged(); + Q_REVISION(2, 3) void iconChanged(); + Q_REVISION(2, 3) void displayChanged(); + Q_REVISION(2, 3) void actionChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void autoRepeatDelayChanged(); - Q_REVISION(4) void autoRepeatIntervalChanged(); - Q_REVISION(4) void pressXChanged(); - Q_REVISION(4) void pressYChanged(); + Q_REVISION(2, 4) void autoRepeatDelayChanged(); + Q_REVISION(2, 4) void autoRepeatIntervalChanged(); + Q_REVISION(2, 4) void pressXChanged(); + Q_REVISION(2, 4) void pressYChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void implicitIndicatorWidthChanged(); - Q_REVISION(5) void implicitIndicatorHeightChanged(); + Q_REVISION(2, 5) void implicitIndicatorWidthChanged(); + Q_REVISION(2, 5) void implicitIndicatorHeightChanged(); protected: QQuickAbstractButton(QQuickAbstractButtonPrivate &dd, QQuickItem *parent); diff --git a/src/quicktemplates2/qquickaction_p.h b/src/quicktemplates2/qquickaction_p.h index cbe0d8fe..f600d89e 100644 --- a/src/quicktemplates2/qquickaction_p.h +++ b/src/quicktemplates2/qquickaction_p.h @@ -69,6 +69,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAction : public QObject #if QT_CONFIG(shortcut) Q_PRIVATE_PROPERTY(QQuickAction::d_func(), QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL) #endif + QML_NAMED_ELEMENT(Action) + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickAction(QObject *parent = nullptr); diff --git a/src/quicktemplates2/qquickactiongroup_p.h b/src/quicktemplates2/qquickactiongroup_p.h index aa04d32e..d905f595 100644 --- a/src/quicktemplates2/qquickactiongroup_p.h +++ b/src/quicktemplates2/qquickactiongroup_p.h @@ -67,6 +67,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickActionGroup : public QObject Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) Q_CLASSINFO("DefaultProperty", "actions") + QML_NAMED_ELEMENT(ActionGroup) + QML_ATTACHED(QQuickActionGroupAttached) + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickActionGroup(QObject *parent = nullptr); diff --git a/src/quicktemplates2/qquickapplicationwindow_p.h b/src/quicktemplates2/qquickapplicationwindow_p.h index 9c0292ed..4e4f50ef 100644 --- a/src/quicktemplates2/qquickapplicationwindow_p.h +++ b/src/quicktemplates2/qquickapplicationwindow_p.h @@ -72,11 +72,13 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickApplicationWindow : public QQuickWi Q_PROPERTY(QFont font READ font WRITE setFont RESET resetFont NOTIFY fontChanged FINAL) Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET resetLocale NOTIFY localeChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(QQuickItem *menuBar READ menuBar WRITE setMenuBar NOTIFY menuBarChanged FINAL REVISION 3) + Q_PROPERTY(QQuickItem *menuBar READ menuBar WRITE setMenuBar NOTIFY menuBarChanged FINAL REVISION(2, 3)) // 2.14 (Qt 6) - Q_PRIVATE_PROPERTY(QQuickApplicationWindow::d_func(), QQuickPalette *palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged REVISION 3) + Q_PRIVATE_PROPERTY(QQuickApplicationWindow::d_func(), QQuickPalette *palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged REVISION(2, 3)) Q_CLASSINFO("DeferredPropertyNames", "background") Q_CLASSINFO("DefaultProperty", "contentData") + QML_NAMED_ELEMENT(ApplicationWindow) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickApplicationWindow(QWindow *parent = nullptr); @@ -115,7 +117,7 @@ Q_SIGNALS: void footerChanged(); void fontChanged(); void localeChanged(); - Q_REVISION(3) void menuBarChanged(); + Q_REVISION(2, 3) void menuBarChanged(); protected: bool isComponentComplete() const; @@ -137,7 +139,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickApplicationWindowAttached : public Q_PROPERTY(QQuickItem *activeFocusControl READ activeFocusControl NOTIFY activeFocusControlChanged FINAL) Q_PROPERTY(QQuickItem *header READ header NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer NOTIFY footerChanged FINAL) - Q_PROPERTY(QQuickItem *menuBar READ menuBar NOTIFY menuBarChanged FINAL) // REVISION 3 + Q_PROPERTY(QQuickItem *menuBar READ menuBar NOTIFY menuBarChanged FINAL) // REVISION(2, 3) public: explicit QQuickApplicationWindowAttached(QObject *parent = nullptr); @@ -156,13 +158,37 @@ Q_SIGNALS: void headerChanged(); void footerChanged(); // 2.3 (Qt 5.10) - /*Q_REVISION(3)*/ void menuBarChanged(); + /*Q_REVISION(2, 3)*/ void menuBarChanged(); private: Q_DISABLE_COPY(QQuickApplicationWindowAttached) Q_DECLARE_PRIVATE(QQuickApplicationWindowAttached) }; +struct QWindowForeign2 +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QWindow) + QML_ADDED_IN_VERSION(2, 0) +}; + +struct QQuickWindowForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickWindow) + QML_ADDED_IN_VERSION(2, 0) +}; + +struct QQuickWindowQmlImplForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickWindowQmlImpl) + QML_ADDED_IN_VERSION(2, 2) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickApplicationWindow) diff --git a/src/quicktemplates2/qquickbusyindicator_p.h b/src/quicktemplates2/qquickbusyindicator_p.h index f140764b..bdb2eb24 100644 --- a/src/quicktemplates2/qquickbusyindicator_p.h +++ b/src/quicktemplates2/qquickbusyindicator_p.h @@ -58,6 +58,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickBusyIndicator : public QQuickContro { Q_OBJECT Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged FINAL) + QML_NAMED_ELEMENT(BusyIndicator) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickBusyIndicator(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickbutton_p.h b/src/quicktemplates2/qquickbutton_p.h index 2a757952..bfac5663 100644 --- a/src/quicktemplates2/qquickbutton_p.h +++ b/src/quicktemplates2/qquickbutton_p.h @@ -59,6 +59,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickButton : public QQuickAbstractButto Q_OBJECT Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL) Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL) + QML_NAMED_ELEMENT(Button) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickbuttongroup_p.h b/src/quicktemplates2/qquickbuttongroup_p.h index 84ddd225..daff84f2 100644 --- a/src/quicktemplates2/qquickbuttongroup_p.h +++ b/src/quicktemplates2/qquickbuttongroup_p.h @@ -66,10 +66,13 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickButtonGroup : public QObject, publi Q_PROPERTY(QQuickAbstractButton *checkedButton READ checkedButton WRITE setCheckedButton NOTIFY checkedButtonChanged FINAL) Q_PROPERTY(QQmlListProperty buttons READ buttons NOTIFY buttonsChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL REVISION 3) + Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL REVISION(2, 3)) // 2.4 (Qt 5.11) - Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL REVISION 4) + Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL REVISION(2, 4)) Q_INTERFACES(QQmlParserStatus) + QML_NAMED_ELEMENT(ButtonGroup) + QML_ATTACHED(QQuickButtonGroupAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickButtonGroup(QObject *parent = nullptr); @@ -97,11 +100,11 @@ Q_SIGNALS: void checkedButtonChanged(); void buttonsChanged(); // 2.1 (Qt 5.8) - Q_REVISION(1) void clicked(QQuickAbstractButton *button); + Q_REVISION(2, 1) void clicked(QQuickAbstractButton *button); // 2.3 (Qt 5.10) - Q_REVISION(3) void exclusiveChanged(); + Q_REVISION(2, 3) void exclusiveChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void checkStateChanged(); + Q_REVISION(2, 4) void checkStateChanged(); protected: void classBegin() override; diff --git a/src/quicktemplates2/qquickcheckbox_p.h b/src/quicktemplates2/qquickcheckbox_p.h index 1e333d7c..8e53b41d 100644 --- a/src/quicktemplates2/qquickcheckbox_p.h +++ b/src/quicktemplates2/qquickcheckbox_p.h @@ -60,7 +60,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickCheckBox : public QQuickAbstractBut Q_PROPERTY(bool tristate READ isTristate WRITE setTristate NOTIFY tristateChanged FINAL) Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL) // 2.4 (Qt 5.11) - Q_PRIVATE_PROPERTY(QQuickCheckBox::d_func(), QJSValue nextCheckState MEMBER nextCheckState WRITE setNextCheckState NOTIFY nextCheckStateChanged FINAL REVISION 4) + Q_PRIVATE_PROPERTY(QQuickCheckBox::d_func(), QJSValue nextCheckState MEMBER nextCheckState WRITE setNextCheckState NOTIFY nextCheckStateChanged FINAL REVISION(2, 4)) + QML_NAMED_ELEMENT(CheckBox) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickCheckBox(QQuickItem *parent = nullptr); @@ -75,7 +77,7 @@ Q_SIGNALS: void tristateChanged(); void checkStateChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void nextCheckStateChanged(); + Q_REVISION(2, 4) void nextCheckStateChanged(); protected: QFont defaultFont() const override; diff --git a/src/quicktemplates2/qquickcheckdelegate_p.h b/src/quicktemplates2/qquickcheckdelegate_p.h index 67dcf706..9b69943f 100644 --- a/src/quicktemplates2/qquickcheckdelegate_p.h +++ b/src/quicktemplates2/qquickcheckdelegate_p.h @@ -60,7 +60,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickCheckDelegate : public QQuickItemDe Q_PROPERTY(bool tristate READ isTristate WRITE setTristate NOTIFY tristateChanged FINAL) Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL) // 2.4 (Qt 5.11) - Q_PRIVATE_PROPERTY(QQuickCheckDelegate::d_func(), QJSValue nextCheckState MEMBER nextCheckState WRITE setNextCheckState NOTIFY nextCheckStateChanged FINAL REVISION 4) + Q_PRIVATE_PROPERTY(QQuickCheckDelegate::d_func(), QJSValue nextCheckState MEMBER nextCheckState WRITE setNextCheckState NOTIFY nextCheckStateChanged FINAL REVISION(2, 4)) + QML_NAMED_ELEMENT(CheckDelegate) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickCheckDelegate(QQuickItem *parent = nullptr); @@ -75,7 +77,7 @@ Q_SIGNALS: void tristateChanged(); void checkStateChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void nextCheckStateChanged(); + Q_REVISION(2, 4) void nextCheckStateChanged(); protected: QFont defaultFont() const override; diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h index 18c1275c..4ad8279e 100644 --- a/src/quicktemplates2/qquickcombobox_p.h +++ b/src/quicktemplates2/qquickcombobox_p.h @@ -76,27 +76,29 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickComboBox : public QQuickControl Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL) Q_PROPERTY(QQuickPopup *popup READ popup WRITE setPopup NOTIFY popupChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL REVISION 1) + Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL REVISION(2, 1)) // 2.2 (Qt 5.9) - Q_PROPERTY(bool down READ isDown WRITE setDown RESET resetDown NOTIFY downChanged FINAL REVISION 2) - Q_PROPERTY(bool editable READ isEditable WRITE setEditable NOTIFY editableChanged FINAL REVISION 2) - Q_PROPERTY(QString editText READ editText WRITE setEditText RESET resetEditText NOTIFY editTextChanged FINAL REVISION 2) - Q_PROPERTY(QValidator *validator READ validator WRITE setValidator NOTIFY validatorChanged FINAL REVISION 2) - Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION 2) - Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION 2) - Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged FINAL REVISION 2) + Q_PROPERTY(bool down READ isDown WRITE setDown RESET resetDown NOTIFY downChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool editable READ isEditable WRITE setEditable NOTIFY editableChanged FINAL REVISION(2, 2)) + Q_PROPERTY(QString editText READ editText WRITE setEditText RESET resetEditText NOTIFY editTextChanged FINAL REVISION(2, 2)) + Q_PROPERTY(QValidator *validator READ validator WRITE setValidator NOTIFY validatorChanged FINAL REVISION(2, 2)) + Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged FINAL REVISION(2, 2)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,contentItem,indicator,popup") // 2.14 (Qt 5.14) - Q_PROPERTY(QVariant currentValue READ currentValue NOTIFY currentValueChanged FINAL REVISION 14) - Q_PROPERTY(QString valueRole READ valueRole WRITE setValueRole NOTIFY valueRoleChanged FINAL REVISION 14) + Q_PROPERTY(QVariant currentValue READ currentValue NOTIFY currentValueChanged FINAL REVISION(2, 14)) + Q_PROPERTY(QString valueRole READ valueRole WRITE setValueRole NOTIFY valueRoleChanged FINAL REVISION(2, 14)) // 2.15 (Qt 5.15) - Q_PROPERTY(bool selectTextByMouse READ selectTextByMouse WRITE setSelectTextByMouse NOTIFY selectTextByMouseChanged FINAL REVISION 15) + Q_PROPERTY(bool selectTextByMouse READ selectTextByMouse WRITE setSelectTextByMouse NOTIFY selectTextByMouseChanged FINAL REVISION(2, 15)) // TODO: 6.0 (Qt 6.0) - QTBUG-84190 Q_PROPERTY(ImplicitContentWidthPolicy implicitContentWidthPolicy READ implicitContentWidthPolicy WRITE setImplicitContentWidthPolicy NOTIFY implicitContentWidthPolicyChanged FINAL REVISION 15) + QML_NAMED_ELEMENT(ComboBox) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickComboBox(QQuickItem *parent = nullptr); @@ -171,8 +173,8 @@ public: // 2.14 (Qt 5.14) QVariant currentValue() const; - Q_REVISION(14) Q_INVOKABLE QVariant valueAt(int index) const; - Q_REVISION(14) Q_INVOKABLE int indexOfValue(const QVariant &value) const; + Q_REVISION(2, 14) Q_INVOKABLE QVariant valueAt(int index) const; + Q_REVISION(2, 14) Q_INVOKABLE int indexOfValue(const QVariant &value) const; // 2.15 (Qt 5.15) bool selectTextByMouse() const; @@ -192,7 +194,7 @@ public: public Q_SLOTS: void incrementCurrentIndex(); void decrementCurrentIndex(); - Q_REVISION(2) void selectAll(); + Q_REVISION(2, 2) void selectAll(); Q_SIGNALS: void activated(int index); @@ -210,24 +212,24 @@ Q_SIGNALS: void indicatorChanged(); void popupChanged(); // 2.1 (Qt 5.8) - Q_REVISION(1) void flatChanged(); + Q_REVISION(2, 1) void flatChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void accepted(); - Q_REVISION(2) void downChanged(); - Q_REVISION(2) void editableChanged(); - Q_REVISION(2) void editTextChanged(); - Q_REVISION(2) void validatorChanged(); - Q_REVISION(2) void inputMethodHintsChanged(); - Q_REVISION(2) void inputMethodComposingChanged(); - Q_REVISION(2) void acceptableInputChanged(); + Q_REVISION(2, 2) void accepted(); + Q_REVISION(2, 2) void downChanged(); + Q_REVISION(2, 2) void editableChanged(); + Q_REVISION(2, 2) void editTextChanged(); + Q_REVISION(2, 2) void validatorChanged(); + Q_REVISION(2, 2) void inputMethodHintsChanged(); + Q_REVISION(2, 2) void inputMethodComposingChanged(); + Q_REVISION(2, 2) void acceptableInputChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void implicitIndicatorWidthChanged(); - Q_REVISION(5) void implicitIndicatorHeightChanged(); + Q_REVISION(2, 5) void implicitIndicatorWidthChanged(); + Q_REVISION(2, 5) void implicitIndicatorHeightChanged(); // 2.14 (Qt 5.14) - Q_REVISION(14) void valueRoleChanged(); - Q_REVISION(14) void currentValueChanged(); + Q_REVISION(2, 14) void valueRoleChanged(); + Q_REVISION(2, 14) void currentValueChanged(); // 2.15 (Qt 5.15) - Q_REVISION(15) void selectTextByMouseChanged(); + Q_REVISION(2, 15) void selectTextByMouseChanged(); // 6.0 (Qt 6.0) Q_REVISION(6, 0) void implicitContentWidthPolicyChanged(); diff --git a/src/quicktemplates2/qquickcontainer_p.h b/src/quicktemplates2/qquickcontainer_p.h index 9deba199..666c9307 100644 --- a/src/quicktemplates2/qquickcontainer_p.h +++ b/src/quicktemplates2/qquickcontainer_p.h @@ -65,9 +65,11 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickContainer : public QQuickControl Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL) Q_PROPERTY(QQuickItem *currentItem READ currentItem NOTIFY currentItemChanged FINAL) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DefaultProperty", "contentData") + QML_NAMED_ELEMENT(Container) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickContainer(QQuickItem *parent = nullptr); @@ -80,7 +82,7 @@ public: Q_INVOKABLE void moveItem(int from, int to); Q_INVOKABLE void removeItem(QQuickItem *item); // 2.3 (Qt 5.10) - Q_REVISION(3) Q_INVOKABLE QQuickItem *takeItem(int index); + Q_REVISION(2, 3) Q_INVOKABLE QQuickItem *takeItem(int index); QVariant contentModel() const; QQmlListProperty contentData(); @@ -101,8 +103,8 @@ public: public Q_SLOTS: void setCurrentIndex(int index); // 2.1 (Qt 5.8) - Q_REVISION(1) void incrementCurrentIndex(); - Q_REVISION(1) void decrementCurrentIndex(); + Q_REVISION(2, 1) void incrementCurrentIndex(); + Q_REVISION(2, 1) void decrementCurrentIndex(); Q_SIGNALS: void countChanged(); @@ -110,8 +112,8 @@ Q_SIGNALS: void currentIndexChanged(); void currentItemChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void contentWidthChanged(); - Q_REVISION(5) void contentHeightChanged(); + Q_REVISION(2, 5) void contentWidthChanged(); + Q_REVISION(2, 5) void contentHeightChanged(); protected: QQuickContainer(QQuickContainerPrivate &dd, QQuickItem *parent); diff --git a/src/quicktemplates2/qquickcontrol_p.h b/src/quicktemplates2/qquickcontrol_p.h index 6d88a8b2..5e4a7cd9 100644 --- a/src/quicktemplates2/qquickcontrol_p.h +++ b/src/quicktemplates2/qquickcontrol_p.h @@ -81,17 +81,19 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickControl : public QQuickItem Q_PROPERTY(QQuickItem *contentItem READ contentItem WRITE setContentItem NOTIFY contentItemChanged FINAL) Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset RESET resetBaselineOffset NOTIFY baselineOffsetChanged FINAL) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal horizontalPadding READ horizontalPadding WRITE setHorizontalPadding RESET resetHorizontalPadding NOTIFY horizontalPaddingChanged FINAL REVISION 5) - Q_PROPERTY(qreal verticalPadding READ verticalPadding WRITE setVerticalPadding RESET resetVerticalPadding NOTIFY verticalPaddingChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitContentWidth READ implicitContentWidth NOTIFY implicitContentWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5) + Q_PROPERTY(qreal horizontalPadding READ horizontalPadding WRITE setHorizontalPadding RESET resetHorizontalPadding NOTIFY horizontalPaddingChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal verticalPadding READ verticalPadding WRITE setVerticalPadding RESET resetVerticalPadding NOTIFY verticalPaddingChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitContentWidth READ implicitContentWidth NOTIFY implicitContentWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,contentItem") + QML_NAMED_ELEMENT(Control) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickControl(QQuickItem *parent = nullptr); @@ -215,16 +217,16 @@ Q_SIGNALS: void contentItemChanged(); void baselineOffsetChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void horizontalPaddingChanged(); - Q_REVISION(5) void verticalPaddingChanged(); - Q_REVISION(5) void implicitContentWidthChanged(); - Q_REVISION(5) void implicitContentHeightChanged(); - Q_REVISION(5) void implicitBackgroundWidthChanged(); - Q_REVISION(5) void implicitBackgroundHeightChanged(); - Q_REVISION(5) void topInsetChanged(); - Q_REVISION(5) void leftInsetChanged(); - Q_REVISION(5) void rightInsetChanged(); - Q_REVISION(5) void bottomInsetChanged(); + Q_REVISION(2, 5) void horizontalPaddingChanged(); + Q_REVISION(2, 5) void verticalPaddingChanged(); + Q_REVISION(2, 5) void implicitContentWidthChanged(); + Q_REVISION(2, 5) void implicitContentHeightChanged(); + Q_REVISION(2, 5) void implicitBackgroundWidthChanged(); + Q_REVISION(2, 5) void implicitBackgroundHeightChanged(); + Q_REVISION(2, 5) void topInsetChanged(); + Q_REVISION(2, 5) void leftInsetChanged(); + Q_REVISION(2, 5) void rightInsetChanged(); + Q_REVISION(2, 5) void bottomInsetChanged(); protected: virtual QFont defaultFont() const; @@ -286,6 +288,21 @@ private: Q_DECLARE_PRIVATE(QQuickControl) }; +struct QQuickItemForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickItem) + QML_ADDED_IN_VERSION(2, 3) +}; + +struct QQuickPaletteForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(Palette) + QML_ADDED_IN_VERSION(6, 0) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickControl) diff --git a/src/quicktemplates2/qquickdelaybutton_p.h b/src/quicktemplates2/qquickdelaybutton_p.h index 5ac0885d..a697bca8 100644 --- a/src/quicktemplates2/qquickdelaybutton_p.h +++ b/src/quicktemplates2/qquickdelaybutton_p.h @@ -61,6 +61,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDelayButton : public QQuickAbstract Q_PROPERTY(int delay READ delay WRITE setDelay NOTIFY delayChanged FINAL) Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged FINAL) Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL) + QML_NAMED_ELEMENT(DelayButton) + QML_ADDED_IN_VERSION(2, 2) public: explicit QQuickDelayButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickdial_p.h b/src/quicktemplates2/qquickdial_p.h index cc641c78..67bbc183 100644 --- a/src/quicktemplates2/qquickdial_p.h +++ b/src/quicktemplates2/qquickdial_p.h @@ -71,10 +71,12 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDial : public QQuickControl Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged FINAL) Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION 2) + Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION(2, 2)) // 2.5 (Qt 5.12) - Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode NOTIFY inputModeChanged FINAL REVISION 5) + Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode NOTIFY inputModeChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,handle") + QML_NAMED_ELEMENT(Dial) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickDial(QQuickItem *parent = nullptr); @@ -145,10 +147,10 @@ Q_SIGNALS: void pressedChanged(); void handleChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void moved(); - Q_REVISION(2) void liveChanged(); + Q_REVISION(2, 2) void moved(); + Q_REVISION(2, 2) void liveChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void inputModeChanged(); + Q_REVISION(2, 5) void inputModeChanged(); protected: void keyPressEvent(QKeyEvent *event) override; diff --git a/src/quicktemplates2/qquickdialog_p.h b/src/quicktemplates2/qquickdialog_p.h index 38a1b396..20f56f6b 100644 --- a/src/quicktemplates2/qquickdialog_p.h +++ b/src/quicktemplates2/qquickdialog_p.h @@ -64,13 +64,15 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialog : public QQuickPopup Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) Q_PROPERTY(QPlatformDialogHelper::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL REVISION 3) + Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL REVISION(2, 3)) Q_FLAGS(QPlatformDialogHelper::StandardButtons) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY implicitHeaderHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY implicitFooterHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY implicitHeaderHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY implicitFooterHeightChanged FINAL REVISION(2, 5)) + QML_NAMED_ELEMENT(Dialog) + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickDialog(QObject *parent = nullptr); @@ -86,7 +88,7 @@ public: QPlatformDialogHelper::StandardButtons standardButtons() const; void setStandardButtons(QPlatformDialogHelper::StandardButtons buttons); - Q_REVISION(3) Q_INVOKABLE QQuickAbstractButton *standardButton(QPlatformDialogHelper::StandardButton button) const; + Q_REVISION(2, 3) Q_INVOKABLE QQuickAbstractButton *standardButton(QPlatformDialogHelper::StandardButton button) const; // 2.3 (Qt 5.10) enum StandardCode { Rejected, Accepted }; @@ -115,11 +117,11 @@ Q_SIGNALS: void footerChanged(); void standardButtonsChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void applied(); - Q_REVISION(3) void reset(); - Q_REVISION(3) void discarded(); - Q_REVISION(3) void helpRequested(); - Q_REVISION(3) void resultChanged(); + Q_REVISION(2, 3) void applied(); + Q_REVISION(2, 3) void reset(); + Q_REVISION(2, 3) void discarded(); + Q_REVISION(2, 3) void helpRequested(); + Q_REVISION(2, 3) void resultChanged(); // 2.5 (Qt 5.12) void implicitHeaderWidthChanged(); void implicitHeaderHeightChanged(); diff --git a/src/quicktemplates2/qquickdialogbuttonbox_p.h b/src/quicktemplates2/qquickdialogbuttonbox_p.h index 996f4ef7..b1687df7 100644 --- a/src/quicktemplates2/qquickdialogbuttonbox_p.h +++ b/src/quicktemplates2/qquickdialogbuttonbox_p.h @@ -67,8 +67,11 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialogButtonBox : public QQuickCont Q_PROPERTY(QPlatformDialogHelper::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged FINAL) Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL) // 2.5 (Qt 5.12) - Q_PROPERTY(QPlatformDialogHelper::ButtonLayout buttonLayout READ buttonLayout WRITE setButtonLayout RESET resetButtonLayout NOTIFY buttonLayoutChanged FINAL REVISION 5) + Q_PROPERTY(QPlatformDialogHelper::ButtonLayout buttonLayout READ buttonLayout WRITE setButtonLayout RESET resetButtonLayout NOTIFY buttonLayoutChanged FINAL REVISION(2, 5)) Q_FLAGS(QPlatformDialogHelper::StandardButtons) + QML_NAMED_ELEMENT(DialogButtonBox) + QML_ATTACHED(QQuickDialogButtonBoxAttached) + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickDialogButtonBox(QQuickItem *parent = nullptr); @@ -113,11 +116,11 @@ Q_SIGNALS: void standardButtonsChanged(); void delegateChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void applied(); - Q_REVISION(3) void reset(); - Q_REVISION(3) void discarded(); + Q_REVISION(2, 3) void applied(); + Q_REVISION(2, 3) void reset(); + Q_REVISION(2, 3) void discarded(); // 2.5 (Qt 5.12) - Q_REVISION(5) void buttonLayoutChanged(); + Q_REVISION(2, 5) void buttonLayoutChanged(); protected: void updatePolish() override; diff --git a/src/quicktemplates2/qquickdrawer_p.h b/src/quicktemplates2/qquickdrawer_p.h index 8e246fcc..f16ae771 100644 --- a/src/quicktemplates2/qquickdrawer_p.h +++ b/src/quicktemplates2/qquickdrawer_p.h @@ -61,7 +61,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDrawer : public QQuickPopup Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL) Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin RESET resetDragMargin NOTIFY dragMarginChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL REVISION 2) + Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL REVISION(2, 2)) + QML_NAMED_ELEMENT(Drawer) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickDrawer(QObject *parent = nullptr); @@ -85,7 +87,7 @@ Q_SIGNALS: void positionChanged(); void dragMarginChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void interactiveChanged(); + Q_REVISION(2, 2) void interactiveChanged(); protected: bool childMouseEventFilter(QQuickItem *child, QEvent *event) override; diff --git a/src/quicktemplates2/qquickframe_p.h b/src/quicktemplates2/qquickframe_p.h index 381088ec..f65e2814 100644 --- a/src/quicktemplates2/qquickframe_p.h +++ b/src/quicktemplates2/qquickframe_p.h @@ -57,6 +57,8 @@ class QQuickFramePrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickFrame : public QQuickPane { Q_OBJECT + QML_NAMED_ELEMENT(Frame) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickFrame(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickgroupbox_p.h b/src/quicktemplates2/qquickgroupbox_p.h index f5159630..39e20494 100644 --- a/src/quicktemplates2/qquickgroupbox_p.h +++ b/src/quicktemplates2/qquickgroupbox_p.h @@ -60,9 +60,11 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickGroupBox : public QQuickFrame Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) Q_PROPERTY(QQuickItem *label READ label WRITE setLabel NOTIFY labelChanged FINAL) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitLabelWidth READ implicitLabelWidth NOTIFY implicitLabelWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitLabelHeight READ implicitLabelHeight NOTIFY implicitLabelHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitLabelWidth READ implicitLabelWidth NOTIFY implicitLabelWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitLabelHeight READ implicitLabelHeight NOTIFY implicitLabelHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,contentItem,label") + QML_NAMED_ELEMENT(GroupBox) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickGroupBox(QQuickItem *parent = nullptr); @@ -82,8 +84,8 @@ Q_SIGNALS: void titleChanged(); void labelChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void implicitLabelWidthChanged(); - Q_REVISION(5) void implicitLabelHeightChanged(); + Q_REVISION(2, 5) void implicitLabelWidthChanged(); + Q_REVISION(2, 5) void implicitLabelHeightChanged(); protected: void componentComplete() override; diff --git a/src/quicktemplates2/qquickheaderview_p.h b/src/quicktemplates2/qquickheaderview_p.h index 10c55c6e..b8e8b77a 100644 --- a/src/quicktemplates2/qquickheaderview_p.h +++ b/src/quicktemplates2/qquickheaderview_p.h @@ -88,6 +88,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickHorizontalHeaderView : public QQuic { Q_OBJECT Q_DECLARE_PRIVATE(QQuickHorizontalHeaderView) + QML_NAMED_ELEMENT(HorizontalHeaderView) + QML_ADDED_IN_VERSION(2, 15) public: QQuickHorizontalHeaderView(QQuickItem *parent = nullptr); @@ -105,6 +107,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickVerticalHeaderView : public QQuickH { Q_OBJECT Q_DECLARE_PRIVATE(QQuickVerticalHeaderView) + QML_NAMED_ELEMENT(VerticalHeaderView) + QML_ADDED_IN_VERSION(2, 15) public: QQuickVerticalHeaderView(QQuickItem *parent = nullptr); @@ -117,6 +121,14 @@ private: Q_DISABLE_COPY(QQuickVerticalHeaderView) }; +struct QQuickTableViewForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickTableView) + QML_ADDED_IN_VERSION(2, 14) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickHorizontalHeaderView) diff --git a/src/quicktemplates2/qquickicon_p.h b/src/quicktemplates2/qquickicon_p.h index 1835585d..0c0fe101 100644 --- a/src/quicktemplates2/qquickicon_p.h +++ b/src/quicktemplates2/qquickicon_p.h @@ -54,6 +54,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -68,6 +69,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickIcon Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL) Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL) Q_PROPERTY(bool cache READ cache WRITE setCache RESET resetCache FINAL) + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 3) public: QQuickIcon(); diff --git a/src/quicktemplates2/qquickitemdelegate_p.h b/src/quicktemplates2/qquickitemdelegate_p.h index a162ddee..2568a0bf 100644 --- a/src/quicktemplates2/qquickitemdelegate_p.h +++ b/src/quicktemplates2/qquickitemdelegate_p.h @@ -58,6 +58,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickItemDelegate : public QQuickAbstrac { Q_OBJECT Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL) + QML_NAMED_ELEMENT(ItemDelegate) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickItemDelegate(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicklabel_p.h b/src/quicktemplates2/qquicklabel_p.h index c3e4fb45..02acddca 100644 --- a/src/quicktemplates2/qquicklabel_p.h +++ b/src/quicktemplates2/qquicklabel_p.h @@ -62,13 +62,15 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickLabel : public QQuickText Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) // override Q_PROPERTY(QQuickItem *background READ background WRITE setBackground NOTIFY backgroundChanged FINAL) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background") + QML_NAMED_ELEMENT(Label) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickLabel(QQuickItem *parent = nullptr); @@ -104,12 +106,12 @@ Q_SIGNALS: void fontChanged(); void backgroundChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void implicitBackgroundWidthChanged(); - Q_REVISION(5) void implicitBackgroundHeightChanged(); - Q_REVISION(5) void topInsetChanged(); - Q_REVISION(5) void leftInsetChanged(); - Q_REVISION(5) void rightInsetChanged(); - Q_REVISION(5) void bottomInsetChanged(); + Q_REVISION(2, 5) void implicitBackgroundWidthChanged(); + Q_REVISION(2, 5) void implicitBackgroundHeightChanged(); + Q_REVISION(2, 5) void topInsetChanged(); + Q_REVISION(2, 5) void leftInsetChanged(); + Q_REVISION(2, 5) void rightInsetChanged(); + Q_REVISION(2, 5) void bottomInsetChanged(); protected: void classBegin() override; @@ -124,6 +126,14 @@ private: Q_DECLARE_PRIVATE(QQuickLabel) }; +struct QQuickTextForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickText) + QML_ADDED_IN_VERSION(2, 3) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickLabel) diff --git a/src/quicktemplates2/qquickmenu_p.h b/src/quicktemplates2/qquickmenu_p.h index de252bf8..2646cffa 100644 --- a/src/quicktemplates2/qquickmenu_p.h +++ b/src/quicktemplates2/qquickmenu_p.h @@ -67,12 +67,14 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenu : public QQuickPopup Q_PROPERTY(QQmlListProperty contentData READ contentData FINAL) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION 3) - Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION 3) - Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION 3) - Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION 3) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL REVISION 3) + Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION(2, 3)) + Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION(2, 3)) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION(2, 3)) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL REVISION(2, 3)) Q_CLASSINFO("DefaultProperty", "contentData") + QML_NAMED_ELEMENT(Menu) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickMenu(QObject *parent = nullptr); @@ -104,25 +106,25 @@ public: // 2.3 (Qt 5.10) int count() const; - Q_REVISION(3) Q_INVOKABLE QQuickItem *takeItem(int index); + Q_REVISION(2, 3) Q_INVOKABLE QQuickItem *takeItem(int index); - Q_REVISION(3) Q_INVOKABLE QQuickMenu *menuAt(int index) const; - Q_REVISION(3) Q_INVOKABLE void addMenu(QQuickMenu *menu); - Q_REVISION(3) Q_INVOKABLE void insertMenu(int index, QQuickMenu *menu); - Q_REVISION(3) Q_INVOKABLE void removeMenu(QQuickMenu *menu); - Q_REVISION(3) Q_INVOKABLE QQuickMenu *takeMenu(int index); + Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *menuAt(int index) const; + Q_REVISION(2, 3) Q_INVOKABLE void addMenu(QQuickMenu *menu); + Q_REVISION(2, 3) Q_INVOKABLE void insertMenu(int index, QQuickMenu *menu); + Q_REVISION(2, 3) Q_INVOKABLE void removeMenu(QQuickMenu *menu); + Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *takeMenu(int index); - Q_REVISION(3) Q_INVOKABLE QQuickAction *actionAt(int index) const; - Q_REVISION(3) Q_INVOKABLE void addAction(QQuickAction *action); - Q_REVISION(3) Q_INVOKABLE void insertAction(int index, QQuickAction *action); - Q_REVISION(3) Q_INVOKABLE void removeAction(QQuickAction *action); - Q_REVISION(3) Q_INVOKABLE QQuickAction *takeAction(int index); + Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *actionAt(int index) const; + Q_REVISION(2, 3) Q_INVOKABLE void addAction(QQuickAction *action); + Q_REVISION(2, 3) Q_INVOKABLE void insertAction(int index, QQuickAction *action); + Q_REVISION(2, 3) Q_INVOKABLE void removeAction(QQuickAction *action); + Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *takeAction(int index); void popup(QQuickItem *menuItem = nullptr); void popup(const QPointF &pos, QQuickItem *menuItem = nullptr); - Q_REVISION(3) Q_INVOKABLE void popup(QQmlV4Function *args); - Q_REVISION(3) Q_INVOKABLE void dismiss(); + Q_REVISION(2, 3) Q_INVOKABLE void popup(QQmlV4Function *args); + Q_REVISION(2, 3) Q_INVOKABLE void dismiss(); protected: void componentComplete() override; @@ -133,11 +135,11 @@ protected: Q_SIGNALS: void titleChanged(const QString &title); // 2.3 (Qt 5.10) - Q_REVISION(3) void countChanged(); - Q_REVISION(3) void cascadeChanged(bool cascade); - Q_REVISION(3) void overlapChanged(); - Q_REVISION(3) void delegateChanged(); - Q_REVISION(3) void currentIndexChanged(); + Q_REVISION(2, 3) void countChanged(); + Q_REVISION(2, 3) void cascadeChanged(bool cascade); + Q_REVISION(2, 3) void overlapChanged(); + Q_REVISION(2, 3) void delegateChanged(); + Q_REVISION(2, 3) void currentIndexChanged(); protected: void timerEvent(QTimerEvent *event) override; diff --git a/src/quicktemplates2/qquickmenubar_p.h b/src/quicktemplates2/qquickmenubar_p.h index 8fcaa870..8092cf9b 100644 --- a/src/quicktemplates2/qquickmenubar_p.h +++ b/src/quicktemplates2/qquickmenubar_p.h @@ -63,6 +63,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuBar : public QQuickContainer Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL) // re-declare QQuickContainer::contentHeight (REV 5) Q_PRIVATE_PROPERTY(QQuickMenuBar::d_func(), QQmlListProperty menus READ menus NOTIFY menusChanged FINAL) Q_PRIVATE_PROPERTY(QQuickMenuBar::d_func(), QQmlListProperty contentData READ contentData FINAL) + QML_NAMED_ELEMENT(MenuBar) + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickMenuBar(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickmenubaritem_p.h b/src/quicktemplates2/qquickmenubaritem_p.h index b58ef1c4..a913f242 100644 --- a/src/quicktemplates2/qquickmenubaritem_p.h +++ b/src/quicktemplates2/qquickmenubaritem_p.h @@ -62,6 +62,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuBarItem : public QQuickAbstract Q_PROPERTY(QQuickMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL) Q_PROPERTY(QQuickMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL) Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL) + QML_NAMED_ELEMENT(MenuBarItem) + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickMenuBarItem(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickmenuitem_p.h b/src/quicktemplates2/qquickmenuitem_p.h index e519132e..817da76b 100644 --- a/src/quicktemplates2/qquickmenuitem_p.h +++ b/src/quicktemplates2/qquickmenuitem_p.h @@ -60,10 +60,12 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuItem : public QQuickAbstractBut Q_OBJECT Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(QQuickItem *arrow READ arrow WRITE setArrow NOTIFY arrowChanged FINAL REVISION 3) - Q_PROPERTY(QQuickMenu *menu READ menu NOTIFY menuChanged FINAL REVISION 3) - Q_PROPERTY(QQuickMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL REVISION 3) + Q_PROPERTY(QQuickItem *arrow READ arrow WRITE setArrow NOTIFY arrowChanged FINAL REVISION(2, 3)) + Q_PROPERTY(QQuickMenu *menu READ menu NOTIFY menuChanged FINAL REVISION(2, 3)) + Q_PROPERTY(QQuickMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL REVISION(2, 3)) Q_CLASSINFO("DeferredPropertyNames", "arrow,background,contentItem,indicator") + QML_NAMED_ELEMENT(MenuItem) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickMenuItem(QQuickItem *parent = nullptr); @@ -82,9 +84,9 @@ Q_SIGNALS: void triggered(); void highlightedChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void arrowChanged(); - Q_REVISION(3) void menuChanged(); - Q_REVISION(3) void subMenuChanged(); + Q_REVISION(2, 3) void arrowChanged(); + Q_REVISION(2, 3) void menuChanged(); + Q_REVISION(2, 3) void subMenuChanged(); protected: void componentComplete() override; diff --git a/src/quicktemplates2/qquickmenuseparator_p.h b/src/quicktemplates2/qquickmenuseparator_p.h index 15d96739..330aaac4 100644 --- a/src/quicktemplates2/qquickmenuseparator_p.h +++ b/src/quicktemplates2/qquickmenuseparator_p.h @@ -58,6 +58,8 @@ class QQuickMenuSeparator; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuSeparator : public QQuickControl { Q_OBJECT + QML_NAMED_ELEMENT(MenuSeparator) + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickMenuSeparator(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h index 20ec21a1..c6e530e2 100644 --- a/src/quicktemplates2/qquickoverlay_p.h +++ b/src/quicktemplates2/qquickoverlay_p.h @@ -63,6 +63,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickOverlay : public QQuickItem Q_OBJECT Q_PROPERTY(QQmlComponent *modal READ modal WRITE setModal NOTIFY modalChanged FINAL) Q_PROPERTY(QQmlComponent *modeless READ modeless WRITE setModeless NOTIFY modelessChanged FINAL) + QML_NAMED_ELEMENT(Overlay) + QML_ATTACHED(QQuickOverlayAttached) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 3) public: explicit QQuickOverlay(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h index b7888ad6..3278900d 100644 --- a/src/quicktemplates2/qquickpage_p.h +++ b/src/quicktemplates2/qquickpage_p.h @@ -62,13 +62,15 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPage : public QQuickPane Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL REVISION 1) - Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL REVISION 1) + Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL REVISION(2, 1)) + Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL REVISION(2, 1)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY implicitHeaderHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY implicitFooterHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY implicitHeaderHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY implicitFooterHeightChanged FINAL REVISION(2, 5)) + QML_NAMED_ELEMENT(Page) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickPage(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickpageindicator_p.h b/src/quicktemplates2/qquickpageindicator_p.h index 01352016..a21e88fe 100644 --- a/src/quicktemplates2/qquickpageindicator_p.h +++ b/src/quicktemplates2/qquickpageindicator_p.h @@ -62,6 +62,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPageIndicator : public QQuickContro Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL) Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL) Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL) + QML_NAMED_ELEMENT(PageIndicator) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickPageIndicator(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickpane_p.h b/src/quicktemplates2/qquickpane_p.h index 86b2c9f2..2aeb94cd 100644 --- a/src/quicktemplates2/qquickpane_p.h +++ b/src/quicktemplates2/qquickpane_p.h @@ -63,6 +63,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPane : public QQuickControl Q_PRIVATE_PROPERTY(QQuickPane::d_func(), QQmlListProperty contentData READ contentData FINAL) Q_PRIVATE_PROPERTY(QQuickPane::d_func(), QQmlListProperty contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL) Q_CLASSINFO("DefaultProperty", "contentData") + QML_NAMED_ELEMENT(Pane) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickPane(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h index d5e2f1e9..76ccc7a9 100644 --- a/src/quicktemplates2/qquickpopup_p.h +++ b/src/quicktemplates2/qquickpopup_p.h @@ -116,26 +116,28 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopup : public QObject, public QQml Q_PROPERTY(QQuickTransition *enter READ enter WRITE setEnter NOTIFY enterChanged FINAL) Q_PROPERTY(QQuickTransition *exit READ exit WRITE setExit NOTIFY exitChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET resetSpacing NOTIFY spacingChanged FINAL REVISION 1) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET resetSpacing NOTIFY spacingChanged FINAL REVISION(2, 1)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool opened READ isOpened NOTIFY openedChanged FINAL REVISION 3) - Q_PROPERTY(bool mirrored READ isMirrored NOTIFY mirroredChanged FINAL REVISION 3) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL REVISION 3) - Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPalette *palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged REVISION 3) + Q_PROPERTY(bool opened READ isOpened NOTIFY openedChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool mirrored READ isMirrored NOTIFY mirroredChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL REVISION(2, 3)) + Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPalette *palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged REVISION(2, 3)) // 2.5 (Qt 5.12) Q_PROPERTY(qreal horizontalPadding READ horizontalPadding WRITE setHorizontalPadding RESET resetHorizontalPadding NOTIFY horizontalPaddingChanged FINAL) Q_PROPERTY(qreal verticalPadding READ verticalPadding WRITE setVerticalPadding RESET resetVerticalPadding NOTIFY verticalPaddingChanged FINAL) - Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPopupAnchors *anchors READ getAnchors DESIGNABLE false CONSTANT FINAL REVISION 5) - Q_PROPERTY(qreal implicitContentWidth READ implicitContentWidth NOTIFY implicitContentWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5) + Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPopupAnchors *anchors READ getAnchors DESIGNABLE false CONSTANT FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitContentWidth READ implicitContentWidth NOTIFY implicitContentWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,contentItem") Q_CLASSINFO("DefaultProperty", "contentData") + QML_NAMED_ELEMENT(Popup) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickPopup(QObject *parent = nullptr); @@ -390,24 +392,24 @@ Q_SIGNALS: void exitChanged(); void windowChanged(QQuickWindow *window); // 2.1 (Qt 5.8) - Q_REVISION(1) void spacingChanged(); + Q_REVISION(2, 1) void spacingChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void openedChanged(); - Q_REVISION(3) void mirroredChanged(); - Q_REVISION(3) void enabledChanged(); - Q_REVISION(3) void paletteChanged(); - Q_REVISION(3) void paletteCreated(); + Q_REVISION(2, 3) void openedChanged(); + Q_REVISION(2, 3) void mirroredChanged(); + Q_REVISION(2, 3) void enabledChanged(); + Q_REVISION(2, 3) void paletteChanged(); + Q_REVISION(2, 3) void paletteCreated(); // 2.5 (Qt 5.12) - Q_REVISION(5) void horizontalPaddingChanged(); - Q_REVISION(5) void verticalPaddingChanged(); - Q_REVISION(5) void implicitContentWidthChanged(); - Q_REVISION(5) void implicitContentHeightChanged(); - Q_REVISION(5) void implicitBackgroundWidthChanged(); - Q_REVISION(5) void implicitBackgroundHeightChanged(); - Q_REVISION(5) void topInsetChanged(); - Q_REVISION(5) void leftInsetChanged(); - Q_REVISION(5) void rightInsetChanged(); - Q_REVISION(5) void bottomInsetChanged(); + Q_REVISION(2, 5) void horizontalPaddingChanged(); + Q_REVISION(2, 5) void verticalPaddingChanged(); + Q_REVISION(2, 5) void implicitContentWidthChanged(); + Q_REVISION(2, 5) void implicitContentHeightChanged(); + Q_REVISION(2, 5) void implicitBackgroundWidthChanged(); + Q_REVISION(2, 5) void implicitBackgroundHeightChanged(); + Q_REVISION(2, 5) void topInsetChanged(); + Q_REVISION(2, 5) void leftInsetChanged(); + Q_REVISION(2, 5) void rightInsetChanged(); + Q_REVISION(2, 5) void bottomInsetChanged(); protected: QQuickPopup(QQuickPopupPrivate &dd, QObject *parent); diff --git a/src/quicktemplates2/qquickpopupanchors_p.h b/src/quicktemplates2/qquickpopupanchors_p.h index eff4e23d..dce1c5b2 100644 --- a/src/quicktemplates2/qquickpopupanchors_p.h +++ b/src/quicktemplates2/qquickpopupanchors_p.h @@ -63,6 +63,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupAnchors : public QObject, publ { Q_OBJECT Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged) + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 5) public: explicit QQuickPopupAnchors(QQuickPopup *popup); diff --git a/src/quicktemplates2/qquickprogressbar_p.h b/src/quicktemplates2/qquickprogressbar_p.h index f2284c65..8322670f 100644 --- a/src/quicktemplates2/qquickprogressbar_p.h +++ b/src/quicktemplates2/qquickprogressbar_p.h @@ -63,6 +63,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickProgressBar : public QQuickControl Q_PROPERTY(qreal position READ position NOTIFY positionChanged FINAL) Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL) Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate NOTIFY indeterminateChanged FINAL) + QML_NAMED_ELEMENT(ProgressBar) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickProgressBar(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickradiobutton_p.h b/src/quicktemplates2/qquickradiobutton_p.h index f937081f..29e18922 100644 --- a/src/quicktemplates2/qquickradiobutton_p.h +++ b/src/quicktemplates2/qquickradiobutton_p.h @@ -58,6 +58,8 @@ class QQuickRadioButtonPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRadioButton : public QQuickAbstractButton { Q_OBJECT + QML_NAMED_ELEMENT(RadioButton) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickRadioButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickradiodelegate_p.h b/src/quicktemplates2/qquickradiodelegate_p.h index 1a4761a3..0ddff985 100644 --- a/src/quicktemplates2/qquickradiodelegate_p.h +++ b/src/quicktemplates2/qquickradiodelegate_p.h @@ -57,6 +57,8 @@ class QQuickRadioDelegatePrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRadioDelegate : public QQuickItemDelegate { Q_OBJECT + QML_NAMED_ELEMENT(RadioDelegate) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickRadioDelegate(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickrangeslider_p.h b/src/quicktemplates2/qquickrangeslider_p.h index a42245a1..d767228e 100644 --- a/src/quicktemplates2/qquickrangeslider_p.h +++ b/src/quicktemplates2/qquickrangeslider_p.h @@ -66,12 +66,14 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRangeSlider : public QQuickControl Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged FINAL) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION 2) - Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION 5) + Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION(2, 5)) + QML_NAMED_ELEMENT(RangeSlider) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickRangeSlider(QQuickItem *parent = nullptr); @@ -116,7 +118,7 @@ public: qreal touchDragThreshold() const; void setTouchDragThreshold(qreal touchDragThreshold); void resetTouchDragThreshold(); - Q_REVISION(5) Q_INVOKABLE qreal valueAt(qreal position) const; + Q_REVISION(2, 5) Q_INVOKABLE qreal valueAt(qreal position) const; Q_SIGNALS: void fromChanged(); @@ -125,9 +127,9 @@ Q_SIGNALS: void snapModeChanged(); void orientationChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void liveChanged(); + Q_REVISION(2, 2) void liveChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void touchDragThresholdChanged(); + Q_REVISION(2, 5) void touchDragThresholdChanged(); protected: void focusInEvent(QFocusEvent *event) override; @@ -166,11 +168,13 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRangeSliderNode : public QObject Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL) Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION 1) + Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION(2, 1)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "handle") + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickRangeSliderNode(qreal value, QQuickRangeSlider *slider); @@ -207,11 +211,11 @@ Q_SIGNALS: void handleChanged(); void pressedChanged(); // 2.1 (Qt 5.8) - Q_REVISION(1) void hoveredChanged(); + Q_REVISION(2, 1) void hoveredChanged(); // 2.5 (Qt 5.12) - /*Q_REVISION(5)*/ void moved(); - /*Q_REVISION(5)*/ void implicitHandleWidthChanged(); - /*Q_REVISION(5)*/ void implicitHandleHeightChanged(); + /*Q_REVISION(2, 5)*/ void moved(); + /*Q_REVISION(2, 5)*/ void implicitHandleWidthChanged(); + /*Q_REVISION(2, 5)*/ void implicitHandleHeightChanged(); private: Q_DISABLE_COPY(QQuickRangeSliderNode) diff --git a/src/quicktemplates2/qquickroundbutton_p.h b/src/quicktemplates2/qquickroundbutton_p.h index dc5e432a..fdd46cf8 100644 --- a/src/quicktemplates2/qquickroundbutton_p.h +++ b/src/quicktemplates2/qquickroundbutton_p.h @@ -58,6 +58,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRoundButton : public QQuickButton { Q_OBJECT Q_PROPERTY(qreal radius READ radius WRITE setRadius RESET resetRadius NOTIFY radiusChanged FINAL) + QML_NAMED_ELEMENT(RoundButton) + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickRoundButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickscrollbar_p.h b/src/quicktemplates2/qquickscrollbar_p.h index 5fad8240..dee0b749 100644 --- a/src/quicktemplates2/qquickscrollbar_p.h +++ b/src/quicktemplates2/qquickscrollbar_p.h @@ -65,16 +65,19 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickScrollBar : public QQuickControl Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged FINAL REVISION 2) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive RESET resetInteractive NOTIFY interactiveChanged FINAL REVISION 2) - Q_PROPERTY(Policy policy READ policy WRITE setPolicy NOTIFY policyChanged FINAL REVISION 2) + Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive RESET resetInteractive NOTIFY interactiveChanged FINAL REVISION(2, 2)) + Q_PROPERTY(Policy policy READ policy WRITE setPolicy NOTIFY policyChanged FINAL REVISION(2, 2)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) - Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3)) // 2.4 (Qt 5.11) - Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION 4) - Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION 4) - Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION 4) + Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION(2, 4)) + QML_NAMED_ELEMENT(ScrollBar) + QML_ATTACHED(QQuickScrollBarAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickScrollBar(QQuickItem *parent = nullptr); @@ -146,13 +149,13 @@ Q_SIGNALS: void pressedChanged(); void orientationChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void snapModeChanged(); - Q_REVISION(2) void interactiveChanged(); - Q_REVISION(2) void policyChanged(); + Q_REVISION(2, 2) void snapModeChanged(); + Q_REVISION(2, 2) void interactiveChanged(); + Q_REVISION(2, 2) void policyChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void minimumSizeChanged(); - Q_REVISION(4) void visualSizeChanged(); - Q_REVISION(4) void visualPositionChanged(); + Q_REVISION(2, 4) void minimumSizeChanged(); + Q_REVISION(2, 4) void visualSizeChanged(); + Q_REVISION(2, 4) void visualPositionChanged(); protected: void mousePressEvent(QMouseEvent *event) override; diff --git a/src/quicktemplates2/qquickscrollindicator_p.h b/src/quicktemplates2/qquickscrollindicator_p.h index 4fa06a33..dbad6ffe 100644 --- a/src/quicktemplates2/qquickscrollindicator_p.h +++ b/src/quicktemplates2/qquickscrollindicator_p.h @@ -64,12 +64,15 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickScrollIndicator : public QQuickCont Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged FINAL) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) - Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3)) // 2.4 (Qt 5.11) - Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION 4) - Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION 4) - Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION 4) + Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION(2, 4)) + Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION(2, 4)) + QML_NAMED_ELEMENT(ScrollIndicator) + QML_ATTACHED(QQuickScrollIndicatorAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickScrollIndicator(QQuickItem *parent = nullptr); @@ -106,9 +109,9 @@ Q_SIGNALS: void activeChanged(); void orientationChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void minimumSizeChanged(); - Q_REVISION(4) void visualSizeChanged(); - Q_REVISION(4) void visualPositionChanged(); + Q_REVISION(2, 4) void minimumSizeChanged(); + Q_REVISION(2, 4) void visualSizeChanged(); + Q_REVISION(2, 4) void visualPositionChanged(); protected: #if QT_CONFIG(quicktemplates2_multitouch) diff --git a/src/quicktemplates2/qquickscrollview_p.h b/src/quicktemplates2/qquickscrollview_p.h index 2b8d260e..7eea46dd 100644 --- a/src/quicktemplates2/qquickscrollview_p.h +++ b/src/quicktemplates2/qquickscrollview_p.h @@ -58,6 +58,8 @@ class QQuickScrollViewPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickScrollView : public QQuickPane { Q_OBJECT + QML_NAMED_ELEMENT(ScrollView) + QML_ADDED_IN_VERSION(2, 2) public: explicit QQuickScrollView(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickslider_p.h b/src/quicktemplates2/qquickslider_p.h index c65733dc..ac03f7f9 100644 --- a/src/quicktemplates2/qquickslider_p.h +++ b/src/quicktemplates2/qquickslider_p.h @@ -67,15 +67,17 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSlider : public QQuickControl Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL) - Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION 2) + Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION(2, 2)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) - Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background,handle") + QML_NAMED_ELEMENT(Slider) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSlider(QQuickItem *parent = nullptr); @@ -116,7 +118,7 @@ public: void setHandle(QQuickItem *handle); // 2.1 (Qt 5.8) - Q_REVISION(1) Q_INVOKABLE qreal valueAt(qreal position) const; + Q_REVISION(2, 1) Q_INVOKABLE qreal valueAt(qreal position) const; // 2.2 (Qt 5.9) bool live() const; @@ -150,12 +152,12 @@ Q_SIGNALS: void orientationChanged(); void handleChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void moved(); - Q_REVISION(2) void liveChanged(); + Q_REVISION(2, 2) void moved(); + Q_REVISION(2, 2) void liveChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void touchDragThresholdChanged(); - Q_REVISION(5) void implicitHandleWidthChanged(); - Q_REVISION(5) void implicitHandleHeightChanged(); + Q_REVISION(2, 5) void touchDragThresholdChanged(); + Q_REVISION(2, 5) void implicitHandleWidthChanged(); + Q_REVISION(2, 5) void implicitHandleHeightChanged(); protected: void keyPressEvent(QKeyEvent *event) override; diff --git a/src/quicktemplates2/qquickspinbox_p.h b/src/quicktemplates2/qquickspinbox_p.h index 6b787674..d90aa531 100644 --- a/src/quicktemplates2/qquickspinbox_p.h +++ b/src/quicktemplates2/qquickspinbox_p.h @@ -72,12 +72,14 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSpinBox : public QQuickControl Q_PROPERTY(QQuickSpinButton *up READ up CONSTANT FINAL) Q_PROPERTY(QQuickSpinButton *down READ down CONSTANT FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION 2) - Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION 2) + Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged FINAL REVISION(2, 2)) + Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged FINAL REVISION(2, 2)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged FINAL REVISION 3) + Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged FINAL REVISION(2, 3)) // 2.4 (Qt 5.11) - Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged FINAL REVISION 4) + Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged FINAL REVISION(2, 4)) + QML_NAMED_ELEMENT(SpinBox) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSpinBox(QQuickItem *parent = nullptr); @@ -137,13 +139,13 @@ Q_SIGNALS: void textFromValueChanged(); void valueFromTextChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void valueModified(); - Q_REVISION(2) void inputMethodHintsChanged(); - Q_REVISION(2) void inputMethodComposingChanged(); + Q_REVISION(2, 2) void valueModified(); + Q_REVISION(2, 2) void inputMethodHintsChanged(); + Q_REVISION(2, 2) void inputMethodComposingChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void wrapChanged(); + Q_REVISION(2, 3) void wrapChanged(); // 2.4 (Qt 5.11) - Q_REVISION(4) void displayTextChanged(); + Q_REVISION(2, 4) void displayTextChanged(); protected: void focusInEvent(QFocusEvent *event) override; @@ -181,11 +183,13 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSpinButton : public QObject Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL) Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION 1) + Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION(2, 1)) // 2.5 (Qt 5.12) - Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION 5) + Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "indicator") + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSpinButton(QQuickSpinBox *parent); @@ -208,10 +212,10 @@ Q_SIGNALS: void pressedChanged(); void indicatorChanged(); // 2.1 (Qt 5.8) - Q_REVISION(1) void hoveredChanged(); + Q_REVISION(2, 1) void hoveredChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void implicitIndicatorWidthChanged(); - Q_REVISION(5) void implicitIndicatorHeightChanged(); + Q_REVISION(2, 5) void implicitIndicatorWidthChanged(); + Q_REVISION(2, 5) void implicitIndicatorHeightChanged(); private: Q_DISABLE_COPY(QQuickSpinButton) diff --git a/src/quicktemplates2/qquicksplitview_p.h b/src/quicktemplates2/qquicksplitview_p.h index 06dc1a55..55b45ed8 100644 --- a/src/quicktemplates2/qquicksplitview_p.h +++ b/src/quicktemplates2/qquicksplitview_p.h @@ -65,6 +65,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSplitView : public QQuickContainer Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) Q_PROPERTY(bool resizing READ isResizing NOTIFY resizingChanged) Q_PROPERTY(QQmlComponent *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL) + QML_NAMED_ELEMENT(SplitView) + QML_ATTACHED(QQuickSplitViewAttached) + QML_ADDED_IN_VERSION(2, 13) public: explicit QQuickSplitView(QQuickItem *parent = nullptr); @@ -190,6 +193,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSplitHandleAttached : public QObjec Q_OBJECT Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL) Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged FINAL) + QML_NAMED_ELEMENT(SplitHandle) + QML_ATTACHED(QQuickSplitHandleAttached) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(2, 13) public: explicit QQuickSplitHandleAttached(QObject *parent = nullptr); diff --git a/src/quicktemplates2/qquickstackview_p.h b/src/quicktemplates2/qquickstackview_p.h index f551f027..f4cb5458 100644 --- a/src/quicktemplates2/qquickstackview_p.h +++ b/src/quicktemplates2/qquickstackview_p.h @@ -73,7 +73,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickStackView : public QQuickControl Q_PROPERTY(QQuickTransition *replaceEnter READ replaceEnter WRITE setReplaceEnter NOTIFY replaceEnterChanged FINAL) Q_PROPERTY(QQuickTransition *replaceExit READ replaceExit WRITE setReplaceExit NOTIFY replaceExitChanged FINAL) // 2.3 (Qt 5.10) - Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged FINAL REVISION 3) + Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged FINAL REVISION(2, 3)) + QML_NAMED_ELEMENT(StackView) + QML_ATTACHED(QQuickStackViewAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickStackView(QQuickItem *parent = nullptr); @@ -153,7 +156,7 @@ Q_SIGNALS: void replaceEnterChanged(); void replaceExitChanged(); // 2.3 (Qt 5.10) - Q_REVISION(3) void emptyChanged(); + Q_REVISION(2, 3) void emptyChanged(); protected: void componentComplete() override; @@ -180,7 +183,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickStackViewAttached : public QObject Q_PROPERTY(QQuickStackView *view READ view NOTIFY viewChanged FINAL) Q_PROPERTY(QQuickStackView::Status status READ status NOTIFY statusChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible RESET resetVisible NOTIFY visibleChanged FINAL) // REVISION 2 + Q_PROPERTY(bool visible READ isVisible WRITE setVisible RESET resetVisible NOTIFY visibleChanged FINAL) // REVISION(2, 2) public: explicit QQuickStackViewAttached(QObject *parent = nullptr); @@ -200,13 +203,13 @@ Q_SIGNALS: void viewChanged(); void statusChanged(); // 2.1 (Qt 5.8) - /*Q_REVISION(1)*/ void activated(); - /*Q_REVISION(1)*/ void activating(); - /*Q_REVISION(1)*/ void deactivated(); - /*Q_REVISION(1)*/ void deactivating(); - /*Q_REVISION(1)*/ void removed(); + /*Q_REVISION(2, 1)*/ void activated(); + /*Q_REVISION(2, 1)*/ void activating(); + /*Q_REVISION(2, 1)*/ void deactivated(); + /*Q_REVISION(2, 1)*/ void deactivating(); + /*Q_REVISION(2, 1)*/ void removed(); // 2.2 (Qt 5.9) - /*Q_REVISION(2)*/ void visibleChanged(); + /*Q_REVISION(2, 2)*/ void visibleChanged(); private: Q_DISABLE_COPY(QQuickStackViewAttached) diff --git a/src/quicktemplates2/qquickswipe_p.h b/src/quicktemplates2/qquickswipe_p.h index 20e38e90..768d5638 100644 --- a/src/quicktemplates2/qquickswipe_p.h +++ b/src/quicktemplates2/qquickswipe_p.h @@ -71,8 +71,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipe : public QObject Q_PROPERTY(QQuickItem *behindItem READ behindItem NOTIFY behindItemChanged FINAL) Q_PROPERTY(QQuickItem *rightItem READ rightItem NOTIFY rightItemChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) // REVISION 2 - Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL) // REVISION 2 + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) // REVISION(2, 2) + Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL) // REVISION(2, 2) + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSwipe(QQuickSwipeDelegate *control); @@ -102,7 +104,7 @@ public: void setRightItem(QQuickItem *item); // 2.1 (Qt 5.8) - Q_REVISION(1) Q_INVOKABLE void close(); + Q_REVISION(2, 1) Q_INVOKABLE void close(); // 2.2 (Qt 5.9) bool isEnabled() const; @@ -111,7 +113,7 @@ public: QQuickTransition *transition() const; void setTransition(QQuickTransition *transition); - Q_REVISION(2) Q_INVOKABLE void open(QQuickSwipeDelegate::Side side); + Q_REVISION(2, 2) Q_INVOKABLE void open(QQuickSwipeDelegate::Side side); Q_SIGNALS: void positionChanged(); @@ -123,12 +125,12 @@ Q_SIGNALS: void behindItemChanged(); void rightItemChanged(); // 2.1 (Qt 5.8) - /*Q_REVISION(1)*/ void completed(); + /*Q_REVISION(2, 1)*/ void completed(); // 2.2 (Qt 5.9) - /*Q_REVISION(2)*/ void opened(); - /*Q_REVISION(2)*/ void closed(); - /*Q_REVISION(2)*/ void enabledChanged(); - /*Q_REVISION(2)*/ void transitionChanged(); + /*Q_REVISION(2, 2)*/ void opened(); + /*Q_REVISION(2, 2)*/ void closed(); + /*Q_REVISION(2, 2)*/ void enabledChanged(); + /*Q_REVISION(2, 2)*/ void transitionChanged(); private: Q_DISABLE_COPY(QQuickSwipe) diff --git a/src/quicktemplates2/qquickswipedelegate_p.h b/src/quicktemplates2/qquickswipedelegate_p.h index 76f9df5b..228f1085 100644 --- a/src/quicktemplates2/qquickswipedelegate_p.h +++ b/src/quicktemplates2/qquickswipedelegate_p.h @@ -61,6 +61,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipeDelegate : public QQuickItemDe { Q_OBJECT Q_PROPERTY(QQuickSwipe *swipe READ swipe CONSTANT FINAL) + QML_NAMED_ELEMENT(SwipeDelegate) + QML_ATTACHED(QQuickSwipeDelegateAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSwipeDelegate(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickswipeview_p.h b/src/quicktemplates2/qquickswipeview_p.h index 72d7d543..8a09a37e 100644 --- a/src/quicktemplates2/qquickswipeview_p.h +++ b/src/quicktemplates2/qquickswipeview_p.h @@ -59,12 +59,15 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipeView : public QQuickContainer { Q_OBJECT // 2.1 (Qt 5.8) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL REVISION 1) + Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL REVISION(2, 1)) // 2.2 (Qt 5.9) - Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL REVISION 2) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL REVISION(2, 2)) // 2.3 (Qt 5.10) - Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) - Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3)) + Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3)) + QML_NAMED_ELEMENT(SwipeView) + QML_ATTACHED(QQuickSwipeViewAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSwipeView(QQuickItem *parent = nullptr); @@ -85,9 +88,9 @@ public: Q_SIGNALS: // 2.1 (Qt 5.8) - Q_REVISION(1) void interactiveChanged(); + Q_REVISION(2, 1) void interactiveChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void orientationChanged(); + Q_REVISION(2, 2) void orientationChanged(); protected: void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; @@ -113,8 +116,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipeViewAttached : public QObject Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY isCurrentItemChanged FINAL) Q_PROPERTY(QQuickSwipeView *view READ view NOTIFY viewChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool isNextItem READ isNextItem NOTIFY isNextItemChanged FINAL REVISION 1) - Q_PROPERTY(bool isPreviousItem READ isPreviousItem NOTIFY isPreviousItemChanged FINAL REVISION 1) + Q_PROPERTY(bool isNextItem READ isNextItem NOTIFY isNextItemChanged FINAL REVISION(2, 1)) + Q_PROPERTY(bool isPreviousItem READ isPreviousItem NOTIFY isPreviousItemChanged FINAL REVISION(2, 1)) public: explicit QQuickSwipeViewAttached(QObject *parent = nullptr); @@ -132,8 +135,8 @@ Q_SIGNALS: void isCurrentItemChanged(); void viewChanged(); // 2.1 (Qt 5.8) - /*Q_REVISION(1)*/ void isNextItemChanged(); - /*Q_REVISION(1)*/ void isPreviousItemChanged(); + /*Q_REVISION(2, 1)*/ void isNextItemChanged(); + /*Q_REVISION(2, 1)*/ void isPreviousItemChanged(); private: Q_DISABLE_COPY(QQuickSwipeViewAttached) diff --git a/src/quicktemplates2/qquickswitch_p.h b/src/quicktemplates2/qquickswitch_p.h index e4c55c2b..b3df0299 100644 --- a/src/quicktemplates2/qquickswitch_p.h +++ b/src/quicktemplates2/qquickswitch_p.h @@ -59,6 +59,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwitch : public QQuickAbstractButto Q_OBJECT Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL) Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL) + QML_NAMED_ELEMENT(Switch) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSwitch(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquickswitchdelegate_p.h b/src/quicktemplates2/qquickswitchdelegate_p.h index 383a662d..a2eb6f62 100644 --- a/src/quicktemplates2/qquickswitchdelegate_p.h +++ b/src/quicktemplates2/qquickswitchdelegate_p.h @@ -59,6 +59,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwitchDelegate : public QQuickItemD Q_OBJECT Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL) Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL) + QML_NAMED_ELEMENT(SwitchDelegate) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickSwitchDelegate(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktabbar_p.h b/src/quicktemplates2/qquicktabbar_p.h index 42d39767..1025d3c6 100644 --- a/src/quicktemplates2/qquicktabbar_p.h +++ b/src/quicktemplates2/qquicktabbar_p.h @@ -61,8 +61,11 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTabBar : public QQuickContainer Q_OBJECT Q_PROPERTY(Position position READ position WRITE setPosition NOTIFY positionChanged FINAL) // 2.2 (Qt 5.9) - Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL REVISION 2) // re-declare QQuickContainer::contentWidth (REV 5) - Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL REVISION 2) // re-declare QQuickContainer::contentHeight (REV 5) + Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL REVISION(2, 2)) // re-declare QQuickContainer::contentWidth (REV 5) + Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL REVISION(2, 2)) // re-declare QQuickContainer::contentHeight (REV 5) + QML_NAMED_ELEMENT(TabBar) + QML_ATTACHED(QQuickTabBarAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickTabBar(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktabbutton_p.h b/src/quicktemplates2/qquicktabbutton_p.h index bcaf7c29..302180c4 100644 --- a/src/quicktemplates2/qquicktabbutton_p.h +++ b/src/quicktemplates2/qquicktabbutton_p.h @@ -57,6 +57,8 @@ class QQuickTabButtonPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTabButton : public QQuickAbstractButton { Q_OBJECT + QML_NAMED_ELEMENT(TabButton) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickTabButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktextarea_p.h b/src/quicktemplates2/qquicktextarea_p.h index 74247703..fed0eb59 100644 --- a/src/quicktemplates2/qquicktextarea_p.h +++ b/src/quicktemplates2/qquicktextarea_p.h @@ -69,17 +69,19 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTextArea : public QQuickTextEdit Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText NOTIFY placeholderTextChanged FINAL) Q_PROPERTY(Qt::FocusReason focusReason READ focusReason WRITE setFocusReason NOTIFY focusReasonChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION 1) - Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION 1) + Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION(2, 1)) + Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION(2, 1)) // 2.5 (Qt 5.12) - Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5) + Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background") + QML_NAMED_ELEMENT(TextArea) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickTextArea(QQuickItem *parent = nullptr); @@ -141,18 +143,18 @@ Q_SIGNALS: void focusReasonChanged(); void pressAndHold(QQuickMouseEvent *event); // 2.1 (Qt 5.8) - Q_REVISION(1) void pressed(QQuickMouseEvent *event); - Q_REVISION(1) void released(QQuickMouseEvent *event); - Q_REVISION(1) void hoveredChanged(); - Q_REVISION(1) void hoverEnabledChanged(); + Q_REVISION(2, 1) void pressed(QQuickMouseEvent *event); + Q_REVISION(2, 1) void released(QQuickMouseEvent *event); + Q_REVISION(2, 1) void hoveredChanged(); + Q_REVISION(2, 1) void hoverEnabledChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void placeholderTextColorChanged(); - Q_REVISION(5) void implicitBackgroundWidthChanged(); - Q_REVISION(5) void implicitBackgroundHeightChanged(); - Q_REVISION(5) void topInsetChanged(); - Q_REVISION(5) void leftInsetChanged(); - Q_REVISION(5) void rightInsetChanged(); - Q_REVISION(5) void bottomInsetChanged(); + Q_REVISION(2, 5) void placeholderTextColorChanged(); + Q_REVISION(2, 5) void implicitBackgroundWidthChanged(); + Q_REVISION(2, 5) void implicitBackgroundHeightChanged(); + Q_REVISION(2, 5) void topInsetChanged(); + Q_REVISION(2, 5) void leftInsetChanged(); + Q_REVISION(2, 5) void rightInsetChanged(); + Q_REVISION(2, 5) void bottomInsetChanged(); protected: friend struct QQuickPressHandler; @@ -204,6 +206,14 @@ private: Q_DECLARE_PRIVATE(QQuickTextAreaAttached) }; +struct QQuickTextEditForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickTextEdit) + QML_ADDED_IN_VERSION(2, 3) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickTextArea) diff --git a/src/quicktemplates2/qquicktextfield_p.h b/src/quicktemplates2/qquicktextfield_p.h index f24330c7..b1b9715c 100644 --- a/src/quicktemplates2/qquicktextfield_p.h +++ b/src/quicktemplates2/qquicktextfield_p.h @@ -68,17 +68,19 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTextField : public QQuickTextInput Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText NOTIFY placeholderTextChanged FINAL) Q_PROPERTY(Qt::FocusReason focusReason READ focusReason WRITE setFocusReason NOTIFY focusReasonChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION 1) - Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION 1) + Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION(2, 1)) + Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION(2, 1)) // 2.5 (Qt 5.12) - Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5) - Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5) - Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5) - Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5) + Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) + Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) Q_CLASSINFO("DeferredPropertyNames", "background") + QML_NAMED_ELEMENT(TextField) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickTextField(QQuickItem *parent = nullptr); @@ -136,18 +138,18 @@ Q_SIGNALS: void focusReasonChanged(); void pressAndHold(QQuickMouseEvent *event); // 2.1 (Qt 5.8) - Q_REVISION(1) void pressed(QQuickMouseEvent *event); - Q_REVISION(1) void released(QQuickMouseEvent *event); - Q_REVISION(1) void hoveredChanged(); - Q_REVISION(1) void hoverEnabledChanged(); + Q_REVISION(2, 1) void pressed(QQuickMouseEvent *event); + Q_REVISION(2, 1) void released(QQuickMouseEvent *event); + Q_REVISION(2, 1) void hoveredChanged(); + Q_REVISION(2, 1) void hoverEnabledChanged(); // 2.5 (Qt 5.12) - Q_REVISION(5) void placeholderTextColorChanged(); - Q_REVISION(5) void implicitBackgroundWidthChanged(); - Q_REVISION(5) void implicitBackgroundHeightChanged(); - Q_REVISION(5) void topInsetChanged(); - Q_REVISION(5) void leftInsetChanged(); - Q_REVISION(5) void rightInsetChanged(); - Q_REVISION(5) void bottomInsetChanged(); + Q_REVISION(2, 5) void placeholderTextColorChanged(); + Q_REVISION(2, 5) void implicitBackgroundWidthChanged(); + Q_REVISION(2, 5) void implicitBackgroundHeightChanged(); + Q_REVISION(2, 5) void topInsetChanged(); + Q_REVISION(2, 5) void leftInsetChanged(); + Q_REVISION(2, 5) void rightInsetChanged(); + Q_REVISION(2, 5) void bottomInsetChanged(); protected: friend struct QQuickPressHandler; @@ -178,6 +180,14 @@ private: Q_DECLARE_PRIVATE(QQuickTextField) }; +struct QQuickTextFieldForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQuickTextInput) + QML_ADDED_IN_VERSION(2, 2) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickTextField) diff --git a/src/quicktemplates2/qquicktoolbar_p.h b/src/quicktemplates2/qquicktoolbar_p.h index 631f553e..cefdeaa1 100644 --- a/src/quicktemplates2/qquicktoolbar_p.h +++ b/src/quicktemplates2/qquicktoolbar_p.h @@ -58,6 +58,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickToolBar : public QQuickPane { Q_OBJECT Q_PROPERTY(Position position READ position WRITE setPosition NOTIFY positionChanged FINAL) + QML_NAMED_ELEMENT(ToolBar) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickToolBar(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktoolbutton_p.h b/src/quicktemplates2/qquicktoolbutton_p.h index c8d70aef..2db052f6 100644 --- a/src/quicktemplates2/qquicktoolbutton_p.h +++ b/src/quicktemplates2/qquicktoolbutton_p.h @@ -57,6 +57,8 @@ class QQuickToolButtonPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickToolButton : public QQuickButton { Q_OBJECT + QML_NAMED_ELEMENT(ToolButton) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickToolButton(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktoolseparator_p.h b/src/quicktemplates2/qquicktoolseparator_p.h index 30bcf7df..e4692154 100644 --- a/src/quicktemplates2/qquicktoolseparator_p.h +++ b/src/quicktemplates2/qquicktoolseparator_p.h @@ -60,6 +60,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickToolSeparator : public QQuickContro Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL) Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL) Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL) + QML_NAMED_ELEMENT(ToolSeparator) + QML_ADDED_IN_VERSION(2, 1) public: explicit QQuickToolSeparator(QQuickItem *parent = nullptr); diff --git a/src/quicktemplates2/qquicktooltip_p.h b/src/quicktemplates2/qquicktooltip_p.h index a143452d..5be22fd8 100644 --- a/src/quicktemplates2/qquicktooltip_p.h +++ b/src/quicktemplates2/qquicktooltip_p.h @@ -62,6 +62,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickToolTip : public QQuickPopup Q_PROPERTY(int delay READ delay WRITE setDelay NOTIFY delayChanged FINAL) Q_PROPERTY(int timeout READ timeout WRITE setTimeout NOTIFY timeoutChanged FINAL) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) + QML_NAMED_ELEMENT(ToolTip) + QML_ATTACHED(QQuickToolTipAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickToolTip(QQuickItem *parent = nullptr); @@ -85,8 +88,8 @@ Q_SIGNALS: void timeoutChanged(); public Q_SLOTS: - Q_REVISION(5) void show(const QString &text, int ms = -1); - Q_REVISION(5) void hide(); + Q_REVISION(2, 5) void show(const QString &text, int ms = -1); + Q_REVISION(2, 5) void hide(); protected: QFont defaultFont() const override; diff --git a/src/quicktemplates2/qquicktumbler_p.h b/src/quicktemplates2/qquicktumbler_p.h index 046e8b8c..f9d5a13b 100644 --- a/src/quicktemplates2/qquicktumbler_p.h +++ b/src/quicktemplates2/qquicktumbler_p.h @@ -67,9 +67,12 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTumbler : public QQuickControl Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL) Q_PROPERTY(int visibleItemCount READ visibleItemCount WRITE setVisibleItemCount NOTIFY visibleItemCountChanged FINAL) // 2.1 (Qt 5.8) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap RESET resetWrap NOTIFY wrapChanged FINAL REVISION 1) + Q_PROPERTY(bool wrap READ wrap WRITE setWrap RESET resetWrap NOTIFY wrapChanged FINAL REVISION(2, 1)) // 2.2 (Qt 5.9) - Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged FINAL REVISION 2) + Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged FINAL REVISION(2, 2)) + QML_NAMED_ELEMENT(Tumbler) + QML_ATTACHED(QQuickTumblerAttached) + QML_ADDED_IN_VERSION(2, 0) public: explicit QQuickTumbler(QQuickItem *parent = nullptr); @@ -111,7 +114,7 @@ public: Q_ENUM(PositionMode) // 2.5 (Qt 5.12) - Q_REVISION(5) Q_INVOKABLE void positionViewAtIndex(int index, PositionMode mode); + Q_REVISION(2, 5) Q_INVOKABLE void positionViewAtIndex(int index, PositionMode mode); Q_SIGNALS: void modelChanged(); @@ -121,9 +124,9 @@ Q_SIGNALS: void delegateChanged(); void visibleItemCountChanged(); // 2.1 (Qt 5.8) - Q_REVISION(1) void wrapChanged(); + Q_REVISION(2, 1) void wrapChanged(); // 2.2 (Qt 5.9) - Q_REVISION(2) void movingChanged(); + Q_REVISION(2, 2) void movingChanged(); protected: void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; diff --git a/src/quicktemplates2/qtquicktemplates2global_p.h b/src/quicktemplates2/qtquicktemplates2global_p.h index e5ee3f2e..37d81888 100644 --- a/src/quicktemplates2/qtquicktemplates2global_p.h +++ b/src/quicktemplates2/qtquicktemplates2global_p.h @@ -66,4 +66,6 @@ QT_BEGIN_NAMESPACE QT_END_NAMESPACE +Q_QUICKTEMPLATES2_PRIVATE_EXPORT void qml_register_types_QtQuick_Templates(); + #endif // QTQUICKTEMPLATES2GLOBAL_P_H diff --git a/src/quicktemplates2/quicktemplates2.pro b/src/quicktemplates2/quicktemplates2.pro index 8ed0151a..3567923e 100644 --- a/src/quicktemplates2/quicktemplates2.pro +++ b/src/quicktemplates2/quicktemplates2.pro @@ -12,3 +12,9 @@ HEADERS += \ include(quicktemplates2.pri) load(qt_module) + +QMLTYPES_FILENAME = plugins.qmltypes +QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Templates +QML_IMPORT_NAME = QtQuick.Templates +QML_IMPORT_VERSION = 2.15 +CONFIG += qmltypes install_qmltypes install_metatypes diff --git a/src/src.pro b/src/src.pro index 7f945ffb..b6d3b850 100644 --- a/src/src.pro +++ b/src/src.pro @@ -2,7 +2,9 @@ TEMPLATE = subdirs SUBDIRS += \ quicktemplates2 \ quickcontrols2 \ + quickcontrols2impl \ imports quickcontrols2.depends = quicktemplates2 -imports.depends = quickcontrols2 quicktemplates2 +quickcontrols2impl.depends = quicktemplates2 +imports.depends = quicktemplates2 quickcontrols2 quickcontrols2impl -- cgit v1.2.3 From 44847322109bd237498f3f74c4784bf27757a810 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 26 Mar 2020 16:07:16 +0100 Subject: Remove ".2" from TARGETPATH, resource prefixes, etc. Qt Quick Controls 1 will be removed in Qt 6, so now we can have the simplified path for ourselves. Having the .2 in the path causes issues for importing now that the version is being bumped to 6. Task-number: QTBUG-82922 Change-Id: I0b92cdd44c42c19b1c82e7b9a7959b86ac26c6e2 Reviewed-by: Ulf Hermann --- src/imports/controls/controls.pro | 2 +- src/imports/controls/default/CheckBox.qml | 2 +- src/imports/controls/default/CheckDelegate.qml | 2 +- src/imports/controls/default/ComboBox.qml | 2 +- src/imports/controls/default/Dial.qml | 2 +- src/imports/controls/default/MenuItem.qml | 4 ++-- src/imports/controls/default/default.pro | 2 +- src/imports/controls/default/impl/default-impl.pro | 2 +- src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc | 2 +- .../controls/doc/snippets/qtquickcontrols2-button-icononly.qml | 2 +- .../controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml | 2 +- src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc | 4 ++-- src/imports/controls/fusion/fusion.pro | 2 +- src/imports/controls/fusion/impl/fusion-impl.pro | 2 +- src/imports/controls/imagine/imagine.pro | 2 +- src/imports/controls/imagine/impl/imagine-impl.pro | 2 +- src/imports/controls/material/impl/material-impl.pro | 2 +- src/imports/controls/material/material.pro | 2 +- src/imports/controls/universal/impl/universal-impl.pro | 2 +- src/imports/controls/universal/universal.pro | 2 +- src/imports/controlsimpl/controlsimpl.pro | 2 +- 21 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 5a782f2d..16a95510 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2plugin -TARGETPATH = QtQuick/Controls.2 +TARGETPATH = QtQuick/Controls IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick diff --git a/src/imports/controls/default/CheckBox.qml b/src/imports/controls/default/CheckBox.qml index 3a7c3a06..eae6e208 100644 --- a/src/imports/controls/default/CheckBox.qml +++ b/src/imports/controls/default/CheckBox.qml @@ -68,7 +68,7 @@ T.CheckBox { y: (parent.height - height) / 2 defaultColor: "#353637" color: control.palette.text - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" visible: control.checkState === Qt.Checked } diff --git a/src/imports/controls/default/CheckDelegate.qml b/src/imports/controls/default/CheckDelegate.qml index 4dec9b98..176e0843 100644 --- a/src/imports/controls/default/CheckDelegate.qml +++ b/src/imports/controls/default/CheckDelegate.qml @@ -87,7 +87,7 @@ T.CheckDelegate { y: (parent.height - height) / 2 defaultColor: "#353637" color: control.palette.text - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" visible: control.checkState === Qt.Checked } diff --git a/src/imports/controls/default/ComboBox.qml b/src/imports/controls/default/ComboBox.qml index 2c36aac6..a402b7be 100644 --- a/src/imports/controls/default/ComboBox.qml +++ b/src/imports/controls/default/ComboBox.qml @@ -67,7 +67,7 @@ T.ComboBox { y: control.topPadding + (control.availableHeight - height) / 2 color: control.palette.dark defaultColor: "#353637" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/double-arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/double-arrow.png" opacity: enabled ? 1 : 0.3 } diff --git a/src/imports/controls/default/Dial.qml b/src/imports/controls/default/Dial.qml index daae1e64..8e94e2fb 100644 --- a/src/imports/controls/default/Dial.qml +++ b/src/imports/controls/default/Dial.qml @@ -63,7 +63,7 @@ T.Dial { height: 10 defaultColor: "#353637" color: control.visualFocus ? control.palette.highlight : control.palette.dark - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/dial-indicator.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/dial-indicator.png" antialiasing: true opacity: control.enabled ? 1 : 0.3 transform: [ diff --git a/src/imports/controls/default/MenuItem.qml b/src/imports/controls/default/MenuItem.qml index 0632decb..678bac57 100644 --- a/src/imports/controls/default/MenuItem.qml +++ b/src/imports/controls/default/MenuItem.qml @@ -77,7 +77,7 @@ T.MenuItem { y: control.topPadding + (control.availableHeight - height) / 2 visible: control.checked - source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" : "" + source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" : "" color: control.palette.windowText defaultColor: "#353637" } @@ -88,7 +88,7 @@ T.MenuItem { visible: control.subMenu mirror: control.mirrored - source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/arrow-indicator.png" : "" + source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/arrow-indicator.png" : "" color: control.palette.windowText defaultColor: "#353637" } diff --git a/src/imports/controls/default/default.pro b/src/imports/controls/default/default.pro index 46e46531..ae6761a5 100644 --- a/src/imports/controls/default/default.pro +++ b/src/imports/controls/default/default.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2defaultstyleplugin -TARGETPATH = QtQuick/Controls.2/Default +TARGETPATH = QtQuick/Controls/Default IMPORT_NAME = QtQuick.Controls.Default IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/default/impl/default-impl.pro b/src/imports/controls/default/impl/default-impl.pro index 88ec2077..35368a5e 100644 --- a/src/imports/controls/default/impl/default-impl.pro +++ b/src/imports/controls/default/impl/default-impl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2defaultstyleimplplugin -TARGETPATH = QtQuick/Controls.2/Default/impl +TARGETPATH = QtQuick/Controls/Default/impl QML_IMPORT_NAME = QtQuick.Controls.Default.impl QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc index eddadf2d..a6058dd1 100644 --- a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc +++ b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.qrc @@ -1,5 +1,5 @@ - + images/arrow-indicator.png images/arrow-indicator@2x.png images/arrow-indicator@3x.png diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml index a04f93cb..ec9d773e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml @@ -29,6 +29,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 Button { - icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" display: Button.IconOnly } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml index 0c1f8ef1..3bd35a84 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml @@ -30,6 +30,6 @@ import QtQuick.Controls 2.12 Button { text: "Button" - icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png" + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" display: Button.TextBesideIcon } diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc index 5226646e..6ab649d0 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc @@ -58,7 +58,7 @@ \c Button.qml. This file can be found in the following path in your Qt installation: - \c {$QTDIR/qml/QtQuick/Controls.2/Default/Button.qml} + \c {$QTDIR/qml/QtQuick/Controls/Default/Button.qml} After doing that, we'll simply add the following line: @@ -397,7 +397,7 @@ \endcode We then copy \c Button.qml from the Default style in - \c {$QTDIR/qml/QtQuick/Controls.2/Default/} into a new \c myproject folder in our + \c {$QTDIR/qml/QtQuick/Controls/Default/} into a new \c myproject folder in our project directory. Add the newly copied \c Button.qml to \c qml.qrc, which is the resource file that contains our QML files. diff --git a/src/imports/controls/fusion/fusion.pro b/src/imports/controls/fusion/fusion.pro index 663636da..49585212 100644 --- a/src/imports/controls/fusion/fusion.pro +++ b/src/imports/controls/fusion/fusion.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2fusionstyleplugin -TARGETPATH = QtQuick/Controls.2/Fusion +TARGETPATH = QtQuick/Controls/Fusion IMPORT_NAME = QtQuick.Controls.Fusion IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/fusion/impl/fusion-impl.pro b/src/imports/controls/fusion/impl/fusion-impl.pro index e3333e18..78692abd 100644 --- a/src/imports/controls/fusion/impl/fusion-impl.pro +++ b/src/imports/controls/fusion/impl/fusion-impl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2fusionstyleimplplugin -TARGETPATH = QtQuick/Controls.2/Fusion/impl +TARGETPATH = QtQuick/Controls/Fusion/impl QML_IMPORT_NAME = QtQuick.Controls.Fusion.impl QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/imagine/imagine.pro b/src/imports/controls/imagine/imagine.pro index 0dfba717..9bb6afd4 100644 --- a/src/imports/controls/imagine/imagine.pro +++ b/src/imports/controls/imagine/imagine.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2imaginestyleplugin -TARGETPATH = QtQuick/Controls.2/Imagine +TARGETPATH = QtQuick/Controls/Imagine IMPORT_NAME = QtQuick.Controls.Imagine IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/imagine/impl/imagine-impl.pro b/src/imports/controls/imagine/impl/imagine-impl.pro index cb0f7043..9b45fd31 100644 --- a/src/imports/controls/imagine/impl/imagine-impl.pro +++ b/src/imports/controls/imagine/impl/imagine-impl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2imaginestyleimplplugin -TARGETPATH = QtQuick/Controls.2/Imagine/impl +TARGETPATH = QtQuick/Controls/Imagine/impl QML_IMPORT_NAME = QtQuick.Controls.Imagine.impl QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/material/impl/material-impl.pro b/src/imports/controls/material/impl/material-impl.pro index f0a97b18..bc063d84 100644 --- a/src/imports/controls/material/impl/material-impl.pro +++ b/src/imports/controls/material/impl/material-impl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2materialstyleimplplugin -TARGETPATH = QtQuick/Controls.2/Material/impl +TARGETPATH = QtQuick/Controls/Material/impl QML_IMPORT_NAME = QtQuick.Controls.Material.impl QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index 269f704d..ce96924e 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2materialstyleplugin -TARGETPATH = QtQuick/Controls.2/Material +TARGETPATH = QtQuick/Controls/Material IMPORT_NAME = QtQuick.Controls.Material IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/universal/impl/universal-impl.pro b/src/imports/controls/universal/impl/universal-impl.pro index 520f3243..a27ae154 100644 --- a/src/imports/controls/universal/impl/universal-impl.pro +++ b/src/imports/controls/universal/impl/universal-impl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2universalstyleimplplugin -TARGETPATH = QtQuick/Controls.2/Universal/impl +TARGETPATH = QtQuick/Controls/Universal/impl QML_IMPORT_NAME = QtQuick.Controls.Universal.impl QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index 9065936c..33dd8f14 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2universalstyleplugin -TARGETPATH = QtQuick/Controls.2/Universal +TARGETPATH = QtQuick/Controls/Universal IMPORT_NAME = QtQuick.Controls.Universal IMPORT_VERSION = 2.$$QT_MINOR_VERSION diff --git a/src/imports/controlsimpl/controlsimpl.pro b/src/imports/controlsimpl/controlsimpl.pro index 70f3e170..89d4e1bd 100644 --- a/src/imports/controlsimpl/controlsimpl.pro +++ b/src/imports/controlsimpl/controlsimpl.pro @@ -1,5 +1,5 @@ TARGET = qtquickcontrols2implplugin -TARGETPATH = QtQuick/Controls.2/impl +TARGETPATH = QtQuick/Controls/impl IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick -- cgit v1.2.3 From d451cab0c8b727fa7f12a169a3d6ee449a3a1902 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 26 Mar 2020 17:01:51 +0100 Subject: Remove all version numbers from QML imports As of Qt 6, the latest version will be used by default. This saves us a lot of effort in terms of version bumps. Task-number: QTBUG-82922 Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928 Reviewed-by: Fabian Kosmale --- src/imports/controls/default/AbstractButton.qml | 4 ++-- src/imports/controls/default/Action.qml | 4 ++-- src/imports/controls/default/ActionGroup.qml | 4 ++-- src/imports/controls/default/ApplicationWindow.qml | 10 +++++----- src/imports/controls/default/BusyIndicator.qml | 8 ++++---- src/imports/controls/default/Button.qml | 8 ++++---- src/imports/controls/default/ButtonGroup.qml | 4 ++-- src/imports/controls/default/CheckBox.qml | 8 ++++---- src/imports/controls/default/CheckDelegate.qml | 8 ++++---- src/imports/controls/default/ComboBox.qml | 10 +++++----- src/imports/controls/default/Container.qml | 4 ++-- src/imports/controls/default/Control.qml | 4 ++-- src/imports/controls/default/DelayButton.qml | 8 ++++---- src/imports/controls/default/Dial.qml | 10 +++++----- src/imports/controls/default/Dialog.qml | 8 ++++---- src/imports/controls/default/DialogButtonBox.qml | 4 ++-- src/imports/controls/default/Drawer.qml | 8 ++++---- src/imports/controls/default/Frame.qml | 8 ++++---- src/imports/controls/default/GroupBox.qml | 8 ++++---- src/imports/controls/default/HorizontalHeaderView.qml | 6 +++--- src/imports/controls/default/ItemDelegate.qml | 8 ++++---- src/imports/controls/default/Label.qml | 8 ++++---- src/imports/controls/default/Menu.qml | 10 +++++----- src/imports/controls/default/MenuBar.qml | 8 ++++---- src/imports/controls/default/MenuBarItem.qml | 8 ++++---- src/imports/controls/default/MenuItem.qml | 8 ++++---- src/imports/controls/default/MenuSeparator.qml | 8 ++++---- src/imports/controls/default/Page.qml | 8 ++++---- src/imports/controls/default/PageIndicator.qml | 8 ++++---- src/imports/controls/default/Pane.qml | 8 ++++---- src/imports/controls/default/Popup.qml | 8 ++++---- src/imports/controls/default/ProgressBar.qml | 8 ++++---- src/imports/controls/default/RadioButton.qml | 8 ++++---- src/imports/controls/default/RadioDelegate.qml | 8 ++++---- src/imports/controls/default/RangeSlider.qml | 8 ++++---- src/imports/controls/default/RoundButton.qml | 8 ++++---- src/imports/controls/default/ScrollBar.qml | 8 ++++---- src/imports/controls/default/ScrollIndicator.qml | 8 ++++---- src/imports/controls/default/ScrollView.qml | 8 ++++---- src/imports/controls/default/Slider.qml | 8 ++++---- src/imports/controls/default/SpinBox.qml | 8 ++++---- src/imports/controls/default/SplitView.qml | 8 ++++---- src/imports/controls/default/StackView.qml | 6 +++--- src/imports/controls/default/SwipeDelegate.qml | 8 ++++---- src/imports/controls/default/SwipeView.qml | 6 +++--- src/imports/controls/default/Switch.qml | 8 ++++---- src/imports/controls/default/SwitchDelegate.qml | 8 ++++---- src/imports/controls/default/TabBar.qml | 4 ++-- src/imports/controls/default/TabButton.qml | 8 ++++---- src/imports/controls/default/TextArea.qml | 8 ++++---- src/imports/controls/default/TextField.qml | 8 ++++---- src/imports/controls/default/ToolBar.qml | 8 ++++---- src/imports/controls/default/ToolButton.qml | 8 ++++---- src/imports/controls/default/ToolSeparator.qml | 8 ++++---- src/imports/controls/default/ToolTip.qml | 8 ++++---- src/imports/controls/default/Tumbler.qml | 8 ++++---- src/imports/controls/default/VerticalHeaderView.qml | 6 +++--- src/imports/controls/designer/AbstractButtonSection.qml | 6 +++--- src/imports/controls/designer/BusyIndicatorSpecifics.qml | 6 +++--- src/imports/controls/designer/ButtonSection.qml | 6 +++--- src/imports/controls/designer/ButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/CheckBoxSpecifics.qml | 6 +++--- src/imports/controls/designer/CheckDelegateSpecifics.qml | 6 +++--- src/imports/controls/designer/CheckSection.qml | 6 +++--- src/imports/controls/designer/ComboBoxSpecifics.qml | 6 +++--- src/imports/controls/designer/ContainerSection.qml | 6 +++--- src/imports/controls/designer/ControlSection.qml | 6 +++--- src/imports/controls/designer/ControlSpecifics.qml | 6 +++--- src/imports/controls/designer/DelayButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/DialSpecifics.qml | 6 +++--- src/imports/controls/designer/FrameSpecifics.qml | 6 +++--- src/imports/controls/designer/GroupBoxSpecifics.qml | 6 +++--- src/imports/controls/designer/InsetSection.qml | 6 +++--- src/imports/controls/designer/ItemDelegateSection.qml | 6 +++--- src/imports/controls/designer/ItemDelegateSpecifics.qml | 6 +++--- src/imports/controls/designer/LabelSpecifics.qml | 6 +++--- src/imports/controls/designer/PaddingSection.qml | 6 +++--- src/imports/controls/designer/PageIndicatorSpecifics.qml | 6 +++--- src/imports/controls/designer/PageSpecifics.qml | 6 +++--- src/imports/controls/designer/PaneSection.qml | 6 +++--- src/imports/controls/designer/PaneSpecifics.qml | 6 +++--- src/imports/controls/designer/ProgressBarSpecifics.qml | 6 +++--- src/imports/controls/designer/RadioButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/RadioDelegateSpecifics.qml | 6 +++--- src/imports/controls/designer/RangeSliderSpecifics.qml | 6 +++--- src/imports/controls/designer/RoundButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/ScrollViewSpecifics.qml | 6 +++--- src/imports/controls/designer/SliderSpecifics.qml | 6 +++--- src/imports/controls/designer/SpinBoxSpecifics.qml | 6 +++--- src/imports/controls/designer/StackViewSpecifics.qml | 6 +++--- src/imports/controls/designer/SwipeDelegateSpecifics.qml | 6 +++--- src/imports/controls/designer/SwipeViewSpecifics.qml | 6 +++--- src/imports/controls/designer/SwitchDelegateSpecifics.qml | 6 +++--- src/imports/controls/designer/SwitchSpecifics.qml | 6 +++--- src/imports/controls/designer/TabBarSpecifics.qml | 6 +++--- src/imports/controls/designer/TabButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/TextAreaSpecifics.qml | 6 +++--- src/imports/controls/designer/TextFieldSpecifics.qml | 6 +++--- src/imports/controls/designer/ToolBarSpecifics.qml | 6 +++--- src/imports/controls/designer/ToolButtonSpecifics.qml | 6 +++--- src/imports/controls/designer/ToolSeparatorSpecifics.qml | 6 +++--- src/imports/controls/designer/TumblerSpecifics.qml | 6 +++--- .../controls/doc/snippets/qtquickcontrols2-action.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-busyindicator-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-button-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-button-icononly.qml | 4 ++-- .../snippets/qtquickcontrols2-button-textbesideicon.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-button-textonly.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-checkbox-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-checkbox-group.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-checkdelegate-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-combobox-accepted.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-combobox-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-combobox-valuerole.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-delaybutton-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-dial-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-dialog-modal.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-dialog-modeless.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-dialog.qml | 4 ++-- .../snippets/qtquickcontrols2-dialogbuttonbox-attached.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-dialogbuttonbox.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-frame-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-frame.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-groupbox-checkable.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-groupbox-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-groupbox.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-headerview-simple.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-itemdelegate-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-itemdelegate.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-label-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-label.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-material-accent.qml | 8 ++++---- .../doc/snippets/qtquickcontrols2-material-background.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-material-elevation.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-material-foreground.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-material-theme.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-material-variant.qml | 8 ++++---- .../controls/doc/snippets/qtquickcontrols2-menu-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-menubar-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-menubar.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-menuseparator-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-menuseparator.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-overlay-modal.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-overlay-modeless.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-pageindicator-custom.qml | 4 ++-- .../qtquickcontrols2-pageindicator-interactive.qml | 2 +- .../doc/snippets/qtquickcontrols2-pageindicator.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-pane-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-pane.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-popup-custom.qml | 6 +++--- .../controls/doc/snippets/qtquickcontrols2-popup.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-progressbar-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-radiobutton-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-radiodelegate-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-rangeslider-custom.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-roundbutton.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollbar-active.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollbar-custom.qml | 4 ++-- .../snippets/qtquickcontrols2-scrollbar-non-attached.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollbar-policy.qml | 4 ++-- .../snippets/qtquickcontrols2-scrollindicator-active.qml | 4 ++-- .../snippets/qtquickcontrols2-scrollindicator-custom.qml | 4 ++-- .../qtquickcontrols2-scrollindicator-non-attached.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollview-custom.qml | 4 ++-- .../snippets/qtquickcontrols2-scrollview-interactive.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollview-listview.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-scrollview-policy.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-scrollview.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-slider-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-spinbox-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-spinbox-double.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-spinbox-textual.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-spinbox.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-splitview-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-stackview-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-stackview-visible.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-swipedelegate-custom.qml | 4 ++-- .../snippets/qtquickcontrols2-swipedelegate-transition.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-swipedelegate.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-swipeview-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-swipeview-indicator.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-switch-custom.qml | 4 ++-- .../snippets/qtquickcontrols2-switchdelegate-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tabbar-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tabbar-explicit.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tabbar-flickable.qml | 4 ++-- .../controls/doc/snippets/qtquickcontrols2-tabbar.qml | 6 +++--- .../controls/doc/snippets/qtquickcontrols2-tabbutton.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textarea-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textarea-scrollable.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textfield-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textfield-disabled.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textfield-focused.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-textfield-normal.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-toolbar-custom.qml | 6 +++--- .../controls/doc/snippets/qtquickcontrols2-toolbar.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-toolbutton-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-toolseparator-custom.qml | 8 ++++---- .../doc/snippets/qtquickcontrols2-toolseparator.qml | 8 ++++---- .../doc/snippets/qtquickcontrols2-tooltip-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tooltip-hover.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tooltip-pressandhold.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tooltip-slider.qml | 6 +++--- .../controls/doc/snippets/qtquickcontrols2-tooltip.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-tumbler-custom.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tumbler-listView.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tumbler-pathView.qml | 4 ++-- .../doc/snippets/qtquickcontrols2-tumbler-timePicker.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-universal-accent.qml | 8 ++++---- .../doc/snippets/qtquickcontrols2-universal-background.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-universal-foreground.qml | 6 +++--- .../doc/snippets/qtquickcontrols2-universal-theme.qml | 6 +++--- src/imports/controls/fusion/ApplicationWindow.qml | 10 +++++----- src/imports/controls/fusion/BusyIndicator.qml | 12 ++++++------ src/imports/controls/fusion/Button.qml | 12 ++++++------ src/imports/controls/fusion/CheckBox.qml | 12 ++++++------ src/imports/controls/fusion/CheckDelegate.qml | 12 ++++++------ src/imports/controls/fusion/ComboBox.qml | 14 +++++++------- src/imports/controls/fusion/DelayButton.qml | 12 ++++++------ src/imports/controls/fusion/Dial.qml | 12 ++++++------ src/imports/controls/fusion/Dialog.qml | 12 ++++++------ src/imports/controls/fusion/DialogButtonBox.qml | 12 ++++++------ src/imports/controls/fusion/Drawer.qml | 12 ++++++------ src/imports/controls/fusion/Frame.qml | 12 ++++++------ src/imports/controls/fusion/GroupBox.qml | 12 ++++++------ src/imports/controls/fusion/HorizontalHeaderView.qml | 6 +++--- src/imports/controls/fusion/ItemDelegate.qml | 12 ++++++------ src/imports/controls/fusion/Label.qml | 12 ++++++------ src/imports/controls/fusion/Menu.qml | 14 +++++++------- src/imports/controls/fusion/MenuBar.qml | 12 ++++++------ src/imports/controls/fusion/MenuBarItem.qml | 12 ++++++------ src/imports/controls/fusion/MenuItem.qml | 12 ++++++------ src/imports/controls/fusion/MenuSeparator.qml | 12 ++++++------ src/imports/controls/fusion/Page.qml | 12 ++++++------ src/imports/controls/fusion/PageIndicator.qml | 12 ++++++------ src/imports/controls/fusion/Pane.qml | 12 ++++++------ src/imports/controls/fusion/Popup.qml | 12 ++++++------ src/imports/controls/fusion/ProgressBar.qml | 12 ++++++------ src/imports/controls/fusion/RadioButton.qml | 12 ++++++------ src/imports/controls/fusion/RadioDelegate.qml | 12 ++++++------ src/imports/controls/fusion/RangeSlider.qml | 12 ++++++------ src/imports/controls/fusion/RoundButton.qml | 12 ++++++------ src/imports/controls/fusion/ScrollBar.qml | 12 ++++++------ src/imports/controls/fusion/ScrollIndicator.qml | 12 ++++++------ src/imports/controls/fusion/Slider.qml | 12 ++++++------ src/imports/controls/fusion/SpinBox.qml | 12 ++++++------ src/imports/controls/fusion/SplitView.qml | 10 +++++----- src/imports/controls/fusion/SwipeDelegate.qml | 12 ++++++------ src/imports/controls/fusion/Switch.qml | 12 ++++++------ src/imports/controls/fusion/SwitchDelegate.qml | 12 ++++++------ src/imports/controls/fusion/TabBar.qml | 12 ++++++------ src/imports/controls/fusion/TabButton.qml | 12 ++++++------ src/imports/controls/fusion/TextArea.qml | 12 ++++++------ src/imports/controls/fusion/TextField.qml | 12 ++++++------ src/imports/controls/fusion/ToolBar.qml | 12 ++++++------ src/imports/controls/fusion/ToolButton.qml | 12 ++++++------ src/imports/controls/fusion/ToolSeparator.qml | 12 ++++++------ src/imports/controls/fusion/ToolTip.qml | 12 ++++++------ src/imports/controls/fusion/Tumbler.qml | 12 ++++++------ src/imports/controls/fusion/VerticalHeaderView.qml | 6 +++--- src/imports/controls/fusion/impl/ButtonPanel.qml | 10 +++++----- src/imports/controls/fusion/impl/CheckIndicator.qml | 10 +++++----- src/imports/controls/fusion/impl/RadioIndicator.qml | 10 +++++----- src/imports/controls/fusion/impl/SliderGroove.qml | 10 +++++----- src/imports/controls/fusion/impl/SliderHandle.qml | 10 +++++----- src/imports/controls/fusion/impl/SwitchIndicator.qml | 10 +++++----- src/imports/controls/imagine/ApplicationWindow.qml | 10 +++++----- src/imports/controls/imagine/BusyIndicator.qml | 8 ++++---- src/imports/controls/imagine/Button.qml | 12 ++++++------ src/imports/controls/imagine/CheckBox.qml | 8 ++++---- src/imports/controls/imagine/CheckDelegate.qml | 12 ++++++------ src/imports/controls/imagine/ComboBox.qml | 12 ++++++------ src/imports/controls/imagine/DelayButton.qml | 8 ++++---- src/imports/controls/imagine/Dial.qml | 8 ++++---- src/imports/controls/imagine/Dialog.qml | 10 +++++----- src/imports/controls/imagine/DialogButtonBox.qml | 10 +++++----- src/imports/controls/imagine/Drawer.qml | 8 ++++---- src/imports/controls/imagine/Frame.qml | 8 ++++---- src/imports/controls/imagine/GroupBox.qml | 10 +++++----- src/imports/controls/imagine/HorizontalHeaderView.qml | 6 +++--- src/imports/controls/imagine/ItemDelegate.qml | 12 ++++++------ src/imports/controls/imagine/Label.qml | 8 ++++---- src/imports/controls/imagine/Menu.qml | 12 ++++++------ src/imports/controls/imagine/MenuItem.qml | 12 ++++++------ src/imports/controls/imagine/MenuSeparator.qml | 8 ++++---- src/imports/controls/imagine/Page.qml | 8 ++++---- src/imports/controls/imagine/PageIndicator.qml | 8 ++++---- src/imports/controls/imagine/Pane.qml | 8 ++++---- src/imports/controls/imagine/Popup.qml | 8 ++++---- src/imports/controls/imagine/ProgressBar.qml | 8 ++++---- src/imports/controls/imagine/RadioButton.qml | 8 ++++---- src/imports/controls/imagine/RadioDelegate.qml | 12 ++++++------ src/imports/controls/imagine/RangeSlider.qml | 8 ++++---- src/imports/controls/imagine/RoundButton.qml | 12 ++++++------ src/imports/controls/imagine/ScrollBar.qml | 8 ++++---- src/imports/controls/imagine/ScrollIndicator.qml | 8 ++++---- src/imports/controls/imagine/ScrollView.qml | 10 +++++----- src/imports/controls/imagine/Slider.qml | 8 ++++---- src/imports/controls/imagine/SpinBox.qml | 8 ++++---- src/imports/controls/imagine/SplitView.qml | 8 ++++---- src/imports/controls/imagine/StackView.qml | 8 ++++---- src/imports/controls/imagine/SwipeDelegate.qml | 12 ++++++------ src/imports/controls/imagine/SwipeView.qml | 8 ++++---- src/imports/controls/imagine/Switch.qml | 8 ++++---- src/imports/controls/imagine/SwitchDelegate.qml | 12 ++++++------ src/imports/controls/imagine/TabBar.qml | 8 ++++---- src/imports/controls/imagine/TabButton.qml | 12 ++++++------ src/imports/controls/imagine/TextArea.qml | 12 ++++++------ src/imports/controls/imagine/TextField.qml | 12 ++++++------ src/imports/controls/imagine/ToolBar.qml | 8 ++++---- src/imports/controls/imagine/ToolButton.qml | 12 ++++++------ src/imports/controls/imagine/ToolSeparator.qml | 8 ++++---- src/imports/controls/imagine/ToolTip.qml | 8 ++++---- src/imports/controls/imagine/Tumbler.qml | 12 ++++++------ src/imports/controls/imagine/VerticalHeaderView.qml | 6 +++--- src/imports/controls/imagine/impl/OpacityMask.qml | 2 +- src/imports/controls/material/ApplicationWindow.qml | 8 ++++---- src/imports/controls/material/BusyIndicator.qml | 8 ++++---- src/imports/controls/material/Button.qml | 12 ++++++------ src/imports/controls/material/CheckBox.qml | 8 ++++---- src/imports/controls/material/CheckDelegate.qml | 12 ++++++------ src/imports/controls/material/ComboBox.qml | 14 +++++++------- src/imports/controls/material/DelayButton.qml | 12 ++++++------ src/imports/controls/material/Dial.qml | 8 ++++---- src/imports/controls/material/Dialog.qml | 12 ++++++------ src/imports/controls/material/DialogButtonBox.qml | 12 ++++++------ src/imports/controls/material/Drawer.qml | 8 ++++---- src/imports/controls/material/Frame.qml | 8 ++++---- src/imports/controls/material/GroupBox.qml | 8 ++++---- src/imports/controls/material/HorizontalHeaderView.qml | 10 +++++----- src/imports/controls/material/ItemDelegate.qml | 12 ++++++------ src/imports/controls/material/Label.qml | 6 +++--- src/imports/controls/material/Menu.qml | 12 ++++++------ src/imports/controls/material/MenuBar.qml | 12 ++++++------ src/imports/controls/material/MenuBarItem.qml | 12 ++++++------ src/imports/controls/material/MenuItem.qml | 12 ++++++------ src/imports/controls/material/MenuSeparator.qml | 6 +++--- src/imports/controls/material/Page.qml | 6 +++--- src/imports/controls/material/PageIndicator.qml | 6 +++--- src/imports/controls/material/Pane.qml | 8 ++++---- src/imports/controls/material/Popup.qml | 8 ++++---- src/imports/controls/material/ProgressBar.qml | 8 ++++---- src/imports/controls/material/RadioButton.qml | 8 ++++---- src/imports/controls/material/RadioDelegate.qml | 12 ++++++------ src/imports/controls/material/RangeSlider.qml | 10 +++++----- src/imports/controls/material/RoundButton.qml | 12 ++++++------ src/imports/controls/material/ScrollBar.qml | 6 +++--- src/imports/controls/material/ScrollIndicator.qml | 6 +++--- src/imports/controls/material/Slider.qml | 10 +++++----- src/imports/controls/material/SpinBox.qml | 8 ++++---- src/imports/controls/material/SplitView.qml | 10 +++++----- src/imports/controls/material/StackView.qml | 6 +++--- src/imports/controls/material/SwipeDelegate.qml | 12 ++++++------ src/imports/controls/material/SwipeView.qml | 6 +++--- src/imports/controls/material/Switch.qml | 8 ++++---- src/imports/controls/material/SwitchDelegate.qml | 12 ++++++------ src/imports/controls/material/TabBar.qml | 8 ++++---- src/imports/controls/material/TabButton.qml | 12 ++++++------ src/imports/controls/material/TextArea.qml | 12 ++++++------ src/imports/controls/material/TextField.qml | 12 ++++++------ src/imports/controls/material/ToolBar.qml | 8 ++++---- src/imports/controls/material/ToolButton.qml | 12 ++++++------ src/imports/controls/material/ToolSeparator.qml | 6 +++--- src/imports/controls/material/ToolTip.qml | 6 +++--- src/imports/controls/material/Tumbler.qml | 10 +++++----- src/imports/controls/material/VerticalHeaderView.qml | 10 +++++----- src/imports/controls/material/impl/BoxShadow.qml | 6 +++--- src/imports/controls/material/impl/CheckIndicator.qml | 6 +++--- src/imports/controls/material/impl/CursorDelegate.qml | 4 ++-- src/imports/controls/material/impl/ElevationEffect.qml | 6 +++--- src/imports/controls/material/impl/RadioIndicator.qml | 6 +++--- src/imports/controls/material/impl/RectangularGlow.qml | 2 +- src/imports/controls/material/impl/SliderHandle.qml | 6 +++--- src/imports/controls/material/impl/SwitchIndicator.qml | 6 +++--- src/imports/controls/universal/ApplicationWindow.qml | 10 +++++----- src/imports/controls/universal/BusyIndicator.qml | 8 ++++---- src/imports/controls/universal/Button.qml | 10 +++++----- src/imports/controls/universal/CheckBox.qml | 8 ++++---- src/imports/controls/universal/CheckDelegate.qml | 12 ++++++------ src/imports/controls/universal/ComboBox.qml | 12 ++++++------ src/imports/controls/universal/DelayButton.qml | 6 +++--- src/imports/controls/universal/Dial.qml | 6 +++--- src/imports/controls/universal/Dialog.qml | 8 ++++---- src/imports/controls/universal/DialogButtonBox.qml | 8 ++++---- src/imports/controls/universal/Drawer.qml | 6 +++--- src/imports/controls/universal/Frame.qml | 6 +++--- src/imports/controls/universal/GroupBox.qml | 6 +++--- src/imports/controls/universal/HorizontalHeaderView.qml | 12 ++++++------ src/imports/controls/universal/ItemDelegate.qml | 10 +++++----- src/imports/controls/universal/Label.qml | 6 +++--- src/imports/controls/universal/Menu.qml | 10 +++++----- src/imports/controls/universal/MenuBar.qml | 10 +++++----- src/imports/controls/universal/MenuBarItem.qml | 10 +++++----- src/imports/controls/universal/MenuItem.qml | 10 +++++----- src/imports/controls/universal/MenuSeparator.qml | 6 +++--- src/imports/controls/universal/Page.qml | 6 +++--- src/imports/controls/universal/PageIndicator.qml | 6 +++--- src/imports/controls/universal/Pane.qml | 6 +++--- src/imports/controls/universal/Popup.qml | 6 +++--- src/imports/controls/universal/ProgressBar.qml | 8 ++++---- src/imports/controls/universal/RadioButton.qml | 8 ++++---- src/imports/controls/universal/RadioDelegate.qml | 12 ++++++------ src/imports/controls/universal/RangeSlider.qml | 6 +++--- src/imports/controls/universal/RoundButton.qml | 10 +++++----- src/imports/controls/universal/ScrollBar.qml | 6 +++--- src/imports/controls/universal/ScrollIndicator.qml | 6 +++--- src/imports/controls/universal/Slider.qml | 6 +++--- src/imports/controls/universal/SpinBox.qml | 10 +++++----- src/imports/controls/universal/SplitView.qml | 10 +++++----- src/imports/controls/universal/StackView.qml | 6 +++--- src/imports/controls/universal/SwipeDelegate.qml | 10 +++++----- src/imports/controls/universal/Switch.qml | 8 ++++---- src/imports/controls/universal/SwitchDelegate.qml | 12 ++++++------ src/imports/controls/universal/TabBar.qml | 6 +++--- src/imports/controls/universal/TabButton.qml | 10 +++++----- src/imports/controls/universal/TextArea.qml | 10 +++++----- src/imports/controls/universal/TextField.qml | 10 +++++----- src/imports/controls/universal/ToolBar.qml | 6 +++--- src/imports/controls/universal/ToolButton.qml | 10 +++++----- src/imports/controls/universal/ToolSeparator.qml | 6 +++--- src/imports/controls/universal/ToolTip.qml | 6 +++--- src/imports/controls/universal/Tumbler.qml | 10 +++++----- src/imports/controls/universal/VerticalHeaderView.qml | 12 ++++++------ src/imports/controls/universal/impl/CheckIndicator.qml | 10 +++++----- src/imports/controls/universal/impl/RadioIndicator.qml | 4 ++-- src/imports/controls/universal/impl/SwitchIndicator.qml | 6 +++--- 426 files changed, 1609 insertions(+), 1609 deletions(-) (limited to 'src') diff --git a/src/imports/controls/default/AbstractButton.qml b/src/imports/controls/default/AbstractButton.qml index 50ddb933..a4855c21 100644 --- a/src/imports/controls/default/AbstractButton.qml +++ b/src/imports/controls/default/AbstractButton.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.AbstractButton { id: control diff --git a/src/imports/controls/default/Action.qml b/src/imports/controls/default/Action.qml index 996e9086..bb66fc8f 100644 --- a/src/imports/controls/default/Action.qml +++ b/src/imports/controls/default/Action.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.Action { } diff --git a/src/imports/controls/default/ActionGroup.qml b/src/imports/controls/default/ActionGroup.qml index 89e72c8f..70170f0e 100644 --- a/src/imports/controls/default/ActionGroup.qml +++ b/src/imports/controls/default/ActionGroup.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.ActionGroup { } diff --git a/src/imports/controls/default/ApplicationWindow.qml b/src/imports/controls/default/ApplicationWindow.qml index 235ebf13..b383139b 100644 --- a/src/imports/controls/default/ApplicationWindow.qml +++ b/src/imports/controls/default/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ApplicationWindow { id: window diff --git a/src/imports/controls/default/BusyIndicator.qml b/src/imports/controls/default/BusyIndicator.qml index c8b12732..5db2a083 100644 --- a/src/imports/controls/default/BusyIndicator.qml +++ b/src/imports/controls/default/BusyIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Default.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Default.impl +import QtQuick.Templates as T T.BusyIndicator { id: control diff --git a/src/imports/controls/default/Button.qml b/src/imports/controls/default/Button.qml index a9e7fce6..06d4e93f 100644 --- a/src/imports/controls/default/Button.qml +++ b/src/imports/controls/default/Button.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Button { id: control diff --git a/src/imports/controls/default/ButtonGroup.qml b/src/imports/controls/default/ButtonGroup.qml index cf0355ba..fadc538a 100644 --- a/src/imports/controls/default/ButtonGroup.qml +++ b/src/imports/controls/default/ButtonGroup.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.ButtonGroup { } diff --git a/src/imports/controls/default/CheckBox.qml b/src/imports/controls/default/CheckBox.qml index eae6e208..d9c92a56 100644 --- a/src/imports/controls/default/CheckBox.qml +++ b/src/imports/controls/default/CheckBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.CheckBox { id: control diff --git a/src/imports/controls/default/CheckDelegate.qml b/src/imports/controls/default/CheckDelegate.qml index 176e0843..3153bb3e 100644 --- a/src/imports/controls/default/CheckDelegate.qml +++ b/src/imports/controls/default/CheckDelegate.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.CheckDelegate { id: control diff --git a/src/imports/controls/default/ComboBox.qml b/src/imports/controls/default/ComboBox.qml index a402b7be..e1e60164 100644 --- a/src/imports/controls/default/ComboBox.qml +++ b/src/imports/controls/default/ComboBox.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ComboBox { id: control diff --git a/src/imports/controls/default/Container.qml b/src/imports/controls/default/Container.qml index 83ab957d..93919075 100644 --- a/src/imports/controls/default/Container.qml +++ b/src/imports/controls/default/Container.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.Container { id: control diff --git a/src/imports/controls/default/Control.qml b/src/imports/controls/default/Control.qml index a963a563..7a68a431 100644 --- a/src/imports/controls/default/Control.qml +++ b/src/imports/controls/default/Control.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.Control { id: control diff --git a/src/imports/controls/default/DelayButton.qml b/src/imports/controls/default/DelayButton.qml index 1c545a71..3dbed315 100644 --- a/src/imports/controls/default/DelayButton.qml +++ b/src/imports/controls/default/DelayButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.DelayButton { id: control diff --git a/src/imports/controls/default/Dial.qml b/src/imports/controls/default/Dial.qml index 8e94e2fb..80f2bfb0 100644 --- a/src/imports/controls/default/Dial.qml +++ b/src/imports/controls/default/Dial.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Default.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Default.impl +import QtQuick.Templates as T T.Dial { id: control diff --git a/src/imports/controls/default/Dialog.qml b/src/imports/controls/default/Dialog.qml index 6c2e4b1b..254a6dcb 100644 --- a/src/imports/controls/default/Dialog.qml +++ b/src/imports/controls/default/Dialog.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.Dialog { id: control diff --git a/src/imports/controls/default/DialogButtonBox.qml b/src/imports/controls/default/DialogButtonBox.qml index 3c9d5b48..e4cdbd14 100644 --- a/src/imports/controls/default/DialogButtonBox.qml +++ b/src/imports/controls/default/DialogButtonBox.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.DialogButtonBox { id: control diff --git a/src/imports/controls/default/Drawer.qml b/src/imports/controls/default/Drawer.qml index 17465fd4..719e5e1c 100644 --- a/src/imports/controls/default/Drawer.qml +++ b/src/imports/controls/default/Drawer.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Drawer { id: control diff --git a/src/imports/controls/default/Frame.qml b/src/imports/controls/default/Frame.qml index 2fe46104..9696b5c9 100644 --- a/src/imports/controls/default/Frame.qml +++ b/src/imports/controls/default/Frame.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Frame { id: control diff --git a/src/imports/controls/default/GroupBox.qml b/src/imports/controls/default/GroupBox.qml index 96f776f2..d6244113 100644 --- a/src/imports/controls/default/GroupBox.qml +++ b/src/imports/controls/default/GroupBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.GroupBox { id: control diff --git a/src/imports/controls/default/HorizontalHeaderView.qml b/src/imports/controls/default/HorizontalHeaderView.qml index ec91af25..093c868b 100644 --- a/src/imports/controls/default/HorizontalHeaderView.qml +++ b/src/imports/controls/default/HorizontalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.HorizontalHeaderView { id: control diff --git a/src/imports/controls/default/ItemDelegate.qml b/src/imports/controls/default/ItemDelegate.qml index 6229e2bb..1183eb2b 100644 --- a/src/imports/controls/default/ItemDelegate.qml +++ b/src/imports/controls/default/ItemDelegate.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ItemDelegate { id: control diff --git a/src/imports/controls/default/Label.qml b/src/imports/controls/default/Label.qml index 9a42635f..6d0aca41 100644 --- a/src/imports/controls/default/Label.qml +++ b/src/imports/controls/default/Label.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Label { id: control diff --git a/src/imports/controls/default/Menu.qml b/src/imports/controls/default/Menu.qml index cf3a52f2..91384e4f 100644 --- a/src/imports/controls/default/Menu.qml +++ b/src/imports/controls/default/Menu.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Window T.Menu { id: control diff --git a/src/imports/controls/default/MenuBar.qml b/src/imports/controls/default/MenuBar.qml index 122cdc53..9745a52d 100644 --- a/src/imports/controls/default/MenuBar.qml +++ b/src/imports/controls/default/MenuBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.MenuBar { id: control diff --git a/src/imports/controls/default/MenuBarItem.qml b/src/imports/controls/default/MenuBarItem.qml index f6835412..b2771a3c 100644 --- a/src/imports/controls/default/MenuBarItem.qml +++ b/src/imports/controls/default/MenuBarItem.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.MenuBarItem { id: control diff --git a/src/imports/controls/default/MenuItem.qml b/src/imports/controls/default/MenuItem.qml index 678bac57..fc2d434f 100644 --- a/src/imports/controls/default/MenuItem.qml +++ b/src/imports/controls/default/MenuItem.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.MenuItem { id: control diff --git a/src/imports/controls/default/MenuSeparator.qml b/src/imports/controls/default/MenuSeparator.qml index cc5c2b6e..d503aecd 100644 --- a/src/imports/controls/default/MenuSeparator.qml +++ b/src/imports/controls/default/MenuSeparator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.MenuSeparator { id: control diff --git a/src/imports/controls/default/Page.qml b/src/imports/controls/default/Page.qml index 4b3cf3d2..2fec37f0 100644 --- a/src/imports/controls/default/Page.qml +++ b/src/imports/controls/default/Page.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Page { id: control diff --git a/src/imports/controls/default/PageIndicator.qml b/src/imports/controls/default/PageIndicator.qml index 78f9e3cf..3942f54f 100644 --- a/src/imports/controls/default/PageIndicator.qml +++ b/src/imports/controls/default/PageIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.PageIndicator { id: control diff --git a/src/imports/controls/default/Pane.qml b/src/imports/controls/default/Pane.qml index 47b916e3..221819d4 100644 --- a/src/imports/controls/default/Pane.qml +++ b/src/imports/controls/default/Pane.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Pane { id: control diff --git a/src/imports/controls/default/Popup.qml b/src/imports/controls/default/Popup.qml index ee243c10..71372107 100644 --- a/src/imports/controls/default/Popup.qml +++ b/src/imports/controls/default/Popup.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Popup { id: control diff --git a/src/imports/controls/default/ProgressBar.qml b/src/imports/controls/default/ProgressBar.qml index 218cc442..56739f4f 100644 --- a/src/imports/controls/default/ProgressBar.qml +++ b/src/imports/controls/default/ProgressBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Default.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Default.impl T.ProgressBar { id: control diff --git a/src/imports/controls/default/RadioButton.qml b/src/imports/controls/default/RadioButton.qml index cdf0c30e..02b2f627 100644 --- a/src/imports/controls/default/RadioButton.qml +++ b/src/imports/controls/default/RadioButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RadioButton { id: control diff --git a/src/imports/controls/default/RadioDelegate.qml b/src/imports/controls/default/RadioDelegate.qml index a7e7dec0..dc998363 100644 --- a/src/imports/controls/default/RadioDelegate.qml +++ b/src/imports/controls/default/RadioDelegate.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RadioDelegate { id: control diff --git a/src/imports/controls/default/RangeSlider.qml b/src/imports/controls/default/RangeSlider.qml index c3e7c964..1132a78b 100644 --- a/src/imports/controls/default/RangeSlider.qml +++ b/src/imports/controls/default/RangeSlider.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RangeSlider { id: control diff --git a/src/imports/controls/default/RoundButton.qml b/src/imports/controls/default/RoundButton.qml index 825d5252..9445ecdf 100644 --- a/src/imports/controls/default/RoundButton.qml +++ b/src/imports/controls/default/RoundButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RoundButton { id: control diff --git a/src/imports/controls/default/ScrollBar.qml b/src/imports/controls/default/ScrollBar.qml index 0948fb1d..1652ea81 100644 --- a/src/imports/controls/default/ScrollBar.qml +++ b/src/imports/controls/default/ScrollBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ScrollBar { id: control diff --git a/src/imports/controls/default/ScrollIndicator.qml b/src/imports/controls/default/ScrollIndicator.qml index 795c20ee..4f3ece0c 100644 --- a/src/imports/controls/default/ScrollIndicator.qml +++ b/src/imports/controls/default/ScrollIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ScrollIndicator { id: control diff --git a/src/imports/controls/default/ScrollView.qml b/src/imports/controls/default/ScrollView.qml index f775d624..76094c6c 100644 --- a/src/imports/controls/default/ScrollView.qml +++ b/src/imports/controls/default/ScrollView.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ScrollView { id: control diff --git a/src/imports/controls/default/Slider.qml b/src/imports/controls/default/Slider.qml index 6d532389..cdd72b76 100644 --- a/src/imports/controls/default/Slider.qml +++ b/src/imports/controls/default/Slider.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Slider { id: control diff --git a/src/imports/controls/default/SpinBox.qml b/src/imports/controls/default/SpinBox.qml index d1c2ea5b..46eca36e 100644 --- a/src/imports/controls/default/SpinBox.qml +++ b/src/imports/controls/default/SpinBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.SpinBox { id: control diff --git a/src/imports/controls/default/SplitView.qml b/src/imports/controls/default/SplitView.qml index 9d37a83e..020d07ea 100644 --- a/src/imports/controls/default/SplitView.qml +++ b/src/imports/controls/default/SplitView.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls 2.13 -import QtQuick.Controls.impl 2.13 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.SplitView { id: control diff --git a/src/imports/controls/default/StackView.qml b/src/imports/controls/default/StackView.qml index 3e416b87..3b388e46 100644 --- a/src/imports/controls/default/StackView.qml +++ b/src/imports/controls/default/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.StackView { id: control diff --git a/src/imports/controls/default/SwipeDelegate.qml b/src/imports/controls/default/SwipeDelegate.qml index 37d66bb6..ff56f6f0 100644 --- a/src/imports/controls/default/SwipeDelegate.qml +++ b/src/imports/controls/default/SwipeDelegate.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.SwipeDelegate { id: control diff --git a/src/imports/controls/default/SwipeView.qml b/src/imports/controls/default/SwipeView.qml index 7722d258..7fb8d449 100644 --- a/src/imports/controls/default/SwipeView.qml +++ b/src/imports/controls/default/SwipeView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.SwipeView { id: control diff --git a/src/imports/controls/default/Switch.qml b/src/imports/controls/default/Switch.qml index f62e2502..12420bed 100644 --- a/src/imports/controls/default/Switch.qml +++ b/src/imports/controls/default/Switch.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.Switch { id: control diff --git a/src/imports/controls/default/SwitchDelegate.qml b/src/imports/controls/default/SwitchDelegate.qml index d6447e77..e2a9f7b5 100644 --- a/src/imports/controls/default/SwitchDelegate.qml +++ b/src/imports/controls/default/SwitchDelegate.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.SwitchDelegate { id: control diff --git a/src/imports/controls/default/TabBar.qml b/src/imports/controls/default/TabBar.qml index 83f6b3b2..f1b11ac2 100644 --- a/src/imports/controls/default/TabBar.qml +++ b/src/imports/controls/default/TabBar.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Templates as T T.TabBar { id: control diff --git a/src/imports/controls/default/TabButton.qml b/src/imports/controls/default/TabButton.qml index f8b303ea..0935d463 100644 --- a/src/imports/controls/default/TabButton.qml +++ b/src/imports/controls/default/TabButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.TabButton { id: control diff --git a/src/imports/controls/default/TextArea.qml b/src/imports/controls/default/TextArea.qml index 45790e67..e6a1509e 100644 --- a/src/imports/controls/default/TextArea.qml +++ b/src/imports/controls/default/TextArea.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.TextArea { id: control diff --git a/src/imports/controls/default/TextField.qml b/src/imports/controls/default/TextField.qml index 4d9cb691..2c69d351 100644 --- a/src/imports/controls/default/TextField.qml +++ b/src/imports/controls/default/TextField.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.TextField { id: control diff --git a/src/imports/controls/default/ToolBar.qml b/src/imports/controls/default/ToolBar.qml index 1e07b6bf..6f5e54e6 100644 --- a/src/imports/controls/default/ToolBar.qml +++ b/src/imports/controls/default/ToolBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ToolBar { id: control diff --git a/src/imports/controls/default/ToolButton.qml b/src/imports/controls/default/ToolButton.qml index 63aaf893..63b40233 100644 --- a/src/imports/controls/default/ToolButton.qml +++ b/src/imports/controls/default/ToolButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ToolButton { id: control diff --git a/src/imports/controls/default/ToolSeparator.qml b/src/imports/controls/default/ToolSeparator.qml index 188d0758..e6d6a7f7 100644 --- a/src/imports/controls/default/ToolSeparator.qml +++ b/src/imports/controls/default/ToolSeparator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ToolSeparator { id: control diff --git a/src/imports/controls/default/ToolTip.qml b/src/imports/controls/default/ToolTip.qml index e0389903..933b7400 100644 --- a/src/imports/controls/default/ToolTip.qml +++ b/src/imports/controls/default/ToolTip.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ToolTip { id: control diff --git a/src/imports/controls/default/Tumbler.qml b/src/imports/controls/default/Tumbler.qml index 4d1abdd3..89f7f056 100644 --- a/src/imports/controls/default/Tumbler.qml +++ b/src/imports/controls/default/Tumbler.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Tumbler { id: control diff --git a/src/imports/controls/default/VerticalHeaderView.qml b/src/imports/controls/default/VerticalHeaderView.qml index 3fc9ca5a..21e39c39 100644 --- a/src/imports/controls/default/VerticalHeaderView.qml +++ b/src/imports/controls/default/VerticalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.VerticalHeaderView { id: control diff --git a/src/imports/controls/designer/AbstractButtonSection.qml b/src/imports/controls/designer/AbstractButtonSection.qml index e8aa39c2..1b529c98 100644 --- a/src/imports/controls/designer/AbstractButtonSection.qml +++ b/src/imports/controls/designer/AbstractButtonSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("AbstractButton") diff --git a/src/imports/controls/designer/BusyIndicatorSpecifics.qml b/src/imports/controls/designer/BusyIndicatorSpecifics.qml index 7ae927fc..7b2899d3 100644 --- a/src/imports/controls/designer/BusyIndicatorSpecifics.qml +++ b/src/imports/controls/designer/BusyIndicatorSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ButtonSection.qml b/src/imports/controls/designer/ButtonSection.qml index fef46071..de8194da 100644 --- a/src/imports/controls/designer/ButtonSection.qml +++ b/src/imports/controls/designer/ButtonSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { id: section diff --git a/src/imports/controls/designer/ButtonSpecifics.qml b/src/imports/controls/designer/ButtonSpecifics.qml index e094b9df..5a46e72a 100644 --- a/src/imports/controls/designer/ButtonSpecifics.qml +++ b/src/imports/controls/designer/ButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/CheckBoxSpecifics.qml b/src/imports/controls/designer/CheckBoxSpecifics.qml index f76aa215..d3aae9b6 100644 --- a/src/imports/controls/designer/CheckBoxSpecifics.qml +++ b/src/imports/controls/designer/CheckBoxSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/CheckDelegateSpecifics.qml b/src/imports/controls/designer/CheckDelegateSpecifics.qml index 1df55e11..8014480c 100644 --- a/src/imports/controls/designer/CheckDelegateSpecifics.qml +++ b/src/imports/controls/designer/CheckDelegateSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/CheckSection.qml b/src/imports/controls/designer/CheckSection.qml index 76cde03e..0f49fa25 100644 --- a/src/imports/controls/designer/CheckSection.qml +++ b/src/imports/controls/designer/CheckSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { SectionLayout { diff --git a/src/imports/controls/designer/ComboBoxSpecifics.qml b/src/imports/controls/designer/ComboBoxSpecifics.qml index 8a5e33b6..810f19b5 100644 --- a/src/imports/controls/designer/ComboBoxSpecifics.qml +++ b/src/imports/controls/designer/ComboBoxSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ContainerSection.qml b/src/imports/controls/designer/ContainerSection.qml index 896804c0..15d1ddf5 100644 --- a/src/imports/controls/designer/ContainerSection.qml +++ b/src/imports/controls/designer/ContainerSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("Container") diff --git a/src/imports/controls/designer/ControlSection.qml b/src/imports/controls/designer/ControlSection.qml index 3446c08f..31780129 100644 --- a/src/imports/controls/designer/ControlSection.qml +++ b/src/imports/controls/designer/ControlSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("Control") diff --git a/src/imports/controls/designer/ControlSpecifics.qml b/src/imports/controls/designer/ControlSpecifics.qml index ccfd8853..3937437b 100644 --- a/src/imports/controls/designer/ControlSpecifics.qml +++ b/src/imports/controls/designer/ControlSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/DelayButtonSpecifics.qml b/src/imports/controls/designer/DelayButtonSpecifics.qml index 40b673a1..024fe589 100644 --- a/src/imports/controls/designer/DelayButtonSpecifics.qml +++ b/src/imports/controls/designer/DelayButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/DialSpecifics.qml b/src/imports/controls/designer/DialSpecifics.qml index a0df81ef..026cb2b1 100644 --- a/src/imports/controls/designer/DialSpecifics.qml +++ b/src/imports/controls/designer/DialSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/FrameSpecifics.qml b/src/imports/controls/designer/FrameSpecifics.qml index f17b6399..36739956 100644 --- a/src/imports/controls/designer/FrameSpecifics.qml +++ b/src/imports/controls/designer/FrameSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/GroupBoxSpecifics.qml b/src/imports/controls/designer/GroupBoxSpecifics.qml index 3a705bcc..f808b001 100644 --- a/src/imports/controls/designer/GroupBoxSpecifics.qml +++ b/src/imports/controls/designer/GroupBoxSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/InsetSection.qml b/src/imports/controls/designer/InsetSection.qml index 4253b170..45a4df4f 100644 --- a/src/imports/controls/designer/InsetSection.qml +++ b/src/imports/controls/designer/InsetSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("Inset") diff --git a/src/imports/controls/designer/ItemDelegateSection.qml b/src/imports/controls/designer/ItemDelegateSection.qml index a337bcee..448a20d9 100644 --- a/src/imports/controls/designer/ItemDelegateSection.qml +++ b/src/imports/controls/designer/ItemDelegateSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { id: section diff --git a/src/imports/controls/designer/ItemDelegateSpecifics.qml b/src/imports/controls/designer/ItemDelegateSpecifics.qml index 58063980..1757521d 100644 --- a/src/imports/controls/designer/ItemDelegateSpecifics.qml +++ b/src/imports/controls/designer/ItemDelegateSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/LabelSpecifics.qml b/src/imports/controls/designer/LabelSpecifics.qml index e5d5e04f..569b44c8 100644 --- a/src/imports/controls/designer/LabelSpecifics.qml +++ b/src/imports/controls/designer/LabelSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/PaddingSection.qml b/src/imports/controls/designer/PaddingSection.qml index a7dee28e..325c5698 100644 --- a/src/imports/controls/designer/PaddingSection.qml +++ b/src/imports/controls/designer/PaddingSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("Padding") diff --git a/src/imports/controls/designer/PageIndicatorSpecifics.qml b/src/imports/controls/designer/PageIndicatorSpecifics.qml index 20aa8577..c73652e9 100644 --- a/src/imports/controls/designer/PageIndicatorSpecifics.qml +++ b/src/imports/controls/designer/PageIndicatorSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/PageSpecifics.qml b/src/imports/controls/designer/PageSpecifics.qml index 2dca1100..965ed655 100644 --- a/src/imports/controls/designer/PageSpecifics.qml +++ b/src/imports/controls/designer/PageSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/PaneSection.qml b/src/imports/controls/designer/PaneSection.qml index 80d154c9..9dcc2097 100644 --- a/src/imports/controls/designer/PaneSection.qml +++ b/src/imports/controls/designer/PaneSection.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Section { caption: qsTr("Pane") diff --git a/src/imports/controls/designer/PaneSpecifics.qml b/src/imports/controls/designer/PaneSpecifics.qml index f17b6399..36739956 100644 --- a/src/imports/controls/designer/PaneSpecifics.qml +++ b/src/imports/controls/designer/PaneSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ProgressBarSpecifics.qml b/src/imports/controls/designer/ProgressBarSpecifics.qml index c24d71db..aa834142 100644 --- a/src/imports/controls/designer/ProgressBarSpecifics.qml +++ b/src/imports/controls/designer/ProgressBarSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/RadioButtonSpecifics.qml b/src/imports/controls/designer/RadioButtonSpecifics.qml index 6137ad8c..df0af7e7 100644 --- a/src/imports/controls/designer/RadioButtonSpecifics.qml +++ b/src/imports/controls/designer/RadioButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/RadioDelegateSpecifics.qml b/src/imports/controls/designer/RadioDelegateSpecifics.qml index 58063980..1757521d 100644 --- a/src/imports/controls/designer/RadioDelegateSpecifics.qml +++ b/src/imports/controls/designer/RadioDelegateSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/RangeSliderSpecifics.qml b/src/imports/controls/designer/RangeSliderSpecifics.qml index 2324a66f..9ff032b9 100644 --- a/src/imports/controls/designer/RangeSliderSpecifics.qml +++ b/src/imports/controls/designer/RangeSliderSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/RoundButtonSpecifics.qml b/src/imports/controls/designer/RoundButtonSpecifics.qml index af4ab5d0..58d34689 100644 --- a/src/imports/controls/designer/RoundButtonSpecifics.qml +++ b/src/imports/controls/designer/RoundButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ScrollViewSpecifics.qml b/src/imports/controls/designer/ScrollViewSpecifics.qml index 0f3d56d2..ae525b74 100644 --- a/src/imports/controls/designer/ScrollViewSpecifics.qml +++ b/src/imports/controls/designer/ScrollViewSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SliderSpecifics.qml b/src/imports/controls/designer/SliderSpecifics.qml index d126dd06..3edc2a66 100644 --- a/src/imports/controls/designer/SliderSpecifics.qml +++ b/src/imports/controls/designer/SliderSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SpinBoxSpecifics.qml b/src/imports/controls/designer/SpinBoxSpecifics.qml index db59f074..9c07e8c5 100644 --- a/src/imports/controls/designer/SpinBoxSpecifics.qml +++ b/src/imports/controls/designer/SpinBoxSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/StackViewSpecifics.qml b/src/imports/controls/designer/StackViewSpecifics.qml index ccfd8853..3937437b 100644 --- a/src/imports/controls/designer/StackViewSpecifics.qml +++ b/src/imports/controls/designer/StackViewSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SwipeDelegateSpecifics.qml b/src/imports/controls/designer/SwipeDelegateSpecifics.qml index 58063980..1757521d 100644 --- a/src/imports/controls/designer/SwipeDelegateSpecifics.qml +++ b/src/imports/controls/designer/SwipeDelegateSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SwipeViewSpecifics.qml b/src/imports/controls/designer/SwipeViewSpecifics.qml index 02cc900e..a28a2917 100644 --- a/src/imports/controls/designer/SwipeViewSpecifics.qml +++ b/src/imports/controls/designer/SwipeViewSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SwitchDelegateSpecifics.qml b/src/imports/controls/designer/SwitchDelegateSpecifics.qml index f8c0dcc6..4236de67 100644 --- a/src/imports/controls/designer/SwitchDelegateSpecifics.qml +++ b/src/imports/controls/designer/SwitchDelegateSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/SwitchSpecifics.qml b/src/imports/controls/designer/SwitchSpecifics.qml index 6137ad8c..df0af7e7 100644 --- a/src/imports/controls/designer/SwitchSpecifics.qml +++ b/src/imports/controls/designer/SwitchSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/TabBarSpecifics.qml b/src/imports/controls/designer/TabBarSpecifics.qml index f17e8e9a..6f02cdaa 100644 --- a/src/imports/controls/designer/TabBarSpecifics.qml +++ b/src/imports/controls/designer/TabBarSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/TabButtonSpecifics.qml b/src/imports/controls/designer/TabButtonSpecifics.qml index 6137ad8c..df0af7e7 100644 --- a/src/imports/controls/designer/TabButtonSpecifics.qml +++ b/src/imports/controls/designer/TabButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/TextAreaSpecifics.qml b/src/imports/controls/designer/TextAreaSpecifics.qml index f8cf92e8..785d7a50 100644 --- a/src/imports/controls/designer/TextAreaSpecifics.qml +++ b/src/imports/controls/designer/TextAreaSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/TextFieldSpecifics.qml b/src/imports/controls/designer/TextFieldSpecifics.qml index f95f282c..33a90f2a 100644 --- a/src/imports/controls/designer/TextFieldSpecifics.qml +++ b/src/imports/controls/designer/TextFieldSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ToolBarSpecifics.qml b/src/imports/controls/designer/ToolBarSpecifics.qml index acf02e7b..2b1b17d2 100644 --- a/src/imports/controls/designer/ToolBarSpecifics.qml +++ b/src/imports/controls/designer/ToolBarSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ToolButtonSpecifics.qml b/src/imports/controls/designer/ToolButtonSpecifics.qml index e094b9df..5a46e72a 100644 --- a/src/imports/controls/designer/ToolButtonSpecifics.qml +++ b/src/imports/controls/designer/ToolButtonSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/ToolSeparatorSpecifics.qml b/src/imports/controls/designer/ToolSeparatorSpecifics.qml index d0ebd57c..a62147ec 100644 --- a/src/imports/controls/designer/ToolSeparatorSpecifics.qml +++ b/src/imports/controls/designer/ToolSeparatorSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/designer/TumblerSpecifics.qml b/src/imports/controls/designer/TumblerSpecifics.qml index 04507ef6..25fb9275 100644 --- a/src/imports/controls/designer/TumblerSpecifics.qml +++ b/src/imports/controls/designer/TumblerSpecifics.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import HelperWidgets 2.0 -import QtQuick.Layouts 1.12 +import QtQuick +import HelperWidgets +import QtQuick.Layouts Column { width: parent.width diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-action.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-action.qml index 11c7e802..1b65a824 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-action.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-action.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { //! [action] diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-busyindicator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-busyindicator-custom.qml index 93ba9c44..8daffed7 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-busyindicator-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-busyindicator-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls BusyIndicator { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-custom.qml index 3145a6ef..095657b5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Button { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml index ec9d773e..36d1f848 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-icononly.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Button { icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml index 3bd35a84..3fe434e4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textbesideicon.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Button { text: "Button" diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml index 1ff1f0a8..59054f77 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-button-textonly.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Button { text: "Button" diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml index 806655a3..93ebe46d 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls CheckBox { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-group.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-group.qml index a32e9f5f..c5032165 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-group.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-group.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] Column { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml index b8fbbf69..91970f52 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls CheckDelegate { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml index 9f2ad928..b420e3a5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [combobox] ComboBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml index b902dab1..fea7e6d5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ComboBox { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml index 4d7ae3d3..a4c40c0f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.14 -import QtQuick.Controls 2.14 +import QtQuick +import QtQuick.Controls //! [file] ApplicationWindow { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml index 4bcbaa67..0b86f1d0 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls DelayButton { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dial-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dial-custom.qml index 0221350d..170e9ccf 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dial-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dial-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Dial { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml index c8a71e5b..d60e4e30 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: dialog.implicitWidth diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml index be0e6f02..6acb74e5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: dialog.implicitWidth diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml index 2953c371..13fbb0e8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: dialog.implicitWidth diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml index f71f91cb..45a0b9e9 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] DialogButtonBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml index adfd8035..bcfd405b 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] DialogButtonBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-frame-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-frame-custom.qml index 0e90f0aa..798f95da 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-frame-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-frame-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Frame { background: Rectangle { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-frame.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-frame.qml index 8f8f9c23..71b9b310 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-frame.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-frame.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls //! [1] Frame { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-checkable.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-checkable.qml index 5f6ee591..91689d9f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-checkable.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-checkable.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls //! [1] GroupBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml index 7ccb55c3..e3355b23 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls GroupBox { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox.qml index 67c68cf3..e9f1c7dc 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls //! [1] GroupBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml index 07ec84d8..6878904f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml @@ -49,9 +49,9 @@ ****************************************************************************/ //![file] -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import Qt.labs.qmlmodels 1.0 +import QtQuick +import QtQuick.Controls +import Qt.labs.qmlmodels ApplicationWindow { visible: true diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml index d6ec5f78..fd52b46f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ItemDelegate { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate.qml index 8f483ed9..70d6104f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] ListView { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-label-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-label-custom.qml index e984fc71..cc88d00f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-label-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-label-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Label { text: qsTr("Label") diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-label.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-label.qml index fb68bb04..c492af50 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-label.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-label.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] Label { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-accent.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-accent.qml index 5191efce..aa4c62b8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-accent.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-accent.qml @@ -25,10 +25,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Controls.Material Pane { padding: 4 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-background.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-background.qml index cdbc16cc..f64e48d2 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-background.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-background.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material Pane { padding: 4 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-elevation.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-elevation.qml index e15bc216..f9e189f1 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-elevation.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-elevation.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material Pane { contentWidth: 120 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-foreground.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-foreground.qml index 003b5624..070576f5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-foreground.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-foreground.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material Pane { padding: 4 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-theme.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-theme.qml index 955290fd..586433c3 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-theme.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-theme.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material Pane { padding: 10 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml index ce8a0356..1283fb43 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml @@ -25,10 +25,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material +import QtQuick.Layouts Pane { implicitWidth: 400 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menu-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menu-custom.qml index 5a702b9f..3e766e8a 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-menu-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menu-custom.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ApplicationWindow { id: window diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menubar-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menubar-custom.qml index ea27acf6..4b3d641e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-menubar-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menubar-custom.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ApplicationWindow { id: window diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menubar.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menubar.qml index 87371877..7ae22ae8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-menubar.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menubar.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [begin] ApplicationWindow { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml index ea2d6ae7..fa7fa14a 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { id: window diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml index 0712c5fa..cd5d5441 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { id: window diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modal.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modal.qml index 8913e5bd..9751f057 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modal.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modal.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Window 2.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Window Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modeless.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modeless.qml index 96fb606f..a4951d13 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modeless.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-overlay-modeless.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Window 2.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Window Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-custom.qml index 7f828d93..ba0d2db9 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls PageIndicator { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-interactive.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-interactive.qml index 0a40c8b0..8f2221ee 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-interactive.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator-interactive.qml @@ -25,7 +25,7 @@ ** ****************************************************************************/ -import QtQuick.Controls 2.12 +import QtQuick.Controls Pane { //! [1] diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator.qml index 0eeec4d8..b3912efe 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-pageindicator.qml @@ -24,8 +24,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] PageIndicator { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-pane-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-pane-custom.qml index dfe2eaa4..855423c4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-pane-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-pane-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Pane { background: Rectangle { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-pane.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-pane.qml index 9ed7a5b4..a8c8672e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-pane.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-pane.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls //! [1] Pane { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-popup-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-popup-custom.qml index 9408cd66..ad5481e3 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-popup-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-popup-custom.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Window 2.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Window Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml index 6d46b810..76ec20cd 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { //! [centerIn] diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-progressbar-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-progressbar-custom.qml index e23c1438..d9616157 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-progressbar-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-progressbar-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ProgressBar { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml index 1361f09e..b33ce6b6 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls RadioButton { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml index 27ad9da2..ed3dae67 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls RadioDelegate { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml index b8510ddd..fcddc400 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls RangeSlider { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml index 4f727344..201ee244 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] RoundButton { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-active.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-active.qml index a4a66e93..bd417955 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-active.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-active.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 100 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-custom.qml index 5efcb461..0aea2572 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ScrollBar { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-non-attached.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-non-attached.qml index 43e2853e..7ca66615 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-non-attached.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-non-attached.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 200 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-policy.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-policy.qml index 942722a5..c608dac4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-policy.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollbar-policy.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] Flickable { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-active.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-active.qml index 6cb749e6..719b9393 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-active.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-active.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 100 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-custom.qml index 616c877d..b18d391c 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ScrollIndicator { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-non-attached.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-non-attached.qml index f1b99bca..0d6c4529 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-non-attached.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollindicator-non-attached.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 200 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-custom.qml index 9010f0af..1a80d263 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-custom.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 200 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-interactive.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-interactive.qml index 26b0b5c4..83861720 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-interactive.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-interactive.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [file] ScrollView { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-listview.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-listview.qml index 6907d674..f1fbb627 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-listview.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-listview.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-policy.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-policy.qml index f5c33975..78098eaa 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-policy.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview-policy.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [file] ScrollView { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview.qml index cbdf9eb8..dce07b39 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-scrollview.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Rectangle { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-slider-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-slider-custom.qml index 7745892d..c3d7f4b2 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-slider-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-slider-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Slider { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-custom.qml index ad05d463..89f6244f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls SpinBox { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-double.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-double.qml index 6f1bb55b..852ee5be 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-double.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-double.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] SpinBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-textual.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-textual.qml index dd58b5ab..c1879d93 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-textual.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox-textual.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.14 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] SpinBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox.qml index 32d39b9f..87722749 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-spinbox.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] SpinBox { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-splitview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-splitview-custom.qml index 96e8ad2f..570c3acd 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-splitview-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-splitview-custom.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Controls 2.13 +import QtQuick +import QtQuick.Controls Item { width: 200 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml index cfeab812..64cdb3ce 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls StackView { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-visible.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-visible.qml index a9298460..0e1a0dd4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-visible.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-visible.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] StackView { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml index 432fcc87..c89b96a4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls SwipeDelegate { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-transition.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-transition.qml index 6b71a5f0..dc0d58a2 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-transition.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-transition.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] SwipeDelegate { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml index 6e02c057..dcab908e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] ListView { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml index 40833dde..b8cddb31 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls SwipeView { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-indicator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-indicator.qml index 1869a032..98b381f1 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-indicator.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-indicator.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 200 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml index a7dd2eea..9adccbed 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Switch { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml index 19060824..bea35f29 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls SwitchDelegate { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-custom.qml index c06c44c7..eba48256 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TabBar { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-explicit.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-explicit.qml index 01f0d875..5f548255 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-explicit.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-explicit.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 360 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml index 628aef80..8e41bbf0 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 360 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar.qml index cbf6d728..7a02f375 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls Column { width: 300 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbutton.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbutton.qml index 0aae7d15..e7240db4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbutton.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbutton.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] TabBar { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-custom.qml index 3ce856ac..e4f1b397 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TextArea { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-scrollable.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-scrollable.qml index e16c6bbf..52d9996e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-scrollable.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textarea-scrollable.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { width: 100 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-custom.qml index e48e0d65..8f1aba23 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TextField { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-disabled.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-disabled.qml index 18634d5e..3d92b647 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-disabled.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-disabled.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TextField { width: 80 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-focused.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-focused.qml index 5d8e067b..f2761988 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-focused.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-focused.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TextField { width: 80 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-normal.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-normal.qml index b0a04674..c9208c0e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-normal.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-textfield-normal.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls TextField { width: 80 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar-custom.qml index 3d26e510..2cb9d0c5 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar-custom.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls //! [file] ToolBar { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar.qml index e1c8c580..2ed5c23f 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbar.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls Item { width: children[0].implicitWidth * 2 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbutton-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbutton-custom.qml index cf5bc70e..8eb27430 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-toolbutton-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolbutton-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ToolButton { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml index e26986cc..f630256d 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml @@ -25,10 +25,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Window +import QtQuick.Controls //! [file] ToolBar { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml index 2ccfb439..514b97fa 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml @@ -25,10 +25,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Window +import QtQuick.Controls //! [1] ToolBar { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml index 6a0a5b38..7b40c974 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { ToolTip { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-hover.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-hover.qml index 812b5ba2..6d1ee4c4 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-hover.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-hover.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] Button { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-pressandhold.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-pressandhold.qml index 927d29c3..cea49553 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-pressandhold.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-pressandhold.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [1] Button { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-slider.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-slider.qml index 508a417e..5f408224 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-slider.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-slider.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip.qml index a4e92f88..2e5231dc 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Item { id: root diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml index ee054106..792e0e14 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml @@ -26,8 +26,8 @@ ****************************************************************************/ //! [file] -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Tumbler { id: control diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml index 7d16d139..54ce78af 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [contentItem] Tumbler { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml index 61e4ce01..408b7479 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml @@ -25,8 +25,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls //! [contentItem] Tumbler { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml index 13130f97..d9edb2cb 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml @@ -26,9 +26,9 @@ ****************************************************************************/ //! [tumbler] -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Rectangle { width: frame.implicitWidth + 10 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-accent.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-accent.qml index c54a18a0..f429359e 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-accent.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-accent.qml @@ -25,10 +25,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Controls.Universal Pane { padding: 10 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-background.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-background.qml index f22b5308..558618e6 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-background.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-background.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Universal Pane { padding: 10 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-foreground.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-foreground.qml index 8c5b99a3..39a292d8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-foreground.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-foreground.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Universal Pane { padding: 10 diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-theme.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-theme.qml index 1f0d6bd0..b55bf188 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-universal-theme.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-universal-theme.qml @@ -25,9 +25,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Universal Pane { padding: 10 diff --git a/src/imports/controls/fusion/ApplicationWindow.qml b/src/imports/controls/fusion/ApplicationWindow.qml index 26dfbbdf..090d361c 100644 --- a/src/imports/controls/fusion/ApplicationWindow.qml +++ b/src/imports/controls/fusion/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ApplicationWindow { id: window diff --git a/src/imports/controls/fusion/BusyIndicator.qml b/src/imports/controls/fusion/BusyIndicator.qml index 554c3368..e5f5b75a 100644 --- a/src/imports/controls/fusion/BusyIndicator.qml +++ b/src/imports/controls/fusion/BusyIndicator.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.BusyIndicator { id: control diff --git a/src/imports/controls/fusion/Button.qml b/src/imports/controls/fusion/Button.qml index 7822634d..f0a8bfcd 100644 --- a/src/imports/controls/fusion/Button.qml +++ b/src/imports/controls/fusion/Button.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Button { id: control diff --git a/src/imports/controls/fusion/CheckBox.qml b/src/imports/controls/fusion/CheckBox.qml index edb4c77f..fec41f22 100644 --- a/src/imports/controls/fusion/CheckBox.qml +++ b/src/imports/controls/fusion/CheckBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.CheckBox { id: control diff --git a/src/imports/controls/fusion/CheckDelegate.qml b/src/imports/controls/fusion/CheckDelegate.qml index 1b97b1fd..81c5da0b 100644 --- a/src/imports/controls/fusion/CheckDelegate.qml +++ b/src/imports/controls/fusion/CheckDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.CheckDelegate { id: control diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index 64e9603f..b8ad32e9 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Controls.Fusion 2.15 -import QtQuick.Controls.Fusion.impl 2.15 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ComboBox { id: control diff --git a/src/imports/controls/fusion/DelayButton.qml b/src/imports/controls/fusion/DelayButton.qml index 622de111..9a9371fb 100644 --- a/src/imports/controls/fusion/DelayButton.qml +++ b/src/imports/controls/fusion/DelayButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.DelayButton { id: control diff --git a/src/imports/controls/fusion/Dial.qml b/src/imports/controls/fusion/Dial.qml index 3c22c66a..94558e3b 100644 --- a/src/imports/controls/fusion/Dial.qml +++ b/src/imports/controls/fusion/Dial.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Dial { id: control diff --git a/src/imports/controls/fusion/Dialog.qml b/src/imports/controls/fusion/Dialog.qml index 79e179d9..600777d9 100644 --- a/src/imports/controls/fusion/Dialog.qml +++ b/src/imports/controls/fusion/Dialog.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Dialog { id: control diff --git a/src/imports/controls/fusion/DialogButtonBox.qml b/src/imports/controls/fusion/DialogButtonBox.qml index a0b0f243..101c0ba3 100644 --- a/src/imports/controls/fusion/DialogButtonBox.qml +++ b/src/imports/controls/fusion/DialogButtonBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.DialogButtonBox { id: control diff --git a/src/imports/controls/fusion/Drawer.qml b/src/imports/controls/fusion/Drawer.qml index 5a23dde1..2f7e510e 100644 --- a/src/imports/controls/fusion/Drawer.qml +++ b/src/imports/controls/fusion/Drawer.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Drawer { id: control diff --git a/src/imports/controls/fusion/Frame.qml b/src/imports/controls/fusion/Frame.qml index c2df6351..d0d7d8f2 100644 --- a/src/imports/controls/fusion/Frame.qml +++ b/src/imports/controls/fusion/Frame.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Frame { id: control diff --git a/src/imports/controls/fusion/GroupBox.qml b/src/imports/controls/fusion/GroupBox.qml index 3df3e1e6..501db7ac 100644 --- a/src/imports/controls/fusion/GroupBox.qml +++ b/src/imports/controls/fusion/GroupBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.GroupBox { id: control diff --git a/src/imports/controls/fusion/HorizontalHeaderView.qml b/src/imports/controls/fusion/HorizontalHeaderView.qml index bbd9dc3f..ef4db4b5 100644 --- a/src/imports/controls/fusion/HorizontalHeaderView.qml +++ b/src/imports/controls/fusion/HorizontalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.HorizontalHeaderView { id: control diff --git a/src/imports/controls/fusion/ItemDelegate.qml b/src/imports/controls/fusion/ItemDelegate.qml index 4c15ae68..a90dc8e4 100644 --- a/src/imports/controls/fusion/ItemDelegate.qml +++ b/src/imports/controls/fusion/ItemDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ItemDelegate { id: control diff --git a/src/imports/controls/fusion/Label.qml b/src/imports/controls/fusion/Label.qml index 9821f71c..ddd1634c 100644 --- a/src/imports/controls/fusion/Label.qml +++ b/src/imports/controls/fusion/Label.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Label { id: control diff --git a/src/imports/controls/fusion/Menu.qml b/src/imports/controls/fusion/Menu.qml index 8bace6b9..8ce88e37 100644 --- a/src/imports/controls/fusion/Menu.qml +++ b/src/imports/controls/fusion/Menu.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl +import QtQuick.Window T.Menu { id: control diff --git a/src/imports/controls/fusion/MenuBar.qml b/src/imports/controls/fusion/MenuBar.qml index 4ba71fee..1f54d6f2 100644 --- a/src/imports/controls/fusion/MenuBar.qml +++ b/src/imports/controls/fusion/MenuBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.MenuBar { id: control diff --git a/src/imports/controls/fusion/MenuBarItem.qml b/src/imports/controls/fusion/MenuBarItem.qml index 9fa685dc..c12bd344 100644 --- a/src/imports/controls/fusion/MenuBarItem.qml +++ b/src/imports/controls/fusion/MenuBarItem.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.MenuBarItem { id: control diff --git a/src/imports/controls/fusion/MenuItem.qml b/src/imports/controls/fusion/MenuItem.qml index ebd727e0..2f179b17 100644 --- a/src/imports/controls/fusion/MenuItem.qml +++ b/src/imports/controls/fusion/MenuItem.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.MenuItem { id: control diff --git a/src/imports/controls/fusion/MenuSeparator.qml b/src/imports/controls/fusion/MenuSeparator.qml index 522ada15..1ff0dfa8 100644 --- a/src/imports/controls/fusion/MenuSeparator.qml +++ b/src/imports/controls/fusion/MenuSeparator.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.MenuSeparator { id: control diff --git a/src/imports/controls/fusion/Page.qml b/src/imports/controls/fusion/Page.qml index ce4b1d54..3353f155 100644 --- a/src/imports/controls/fusion/Page.qml +++ b/src/imports/controls/fusion/Page.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Page { id: control diff --git a/src/imports/controls/fusion/PageIndicator.qml b/src/imports/controls/fusion/PageIndicator.qml index 5679b14f..907a86cb 100644 --- a/src/imports/controls/fusion/PageIndicator.qml +++ b/src/imports/controls/fusion/PageIndicator.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.PageIndicator { id: control diff --git a/src/imports/controls/fusion/Pane.qml b/src/imports/controls/fusion/Pane.qml index 28be3b47..a05092dc 100644 --- a/src/imports/controls/fusion/Pane.qml +++ b/src/imports/controls/fusion/Pane.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Pane { id: control diff --git a/src/imports/controls/fusion/Popup.qml b/src/imports/controls/fusion/Popup.qml index 25a8c5ae..75923a1f 100644 --- a/src/imports/controls/fusion/Popup.qml +++ b/src/imports/controls/fusion/Popup.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Popup { id: control diff --git a/src/imports/controls/fusion/ProgressBar.qml b/src/imports/controls/fusion/ProgressBar.qml index a522563a..91ccbf19 100644 --- a/src/imports/controls/fusion/ProgressBar.qml +++ b/src/imports/controls/fusion/ProgressBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ProgressBar { id: control diff --git a/src/imports/controls/fusion/RadioButton.qml b/src/imports/controls/fusion/RadioButton.qml index a940aff3..81100e9c 100644 --- a/src/imports/controls/fusion/RadioButton.qml +++ b/src/imports/controls/fusion/RadioButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.RadioButton { id: control diff --git a/src/imports/controls/fusion/RadioDelegate.qml b/src/imports/controls/fusion/RadioDelegate.qml index e8555a17..701a58f7 100644 --- a/src/imports/controls/fusion/RadioDelegate.qml +++ b/src/imports/controls/fusion/RadioDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.RadioDelegate { id: control diff --git a/src/imports/controls/fusion/RangeSlider.qml b/src/imports/controls/fusion/RangeSlider.qml index 7edbed57..3a635459 100644 --- a/src/imports/controls/fusion/RangeSlider.qml +++ b/src/imports/controls/fusion/RangeSlider.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.RangeSlider { id: control diff --git a/src/imports/controls/fusion/RoundButton.qml b/src/imports/controls/fusion/RoundButton.qml index 59bf4c16..3fa27783 100644 --- a/src/imports/controls/fusion/RoundButton.qml +++ b/src/imports/controls/fusion/RoundButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.RoundButton { id: control diff --git a/src/imports/controls/fusion/ScrollBar.qml b/src/imports/controls/fusion/ScrollBar.qml index 93b58f0e..4288adb5 100644 --- a/src/imports/controls/fusion/ScrollBar.qml +++ b/src/imports/controls/fusion/ScrollBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ScrollBar { id: control diff --git a/src/imports/controls/fusion/ScrollIndicator.qml b/src/imports/controls/fusion/ScrollIndicator.qml index efe0b2fa..c8ffb076 100644 --- a/src/imports/controls/fusion/ScrollIndicator.qml +++ b/src/imports/controls/fusion/ScrollIndicator.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ScrollIndicator { id: control diff --git a/src/imports/controls/fusion/Slider.qml b/src/imports/controls/fusion/Slider.qml index d212a233..9d0dbb7a 100644 --- a/src/imports/controls/fusion/Slider.qml +++ b/src/imports/controls/fusion/Slider.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Slider { id: control diff --git a/src/imports/controls/fusion/SpinBox.qml b/src/imports/controls/fusion/SpinBox.qml index 44387e3c..a94451cb 100644 --- a/src/imports/controls/fusion/SpinBox.qml +++ b/src/imports/controls/fusion/SpinBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.SpinBox { id: control diff --git a/src/imports/controls/fusion/SplitView.qml b/src/imports/controls/fusion/SplitView.qml index 6a04b4da..8da522e6 100644 --- a/src/imports/controls/fusion/SplitView.qml +++ b/src/imports/controls/fusion/SplitView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls 2.13 -import QtQuick.Controls.impl 2.13 -import QtQuick.Controls.Fusion 2.13 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion T.SplitView { id: control diff --git a/src/imports/controls/fusion/SwipeDelegate.qml b/src/imports/controls/fusion/SwipeDelegate.qml index 48c531ea..107900b0 100644 --- a/src/imports/controls/fusion/SwipeDelegate.qml +++ b/src/imports/controls/fusion/SwipeDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.SwipeDelegate { id: control diff --git a/src/imports/controls/fusion/Switch.qml b/src/imports/controls/fusion/Switch.qml index bf18003a..2ff19073 100644 --- a/src/imports/controls/fusion/Switch.qml +++ b/src/imports/controls/fusion/Switch.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Switch { id: control diff --git a/src/imports/controls/fusion/SwitchDelegate.qml b/src/imports/controls/fusion/SwitchDelegate.qml index 67c41924..3c3c24e3 100644 --- a/src/imports/controls/fusion/SwitchDelegate.qml +++ b/src/imports/controls/fusion/SwitchDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.SwitchDelegate { id: control diff --git a/src/imports/controls/fusion/TabBar.qml b/src/imports/controls/fusion/TabBar.qml index 233a2acd..1707b305 100644 --- a/src/imports/controls/fusion/TabBar.qml +++ b/src/imports/controls/fusion/TabBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.TabBar { id: control diff --git a/src/imports/controls/fusion/TabButton.qml b/src/imports/controls/fusion/TabButton.qml index 136503b6..3ee09eeb 100644 --- a/src/imports/controls/fusion/TabButton.qml +++ b/src/imports/controls/fusion/TabButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.TabButton { id: control diff --git a/src/imports/controls/fusion/TextArea.qml b/src/imports/controls/fusion/TextArea.qml index c7107ac4..336c699e 100644 --- a/src/imports/controls/fusion/TextArea.qml +++ b/src/imports/controls/fusion/TextArea.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.TextArea { id: control diff --git a/src/imports/controls/fusion/TextField.qml b/src/imports/controls/fusion/TextField.qml index d5b5788d..187aebaf 100644 --- a/src/imports/controls/fusion/TextField.qml +++ b/src/imports/controls/fusion/TextField.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.TextField { id: control diff --git a/src/imports/controls/fusion/ToolBar.qml b/src/imports/controls/fusion/ToolBar.qml index fa069c0b..73324de0 100644 --- a/src/imports/controls/fusion/ToolBar.qml +++ b/src/imports/controls/fusion/ToolBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ToolBar { id: control diff --git a/src/imports/controls/fusion/ToolButton.qml b/src/imports/controls/fusion/ToolButton.qml index 4c00b402..65626ba1 100644 --- a/src/imports/controls/fusion/ToolButton.qml +++ b/src/imports/controls/fusion/ToolButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ToolButton { id: control diff --git a/src/imports/controls/fusion/ToolSeparator.qml b/src/imports/controls/fusion/ToolSeparator.qml index 5d366652..6051e6fe 100644 --- a/src/imports/controls/fusion/ToolSeparator.qml +++ b/src/imports/controls/fusion/ToolSeparator.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ToolSeparator { id: control diff --git a/src/imports/controls/fusion/ToolTip.qml b/src/imports/controls/fusion/ToolTip.qml index b505e2c9..bd1f3dd5 100644 --- a/src/imports/controls/fusion/ToolTip.qml +++ b/src/imports/controls/fusion/ToolTip.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.ToolTip { id: control diff --git a/src/imports/controls/fusion/Tumbler.qml b/src/imports/controls/fusion/Tumbler.qml index c26bd145..cbb84423 100644 --- a/src/imports/controls/fusion/Tumbler.qml +++ b/src/imports/controls/fusion/Tumbler.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl T.Tumbler { id: control diff --git a/src/imports/controls/fusion/VerticalHeaderView.qml b/src/imports/controls/fusion/VerticalHeaderView.qml index b220cdf2..7eeb65f1 100644 --- a/src/imports/controls/fusion/VerticalHeaderView.qml +++ b/src/imports/controls/fusion/VerticalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.VerticalHeaderView { id: control diff --git a/src/imports/controls/fusion/impl/ButtonPanel.qml b/src/imports/controls/fusion/impl/ButtonPanel.qml index 125aa2f3..bb0bd45e 100644 --- a/src/imports/controls/fusion/impl/ButtonPanel.qml +++ b/src/imports/controls/fusion/impl/ButtonPanel.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: panel diff --git a/src/imports/controls/fusion/impl/CheckIndicator.qml b/src/imports/controls/fusion/impl/CheckIndicator.qml index f8c127c4..75d1c5d6 100644 --- a/src/imports/controls/fusion/impl/CheckIndicator.qml +++ b/src/imports/controls/fusion/impl/CheckIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: indicator diff --git a/src/imports/controls/fusion/impl/RadioIndicator.qml b/src/imports/controls/fusion/impl/RadioIndicator.qml index c73cd49f..3dac4d7a 100644 --- a/src/imports/controls/fusion/impl/RadioIndicator.qml +++ b/src/imports/controls/fusion/impl/RadioIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: indicator diff --git a/src/imports/controls/fusion/impl/SliderGroove.qml b/src/imports/controls/fusion/impl/SliderGroove.qml index 381a02b5..62dc05c7 100644 --- a/src/imports/controls/fusion/impl/SliderGroove.qml +++ b/src/imports/controls/fusion/impl/SliderGroove.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: groove diff --git a/src/imports/controls/fusion/impl/SliderHandle.qml b/src/imports/controls/fusion/impl/SliderHandle.qml index c53af57e..e56642f4 100644 --- a/src/imports/controls/fusion/impl/SliderHandle.qml +++ b/src/imports/controls/fusion/impl/SliderHandle.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: handle diff --git a/src/imports/controls/fusion/impl/SwitchIndicator.qml b/src/imports/controls/fusion/impl/SwitchIndicator.qml index ae7c89a0..8d1a8096 100644 --- a/src/imports/controls/fusion/impl/SwitchIndicator.qml +++ b/src/imports/controls/fusion/impl/SwitchIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl Rectangle { id: indicator diff --git a/src/imports/controls/imagine/ApplicationWindow.qml b/src/imports/controls/imagine/ApplicationWindow.qml index 092da1f6..b54527eb 100644 --- a/src/imports/controls/imagine/ApplicationWindow.qml +++ b/src/imports/controls/imagine/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ApplicationWindow { id: window diff --git a/src/imports/controls/imagine/BusyIndicator.qml b/src/imports/controls/imagine/BusyIndicator.qml index 652365b1..163a64b4 100644 --- a/src/imports/controls/imagine/BusyIndicator.qml +++ b/src/imports/controls/imagine/BusyIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.BusyIndicator { id: control diff --git a/src/imports/controls/imagine/Button.qml b/src/imports/controls/imagine/Button.qml index e7171eb1..4d6b2ce0 100644 --- a/src/imports/controls/imagine/Button.qml +++ b/src/imports/controls/imagine/Button.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Button { id: control diff --git a/src/imports/controls/imagine/CheckBox.qml b/src/imports/controls/imagine/CheckBox.qml index b91ceb40..a92837b5 100644 --- a/src/imports/controls/imagine/CheckBox.qml +++ b/src/imports/controls/imagine/CheckBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.CheckBox { id: control diff --git a/src/imports/controls/imagine/CheckDelegate.qml b/src/imports/controls/imagine/CheckDelegate.qml index 19975152..7017b47a 100644 --- a/src/imports/controls/imagine/CheckDelegate.qml +++ b/src/imports/controls/imagine/CheckDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.CheckDelegate { id: control diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index d657e734..166ee7af 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 -import QtQuick.Controls.Imagine 2.15 -import QtQuick.Controls.Imagine.impl 2.15 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ComboBox { id: control diff --git a/src/imports/controls/imagine/DelayButton.qml b/src/imports/controls/imagine/DelayButton.qml index ed4ad1e5..e542eb69 100644 --- a/src/imports/controls/imagine/DelayButton.qml +++ b/src/imports/controls/imagine/DelayButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.DelayButton { id: control diff --git a/src/imports/controls/imagine/Dial.qml b/src/imports/controls/imagine/Dial.qml index 83daf14a..224bff56 100644 --- a/src/imports/controls/imagine/Dial.qml +++ b/src/imports/controls/imagine/Dial.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Dial { id: control diff --git a/src/imports/controls/imagine/Dialog.qml b/src/imports/controls/imagine/Dialog.qml index 730b7f57..46c22b6c 100644 --- a/src/imports/controls/imagine/Dialog.qml +++ b/src/imports/controls/imagine/Dialog.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Dialog { id: control diff --git a/src/imports/controls/imagine/DialogButtonBox.qml b/src/imports/controls/imagine/DialogButtonBox.qml index c24b29fc..5094582a 100644 --- a/src/imports/controls/imagine/DialogButtonBox.qml +++ b/src/imports/controls/imagine/DialogButtonBox.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.DialogButtonBox { id: control diff --git a/src/imports/controls/imagine/Drawer.qml b/src/imports/controls/imagine/Drawer.qml index 8f278621..414516d3 100644 --- a/src/imports/controls/imagine/Drawer.qml +++ b/src/imports/controls/imagine/Drawer.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Drawer { id: control diff --git a/src/imports/controls/imagine/Frame.qml b/src/imports/controls/imagine/Frame.qml index 2bef3c88..7ba93dbc 100644 --- a/src/imports/controls/imagine/Frame.qml +++ b/src/imports/controls/imagine/Frame.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Frame { id: control diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml index 7abdb6f0..ecee0691 100644 --- a/src/imports/controls/imagine/GroupBox.qml +++ b/src/imports/controls/imagine/GroupBox.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.GroupBox { id: control diff --git a/src/imports/controls/imagine/HorizontalHeaderView.qml b/src/imports/controls/imagine/HorizontalHeaderView.qml index ec91af25..093c868b 100644 --- a/src/imports/controls/imagine/HorizontalHeaderView.qml +++ b/src/imports/controls/imagine/HorizontalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.HorizontalHeaderView { id: control diff --git a/src/imports/controls/imagine/ItemDelegate.qml b/src/imports/controls/imagine/ItemDelegate.qml index 0b3edeaf..8073bec4 100644 --- a/src/imports/controls/imagine/ItemDelegate.qml +++ b/src/imports/controls/imagine/ItemDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ItemDelegate { id: control diff --git a/src/imports/controls/imagine/Label.qml b/src/imports/controls/imagine/Label.qml index 82c0ef47..3654cd7d 100644 --- a/src/imports/controls/imagine/Label.qml +++ b/src/imports/controls/imagine/Label.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Label { id: control diff --git a/src/imports/controls/imagine/Menu.qml b/src/imports/controls/imagine/Menu.qml index 832565e6..162edda0 100644 --- a/src/imports/controls/imagine/Menu.qml +++ b/src/imports/controls/imagine/Menu.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl +import QtQuick.Window T.Menu { id: control diff --git a/src/imports/controls/imagine/MenuItem.qml b/src/imports/controls/imagine/MenuItem.qml index f85fc657..717d6af5 100644 --- a/src/imports/controls/imagine/MenuItem.qml +++ b/src/imports/controls/imagine/MenuItem.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.MenuItem { id: control diff --git a/src/imports/controls/imagine/MenuSeparator.qml b/src/imports/controls/imagine/MenuSeparator.qml index 9ed39087..42d1812f 100644 --- a/src/imports/controls/imagine/MenuSeparator.qml +++ b/src/imports/controls/imagine/MenuSeparator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.MenuSeparator { id: control diff --git a/src/imports/controls/imagine/Page.qml b/src/imports/controls/imagine/Page.qml index 07ec0a75..1b77112f 100644 --- a/src/imports/controls/imagine/Page.qml +++ b/src/imports/controls/imagine/Page.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Page { id: control diff --git a/src/imports/controls/imagine/PageIndicator.qml b/src/imports/controls/imagine/PageIndicator.qml index 8da89f5a..ba9bb85c 100644 --- a/src/imports/controls/imagine/PageIndicator.qml +++ b/src/imports/controls/imagine/PageIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.PageIndicator { id: control diff --git a/src/imports/controls/imagine/Pane.qml b/src/imports/controls/imagine/Pane.qml index 970b22b9..4fdfaa18 100644 --- a/src/imports/controls/imagine/Pane.qml +++ b/src/imports/controls/imagine/Pane.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Pane { id: control diff --git a/src/imports/controls/imagine/Popup.qml b/src/imports/controls/imagine/Popup.qml index 8f69bef4..bc7e544b 100644 --- a/src/imports/controls/imagine/Popup.qml +++ b/src/imports/controls/imagine/Popup.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Popup { id: control diff --git a/src/imports/controls/imagine/ProgressBar.qml b/src/imports/controls/imagine/ProgressBar.qml index 69d352eb..0c2ed8d7 100644 --- a/src/imports/controls/imagine/ProgressBar.qml +++ b/src/imports/controls/imagine/ProgressBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ProgressBar { id: control diff --git a/src/imports/controls/imagine/RadioButton.qml b/src/imports/controls/imagine/RadioButton.qml index a50bc127..e1a81321 100644 --- a/src/imports/controls/imagine/RadioButton.qml +++ b/src/imports/controls/imagine/RadioButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.RadioButton { id: control diff --git a/src/imports/controls/imagine/RadioDelegate.qml b/src/imports/controls/imagine/RadioDelegate.qml index 5a8356f8..f8bf6c44 100644 --- a/src/imports/controls/imagine/RadioDelegate.qml +++ b/src/imports/controls/imagine/RadioDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.RadioDelegate { id: control diff --git a/src/imports/controls/imagine/RangeSlider.qml b/src/imports/controls/imagine/RangeSlider.qml index 47d90cf3..37f59a3a 100644 --- a/src/imports/controls/imagine/RangeSlider.qml +++ b/src/imports/controls/imagine/RangeSlider.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.RangeSlider { id: control diff --git a/src/imports/controls/imagine/RoundButton.qml b/src/imports/controls/imagine/RoundButton.qml index fe4cbb36..fe3c3da6 100644 --- a/src/imports/controls/imagine/RoundButton.qml +++ b/src/imports/controls/imagine/RoundButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.RoundButton { id: control diff --git a/src/imports/controls/imagine/ScrollBar.qml b/src/imports/controls/imagine/ScrollBar.qml index 68772e12..f512a0b7 100644 --- a/src/imports/controls/imagine/ScrollBar.qml +++ b/src/imports/controls/imagine/ScrollBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ScrollBar { id: control diff --git a/src/imports/controls/imagine/ScrollIndicator.qml b/src/imports/controls/imagine/ScrollIndicator.qml index 896cd876..316b749c 100644 --- a/src/imports/controls/imagine/ScrollIndicator.qml +++ b/src/imports/controls/imagine/ScrollIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ScrollIndicator { id: control diff --git a/src/imports/controls/imagine/ScrollView.qml b/src/imports/controls/imagine/ScrollView.qml index 9d469ba5..a251a827 100644 --- a/src/imports/controls/imagine/ScrollView.qml +++ b/src/imports/controls/imagine/ScrollView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ScrollView { id: control diff --git a/src/imports/controls/imagine/Slider.qml b/src/imports/controls/imagine/Slider.qml index fe9c3388..597e222a 100644 --- a/src/imports/controls/imagine/Slider.qml +++ b/src/imports/controls/imagine/Slider.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Slider { id: control diff --git a/src/imports/controls/imagine/SpinBox.qml b/src/imports/controls/imagine/SpinBox.qml index 61135806..6d1bdaba 100644 --- a/src/imports/controls/imagine/SpinBox.qml +++ b/src/imports/controls/imagine/SpinBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.SpinBox { id: control diff --git a/src/imports/controls/imagine/SplitView.qml b/src/imports/controls/imagine/SplitView.qml index a4a858f4..36e1b213 100644 --- a/src/imports/controls/imagine/SplitView.qml +++ b/src/imports/controls/imagine/SplitView.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls.Imagine 2.13 -import QtQuick.Controls.Imagine.impl 2.13 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.SplitView { id: control diff --git a/src/imports/controls/imagine/StackView.qml b/src/imports/controls/imagine/StackView.qml index 407b1d15..a9ddac66 100644 --- a/src/imports/controls/imagine/StackView.qml +++ b/src/imports/controls/imagine/StackView.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.StackView { id: control diff --git a/src/imports/controls/imagine/SwipeDelegate.qml b/src/imports/controls/imagine/SwipeDelegate.qml index 3850253f..ff0924b4 100644 --- a/src/imports/controls/imagine/SwipeDelegate.qml +++ b/src/imports/controls/imagine/SwipeDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.SwipeDelegate { id: control diff --git a/src/imports/controls/imagine/SwipeView.qml b/src/imports/controls/imagine/SwipeView.qml index 70d65fef..12cafbb8 100644 --- a/src/imports/controls/imagine/SwipeView.qml +++ b/src/imports/controls/imagine/SwipeView.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.SwipeView { id: control diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml index 50b407ac..a2f7a9a7 100644 --- a/src/imports/controls/imagine/Switch.qml +++ b/src/imports/controls/imagine/Switch.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Switch { id: control diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml index 73e5aac0..5b4b2836 100644 --- a/src/imports/controls/imagine/SwitchDelegate.qml +++ b/src/imports/controls/imagine/SwitchDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.SwitchDelegate { id: control diff --git a/src/imports/controls/imagine/TabBar.qml b/src/imports/controls/imagine/TabBar.qml index 69516e03..26c30e92 100644 --- a/src/imports/controls/imagine/TabBar.qml +++ b/src/imports/controls/imagine/TabBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.TabBar { id: control diff --git a/src/imports/controls/imagine/TabButton.qml b/src/imports/controls/imagine/TabButton.qml index 1cdcfc4b..bdd27b93 100644 --- a/src/imports/controls/imagine/TabButton.qml +++ b/src/imports/controls/imagine/TabButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.TabButton { id: control diff --git a/src/imports/controls/imagine/TextArea.qml b/src/imports/controls/imagine/TextArea.qml index c7505b52..43c34bd2 100644 --- a/src/imports/controls/imagine/TextArea.qml +++ b/src/imports/controls/imagine/TextArea.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.TextArea { id: control diff --git a/src/imports/controls/imagine/TextField.qml b/src/imports/controls/imagine/TextField.qml index 3ff0ad44..e6f0c889 100644 --- a/src/imports/controls/imagine/TextField.qml +++ b/src/imports/controls/imagine/TextField.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.TextField { id: control diff --git a/src/imports/controls/imagine/ToolBar.qml b/src/imports/controls/imagine/ToolBar.qml index 99bcd3ba..4a343e3c 100644 --- a/src/imports/controls/imagine/ToolBar.qml +++ b/src/imports/controls/imagine/ToolBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ToolBar { id: control diff --git a/src/imports/controls/imagine/ToolButton.qml b/src/imports/controls/imagine/ToolButton.qml index cc22f88d..4f1c43b1 100644 --- a/src/imports/controls/imagine/ToolButton.qml +++ b/src/imports/controls/imagine/ToolButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ToolButton { id: control diff --git a/src/imports/controls/imagine/ToolSeparator.qml b/src/imports/controls/imagine/ToolSeparator.qml index c0887e4d..962c14c7 100644 --- a/src/imports/controls/imagine/ToolSeparator.qml +++ b/src/imports/controls/imagine/ToolSeparator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ToolSeparator { id: control diff --git a/src/imports/controls/imagine/ToolTip.qml b/src/imports/controls/imagine/ToolTip.qml index 21d75ebc..f5261400 100644 --- a/src/imports/controls/imagine/ToolTip.qml +++ b/src/imports/controls/imagine/ToolTip.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.ToolTip { id: control diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml index b53b6265..79c719bf 100644 --- a/src/imports/controls/imagine/Tumbler.qml +++ b/src/imports/controls/imagine/Tumbler.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Imagine +import QtQuick.Controls.Imagine.impl T.Tumbler { id: control diff --git a/src/imports/controls/imagine/VerticalHeaderView.qml b/src/imports/controls/imagine/VerticalHeaderView.qml index 3fc9ca5a..21e39c39 100644 --- a/src/imports/controls/imagine/VerticalHeaderView.qml +++ b/src/imports/controls/imagine/VerticalHeaderView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.VerticalHeaderView { id: control diff --git a/src/imports/controls/imagine/impl/OpacityMask.qml b/src/imports/controls/imagine/impl/OpacityMask.qml index 90175386..2f1ab139 100644 --- a/src/imports/controls/imagine/impl/OpacityMask.qml +++ b/src/imports/controls/imagine/impl/OpacityMask.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick /* A cross-graphics API implementation of QtGraphicalEffects' OpacityMask. diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml index 5b8cefac..82a0da8b 100644 --- a/src/imports/controls/material/ApplicationWindow.qml +++ b/src/imports/controls/material/ApplicationWindow.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls.Material T.ApplicationWindow { id: window diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml index 8173248c..621b2b43 100644 --- a/src/imports/controls/material/BusyIndicator.qml +++ b/src/imports/controls/material/BusyIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.BusyIndicator { id: control diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index 04c6664c..9bda0128 100644 --- a/src/imports/controls/material/Button.qml +++ b/src/imports/controls/material/Button.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Button { id: control diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index 159e2f12..a3f717be 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.CheckBox { id: control diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index c7d7575e..e5ea5716 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.CheckDelegate { id: control diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 791e57ab..7abb8ddd 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Material 2.15 -import QtQuick.Controls.Material.impl 2.15 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.ComboBox { id: control diff --git a/src/imports/controls/material/DelayButton.qml b/src/imports/controls/material/DelayButton.qml index 6b5ef3ad..68773b04 100644 --- a/src/imports/controls/material/DelayButton.qml +++ b/src/imports/controls/material/DelayButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.DelayButton { id: control diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml index 1ad9a0ce..2731436f 100644 --- a/src/imports/controls/material/Dial.qml +++ b/src/imports/controls/material/Dial.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Dial { id: control diff --git a/src/imports/controls/material/Dialog.qml b/src/imports/controls/material/Dialog.qml index 364c0e57..0a711eec 100644 --- a/src/imports/controls/material/Dialog.qml +++ b/src/imports/controls/material/Dialog.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Dialog { id: control diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml index c53b8210..fda957b1 100644 --- a/src/imports/controls/material/DialogButtonBox.qml +++ b/src/imports/controls/material/DialogButtonBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.DialogButtonBox { id: control diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index 3d64cdef..93c4bf56 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Drawer { id: control diff --git a/src/imports/controls/material/Frame.qml b/src/imports/controls/material/Frame.qml index 0001825e..8626f766 100644 --- a/src/imports/controls/material/Frame.qml +++ b/src/imports/controls/material/Frame.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Frame { id: control diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index e18a5949..4a27b832 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.GroupBox { id: control diff --git a/src/imports/controls/material/HorizontalHeaderView.qml b/src/imports/controls/material/HorizontalHeaderView.qml index fd672f34..f6c76c4a 100644 --- a/src/imports/controls/material/HorizontalHeaderView.qml +++ b/src/imports/controls/material/HorizontalHeaderView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Material 2.15 -import QtQuick.Controls.Material.impl 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.HorizontalHeaderView { id: control diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml index 2078ce6c..f8cf41df 100644 --- a/src/imports/controls/material/ItemDelegate.qml +++ b/src/imports/controls/material/ItemDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.ItemDelegate { id: control diff --git a/src/imports/controls/material/Label.qml b/src/imports/controls/material/Label.qml index ad923a24..77e85f42 100644 --- a/src/imports/controls/material/Label.qml +++ b/src/imports/controls/material/Label.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.Label { id: control diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml index 94bcc15e..8e362964 100644 --- a/src/imports/controls/material/Menu.qml +++ b/src/imports/controls/material/Menu.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl +import QtQuick.Window T.Menu { id: control diff --git a/src/imports/controls/material/MenuBar.qml b/src/imports/controls/material/MenuBar.qml index 66252d6e..621cfbd5 100644 --- a/src/imports/controls/material/MenuBar.qml +++ b/src/imports/controls/material/MenuBar.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.MenuBar { id: control diff --git a/src/imports/controls/material/MenuBarItem.qml b/src/imports/controls/material/MenuBarItem.qml index 588d6fbb..957ee867 100644 --- a/src/imports/controls/material/MenuBarItem.qml +++ b/src/imports/controls/material/MenuBarItem.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.MenuBarItem { id: control diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index cb558e4c..522efd4d 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.MenuItem { id: control diff --git a/src/imports/controls/material/MenuSeparator.qml b/src/imports/controls/material/MenuSeparator.qml index 6d80c049..08a33ffe 100644 --- a/src/imports/controls/material/MenuSeparator.qml +++ b/src/imports/controls/material/MenuSeparator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.MenuSeparator { id: control diff --git a/src/imports/controls/material/Page.qml b/src/imports/controls/material/Page.qml index 4da0ecc6..711fac2d 100644 --- a/src/imports/controls/material/Page.qml +++ b/src/imports/controls/material/Page.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.Page { id: control diff --git a/src/imports/controls/material/PageIndicator.qml b/src/imports/controls/material/PageIndicator.qml index 5e6ca245..8ccd7de3 100644 --- a/src/imports/controls/material/PageIndicator.qml +++ b/src/imports/controls/material/PageIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.PageIndicator { id: control diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml index 988e225a..055a8d23 100644 --- a/src/imports/controls/material/Pane.qml +++ b/src/imports/controls/material/Pane.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Pane { id: control diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml index 1b576385..cb5b62ec 100644 --- a/src/imports/controls/material/Popup.qml +++ b/src/imports/controls/material/Popup.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Popup { id: control diff --git a/src/imports/controls/material/ProgressBar.qml b/src/imports/controls/material/ProgressBar.qml index 2848f037..dd4fae0e 100644 --- a/src/imports/controls/material/ProgressBar.qml +++ b/src/imports/controls/material/ProgressBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.ProgressBar { id: control diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index dadcc84f..664cb19e 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.RadioButton { id: control diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml index c977d332..f9737fa5 100644 --- a/src/imports/controls/material/RadioDelegate.qml +++ b/src/imports/controls/material/RadioDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.RadioDelegate { id: control diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index f05601a7..d1d22115 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.RangeSlider { id: control diff --git a/src/imports/controls/material/RoundButton.qml b/src/imports/controls/material/RoundButton.qml index 13d0f9db..79f4a249 100644 --- a/src/imports/controls/material/RoundButton.qml +++ b/src/imports/controls/material/RoundButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.RoundButton { id: control diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index fda64346..55de0d13 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.ScrollBar { id: control diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml index 19f23ad2..bc81c630 100644 --- a/src/imports/controls/material/ScrollIndicator.qml +++ b/src/imports/controls/material/ScrollIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.ScrollIndicator { id: control diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml index ac7a0c42..2a366734 100644 --- a/src/imports/controls/material/Slider.qml +++ b/src/imports/controls/material/Slider.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.Slider { id: control diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml index 23c86bc3..4f69dd25 100644 --- a/src/imports/controls/material/SpinBox.qml +++ b/src/imports/controls/material/SpinBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.SpinBox { id: control diff --git a/src/imports/controls/material/SplitView.qml b/src/imports/controls/material/SplitView.qml index 5544e833..e6e3ed3b 100644 --- a/src/imports/controls/material/SplitView.qml +++ b/src/imports/controls/material/SplitView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls 2.13 -import QtQuick.Controls.impl 2.13 -import QtQuick.Controls.Material 2.13 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material T.SplitView { id: control diff --git a/src/imports/controls/material/StackView.qml b/src/imports/controls/material/StackView.qml index dd5d6ce6..4c3e6749 100644 --- a/src/imports/controls/material/StackView.qml +++ b/src/imports/controls/material/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.StackView { id: control diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index d06799be..16ef8ea2 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.SwipeDelegate { id: control diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index a84f16c5..cd4da229 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.SwipeView { id: control diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index fd0db925..a43e8730 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl +import QtQuick.Templates as T T.Switch { id: control diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index 834a3dfa..dd1c4e8d 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.SwitchDelegate { id: control diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml index 98c9132a..9e9585f3 100644 --- a/src/imports/controls/material/TabBar.qml +++ b/src/imports/controls/material/TabBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.TabBar { id: control diff --git a/src/imports/controls/material/TabButton.qml b/src/imports/controls/material/TabButton.qml index 5245652c..eacc95b8 100644 --- a/src/imports/controls/material/TabButton.qml +++ b/src/imports/controls/material/TabButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.TabButton { id: control diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 249b6401..b1529437 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.TextArea { id: control diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml index ed42b295..2c123c91 100644 --- a/src/imports/controls/material/TextField.qml +++ b/src/imports/controls/material/TextField.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.TextField { id: control diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml index 5b887598..a1aa82bd 100644 --- a/src/imports/controls/material/ToolBar.qml +++ b/src/imports/controls/material/ToolBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.ToolBar { id: control diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml index 69c42441..dc27157f 100644 --- a/src/imports/controls/material/ToolButton.qml +++ b/src/imports/controls/material/ToolButton.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.ToolButton { id: control diff --git a/src/imports/controls/material/ToolSeparator.qml b/src/imports/controls/material/ToolSeparator.qml index 94367657..4bce553d 100644 --- a/src/imports/controls/material/ToolSeparator.qml +++ b/src/imports/controls/material/ToolSeparator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.ToolSeparator { id: control diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml index 83afe4b1..033e48a3 100644 --- a/src/imports/controls/material/ToolTip.qml +++ b/src/imports/controls/material/ToolTip.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Material T.ToolTip { id: control diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml index 973b4a68..81e35044 100644 --- a/src/imports/controls/material/Tumbler.qml +++ b/src/imports/controls/material/Tumbler.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Controls.Material T.Tumbler { id: control diff --git a/src/imports/controls/material/VerticalHeaderView.qml b/src/imports/controls/material/VerticalHeaderView.qml index 5fc5aebe..1a38b30a 100644 --- a/src/imports/controls/material/VerticalHeaderView.qml +++ b/src/imports/controls/material/VerticalHeaderView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Material 2.15 -import QtQuick.Controls.Material.impl 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl T.VerticalHeaderView { id: control diff --git a/src/imports/controls/material/impl/BoxShadow.qml b/src/imports/controls/material/impl/BoxShadow.qml index 5a746c0f..ea09570e 100644 --- a/src/imports/controls/material/impl/BoxShadow.qml +++ b/src/imports/controls/material/impl/BoxShadow.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl /* A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design diff --git a/src/imports/controls/material/impl/CheckIndicator.qml b/src/imports/controls/material/impl/CheckIndicator.qml index ecaa673d..b6593fab 100644 --- a/src/imports/controls/material/impl/CheckIndicator.qml +++ b/src/imports/controls/material/impl/CheckIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl Rectangle { id: indicatorItem diff --git a/src/imports/controls/material/impl/CursorDelegate.qml b/src/imports/controls/material/impl/CursorDelegate.qml index fe2d25c6..a913ab84 100644 --- a/src/imports/controls/material/impl/CursorDelegate.qml +++ b/src/imports/controls/material/impl/CursorDelegate.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 +import QtQuick +import QtQuick.Controls.Material Rectangle { id: cursor diff --git a/src/imports/controls/material/impl/ElevationEffect.qml b/src/imports/controls/material/impl/ElevationEffect.qml index 73a2a238..8a4e98e3 100644 --- a/src/imports/controls/material/impl/ElevationEffect.qml +++ b/src/imports/controls/material/impl/ElevationEffect.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl /* An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect. diff --git a/src/imports/controls/material/impl/RadioIndicator.qml b/src/imports/controls/material/impl/RadioIndicator.qml index e2c55184..68681c44 100644 --- a/src/imports/controls/material/impl/RadioIndicator.qml +++ b/src/imports/controls/material/impl/RadioIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl Rectangle { id: indicator diff --git a/src/imports/controls/material/impl/RectangularGlow.qml b/src/imports/controls/material/impl/RectangularGlow.qml index 7e09c1a5..b2337afc 100644 --- a/src/imports/controls/material/impl/RectangularGlow.qml +++ b/src/imports/controls/material/impl/RectangularGlow.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick /* A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow. diff --git a/src/imports/controls/material/impl/SliderHandle.qml b/src/imports/controls/material/impl/SliderHandle.qml index c9078bc8..60fd7aed 100644 --- a/src/imports/controls/material/impl/SliderHandle.qml +++ b/src/imports/controls/material/impl/SliderHandle.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl Item { id: root diff --git a/src/imports/controls/material/impl/SwitchIndicator.qml b/src/imports/controls/material/impl/SwitchIndicator.qml index 3034e771..ae1709b6 100644 --- a/src/imports/controls/material/impl/SwitchIndicator.qml +++ b/src/imports/controls/material/impl/SwitchIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl Item { id: indicator diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index 80cda477..2ec9c565 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.ApplicationWindow { id: window diff --git a/src/imports/controls/universal/BusyIndicator.qml b/src/imports/controls/universal/BusyIndicator.qml index 2ad21b46..0bd3ca03 100644 --- a/src/imports/controls/universal/BusyIndicator.qml +++ b/src/imports/controls/universal/BusyIndicator.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.BusyIndicator { id: control diff --git a/src/imports/controls/universal/Button.qml b/src/imports/controls/universal/Button.qml index 657b2835..2f88fe60 100644 --- a/src/imports/controls/universal/Button.qml +++ b/src/imports/controls/universal/Button.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.Button { id: control diff --git a/src/imports/controls/universal/CheckBox.qml b/src/imports/controls/universal/CheckBox.qml index 9494f4d2..ff35d372 100644 --- a/src/imports/controls/universal/CheckBox.qml +++ b/src/imports/controls/universal/CheckBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.CheckBox { id: control diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml index b544c42e..13de8c57 100644 --- a/src/imports/controls/universal/CheckDelegate.qml +++ b/src/imports/controls/universal/CheckDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.CheckDelegate { id: control diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index eb7fb09d..1568d488 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Universal 2.15 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ComboBox { id: control diff --git a/src/imports/controls/universal/DelayButton.qml b/src/imports/controls/universal/DelayButton.qml index 2a3a3b3a..5840fa86 100644 --- a/src/imports/controls/universal/DelayButton.qml +++ b/src/imports/controls/universal/DelayButton.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.DelayButton { id: control diff --git a/src/imports/controls/universal/Dial.qml b/src/imports/controls/universal/Dial.qml index 0d8fcba0..cd9e615e 100644 --- a/src/imports/controls/universal/Dial.qml +++ b/src/imports/controls/universal/Dial.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Dial { id: control diff --git a/src/imports/controls/universal/Dialog.qml b/src/imports/controls/universal/Dialog.qml index 6151d090..5bec0992 100644 --- a/src/imports/controls/universal/Dialog.qml +++ b/src/imports/controls/universal/Dialog.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Universal T.Dialog { id: control diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml index 0458c39d..1b1148e3 100644 --- a/src/imports/controls/universal/DialogButtonBox.qml +++ b/src/imports/controls/universal/DialogButtonBox.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.Universal T.DialogButtonBox { id: control diff --git a/src/imports/controls/universal/Drawer.qml b/src/imports/controls/universal/Drawer.qml index 7ec1d7f8..19f78f1e 100644 --- a/src/imports/controls/universal/Drawer.qml +++ b/src/imports/controls/universal/Drawer.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Drawer { id: control diff --git a/src/imports/controls/universal/Frame.qml b/src/imports/controls/universal/Frame.qml index 8bb44849..780ba734 100644 --- a/src/imports/controls/universal/Frame.qml +++ b/src/imports/controls/universal/Frame.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Frame { id: control diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml index dc156dd7..5104b710 100644 --- a/src/imports/controls/universal/GroupBox.qml +++ b/src/imports/controls/universal/GroupBox.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.GroupBox { id: control diff --git a/src/imports/controls/universal/HorizontalHeaderView.qml b/src/imports/controls/universal/HorizontalHeaderView.qml index 47daa8ce..30bbbaaf 100644 --- a/src/imports/controls/universal/HorizontalHeaderView.qml +++ b/src/imports/controls/universal/HorizontalHeaderView.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Universal 2.15 -import QtQuick.Controls.Universal.impl 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.HorizontalHeaderView { id: control diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml index ed985405..694a896f 100644 --- a/src/imports/controls/universal/ItemDelegate.qml +++ b/src/imports/controls/universal/ItemDelegate.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.ItemDelegate { id: control diff --git a/src/imports/controls/universal/Label.qml b/src/imports/controls/universal/Label.qml index c66435c3..9460c997 100644 --- a/src/imports/controls/universal/Label.qml +++ b/src/imports/controls/universal/Label.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Label { id: control diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml index 4814d006..080ea482 100644 --- a/src/imports/controls/universal/Menu.qml +++ b/src/imports/controls/universal/Menu.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Window T.Menu { id: control diff --git a/src/imports/controls/universal/MenuBar.qml b/src/imports/controls/universal/MenuBar.qml index 2317f505..f09083aa 100644 --- a/src/imports/controls/universal/MenuBar.qml +++ b/src/imports/controls/universal/MenuBar.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.MenuBar { id: control diff --git a/src/imports/controls/universal/MenuBarItem.qml b/src/imports/controls/universal/MenuBarItem.qml index 30f1fc57..eddc8090 100644 --- a/src/imports/controls/universal/MenuBarItem.qml +++ b/src/imports/controls/universal/MenuBarItem.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.MenuBarItem { id: control diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index 872f1eba..cf6d12c9 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.MenuItem { id: control diff --git a/src/imports/controls/universal/MenuSeparator.qml b/src/imports/controls/universal/MenuSeparator.qml index 72f9f6f7..be6fad45 100644 --- a/src/imports/controls/universal/MenuSeparator.qml +++ b/src/imports/controls/universal/MenuSeparator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.MenuSeparator { id: control diff --git a/src/imports/controls/universal/Page.qml b/src/imports/controls/universal/Page.qml index 347d6d9a..8946e7ad 100644 --- a/src/imports/controls/universal/Page.qml +++ b/src/imports/controls/universal/Page.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Page { id: control diff --git a/src/imports/controls/universal/PageIndicator.qml b/src/imports/controls/universal/PageIndicator.qml index 3dcc84ab..2adb85c6 100644 --- a/src/imports/controls/universal/PageIndicator.qml +++ b/src/imports/controls/universal/PageIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.PageIndicator { id: control diff --git a/src/imports/controls/universal/Pane.qml b/src/imports/controls/universal/Pane.qml index 63a5ecec..257f9caf 100644 --- a/src/imports/controls/universal/Pane.qml +++ b/src/imports/controls/universal/Pane.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Pane { id: control diff --git a/src/imports/controls/universal/Popup.qml b/src/imports/controls/universal/Popup.qml index e39134e1..5e972ea9 100644 --- a/src/imports/controls/universal/Popup.qml +++ b/src/imports/controls/universal/Popup.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Popup { id: control diff --git a/src/imports/controls/universal/ProgressBar.qml b/src/imports/controls/universal/ProgressBar.qml index ce79bd54..4f8cc874 100644 --- a/src/imports/controls/universal/ProgressBar.qml +++ b/src/imports/controls/universal/ProgressBar.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.ProgressBar { id: control diff --git a/src/imports/controls/universal/RadioButton.qml b/src/imports/controls/universal/RadioButton.qml index a50cdf9b..abd386ce 100644 --- a/src/imports/controls/universal/RadioButton.qml +++ b/src/imports/controls/universal/RadioButton.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.RadioButton { id: control diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml index 9fc910f3..e4656af9 100644 --- a/src/imports/controls/universal/RadioDelegate.qml +++ b/src/imports/controls/universal/RadioDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.RadioDelegate { id: control diff --git a/src/imports/controls/universal/RangeSlider.qml b/src/imports/controls/universal/RangeSlider.qml index f2e4d71e..5bdc4d8f 100644 --- a/src/imports/controls/universal/RangeSlider.qml +++ b/src/imports/controls/universal/RangeSlider.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.RangeSlider { id: control diff --git a/src/imports/controls/universal/RoundButton.qml b/src/imports/controls/universal/RoundButton.qml index 2eedf96e..f9538f99 100644 --- a/src/imports/controls/universal/RoundButton.qml +++ b/src/imports/controls/universal/RoundButton.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.RoundButton { id: control diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml index 8b8e325d..d101658c 100644 --- a/src/imports/controls/universal/ScrollBar.qml +++ b/src/imports/controls/universal/ScrollBar.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ScrollBar { id: control diff --git a/src/imports/controls/universal/ScrollIndicator.qml b/src/imports/controls/universal/ScrollIndicator.qml index ab66ee7c..f66a9658 100644 --- a/src/imports/controls/universal/ScrollIndicator.qml +++ b/src/imports/controls/universal/ScrollIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ScrollIndicator { id: control diff --git a/src/imports/controls/universal/Slider.qml b/src/imports/controls/universal/Slider.qml index 8f427b1e..37c77a35 100644 --- a/src/imports/controls/universal/Slider.qml +++ b/src/imports/controls/universal/Slider.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.Slider { id: control diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml index 56fdffdf..8f227190 100644 --- a/src/imports/controls/universal/SpinBox.qml +++ b/src/imports/controls/universal/SpinBox.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.SpinBox { id: control diff --git a/src/imports/controls/universal/SplitView.qml b/src/imports/controls/universal/SplitView.qml index a4ed22dd..e05d7235 100644 --- a/src/imports/controls/universal/SplitView.qml +++ b/src/imports/controls/universal/SplitView.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Templates 2.13 as T -import QtQuick.Controls 2.13 -import QtQuick.Controls.impl 2.13 -import QtQuick.Controls.Universal 2.13 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.SplitView { id: control diff --git a/src/imports/controls/universal/StackView.qml b/src/imports/controls/universal/StackView.qml index 5a3f7751..41611dd3 100644 --- a/src/imports/controls/universal/StackView.qml +++ b/src/imports/controls/universal/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.StackView { id: control diff --git a/src/imports/controls/universal/SwipeDelegate.qml b/src/imports/controls/universal/SwipeDelegate.qml index 066049a7..10460bb8 100644 --- a/src/imports/controls/universal/SwipeDelegate.qml +++ b/src/imports/controls/universal/SwipeDelegate.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.SwipeDelegate { id: control diff --git a/src/imports/controls/universal/Switch.qml b/src/imports/controls/universal/Switch.qml index 284b1229..33ee4abb 100644 --- a/src/imports/controls/universal/Switch.qml +++ b/src/imports/controls/universal/Switch.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.Switch { id: control diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml index 56ba8494..79835808 100644 --- a/src/imports/controls/universal/SwitchDelegate.qml +++ b/src/imports/controls/universal/SwitchDelegate.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls.Universal.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.SwitchDelegate { id: control diff --git a/src/imports/controls/universal/TabBar.qml b/src/imports/controls/universal/TabBar.qml index c7d27cbd..9b98c10e 100644 --- a/src/imports/controls/universal/TabBar.qml +++ b/src/imports/controls/universal/TabBar.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.TabBar { id: control diff --git a/src/imports/controls/universal/TabButton.qml b/src/imports/controls/universal/TabButton.qml index 66e3d725..a68162c7 100644 --- a/src/imports/controls/universal/TabButton.qml +++ b/src/imports/controls/universal/TabButton.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.TabButton { id: control diff --git a/src/imports/controls/universal/TextArea.qml b/src/imports/controls/universal/TextArea.qml index 03ad4a89..5c4a5748 100644 --- a/src/imports/controls/universal/TextArea.qml +++ b/src/imports/controls/universal/TextArea.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.TextArea { id: control diff --git a/src/imports/controls/universal/TextField.qml b/src/imports/controls/universal/TextField.qml index ba5bf685..7f940983 100644 --- a/src/imports/controls/universal/TextField.qml +++ b/src/imports/controls/universal/TextField.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.TextField { id: control diff --git a/src/imports/controls/universal/ToolBar.qml b/src/imports/controls/universal/ToolBar.qml index 5a385e8e..0266056f 100644 --- a/src/imports/controls/universal/ToolBar.qml +++ b/src/imports/controls/universal/ToolBar.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ToolBar { id: control diff --git a/src/imports/controls/universal/ToolButton.qml b/src/imports/controls/universal/ToolButton.qml index f36dac22..adde3dd0 100644 --- a/src/imports/controls/universal/ToolButton.qml +++ b/src/imports/controls/universal/ToolButton.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal T.ToolButton { id: control diff --git a/src/imports/controls/universal/ToolSeparator.qml b/src/imports/controls/universal/ToolSeparator.qml index ee8e6e1c..cd9be32d 100644 --- a/src/imports/controls/universal/ToolSeparator.qml +++ b/src/imports/controls/universal/ToolSeparator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ToolSeparator { id: control diff --git a/src/imports/controls/universal/ToolTip.qml b/src/imports/controls/universal/ToolTip.qml index 431cdf7c..bf931a4c 100644 --- a/src/imports/controls/universal/ToolTip.qml +++ b/src/imports/controls/universal/ToolTip.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal T.ToolTip { id: control diff --git a/src/imports/controls/universal/Tumbler.qml b/src/imports/controls/universal/Tumbler.qml index ebbc746d..5dbe6d93 100644 --- a/src/imports/controls/universal/Tumbler.qml +++ b/src/imports/controls/universal/Tumbler.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls +import QtQuick.Controls.impl T.Tumbler { id: control diff --git a/src/imports/controls/universal/VerticalHeaderView.qml b/src/imports/controls/universal/VerticalHeaderView.qml index 04408d68..47eb8c95 100644 --- a/src/imports/controls/universal/VerticalHeaderView.qml +++ b/src/imports/controls/universal/VerticalHeaderView.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls.Universal 2.15 -import QtQuick.Controls.Universal.impl 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T +import QtQuick.Controls.Universal +import QtQuick.Controls.Universal.impl T.VerticalHeaderView { id: control diff --git a/src/imports/controls/universal/impl/CheckIndicator.qml b/src/imports/controls/universal/impl/CheckIndicator.qml index 7e8d9327..5e56ca88 100644 --- a/src/imports/controls/universal/impl/CheckIndicator.qml +++ b/src/imports/controls/universal/impl/CheckIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Controls.Universal Rectangle { id: indicator diff --git a/src/imports/controls/universal/impl/RadioIndicator.qml b/src/imports/controls/universal/impl/RadioIndicator.qml index 1a32decb..3cf1bf37 100644 --- a/src/imports/controls/universal/impl/RadioIndicator.qml +++ b/src/imports/controls/universal/impl/RadioIndicator.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Controls.Universal Rectangle { id: indicator diff --git a/src/imports/controls/universal/impl/SwitchIndicator.qml b/src/imports/controls/universal/impl/SwitchIndicator.qml index 10f39515..aa455419 100644 --- a/src/imports/controls/universal/impl/SwitchIndicator.qml +++ b/src/imports/controls/universal/impl/SwitchIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.Universal Item { id: indicator -- cgit v1.2.3 From 3c9e77d5639a938a68dc1cf5a7988c17442a669c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 14 Apr 2020 15:01:34 +0200 Subject: List publicly registered QML files in the qmldir for each style This is required in order to move away from imperative registration. Some styles do not have implementations for all types, in which case they fall back to the Default style. The list of those types are: AbstractButton 2.0 AbstractButton.qml Action 2.3 Action.qml ActionGroup 2.3 ActionGroup.qml ButtonGroup 2.0 ButtonGroup.qml Container 2.0 Container.qml Control 2.0 Control.qml ScrollView 2.2 ScrollView.qml (except Imagine) Task-number: QTBUG-82922 Change-Id: If51c8232d7a8b12f6d1f988cc7ce2d8edca1e467 Reviewed-by: Ulf Hermann --- src/imports/controls/default/qmldir | 69 +++++++++++++++++++++++++++++++++++ src/imports/controls/fusion/qmldir | 60 ++++++++++++++++++++++++++++++ src/imports/controls/imagine/qmldir | 58 +++++++++++++++++++++++++++++ src/imports/controls/material/qmldir | 62 +++++++++++++++++++++++++++++++ src/imports/controls/universal/qmldir | 61 +++++++++++++++++++++++++++++++ 5 files changed, 310 insertions(+) (limited to 'src') diff --git a/src/imports/controls/default/qmldir b/src/imports/controls/default/qmldir index 69b219aa..04510397 100644 --- a/src/imports/controls/default/qmldir +++ b/src/imports/controls/default/qmldir @@ -2,3 +2,72 @@ module QtQuick.Controls.Default plugin qtquickcontrols2defaultstyleplugin classname QtQuickControls2DefaultStylePlugin depends QtQuick.Controls 2.5 + +# QtQuick.Controls 2.0 (originally introduced in Qt 5.7) +AbstractButton 2.0 AbstractButton.qml +ApplicationWindow 2.0 ApplicationWindow.qml +BusyIndicator 2.0 BusyIndicator.qml +Button 2.0 Button.qml +ButtonGroup 2.0 ButtonGroup.qml +CheckBox 2.0 CheckBox.qml +CheckDelegate 2.0 CheckDelegate.qml +ComboBox 2.0 ComboBox.qml +Container 2.0 Container.qml +Control 2.0 Control.qml +Dial 2.0 Dial.qml +Drawer 2.0 Drawer.qml +Frame 2.0 Frame.qml +GroupBox 2.0 GroupBox.qml +ItemDelegate 2.0 ItemDelegate.qml +Label 2.0 Label.qml +Menu 2.0 Menu.qml +MenuItem 2.0 MenuItem.qml +Page 2.0 Page.qml +PageIndicator 2.0 PageIndicator.qml +Pane 2.0 Pane.qml +Popup 2.0 Popup.qml +ProgressBar 2.0 ProgressBar.qml +RadioButton 2.0 RadioButton.qml +RadioDelegate 2.0 RadioDelegate.qml +RangeSlider 2.0 RangeSlider.qml +ScrollBar 2.0 ScrollBar.qml +ScrollIndicator 2.0 ScrollIndicator.qml +Slider 2.0 Slider.qml +SpinBox 2.0 SpinBox.qml +StackView 2.0 StackView.qml +SwipeDelegate 2.0 SwipeDelegate.qml +SwipeView 2.0 SwipeView.qml +Switch 2.0 Switch.qml +SwitchDelegate 2.0 SwitchDelegate.qml +TabBar 2.0 TabBar.qml +TabButton 2.0 TabButton.qml +TextArea 2.0 TextArea.qml +TextField 2.0 TextField.qml +ToolBar 2.0 ToolBar.qml +ToolButton 2.0 ToolButton.qml +ToolTip 2.0 ToolTip.qml +Tumbler 2.0 Tumbler.qml + +# QtQuick.Controls 2.1 (new types in Qt 5.8) +Dialog 2.1 Dialog.qml +DialogButtonBox 2.1 DialogButtonBox.qml +MenuSeparator 2.1 MenuSeparator.qml +RoundButton 2.1 RoundButton.qml +ToolSeparator 2.1 ToolSeparator.qml + +# QtQuick.Controls 2.2 (new types in Qt 5.9) +DelayButton 2.2 DelayButton.qml +ScrollView 2.2 ScrollView.qml + +# QtQuick.Controls 2.3 (new types in Qt 5.10) +Action 2.3 Action.qml +ActionGroup 2.3 ActionGroup.qml +MenuBar 2.3 MenuBar.qml +MenuBarItem 2.3 MenuBarItem.qml + +# QtQuick.Controls 2.13 (new types in Qt 5.13) +SplitView 2.13 SplitView.qml + +# QtQuick.Controls 2.15 (new types in Qt 5.15) +HorizontalHeaderView 2.15 HorizontalHeaderView.qml +VerticalHeaderView 2.15 VerticalHeaderView.qml diff --git a/src/imports/controls/fusion/qmldir b/src/imports/controls/fusion/qmldir index b584adc8..572a6dd2 100644 --- a/src/imports/controls/fusion/qmldir +++ b/src/imports/controls/fusion/qmldir @@ -2,3 +2,63 @@ module QtQuick.Controls.Fusion plugin qtquickcontrols2fusionstyleplugin classname QtQuickControls2FusionStylePlugin depends QtQuick.Controls 2.5 + +# QtQuick.Controls 2.0 (originally introduced in Qt 5.7) +ApplicationWindow 2.0 ApplicationWindow.qml +BusyIndicator 2.0 BusyIndicator.qml +Button 2.0 Button.qml +CheckBox 2.0 CheckBox.qml +CheckDelegate 2.0 CheckDelegate.qml +ComboBox 2.0 ComboBox.qml +Dial 2.0 Dial.qml +Drawer 2.0 Drawer.qml +Frame 2.0 Frame.qml +GroupBox 2.0 GroupBox.qml +ItemDelegate 2.0 ItemDelegate.qml +Label 2.0 Label.qml +Menu 2.0 Menu.qml +MenuItem 2.0 MenuItem.qml +Page 2.0 Page.qml +PageIndicator 2.0 PageIndicator.qml +Pane 2.0 Pane.qml +Popup 2.0 Popup.qml +ProgressBar 2.0 ProgressBar.qml +RadioButton 2.0 RadioButton.qml +RadioDelegate 2.0 RadioDelegate.qml +RangeSlider 2.0 RangeSlider.qml +ScrollBar 2.0 ScrollBar.qml +ScrollIndicator 2.0 ScrollIndicator.qml +Slider 2.0 Slider.qml +SpinBox 2.0 SpinBox.qml +SwipeDelegate 2.0 SwipeDelegate.qml +Switch 2.0 Switch.qml +SwitchDelegate 2.0 SwitchDelegate.qml +TabBar 2.0 TabBar.qml +TabButton 2.0 TabButton.qml +TextArea 2.0 TextArea.qml +TextField 2.0 TextField.qml +ToolBar 2.0 ToolBar.qml +ToolButton 2.0 ToolButton.qml +ToolTip 2.0 ToolTip.qml +Tumbler 2.0 Tumbler.qml + +# QtQuick.Controls 2.1 (new types in Qt 5.8) +Dialog 2.1 Dialog.qml +DialogButtonBox 2.1 DialogButtonBox.qml +MenuSeparator 2.1 MenuSeparator.qml +RoundButton 2.1 RoundButton.qml +ToolSeparator 2.1 ToolSeparator.qml + +# QtQuick.Controls 2.2 (new types in Qt 5.9) +DelayButton 2.2 DelayButton.qml + +# QtQuick.Controls 2.3 (new types in Qt 5.10) +MenuBar 2.3 MenuBar.qml +MenuBarItem 2.3 MenuBarItem.qml + +# QtQuick.Controls 2.13 (new types in Qt 5.13) +SplitView 2.13 SplitView.qml + +# QtQuick.Controls 2.15 (new types in Qt 5.15) +HorizontalHeaderView 2.15 HorizontalHeaderView.qml +VerticalHeaderView 2.15 VerticalHeaderView.qml diff --git a/src/imports/controls/imagine/qmldir b/src/imports/controls/imagine/qmldir index 4319a82c..380a0dc3 100644 --- a/src/imports/controls/imagine/qmldir +++ b/src/imports/controls/imagine/qmldir @@ -2,3 +2,61 @@ module QtQuick.Controls.Imagine plugin qtquickcontrols2imaginestyleplugin classname QtQuickControls2ImagineStylePlugin depends QtQuick.Controls 2.5 + +# QtQuick.Controls 2.0 (originally introduced in Qt 5.7) +ApplicationWindow 2.0 ApplicationWindow.qml +BusyIndicator 2.0 BusyIndicator.qml +Button 2.0 Button.qml +CheckBox 2.0 CheckBox.qml +CheckDelegate 2.0 CheckDelegate.qml +ComboBox 2.0 ComboBox.qml +Dial 2.0 Dial.qml +Drawer 2.0 Drawer.qml +Frame 2.0 Frame.qml +GroupBox 2.0 GroupBox.qml +ItemDelegate 2.0 ItemDelegate.qml +Label 2.0 Label.qml +Menu 2.0 Menu.qml +MenuItem 2.0 MenuItem.qml +Page 2.0 Page.qml +PageIndicator 2.0 PageIndicator.qml +Pane 2.0 Pane.qml +Popup 2.0 Popup.qml +ProgressBar 2.0 ProgressBar.qml +RadioButton 2.0 RadioButton.qml +RadioDelegate 2.0 RadioDelegate.qml +RangeSlider 2.0 RangeSlider.qml +ScrollBar 2.0 ScrollBar.qml +ScrollIndicator 2.0 ScrollIndicator.qml +Slider 2.0 Slider.qml +SpinBox 2.0 SpinBox.qml +StackView 2.0 StackView.qml +SwipeDelegate 2.0 SwipeDelegate.qml +SwipeView 2.0 SwipeView.qml +Switch 2.0 Switch.qml +SwitchDelegate 2.0 SwitchDelegate.qml +TabBar 2.0 TabBar.qml +TabButton 2.0 TabButton.qml +TextArea 2.0 TextArea.qml +TextField 2.0 TextField.qml +ToolBar 2.0 ToolBar.qml +ToolButton 2.0 ToolButton.qml +ToolTip 2.0 ToolTip.qml +Tumbler 2.0 Tumbler.qml + +# QtQuick.Controls 2.1 (new types in Qt 5.8) +Dialog 2.1 Dialog.qml +DialogButtonBox 2.1 DialogButtonBox.qml +MenuSeparator 2.1 MenuSeparator.qml +RoundButton 2.1 RoundButton.qml +ToolSeparator 2.1 ToolSeparator.qml + +# QtQuick.Controls 2.2 (new types in Qt 5.9) +DelayButton 2.2 DelayButton.qml + +# QtQuick.Controls 2.13 (new types in Qt 5.13) +SplitView 2.13 SplitView.qml + +# QtQuick.Controls 2.15 (new types in Qt 5.15) +HorizontalHeaderView 2.15 HorizontalHeaderView.qml +VerticalHeaderView 2.15 VerticalHeaderView.qml diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir index 870a0382..a1064229 100644 --- a/src/imports/controls/material/qmldir +++ b/src/imports/controls/material/qmldir @@ -2,3 +2,65 @@ module QtQuick.Controls.Material plugin qtquickcontrols2materialstyleplugin classname QtQuickControls2MaterialStylePlugin depends QtQuick.Controls 2.5 + +# QtQuick.Controls 2.0 (originally introduced in Qt 5.7) +ApplicationWindow 2.0 ApplicationWindow.qml +BusyIndicator 2.0 BusyIndicator.qml +Button 2.0 Button.qml +CheckBox 2.0 CheckBox.qml +CheckDelegate 2.0 CheckDelegate.qml +ComboBox 2.0 ComboBox.qml +Dial 2.0 Dial.qml +Drawer 2.0 Drawer.qml +Frame 2.0 Frame.qml +GroupBox 2.0 GroupBox.qml +ItemDelegate 2.0 ItemDelegate.qml +Label 2.0 Label.qml +Menu 2.0 Menu.qml +MenuItem 2.0 MenuItem.qml +Page 2.0 Page.qml +PageIndicator 2.0 PageIndicator.qml +Pane 2.0 Pane.qml +Popup 2.0 Popup.qml +ProgressBar 2.0 ProgressBar.qml +RadioButton 2.0 RadioButton.qml +RadioDelegate 2.0 RadioDelegate.qml +RangeSlider 2.0 RangeSlider.qml +ScrollBar 2.0 ScrollBar.qml +ScrollIndicator 2.0 ScrollIndicator.qml +Slider 2.0 Slider.qml +SpinBox 2.0 SpinBox.qml +StackView 2.0 StackView.qml +SwipeDelegate 2.0 SwipeDelegate.qml +SwipeView 2.0 SwipeView.qml +Switch 2.0 Switch.qml +SwitchDelegate 2.0 SwitchDelegate.qml +TabBar 2.0 TabBar.qml +TabButton 2.0 TabButton.qml +TextArea 2.0 TextArea.qml +TextField 2.0 TextField.qml +ToolBar 2.0 ToolBar.qml +ToolButton 2.0 ToolButton.qml +ToolTip 2.0 ToolTip.qml +Tumbler 2.0 Tumbler.qml + +# QtQuick.Controls 2.1 (new types in Qt 5.8) +Dialog 2.1 Dialog.qml +DialogButtonBox 2.1 DialogButtonBox.qml +MenuSeparator 2.1 MenuSeparator.qml +RoundButton 2.1 RoundButton.qml +ToolSeparator 2.1 ToolSeparator.qml + +# QtQuick.Controls 2.2 (new types in Qt 5.9) +DelayButton 2.2 DelayButton.qml + +# QtQuick.Controls 2.3 (new types in Qt 5.10) +MenuBar 2.3 MenuBar.qml +MenuBarItem 2.3 MenuBarItem.qml + +# QtQuick.Controls 2.13 (new types in Qt 5.13) +SplitView 2.13 SplitView.qml + +# QtQuick.Controls 2.15 (new types in Qt 5.15) +HorizontalHeaderView 2.15 HorizontalHeaderView.qml +VerticalHeaderView 2.15 VerticalHeaderView.qml diff --git a/src/imports/controls/universal/qmldir b/src/imports/controls/universal/qmldir index 6870a4e1..28bd5706 100644 --- a/src/imports/controls/universal/qmldir +++ b/src/imports/controls/universal/qmldir @@ -2,3 +2,64 @@ module QtQuick.Controls.Universal plugin qtquickcontrols2universalstyleplugin classname QtQuickControls2UniversalStylePlugin depends QtQuick.Controls 2.5 + +# QtQuick.Controls 2.0 (originally introduced in Qt 5.7) +ApplicationWindow 2.0 ApplicationWindow.qml +BusyIndicator 2.0 BusyIndicator.qml +Button 2.0 Button.qml +CheckBox 2.0 CheckBox.qml +CheckDelegate 2.0 CheckDelegate.qml +ComboBox 2.0 ComboBox.qml +Dial 2.0 Dial.qml +Drawer 2.0 Drawer.qml +Frame 2.0 Frame.qml +GroupBox 2.0 GroupBox.qml +ItemDelegate 2.0 ItemDelegate.qml +Label 2.0 Label.qml +Menu 2.0 Menu.qml +MenuItem 2.0 MenuItem.qml +Page 2.0 Page.qml +PageIndicator 2.0 PageIndicator.qml +Pane 2.0 Pane.qml +Popup 2.0 Popup.qml +ProgressBar 2.0 ProgressBar.qml +RadioButton 2.0 RadioButton.qml +RadioDelegate 2.0 RadioDelegate.qml +RangeSlider 2.0 RangeSlider.qml +ScrollBar 2.0 ScrollBar.qml +ScrollIndicator 2.0 ScrollIndicator.qml +Slider 2.0 Slider.qml +SpinBox 2.0 SpinBox.qml +StackView 2.0 StackView.qml +SwipeDelegate 2.0 SwipeDelegate.qml +Switch 2.0 Switch.qml +SwitchDelegate 2.0 SwitchDelegate.qml +TabBar 2.0 TabBar.qml +TabButton 2.0 TabButton.qml +TextArea 2.0 TextArea.qml +TextField 2.0 TextField.qml +ToolBar 2.0 ToolBar.qml +ToolButton 2.0 ToolButton.qml +ToolTip 2.0 ToolTip.qml +Tumbler 2.0 Tumbler.qml + +# QtQuick.Controls 2.1 (new types in Qt 5.8) +Dialog 2.1 Dialog.qml +DialogButtonBox 2.1 DialogButtonBox.qml +MenuSeparator 2.1 MenuSeparator.qml +RoundButton 2.1 RoundButton.qml +ToolSeparator 2.1 ToolSeparator.qml + +# QtQuick.Controls 2.2 (new types in Qt 5.9) +DelayButton 2.2 DelayButton.qml + +# QtQuick.Controls 2.3 (new types in Qt 5.10) +MenuBar 2.3 MenuBar.qml +MenuBarItem 2.3 MenuBarItem.qml + +# QtQuick.Controls 2.13 (new types in Qt 5.13) +SplitView 2.13 SplitView.qml + +# QtQuick.Controls 2.15 (new types in Qt 5.15) +HorizontalHeaderView 2.15 HorizontalHeaderView.qml +VerticalHeaderView 2.15 VerticalHeaderView.qml -- cgit v1.2.3 From 27e2003f7bc6808e872ad22d5502233e7983ef1e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 14 Apr 2020 15:12:00 +0200 Subject: List "privately" registered QML files in the qmldir for each style This is required in order to move away from imperative registration. Task-number: QTBUG-82922 Change-Id: I4b2a727d69e66c29629920a3711548e02f72ce49 Reviewed-by: Ulf Hermann --- src/imports/controls/fusion/impl/qmldir | 7 +++++++ src/imports/controls/material/impl/qmldir | 9 +++++++++ src/imports/controls/universal/impl/qmldir | 4 ++++ 3 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/imports/controls/fusion/impl/qmldir b/src/imports/controls/fusion/impl/qmldir index 16ed7fd8..172f7ae5 100644 --- a/src/imports/controls/fusion/impl/qmldir +++ b/src/imports/controls/fusion/impl/qmldir @@ -1,3 +1,10 @@ module QtQuick.Controls.Fusion.impl plugin qtquickcontrols2fusionstyleimplplugin classname QtQuickControls2FusionStyleImpPlugin + +ButtonPanel 2.3 ButtonPanel.qml +CheckIndicator 2.3 CheckIndicator.qml +RadioIndicator 2.3 RadioIndicator.qml +SliderGroove 2.3 SliderGroove.qml +SliderHandle 2.3 SliderHandle.qml +SwitchIndicator 2.3 SwitchIndicator.qml diff --git a/src/imports/controls/material/impl/qmldir b/src/imports/controls/material/impl/qmldir index 4c863d9d..09c6f01a 100644 --- a/src/imports/controls/material/impl/qmldir +++ b/src/imports/controls/material/impl/qmldir @@ -1,3 +1,12 @@ module QtQuick.Controls.Material.impl plugin qtquickcontrols2materialstyleimplplugin classname QtQuickControls2MaterialStyleImplPlugin + +BoxShadow 2.0 BoxShadow.qml +CheckIndicator 2.0 CheckIndicator.qml +CursorDelegate 2.0 CursorDelegate.qml +ElevationEffect 2.0 ElevationEffect.qml +RadioIndicator 2.0 RadioIndicator.qml +RectangularGlow 2.0 RectangularGlow.qml +SliderHandle 2.0 SliderHandle.qml +SwitchIndicator 2.0 SwitchIndicator.qml diff --git a/src/imports/controls/universal/impl/qmldir b/src/imports/controls/universal/impl/qmldir index 26bbd8bf..5c39a4bb 100644 --- a/src/imports/controls/universal/impl/qmldir +++ b/src/imports/controls/universal/impl/qmldir @@ -1,3 +1,7 @@ module QtQuick.Controls.Universal.impl plugin qtquickcontrols2universalstyleimplplugin classname QtQuickControls2UniversalStyleImplPlugin + +CheckIndicator 2.0 CheckIndicator.qml +RadioIndicator 2.0 RadioIndicator.qml +SwitchIndicator 2.0 SwitchIndicator.qml -- cgit v1.2.3 From 92879d8f6b8b840328813f29f758865a412af270 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 14 Apr 2020 15:31:22 +0200 Subject: Convert remaining imperative type registration to declarative Task-number: QTBUG-82922 Change-Id: I34e9f32d5f695aaac7acf6b4aac30e8a2311e0cf Reviewed-by: Ulf Hermann --- src/imports/controls/default/default.pro | 6 +-- src/imports/controls/fusion/fusion.pro | 6 +-- .../fusion/qtquickcontrols2fusionstyleplugin.cpp | 15 ------ src/imports/controls/imagine/imagine.pro | 6 +-- src/imports/controls/material/material.pro | 6 +-- .../qtquickcontrols2materialstyleplugin.cpp | 17 ------- src/imports/controls/qtquickcontrols2plugin.cpp | 53 +--------------------- .../qtquickcontrols2universalstyleplugin.cpp | 12 ----- src/imports/controls/universal/universal.pro | 6 +-- 9 files changed, 16 insertions(+), 111 deletions(-) (limited to 'src') diff --git a/src/imports/controls/default/default.pro b/src/imports/controls/default/default.pro index ae6761a5..037cf2f7 100644 --- a/src/imports/controls/default/default.pro +++ b/src/imports/controls/default/default.pro @@ -1,8 +1,8 @@ TARGET = qtquickcontrols2defaultstyleplugin TARGETPATH = QtQuick/Controls/Default -IMPORT_NAME = QtQuick.Controls.Default -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_NAME = QtQuick.Controls.Default +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -21,7 +21,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2defaultstyleplugin.qrc -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-default)) diff --git a/src/imports/controls/fusion/fusion.pro b/src/imports/controls/fusion/fusion.pro index 49585212..bb27b3f1 100644 --- a/src/imports/controls/fusion/fusion.pro +++ b/src/imports/controls/fusion/fusion.pro @@ -1,8 +1,8 @@ TARGET = qtquickcontrols2fusionstyleplugin TARGETPATH = QtQuick/Controls/Fusion -IMPORT_NAME = QtQuick.Controls.Fusion -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_NAME = QtQuick.Controls.Fusion +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -21,7 +21,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2fusionstyle.qrc -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-fusion)) diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp index 1f9b4a1b..b9df2e7d 100644 --- a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp +++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp @@ -50,8 +50,6 @@ class QtQuickControls2FusionStylePlugin : public QQuickStylePlugin public: QtQuickControls2FusionStylePlugin(QObject *parent = nullptr); - void registerTypes(const char *uri) override; - QString name() const override; void initializeTheme(QQuickTheme *theme) override; }; @@ -60,19 +58,6 @@ QtQuickControls2FusionStylePlugin::QtQuickControls2FusionStylePlugin(QObject *pa { } -void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri) -{ - QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - - qmlRegisterType(resolvedUrl(QStringLiteral("ButtonPanel.qml")), import, 2, 3, "ButtonPanel"); - qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 3, "CheckIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 3, "RadioIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("SliderGroove.qml")), import, 2, 3, "SliderGroove"); - qmlRegisterType(resolvedUrl(QStringLiteral("SliderHandle.qml")), import, 2, 3, "SliderHandle"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 3, "SwitchIndicator"); -} - QString QtQuickControls2FusionStylePlugin::name() const { return QStringLiteral("Fusion"); diff --git a/src/imports/controls/imagine/imagine.pro b/src/imports/controls/imagine/imagine.pro index 9bb6afd4..4dcd080c 100644 --- a/src/imports/controls/imagine/imagine.pro +++ b/src/imports/controls/imagine/imagine.pro @@ -1,8 +1,8 @@ TARGET = qtquickcontrols2imaginestyleplugin TARGETPATH = QtQuick/Controls/Imagine -IMPORT_NAME = QtQuick.Controls.Imagine -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_NAME = QtQuick.Controls.Imagine +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private @@ -24,7 +24,7 @@ qtquickcontrols2imaginestyle.files += \ $$files($$PWD/images/*.webp) RESOURCES += qtquickcontrols2imaginestyle -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-imagine)) diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index ce96924e..7ff3ea07 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -1,8 +1,8 @@ TARGET = qtquickcontrols2materialstyleplugin TARGETPATH = QtQuick/Controls/Material -IMPORT_NAME = QtQuick.Controls.Material -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_NAME = QtQuick.Controls.Material +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private @@ -21,7 +21,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2materialstyleplugin.qrc -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-material)) diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index c0dc5721..dc6873bb 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -51,8 +51,6 @@ class QtQuickControls2MaterialStylePlugin : public QQuickStylePlugin public: QtQuickControls2MaterialStylePlugin(QObject *parent = nullptr); - void registerTypes(const char *uri) override; - QString name() const override; void initializeTheme(QQuickTheme *theme) override; }; @@ -62,21 +60,6 @@ QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject QQuickMaterialStyle::initGlobals(); } -void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) -{ - QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - - qmlRegisterType(resolvedUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow"); - qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("CursorDelegate.qml")), import, 2, 0, "CursorDelegate"); - qmlRegisterType(resolvedUrl(QStringLiteral("ElevationEffect.qml")), import, 2, 0, "ElevationEffect"); - qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("RectangularGlow.qml")), import, 2, 0, "RectangularGlow"); - qmlRegisterType(resolvedUrl(QStringLiteral("SliderHandle.qml")), import, 2, 0, "SliderHandle"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); -} - QString QtQuickControls2MaterialStylePlugin::name() const { return QStringLiteral("Material"); diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 483e6d0c..17eb2be9 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -46,20 +46,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) -#include -#endif -#include -#include -#include #include QT_BEGIN_NAMESPACE @@ -100,50 +86,13 @@ void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char */* init(); } -void QtQuickControls2Plugin::registerTypes(const char *uri) +void QtQuickControls2Plugin::registerTypes(const char */*uri*/) { QQuickStylePrivate::init(baseUrl()); const QString style = QQuickStyle::name(); if (!style.isEmpty()) QFileSelectorPrivate::addStatics(QStringList() << style.toLower()); - - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 2, 15); - - qmlRegisterTypesAndRevisions(uri, 2); - - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - const QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); - - // QtQuick.Controls.impl 2.0 (Qt 5.7) - qmlRegisterType(import, 2, 0, "PaddedRectangle"); - - // QtQuick.Controls.impl 2.1 (Qt 5.8) -#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(import, 2, 1, "TumblerView"); -#endif - - // QtQuick.Controls.impl 2.2 (Qt 5.9) - qmlRegisterType(import, 2, 2, "ClippedText"); - qmlRegisterType(import, 2, 2, "ItemGroup"); - qmlRegisterType(import, 2, 2, "PlaceholderText"); - - // QtQuick.Controls.impl 2.3 (Qt 5.10) - qmlRegisterType(import, 2, 3, "ColorImage"); - qmlRegisterType(import, 2, 3, "IconImage"); - qmlRegisterSingletonType(import, 2, 3, "Color", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - return new QQuickColor; - }); - qmlRegisterType(import, 2, 3, "IconLabel"); - qmlRegisterType(import, 2, 3, "CheckLabel"); - qmlRegisterType(import, 2, 3, "MnemonicLabel"); - qmlRegisterRevision(import, 2, 3); } void QtQuickControls2Plugin::unregisterTypes() diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index bc0e6bb8..ac154911 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -49,8 +49,6 @@ class QtQuickControls2UniversalStylePlugin : public QQuickStylePlugin public: QtQuickControls2UniversalStylePlugin(QObject *parent = nullptr); - void registerTypes(const char *uri) override; - QString name() const override; void initializeTheme(QQuickTheme *theme) override; }; @@ -60,16 +58,6 @@ QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObje QQuickUniversalStyle::initGlobals(); } -void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri) -{ - QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterModule(import, 2, 15); // Qt 5.12->2.12, 5.13->2.13... - - qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); - qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); -} - QString QtQuickControls2UniversalStylePlugin::name() const { return QStringLiteral("Universal"); diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index 33dd8f14..f41e37b7 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -1,8 +1,8 @@ TARGET = qtquickcontrols2universalstyleplugin TARGETPATH = QtQuick/Controls/Universal -IMPORT_NAME = QtQuick.Controls.Universal -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_NAME = QtQuick.Controls.Universal +QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private @@ -21,7 +21,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2universalstyleplugin.qrc -CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler +CONFIG += qmltypes no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-universal)) -- cgit v1.2.3 From 501bc44bb006ee8021cbaaa7a696e7c9263395d3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 17 Apr 2020 14:32:55 +0200 Subject: Use qmlRegisterModuleImport() to register styles This patch completes the cumulative work done in previous patches. - Uses qmlRegisterModuleImport() to register styles. This has some added requirements: - Each style must now be a QML module -- that is, it must have a qmldir file. - As a result of the above, the module must be available within the QML import path in order to be found. - The various forms of accepted style names have been reduced down to one ("Material", "MyStyle", etc). See below for an explanation of why. - The following API in QQuickStyle is removed: addStylePath(), availableStyles(), path(), stylePathList(). These no longer make sense now that we reuse the existing QML import system. - Adds the tst_qquickstyleselector auto test back as "styleimports". qmlRegisterModuleImport() vs resolvedUrl() Previously we would use QQuickStyleSelector to select individual QML files based on which style was set. We'd do this once when QtQuick.Controls was first imported. With Qt 6, and the requirement that each style be a proper QML module, qmlRegisterModuleImport() was introduced. This allows us to "link" one import with another. For an example of what this looks like in practice, suppose the style was set to "MyStyle", and the fallback to "Material". The "QtQuick.Controls" import will be linked to "MyStyle", "MyStyle" to "QtQuick.Controls.Material", and as a final fallback (for controls like Action which only the Default style implements), "QtQuick.Controls.Material" to "QtQuick.Controls.Default". This is the same behavior as in Qt 5 (see qquickstyleselector.cpp): // 1) requested style (e.g. "MyStyle", included in d->selectors) // 2) fallback style (e.g. "Material", included in d->selectors) // 3) default style (empty selector, not in d->selectors) This is a necessary step to enable compilation of QML to C++. Reducing the set of accepted style names The problem In QtQuickControls2Plugin() we need to call QQuickStylePrivate::init(baseUrl()) in order to detect if the style is a custom style in QQuickStyleSpec::resolve() (by checking if the style path starts with the base URL). In Qt 5, init() is called in QtQuickControls2Plugin::registerTypes(), but in Qt 6 that's too late, because we need to call qmlRegisterModuleImport() in the constructor. qmlRegisterModuleImport() itself requires the style to have already been set in order to create the correct import URI ("QtQuick.Controls.X" for built-in styles, "MyCustomStyle" for custom styles). The solution By reducing the valid forms for style names down to one: ./myapp -style MyStyle we solve the problem of needing baseUrl() to determine if the style is a custom style or not, but needing to call it too early (since we now call qmlRegisterModuleImport() in QtQuickControls2Plugin(), which itself requires the style to have already been set). baseUrl() can't have been set before the constructor is finished. All of the various forms for _setting_ a style are still valid; environment variables, qtquickcontrols2.conf, etc. [ChangeLog][Important Behavior Changes] Custom styles must now have a qmldir that lists the files that the style implements. For example, for a style that only implements Button: --- module MyStyle Button 1.0 Button.qml --- In addition, there is now only one valid, case-sensitive form for style names: "Material", "MyStyle", etc. These changes are done to help enable the compilation of QML code to C++, as well as improve tooling capabilities. [ChangeLog][Important Behavior Changes] The following API was removed: - QQuickStyle::addStylePath() - QQuickStyle::availableStyles() - QQuickStyle::path() - QQuickStyle::stylePathList() - QT_QUICK_CONTROLS_STYLE_PATH This API is no longer necessary and/or able to be provided now that styles are treated as regular QML modules. Task-number: QTBUG-82922 Change-Id: I3b281131903c7c3c1cf0616eb7486a872dccd730 Reviewed-by: Fabian Kosmale --- .../default/qtquickcontrols2defaultstyleplugin.cpp | 12 +- .../doc/src/qtquickcontrols2-customize.qdoc | 44 ++- .../doc/src/qtquickcontrols2-environment.qdoc | 8 +- src/imports/controls/fusion/qmldir | 2 +- .../fusion/qtquickcontrols2fusionstyleplugin.cpp | 18 +- src/imports/controls/imagine/qmldir | 2 +- .../imagine/qtquickcontrols2imaginestyleplugin.cpp | 20 +- src/imports/controls/material/qmldir | 2 +- .../qtquickcontrols2materialstyleplugin.cpp | 17 +- src/imports/controls/qtquickcontrols2plugin.cpp | 160 ++++++---- src/imports/controls/universal/qmldir | 2 +- .../qtquickcontrols2universalstyleplugin.cpp | 18 +- src/quickcontrols2/qquickstyle.cpp | 350 +++------------------ src/quickcontrols2/qquickstyle.h | 4 - src/quickcontrols2/qquickstyle_p.h | 8 +- src/quickcontrols2/qquickstyleplugin.cpp | 16 + src/quickcontrols2/qquickstyleplugin_p.h | 2 +- 17 files changed, 254 insertions(+), 431 deletions(-) (limited to 'src') diff --git a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp index 0ed33d12..a486658e 100644 --- a/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp +++ b/src/imports/controls/default/qtquickcontrols2defaultstyleplugin.cpp @@ -38,6 +38,7 @@ #include "qquickdefaulttheme_p.h" #include +#include QT_BEGIN_NAMESPACE @@ -50,7 +51,10 @@ public: QtQuickControls2DefaultStylePlugin(QObject *parent = nullptr); QString name() const override; - void initializeTheme(QQuickTheme *theme) override; + + void registerTypes(const char *uri) override; + + QQuickDefaultTheme theme; }; QtQuickControls2DefaultStylePlugin::QtQuickControls2DefaultStylePlugin(QObject *parent) : QQuickStylePlugin(parent) @@ -62,9 +66,11 @@ QString QtQuickControls2DefaultStylePlugin::name() const return QStringLiteral("Default"); } -void QtQuickControls2DefaultStylePlugin::initializeTheme(QQuickTheme *theme) +void QtQuickControls2DefaultStylePlugin::registerTypes(const char *uri) { - QQuickDefaultTheme::initialize(theme); + QQuickStylePlugin::registerTypes(uri); + + theme.initialize(QQuickTheme::instance()); } QT_END_NAMESPACE diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc index 6ab649d0..58138a07 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc @@ -112,7 +112,7 @@ \section2 Definition of a Style In Qt Quick Controls, a style is essentially an interchangeable set of - QML files within a single directory. There are three requirements for a style + QML files within a single directory. There are four requirements for a style to be \l {Using Styles in Qt Quick Controls}{usable}: \list @@ -125,21 +125,37 @@ If we instead used the corresponding type from the \l {Qt Quick Controls} {QtQuick.Controls} import as we did in the previous section, it would not work: the control we were defining would try to derive from itself. - \li The files must be in a directory in the filesystem or in the - \l {The Qt Resource System}{resource system}. + \li A \l {Module Definition qmldir Files}{qmldir} file must exist alongside + the QML file(s). Below is an example of a simple \c qmldir file for a style that + provides a button: - For example, these are all valid paths to a style: + \badcode + module MyStyle + Button 2.15 Button.qml + \endcode + + The directory structure for such a style looks like this: + + \badcode + MyStyle + ā”œā”€ā”€ā”€ Button.qml + ā””ā”€ā”€ā”€ qmldir + \endcode + \li The files must be in a directory that is findable via the \l {QML Import Path}. + + For example, if the path to \e MyStyle directory mentioned above was + \c /home/user/MyApp/MyStyle, then \c /home/user/MyApp must be added to + the QML import path. + + To \l {Using Styles in Qt Quick Controls}{use} \e MyStyle in \e MyApp, + refer to it by name: \list - \li \c {./myapp -style /home/absolute/path/to/my/style} - \li \c {./myapp -style :/mystyle} - \li \c {./myapp -style relative/path/to/my/style} - \li \c {./myapp -style MyStyle} + \li \c {./MyApp -style MyStyle} \endlist - The third and fourth paths will be looked up within the QML engine's import path - list. This is the same as what happens when you pass \c Material as the style, - for example. + The style name must match the casing of the style directory; passing + \e mystyle or \e MYSTYLE is not supported. \endlist By default, the styling system uses the Default style as a fallback for @@ -302,7 +318,7 @@ style will illustrate the elevation with a drop shadow; the higher the elevation, the larger the shadow. - The first step is to \l {Qt Creator: Creating Qt Quick Projects}{create a new Qt Quick + The first step is to \l {Creating Qt Quick Projects}{create a new Qt Quick Controls 2 application} in Qt Creator. After that, we \l {Qt Creator: Creating C++ Classes}{add a C++ type} that stores the elevation. Since the type will be used for every control supported by our style, and because @@ -390,6 +406,8 @@ qmlRegisterUncreatableType("MyStyle", 1, 0, "MyStyle", "MyStyle is an attached property"); QQmlApplicationEngine engine; + // Make the directory containing our style known to the QML engine. + engine.addImportPath(":/"); engine.load(QUrl(QLatin1String("qrc:/main.qml"))); return app.exec(); @@ -465,7 +483,7 @@ One button has no elevation, and the other has an elevation of \c 10. With that in place, we can run our example. To tell the application to - use our new style, we pass \c {-style :/mystyle} as an application + use our new style, we pass \c {-style MyStyle} as an application argument, but there are \l {Using Styles in Qt Quick Controls}{many ways} to specify the style to use. diff --git a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc index e1461ee4..4484acf3 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc @@ -41,17 +41,11 @@ \li \c QT_QUICK_CONTROLS_STYLE \li Specifies the default \l {Styling Qt Quick Controls}{Qt Quick Controls style}. The value can be either one of the built-in styles, for example \c "Material", - or the path to a custom style such as \c ":/mystyle". + or a custom style such as \c "MyStyle". \row \li \c QT_QUICK_CONTROLS_FALLBACK_STYLE \li Specifies a fallback style for \l {Creating a Custom Style}{custom styles}. The value can be one of the built-in styles, for example \c "Material", - \row - \li \c QT_QUICK_CONTROLS_STYLE_PATH - \li Specifies a list of additional paths that are used to lookup \l {Styling Qt Quick Controls} - {Qt Quick Controls styles}. Multiple path entries must be \l {QDir::listSeparator}{separated} - by \c ':' under Unix and \c ';' under Windows. By default, styles are looked up from - \c $QML2_IMPORT_PATH/QtQuick/Controls. \row \li \c QT_QUICK_CONTROLS_CONF \li Specifies the location of the \l {Qt Quick Controls configuration file}. diff --git a/src/imports/controls/fusion/qmldir b/src/imports/controls/fusion/qmldir index 572a6dd2..84c0b211 100644 --- a/src/imports/controls/fusion/qmldir +++ b/src/imports/controls/fusion/qmldir @@ -1,7 +1,7 @@ module QtQuick.Controls.Fusion plugin qtquickcontrols2fusionstyleplugin classname QtQuickControls2FusionStylePlugin -depends QtQuick.Controls 2.5 +import QtQuick.Controls.Default auto # QtQuick.Controls 2.0 (originally introduced in Qt 5.7) ApplicationWindow 2.0 ApplicationWindow.qml diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp index b9df2e7d..c70c9602 100644 --- a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp +++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp @@ -34,12 +34,13 @@ ** ****************************************************************************/ -#include -#include - #include "qquickfusionstyle_p.h" #include "qquickfusiontheme_p.h" +#include +#include +#include + QT_BEGIN_NAMESPACE class QtQuickControls2FusionStylePlugin : public QQuickStylePlugin @@ -51,7 +52,10 @@ public: QtQuickControls2FusionStylePlugin(QObject *parent = nullptr); QString name() const override; - void initializeTheme(QQuickTheme *theme) override; + + void registerTypes(const char *uri) override; + + QQuickFusionTheme theme; }; QtQuickControls2FusionStylePlugin::QtQuickControls2FusionStylePlugin(QObject *parent) : QQuickStylePlugin(parent) @@ -63,9 +67,11 @@ QString QtQuickControls2FusionStylePlugin::name() const return QStringLiteral("Fusion"); } -void QtQuickControls2FusionStylePlugin::initializeTheme(QQuickTheme *theme) +void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri) { - QQuickFusionTheme::initialize(theme); + QQuickStylePlugin::registerTypes(uri); + + theme.initialize(QQuickTheme::instance()); } QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/qmldir b/src/imports/controls/imagine/qmldir index 380a0dc3..e3d7d8d5 100644 --- a/src/imports/controls/imagine/qmldir +++ b/src/imports/controls/imagine/qmldir @@ -1,7 +1,7 @@ module QtQuick.Controls.Imagine plugin qtquickcontrols2imaginestyleplugin classname QtQuickControls2ImagineStylePlugin -depends QtQuick.Controls 2.5 +import QtQuick.Controls.Default auto # QtQuick.Controls 2.0 (originally introduced in Qt 5.7) ApplicationWindow 2.0 ApplicationWindow.qml diff --git a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp index d59cf555..0c864254 100644 --- a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp +++ b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp @@ -34,13 +34,14 @@ ** ****************************************************************************/ -#include -#include -#include - #include "qquickimaginestyle_p.h" #include "qquickimaginetheme_p.h" +#include +#include +#include +#include + QT_BEGIN_NAMESPACE class QtQuickControls2ImagineStylePlugin : public QQuickStylePlugin @@ -52,7 +53,10 @@ public: QtQuickControls2ImagineStylePlugin(QObject *parent = nullptr); QString name() const override; - void initializeTheme(QQuickTheme *theme) override; + + void registerTypes(const char *uri) override; + + QQuickImagineTheme theme; }; QtQuickControls2ImagineStylePlugin::QtQuickControls2ImagineStylePlugin(QObject *parent) : QQuickStylePlugin(parent) @@ -64,9 +68,11 @@ QString QtQuickControls2ImagineStylePlugin::name() const return QStringLiteral("Imagine"); } -void QtQuickControls2ImagineStylePlugin::initializeTheme(QQuickTheme *theme) +void QtQuickControls2ImagineStylePlugin::registerTypes(const char *uri) { - QQuickImagineTheme::initialize(theme); + QQuickStylePlugin::registerTypes(uri); + + theme.initialize(QQuickTheme::instance()); } QT_END_NAMESPACE diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir index a1064229..39dae48a 100644 --- a/src/imports/controls/material/qmldir +++ b/src/imports/controls/material/qmldir @@ -1,7 +1,7 @@ module QtQuick.Controls.Material plugin qtquickcontrols2materialstyleplugin classname QtQuickControls2MaterialStylePlugin -depends QtQuick.Controls 2.5 +import QtQuick.Controls.Default auto # QtQuick.Controls 2.0 (originally introduced in Qt 5.7) ApplicationWindow 2.0 ApplicationWindow.qml diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index dc6873bb..6066d3f5 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -34,12 +34,12 @@ ** ****************************************************************************/ -#include - #include "qquickmaterialstyle_p.h" #include "qquickmaterialtheme_p.h" +#include #include +#include QT_BEGIN_NAMESPACE @@ -52,12 +52,14 @@ public: QtQuickControls2MaterialStylePlugin(QObject *parent = nullptr); QString name() const override; - void initializeTheme(QQuickTheme *theme) override; + + void registerTypes(const char *uri) override; + + QQuickMaterialTheme theme; }; QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - QQuickMaterialStyle::initGlobals(); } QString QtQuickControls2MaterialStylePlugin::name() const @@ -65,9 +67,12 @@ QString QtQuickControls2MaterialStylePlugin::name() const return QStringLiteral("Material"); } -void QtQuickControls2MaterialStylePlugin::initializeTheme(QQuickTheme *theme) +void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) { - QQuickMaterialTheme::initialize(theme); + QQuickStylePlugin::registerTypes(uri); + + QQuickMaterialStyle::initGlobals(); + theme.initialize(QQuickTheme::instance()); } QT_END_NAMESPACE diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 17eb2be9..ef642905 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,8 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQtQuickControlsStylePlugin, "qt.quick.controls.qtquickcontrols2plugin") + class QtQuickControls2Plugin : public QQmlExtensionPlugin { Q_OBJECT @@ -59,17 +62,41 @@ public: QtQuickControls2Plugin(QObject *parent = nullptr); ~QtQuickControls2Plugin(); - void initializeEngine(QQmlEngine *engine, const char *uri) override; void registerTypes(const char *uri) override; void unregisterTypes() override; private: - void init(); - - QList loadStylePlugins(); QQuickTheme *createTheme(const QString &name); + + bool registeredFallbackImport = false; }; +static const char *qtQuickControlsUri = "QtQuick.Controls"; + +QString styleUri() +{ + const QString style = QQuickStyle::name(); + if (!QQuickStylePrivate::isCustomStyle()) { + // The style set is a built-in style. + const QString styleName = QQuickStylePrivate::effectiveStyleName(style); + return QString::fromLatin1("QtQuick.Controls.%1").arg(styleName); + } + + // This is a custom style, so just use the name as the import uri. + QString styleName = style; + if (styleName.startsWith(QLatin1String(":/"))) + styleName.remove(0, 2); + return styleName; +} + +QString fallbackStyleUri() +{ + // The fallback style must be a built-in style, so we don't need to check for custom styles here. + const QString fallbackStyle = QQuickStylePrivate::fallbackStyle(); + const QString fallbackStyleName = QQuickStylePrivate::effectiveStyleName(fallbackStyle); + return QString::fromLatin1("QtQuick.Controls.%1").arg(fallbackStyleName); +} + QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQmlExtensionPlugin(parent) { } @@ -80,88 +107,83 @@ QtQuickControls2Plugin::~QtQuickControls2Plugin() // initialization and cleanup, as plugins are not unloaded on macOS. } -void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char */*uri*/) +void QtQuickControls2Plugin::registerTypes(const char *uri) { - engine->addUrlInterceptor(&QQuickStylePrivate::urlInterceptor); - init(); -} + qCDebug(lcQtQuickControlsStylePlugin) << "registerTypes() called with uri" << uri; + + // It's OK that the style is resolved more than once; some accessors like name() cause it to be called, for example. + QQuickStylePrivate::init(); + + const QString styleName = QQuickStylePrivate::effectiveStyleName(QQuickStyle::name()); + const QString fallbackStyleName = QQuickStylePrivate::effectiveStyleName(QQuickStylePrivate::fallbackStyle()); + qCDebug(lcQtQuickControlsStylePlugin) << "style:" << QQuickStyle::name() << "effective style:" << styleName + << "fallback style:" << QQuickStylePrivate::fallbackStyle() << "effective fallback style:" << fallbackStyleName; + + createTheme(styleName); + + // If the style is Default, we don't need to register the fallback because the Default style + // provides all controls. Also, if we didn't return early here, we can get an infinite import loop + // when the style is set to Default. + if (styleName != fallbackStyleName && styleName != QLatin1String("Default")) { + const QString fallbackstyleUri = ::fallbackStyleUri(); + qCDebug(lcQtQuickControlsStylePlugin) << "calling qmlRegisterModuleImport() to register fallback style with" + << "uri \"" << qtQuickControlsUri << "\" moduleMajor" << QQmlModuleImportModuleAny << "import" << fallbackstyleUri + << "importMajor" << QQmlModuleImportAuto; + // The fallback style must be a built-in style, so we match the version number. + qmlRegisterModuleImport(qtQuickControlsUri, QQmlModuleImportModuleAny, fallbackstyleUri.toUtf8().constData(), + QQmlModuleImportAuto, QQmlModuleImportAuto); + registeredFallbackImport = true; + } -void QtQuickControls2Plugin::registerTypes(const char */*uri*/) -{ - QQuickStylePrivate::init(baseUrl()); + const QString styleUri = ::styleUri(); + // If the user imports QtQuick.Controls 2.15, and they're using the Material style, we should import version 2.15. + // However, if they import QtQuick.Controls 2.15, but are using a custom style, we want to use the latest version + // number of their style. + const int importMajor = !QQuickStylePrivate::isCustomStyle() ? QQmlModuleImportAuto : QQmlModuleImportLatest; + qCDebug(lcQtQuickControlsStylePlugin).nospace() << "calling qmlRegisterModuleImport() to register primary style with" + << " uri \"" << qtQuickControlsUri << "\" moduleMajor " << importMajor << " import " << styleUri + << " importMajor " << importMajor; + qmlRegisterModuleImport(qtQuickControlsUri, QQmlModuleImportModuleAny, styleUri.toUtf8().constData(), importMajor); const QString style = QQuickStyle::name(); if (!style.isEmpty()) - QFileSelectorPrivate::addStatics(QStringList() << style.toLower()); + QFileSelectorPrivate::addStatics(QStringList() << style); } void QtQuickControls2Plugin::unregisterTypes() { + qCDebug(lcQtQuickControlsStylePlugin) << "unregisterTypes() called"; + + if (registeredFallbackImport) { + const QString fallbackStyleUri = ::fallbackStyleUri(); + qmlUnregisterModuleImport(qtQuickControlsUri, QQmlModuleImportModuleAny, fallbackStyleUri.toUtf8().constData(), + QQmlModuleImportAuto, QQmlModuleImportAuto); + } + + const QString primary = QQuickStylePrivate::effectiveStyleName(QQuickStyle::name()); + const QString styleUri = ::styleUri(); + const int importMajor = !QQuickStylePrivate::isCustomStyle() ? QQmlModuleImportAuto : QQmlModuleImportLatest; + qmlUnregisterModuleImport(qtQuickControlsUri, QQmlModuleImportModuleAny, styleUri.toUtf8().constData(), importMajor); + QQuickStylePrivate::reset(); } -void QtQuickControls2Plugin::init() -{ - const QString style = QQuickStyle::name(); - QQuickTheme *theme = createTheme(style.isEmpty() ? QLatin1String("Default") : style); +/*! + \internal - // load the style's plugins to get access to its resources and initialize the theme - QList stylePlugins = loadStylePlugins(); - for (QQuickStylePlugin *stylePlugin : stylePlugins) - stylePlugin->initializeTheme(theme); - qDeleteAll(stylePlugins); -} + Responsible for setting the font and palette settings that were specified in the + qtquickcontrols2.conf file. -QList QtQuickControls2Plugin::loadStylePlugins() -{ - QList stylePlugins; - - QFileInfo fileInfo = QQmlFile::urlToLocalFileOrQrc(resolvedUrl(QStringLiteral("qmldir"))); - if (fileInfo.exists() && fileInfo.path() != QQmlFile::urlToLocalFileOrQrc(baseUrl())) { - QFile file(fileInfo.filePath()); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QQmlDirParser parser; - parser.parse(QString::fromUtf8(file.readAll())); - if (!parser.hasError()) { -#ifdef QT_STATIC - const auto plugins = QPluginLoader::staticInstances(); - for (QObject *instance : plugins) { - QQuickStylePlugin *stylePlugin = qobject_cast(instance); - if (!stylePlugin || !parser.classNames().contains(QLatin1String(instance->metaObject()->className()))) - continue; - stylePlugins += stylePlugin; - } -#elif QT_CONFIG(library) - QPluginLoader loader; - const auto plugins = parser.plugins(); - for (const QQmlDirParser::Plugin &plugin : plugins) { - QDir dir = fileInfo.dir(); - if (!plugin.path.isEmpty() && !dir.cd(plugin.path)) - continue; - QString filePath = dir.filePath(plugin.name); -#if defined(Q_OS_MACOS) && defined(QT_DEBUG) - // Avoid mismatching plugins on macOS so that we don't end up loading both debug and - // release versions of the same Qt libraries (due to the plugin's dependencies). - filePath += QStringLiteral("_debug"); -#endif // Q_OS_MACOS && QT_DEBUG -#if defined(Q_OS_WIN) && defined(QT_DEBUG) - // Debug versions of plugins have a "d" prefix on Windows. - filePath += QLatin1Char('d'); -#endif // Q_OS_WIN && QT_DEBUG - loader.setFileName(filePath); - QQuickStylePlugin *stylePlugin = qobject_cast(loader.instance()); - if (stylePlugin) - stylePlugins += stylePlugin; - } -#endif - } - } - } - return stylePlugins; -} + Style-specific settings (e.g. Variant=Dense) are read in the constructor of the + appropriate style plugin (e.g. QtQuickControls2MaterialStylePlugin). + Implicit style-specific font and palette values are assigned in the relevant theme + (e.g. QQuickMaterialTheme). +*/ QQuickTheme *QtQuickControls2Plugin::createTheme(const QString &name) { + qCDebug(lcQtQuickControlsStylePlugin) << "creating QQuickTheme instance to be initialized by style-specific theme of" << name; + QQuickTheme *theme = new QQuickTheme; #if QT_CONFIG(settings) QQuickThemePrivate *p = QQuickThemePrivate::get(theme); diff --git a/src/imports/controls/universal/qmldir b/src/imports/controls/universal/qmldir index 28bd5706..e2faf020 100644 --- a/src/imports/controls/universal/qmldir +++ b/src/imports/controls/universal/qmldir @@ -1,7 +1,7 @@ module QtQuick.Controls.Universal plugin qtquickcontrols2universalstyleplugin classname QtQuickControls2UniversalStylePlugin -depends QtQuick.Controls 2.5 +import QtQuick.Controls.Default auto # QtQuick.Controls 2.0 (originally introduced in Qt 5.7) ApplicationWindow 2.0 ApplicationWindow.qml diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index ac154911..d6f7746d 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -34,11 +34,12 @@ ** ****************************************************************************/ -#include - #include "qquickuniversalstyle_p.h" #include "qquickuniversaltheme_p.h" +#include +#include + QT_BEGIN_NAMESPACE class QtQuickControls2UniversalStylePlugin : public QQuickStylePlugin @@ -50,12 +51,14 @@ public: QtQuickControls2UniversalStylePlugin(QObject *parent = nullptr); QString name() const override; - void initializeTheme(QQuickTheme *theme) override; + + void registerTypes(const char *uri) override; + + QQuickUniversalTheme theme; }; QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - QQuickUniversalStyle::initGlobals(); } QString QtQuickControls2UniversalStylePlugin::name() const @@ -63,9 +66,12 @@ QString QtQuickControls2UniversalStylePlugin::name() const return QStringLiteral("Universal"); } -void QtQuickControls2UniversalStylePlugin::initializeTheme(QQuickTheme *theme) +void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri) { - QQuickUniversalTheme::initialize(theme); + QQuickStylePlugin::registerTypes(uri); + + QQuickUniversalStyle::initGlobals(); + theme.initialize(QQuickTheme::instance()); } QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index 836eb2f4..72078a0e 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -92,54 +92,23 @@ Q_LOGGING_CATEGORY(lcQtQuickControlsStyle, "qt.quick.controls.style") Qt Quick Controls. It is not possible to change the style after the QML types have been registered. - The style can also be specified as a path to a custom style, such as - \c ":/mystyle". See \l {Creating a Custom Style} for more details about - building custom styles. Custom styles do not need to implement all controls. - By default, the styling system uses the \l {Default style} as a fallback - for controls that a custom style does not provide. It is possible to - specify a different fallback style to customize or extend one of the - built-in styles. + To create your own custom style, see \l {Creating a Custom Style}. Custom + styles do not need to implement all controls. By default, the styling + system uses the \l {Default style} as a fallback for controls that a custom + style does not provide. It is possible to specify a different fallback + style to customize or extend one of the built-in styles. \code - QQuickStyle::setStyle(":/mystyle"); + QQuickStyle::setStyle("MyStyle"); QQuickStyle::setFallbackStyle("Material"); \endcode \sa {Styling Qt Quick Controls} */ -static QStringList envPathList(const QByteArray &var) -{ - QStringList paths; - if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(var))) { - const QByteArray value = qgetenv(var); - paths += QString::fromLocal8Bit(value).split(QDir::listSeparator(), Qt::SkipEmptyParts); - } - return paths; -} - -static QStringList defaultImportPathList() -{ - QStringList importPaths; - importPaths.reserve(3); -#ifdef Q_OS_ANDROID - // androiddeployqt puts the QML files inside a resource file and they are not - // showing up in the Qml2ImportsPath as a result - importPaths += QStringLiteral(":/android_rcc_bundle/qml"); -#else -# ifndef QT_STATIC - importPaths += QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); -# endif -#endif - importPaths += envPathList("QML2_IMPORT_PATH"); - importPaths += QStringLiteral(":/qt-project.org/imports"); - importPaths += QCoreApplication::applicationDirPath(); - return importPaths; -} - struct QQuickStyleSpec { - QQuickStyleSpec() : custom(false), resolved(false) { } + QQuickStyleSpec() { } QString name() { @@ -160,6 +129,13 @@ struct QQuickStyleSpec void setStyle(const QString &s) { + qCDebug(lcQtQuickControlsStyle) << "style" << s << "set on QQuickStyleSpec"; + if (s.contains(QLatin1Char('/'))) { + qWarning() << "Style names must not contain paths; see the \"Definition of a Style\" documentation for more information"; + return; + } + + qCDebug(lcQtQuickControlsStyle) << "clearing resolved flag and resolving"; style = s; resolved = false; resolve(); @@ -171,27 +147,9 @@ struct QQuickStyleSpec fallbackMethod = method; } - static QString findStyle(const QString &path, const QString &name) + void resolve() { - QDir dir(path); - if (!dir.exists()) - return QString(); - - if (name.isEmpty()) - return dir.absolutePath() + QLatin1Char('/'); - - const QStringList entries = dir.entryList(QStringList(), QDir::Dirs | QDir::NoDotAndDotDot); - for (const QString &entry : entries) { - if (entry.compare(name, Qt::CaseInsensitive) == 0) - return dir.absoluteFilePath(entry); - } - - return QString(); - } - - void resolve(const QUrl &baseUrl = QUrl()) - { - qCDebug(lcQtQuickControlsStyle) << "resolving style with baseUrl" << baseUrl; + qCDebug(lcQtQuickControlsStyle) << "resolving style"; if (style.isEmpty()) style = QGuiApplicationPrivate::styleOverride; @@ -211,53 +169,33 @@ struct QQuickStyleSpec } #endif - // resolve a path relative to the config - QString configPath = QFileInfo(resolveConfigFilePath()).path(); - QString stylePath = findStyle(configPath, style); - if (!stylePath.isEmpty()) { - style = stylePath; - resolved = true; + auto builtInStyleList = QQuickStylePrivate::builtInStyles(); + if (!fallbackStyle.isEmpty() && !builtInStyleList.contains(fallbackStyle)) { + qWarning().nospace().noquote() << fallbackMethod << ": the specified fallback style \"" << + fallbackStyle << "\" is not one of the built-in Qt Quick Controls 2 styles"; + fallbackStyle.clear(); } - custom = style.contains(QLatin1Char('/')); + // Find the config file. + resolveConfigFilePath(); - if (baseUrl.isValid()) { - QString path = QQmlFile::urlToLocalFileOrQrc(baseUrl); - QString stylePath = findStyle(path, style); - if (!stylePath.isEmpty()) { - style = stylePath; - resolved = true; - } - } + custom = !builtInStyleList.contains(QQuickStylePrivate::effectiveStyleName(style)); - if (QGuiApplication::instance()) { - if (!custom) { - const QStringList stylePaths = QQuickStylePrivate::stylePaths(); - for (const QString &path : stylePaths) { - QString stylePath = findStyle(path, style); - if (!stylePath.isEmpty()) { - custom = !stylePath.startsWith(QQmlFile::urlToLocalFileOrQrc(baseUrl)); - style = stylePath; - resolved = true; - break; - } - } - } - resolved = true; - } + resolved = true; qCDebug(lcQtQuickControlsStyle).nospace() << "done resolving:" + << "\n style=" << style << "\n custom=" << custom << "\n resolved=" << resolved - << "\n style=" << style << "\n fallbackStyle=" << fallbackStyle << "\n fallbackMethod=" << fallbackMethod - << "\n configFilePath=" << configFilePath - << "\n customStylePaths=" << customStylePaths; + << "\n configFilePath=" << configFilePath; } void reset() { + qCDebug(lcQtQuickControlsStyle) << "resetting values to their defaults"; + custom = false; resolved = false; style.clear(); @@ -281,10 +219,10 @@ struct QQuickStyleSpec } // Is this a custom style defined by the user and not "built-in" style? - bool custom; - // Did we manage to find a valid style path? - bool resolved; - // The full path to the style. + bool custom = false; + // Have we resolved the style yet? + bool resolved = false; + // The name of the style. QString style; // The built-in style to use if the requested style cannot be found. QString fallbackStyle; @@ -292,102 +230,13 @@ struct QQuickStyleSpec QByteArray fallbackMethod; // The path to the qtquickcontrols2.conf file. QString configFilePath; - // An extra list of directories where we search for available styles before any other directories. - QStringList customStylePaths; }; Q_GLOBAL_STATIC(QQuickStyleSpec, styleSpec) -static QStringList parseStylePathsWithColon(const QString &var) +QString QQuickStylePrivate::effectiveStyleName(const QString &styleName) { - QStringList paths; - const QChar colon = QLatin1Char(':'); - int currentIndex = 0; - - do { - int nextColonIndex = -1; - QString path; - - if (var.at(currentIndex) == colon) { - // This is either a list separator, or a qrc path. - if (var.at(currentIndex + 1) == colon) { - // It's a double colon (list separator followed by qrc path); - // find the end of the path. - nextColonIndex = var.indexOf(colon, currentIndex + 2); - path = var.mid(currentIndex + 1, - nextColonIndex == -1 ? -1 : nextColonIndex - currentIndex - 1); - } else { - // It's a single colon. - nextColonIndex = var.indexOf(colon, currentIndex + 1); - if (currentIndex == 0) { - // If we're at the start of the string, then it's a qrc path. - path = var.mid(currentIndex, - nextColonIndex == -1 ? -1 : nextColonIndex - currentIndex); - } else { - // Otherwise, it's a separator. - path = var.mid(currentIndex + 1, - nextColonIndex == -1 ? -1 : nextColonIndex - currentIndex - 1); - } - } - } else { - // It's a file path. - nextColonIndex = var.indexOf(colon, currentIndex); - path = var.mid(currentIndex, - nextColonIndex == -1 ? -1 : nextColonIndex - currentIndex); - } - - paths += path; - currentIndex = nextColonIndex; - - // Keep going until we can't find any more colons, - // or we're at the last character. - } while (currentIndex != -1 && currentIndex < var.size() - 1); - - return paths; -} - -QStringList QQuickStylePrivate::stylePaths(bool resolve) -{ - // user-requested style path - QStringList paths; - if (resolve) { - QString path = styleSpec()->path(); - if (path.endsWith(QLatin1Char('/'))) - path.chop(1); - if (!path.isEmpty()) - paths += path; - } - - if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE_PATH"))) { - const QString value = QString::fromLocal8Bit(qgetenv("QT_QUICK_CONTROLS_STYLE_PATH")); - const QChar listSeparator = QDir::listSeparator(); - if (listSeparator == QLatin1Char(':')) { - // Split manually to avoid breaking paths on systems where : is the list separator, - // since it's also used for qrc paths. - paths += parseStylePathsWithColon(value); - } else { - // Fast/simpler path for systems where something other than : is used as - // the list separator (such as ';'). - const QStringList customPaths = value.split(listSeparator, Qt::SkipEmptyParts); - paths += customPaths; - } - } - - // system/custom style paths - paths += styleSpec()->customStylePaths; - paths += envPathList("QT_QUICK_CONTROLS_STYLE_PATH"); - - // built-in import paths - const QString targetPath = QStringLiteral("QtQuick/Controls"); - const QStringList importPaths = defaultImportPathList(); - for (const QString &importPath : importPaths) { - QDir dir(importPath); - if (dir.cd(targetPath)) - paths += dir.absolutePath(); - } - - paths.removeDuplicates(); - return paths; + return !styleName.isEmpty() ? styleName : QLatin1String("Default"); } QString QQuickStylePrivate::fallbackStyle() @@ -400,27 +249,15 @@ bool QQuickStylePrivate::isCustomStyle() return styleSpec()->custom; } -void QQuickStylePrivate::init(const QUrl &baseUrl) +bool QQuickStylePrivate::isResolved() +{ + return styleSpec()->resolved; +} + +void QQuickStylePrivate::init() { QQuickStyleSpec *spec = styleSpec(); - spec->resolve(baseUrl); - - if (!spec->fallbackStyle.isEmpty()) { - QString fallbackStyle; - const QStringList stylePaths = QQuickStylePrivate::stylePaths(); - for (const QString &path : stylePaths) { - fallbackStyle = spec->findStyle(path, spec->fallbackStyle); - if (!fallbackStyle.isEmpty()) - break; - } - if (fallbackStyle.isEmpty()) { - if (spec->fallbackStyle.compare(QStringLiteral("Default")) != 0) { - qWarning() << "ERROR: unable to locate fallback style" << spec->fallbackStyle; - qInfo().nospace().noquote() << spec->fallbackMethod << ": the fallback style must be the name of one of the built-in Qt Quick Controls 2 styles."; - } - spec->fallbackStyle.clear(); - } - } + spec->resolve(); } void QQuickStylePrivate::reset() @@ -541,6 +378,12 @@ bool QQuickStylePrivate::isDarkSystemTheme() return dark; } +QStringList QQuickStylePrivate::builtInStyles() +{ + return { QLatin1String("Default"), QLatin1String("Fusion"), + QLatin1String("Imagine"), QLatin1String("Material"), QLatin1String("Universal") }; +} + /*! Returns the name of the application style. @@ -553,19 +396,6 @@ QString QQuickStyle::name() return styleSpec()->name(); } -/*! - Returns the path of an overridden application style, or an empty - string if the style is one of the built-in Qt Quick Controls 2 styles. - - \note The application style can be specified by passing a \c -style command - line argument. Therefore \c path() may not return a fully resolved - value if called before constructing a QGuiApplication. -*/ -QString QQuickStyle::path() -{ - return styleSpec()->path(); -} - /*! Sets the application style to \a style. @@ -612,88 +442,4 @@ void QQuickStyle::setFallbackStyle(const QString &style) styleSpec()->setFallbackStyle(style, "QQuickStyle::setFallbackStyle()"); } -/*! - \since 5.9 - Returns the names of the available styles. - - \note The method must be called \b after creating an instance of QGuiApplication. - - \sa stylePathList(), addStylePath() -*/ -QStringList QQuickStyle::availableStyles() -{ - QStringList styles; - if (!QGuiApplication::instance()) { - qWarning() << "ERROR: QQuickStyle::availableStyles() must be called after creating an instance of QGuiApplication."; - return styles; - } - - const QStringList stylePaths = QQuickStylePrivate::stylePaths(); - for (const QString &path : stylePaths) { - const QList entries = QDir(path).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); - for (const QFileInfo &entry : entries) { - const QString name = entry.fileName(); - if (!name.endsWith(QLatin1String(".dSYM")) && name != QLatin1String("designer")) - styles += name; - } - } - styles.prepend(QStringLiteral("Default")); - styles.removeDuplicates(); - return styles; -} - -/*! - \since 5.12 - - Returns the list of directories where Qt Quick Controls 2 searches for available styles. - - By default, the list contains paths specified in the \c QT_QUICK_CONTROLS_STYLE_PATH - environment variable, and any existing \c QtQuick/Controls sub-directories in - \l QQmlEngine::importPathList(). - - \sa addStylePath(), availableStyles() -*/ -QStringList QQuickStyle::stylePathList() -{ - return QQuickStylePrivate::stylePaths(); -} - -/*! - \since 5.12 - - Adds \a path as a directory where Qt Quick Controls 2 searches for available styles. - - The \a path may be any local filesystem directory or \l {The Qt Resource System}{Qt Resource} directory. - For example, the following paths are all valid: - - \list - \li \c {/path/to/styles/} - \li \c {file:///path/to/styles/} - \li \c {:/path/to/styles/} - \li \c {qrc:/path/to/styles/}) - \endlist - - The \a path will be converted into \l {QDir::canonicalPath}{canonical form} before it is added to - the style path list. - - The newly added \a path will be first in the stylePathList(). - - \sa stylePathList(), availableStyles() -*/ -void QQuickStyle::addStylePath(const QString &path) -{ - if (path.isEmpty()) - return; - - const QUrl url = QUrl(path); - if (url.isRelative() || url.scheme() == QLatin1String("file") - || (url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path - styleSpec()->customStylePaths.prepend(QDir(path).canonicalPath()); - } else if (url.scheme() == QLatin1String("qrc")) { - styleSpec()->customStylePaths.prepend(QLatin1Char(':') + url.path()); - } else { - styleSpec()->customStylePaths.prepend(path); - } -} - QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyle.h b/src/quickcontrols2/qquickstyle.h index ce55b76b..e26ec90b 100644 --- a/src/quickcontrols2/qquickstyle.h +++ b/src/quickcontrols2/qquickstyle.h @@ -47,12 +47,8 @@ class Q_QUICKCONTROLS2_EXPORT QQuickStyle { public: static QString name(); - static QString path(); static void setStyle(const QString &style); static void setFallbackStyle(const QString &style); - static QStringList availableStyles(); - static QStringList stylePathList(); - static void addStylePath(const QString &path); }; QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyle_p.h b/src/quickcontrols2/qquickstyle_p.h index 7c837423..e2db35d7 100644 --- a/src/quickcontrols2/qquickstyle_p.h +++ b/src/quickcontrols2/qquickstyle_p.h @@ -48,7 +48,6 @@ // We mean it. // -#include #include #include @@ -59,16 +58,19 @@ class QSettings; class Q_QUICKCONTROLS2_EXPORT QQuickStylePrivate { public: - static QStringList stylePaths(bool resolve = false); + static QString effectiveStyleName(const QString &styleName); static QString fallbackStyle(); static bool isCustomStyle(); - static void init(const QUrl &baseUrl); + static bool isResolved(); + static bool exists(); + static void init(); static void reset(); static QString configFilePath(); static QSharedPointer settings(const QString &group = QString()); static const QFont *readFont(const QSharedPointer &settings); static const QPalette *readPalette(const QSharedPointer &settings); static bool isDarkSystemTheme(); + static QStringList builtInStyles(); }; QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp index 18f0d485..1f1c3875 100644 --- a/src/quickcontrols2/qquickstyleplugin.cpp +++ b/src/quickcontrols2/qquickstyleplugin.cpp @@ -34,14 +34,20 @@ ** ****************************************************************************/ +#include "qquickstyle.h" #include "qquickstyle_p.h" #include "qquickstyleplugin_p.h" +#include #include #include +#include + QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcStylePlugin, "qt.quick.controls.styleplugin") + QQuickStylePlugin::QQuickStylePlugin(QObject *parent) : QQmlExtensionPlugin(parent) { @@ -56,4 +62,14 @@ QString QQuickStylePlugin::name() const return QString(); } +void QQuickStylePlugin::registerTypes(const char *uri) +{ + qCDebug(lcStylePlugin).nospace() << "registerTypes called with uri " << uri << "; plugin name is " << name(); +} + +void QQuickStylePlugin::unregisterTypes() +{ + qCDebug(lcStylePlugin) << "unregisterTypes called; plugin name is" << name(); +} + QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleplugin_p.h b/src/quickcontrols2/qquickstyleplugin_p.h index 7ae129d9..37d070db 100644 --- a/src/quickcontrols2/qquickstyleplugin_p.h +++ b/src/quickcontrols2/qquickstyleplugin_p.h @@ -64,9 +64,9 @@ public: ~QQuickStylePlugin(); virtual QString name() const; - virtual void initializeTheme(QQuickTheme *theme) = 0; void registerTypes(const char *uri) override; + void unregisterTypes() override; private: Q_DISABLE_COPY(QQuickStylePlugin) -- cgit v1.2.3 From 9824a71f1d1754485072d66fbac2c98854ace52a Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 15 Jul 2020 14:52:09 +0200 Subject: Bump import version to 6.0 Task-number: QTBUG-82922 Change-Id: I2eb924eaaaddbe75d342f59f5fb3cd30c4a84fef Reviewed-by: Ulf Hermann --- src/imports/controls/controls.pro | 2 +- src/imports/controls/default/default.pro | 2 +- src/imports/controls/default/impl/default-impl.pro | 2 +- src/imports/controls/default/qmldir | 59 ++++++++++++++++++++++ src/imports/controls/fusion/fusion.pro | 2 +- src/imports/controls/fusion/impl/fusion-impl.pro | 2 +- src/imports/controls/fusion/qmldir | 50 ++++++++++++++++++ src/imports/controls/imagine/imagine.pro | 2 +- src/imports/controls/imagine/impl/imagine-impl.pro | 2 +- src/imports/controls/imagine/qmldir | 50 ++++++++++++++++++ .../controls/material/impl/material-impl.pro | 2 +- src/imports/controls/material/material.pro | 2 +- src/imports/controls/material/qmldir | 52 +++++++++++++++++++ .../controls/universal/impl/universal-impl.pro | 2 +- src/imports/controls/universal/qmldir | 51 +++++++++++++++++++ src/imports/controls/universal/universal.pro | 2 +- src/imports/controlsimpl/controlsimpl.pro | 2 +- src/imports/templates/templates.pro | 2 +- src/quickcontrols2/quickcontrols2.pro | 2 +- src/quickcontrols2impl/quickcontrols2impl.pro | 2 +- src/quicktemplates2/quicktemplates2.pro | 2 +- 21 files changed, 278 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 16a95510..4eb402a3 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2plugin TARGETPATH = QtQuick/Controls -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private diff --git a/src/imports/controls/default/default.pro b/src/imports/controls/default/default.pro index 037cf2f7..5ecaafce 100644 --- a/src/imports/controls/default/default.pro +++ b/src/imports/controls/default/default.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2defaultstyleplugin TARGETPATH = QtQuick/Controls/Default QML_IMPORT_NAME = QtQuick.Controls.Default -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private diff --git a/src/imports/controls/default/impl/default-impl.pro b/src/imports/controls/default/impl/default-impl.pro index 35368a5e..e26ae9ff 100644 --- a/src/imports/controls/default/impl/default-impl.pro +++ b/src/imports/controls/default/impl/default-impl.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2defaultstyleimplplugin TARGETPATH = QtQuick/Controls/Default/impl QML_IMPORT_NAME = QtQuick.Controls.Default.impl -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private diff --git a/src/imports/controls/default/qmldir b/src/imports/controls/default/qmldir index 04510397..3f2501b7 100644 --- a/src/imports/controls/default/qmldir +++ b/src/imports/controls/default/qmldir @@ -71,3 +71,62 @@ SplitView 2.13 SplitView.qml # QtQuick.Controls 2.15 (new types in Qt 5.15) HorizontalHeaderView 2.15 HorizontalHeaderView.qml VerticalHeaderView 2.15 VerticalHeaderView.qml + +# Make sure we have types registered for Qt 6: QTBUG-85774, QTBUG-85685 +AbstractButton 6.0 AbstractButton.qml +Action 6.0 Action.qml +ActionGroup 6.0 ActionGroup.qml +ApplicationWindow 6.0 ApplicationWindow.qml +BusyIndicator 6.0 BusyIndicator.qml +Button 6.0 Button.qml +ButtonGroup 6.0 ButtonGroup.qml +CheckBox 6.0 CheckBox.qml +CheckDelegate 6.0 CheckDelegate.qml +ComboBox 6.0 ComboBox.qml +Container 6.0 Container.qml +Control 6.0 Control.qml +DelayButton 6.0 DelayButton.qml +Dial 6.0 Dial.qml +Dialog 6.0 Dialog.qml +DialogButtonBox 6.0 DialogButtonBox.qml +Drawer 6.0 Drawer.qml +Frame 6.0 Frame.qml +GroupBox 6.0 GroupBox.qml +HorizontalHeaderView 6.0 HorizontalHeaderView.qml +ItemDelegate 6.0 ItemDelegate.qml +Label 6.0 Label.qml +Menu 6.0 Menu.qml +MenuBar 6.0 MenuBar.qml +MenuBarItem 6.0 MenuBarItem.qml +MenuItem 6.0 MenuItem.qml +MenuSeparator 6.0 MenuSeparator.qml +Page 6.0 Page.qml +PageIndicator 6.0 PageIndicator.qml +Pane 6.0 Pane.qml +Popup 6.0 Popup.qml +ProgressBar 6.0 ProgressBar.qml +RadioButton 6.0 RadioButton.qml +RadioDelegate 6.0 RadioDelegate.qml +RangeSlider 6.0 RangeSlider.qml +RoundButton 6.0 RoundButton.qml +ScrollBar 6.0 ScrollBar.qml +ScrollIndicator 6.0 ScrollIndicator.qml +ScrollView 6.0 ScrollView.qml +Slider 6.0 Slider.qml +SpinBox 6.0 SpinBox.qml +SplitView 6.0 SplitView.qml +StackView 6.0 StackView.qml +SwipeDelegate 6.0 SwipeDelegate.qml +SwipeView 6.0 SwipeView.qml +Switch 6.0 Switch.qml +SwitchDelegate 6.0 SwitchDelegate.qml +TabBar 6.0 TabBar.qml +TabButton 6.0 TabButton.qml +TextArea 6.0 TextArea.qml +TextField 6.0 TextField.qml +ToolBar 6.0 ToolBar.qml +ToolButton 6.0 ToolButton.qml +ToolSeparator 6.0 ToolSeparator.qml +ToolTip 6.0 ToolTip.qml +Tumbler 6.0 Tumbler.qml +VerticalHeaderView 6.0 VerticalHeaderView.qml diff --git a/src/imports/controls/fusion/fusion.pro b/src/imports/controls/fusion/fusion.pro index bb27b3f1..eceaf0f5 100644 --- a/src/imports/controls/fusion/fusion.pro +++ b/src/imports/controls/fusion/fusion.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2fusionstyleplugin TARGETPATH = QtQuick/Controls/Fusion QML_IMPORT_NAME = QtQuick.Controls.Fusion -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private diff --git a/src/imports/controls/fusion/impl/fusion-impl.pro b/src/imports/controls/fusion/impl/fusion-impl.pro index 78692abd..40abe7ac 100644 --- a/src/imports/controls/fusion/impl/fusion-impl.pro +++ b/src/imports/controls/fusion/impl/fusion-impl.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2fusionstyleimplplugin TARGETPATH = QtQuick/Controls/Fusion/impl QML_IMPORT_NAME = QtQuick.Controls.Fusion.impl -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private diff --git a/src/imports/controls/fusion/qmldir b/src/imports/controls/fusion/qmldir index 84c0b211..c08f1e4a 100644 --- a/src/imports/controls/fusion/qmldir +++ b/src/imports/controls/fusion/qmldir @@ -62,3 +62,53 @@ SplitView 2.13 SplitView.qml # QtQuick.Controls 2.15 (new types in Qt 5.15) HorizontalHeaderView 2.15 HorizontalHeaderView.qml VerticalHeaderView 2.15 VerticalHeaderView.qml + +# Make sure we have types registered for Qt 6: QTBUG-85774, QTBUG-85685 +ApplicationWindow 6.0 ApplicationWindow.qml +BusyIndicator 6.0 BusyIndicator.qml +Button 6.0 Button.qml +CheckBox 6.0 CheckBox.qml +CheckDelegate 6.0 CheckDelegate.qml +ComboBox 6.0 ComboBox.qml +DelayButton 6.0 DelayButton.qml +Dial 6.0 Dial.qml +Dialog 6.0 Dialog.qml +DialogButtonBox 6.0 DialogButtonBox.qml +Drawer 6.0 Drawer.qml +Frame 6.0 Frame.qml +GroupBox 6.0 GroupBox.qml +HorizontalHeaderView 6.0 HorizontalHeaderView.qml +ItemDelegate 6.0 ItemDelegate.qml +Label 6.0 Label.qml +Menu 6.0 Menu.qml +MenuBar 6.0 MenuBar.qml +MenuBarItem 6.0 MenuBarItem.qml +MenuItem 6.0 MenuItem.qml +MenuSeparator 6.0 MenuSeparator.qml +Page 6.0 Page.qml +PageIndicator 6.0 PageIndicator.qml +Pane 6.0 Pane.qml +Popup 6.0 Popup.qml +ProgressBar 6.0 ProgressBar.qml +RadioButton 6.0 RadioButton.qml +RadioDelegate 6.0 RadioDelegate.qml +RangeSlider 6.0 RangeSlider.qml +RoundButton 6.0 RoundButton.qml +ScrollBar 6.0 ScrollBar.qml +ScrollIndicator 6.0 ScrollIndicator.qml +Slider 6.0 Slider.qml +SpinBox 6.0 SpinBox.qml +SplitView 6.0 SplitView.qml +SwipeDelegate 6.0 SwipeDelegate.qml +Switch 6.0 Switch.qml +SwitchDelegate 6.0 SwitchDelegate.qml +TabBar 6.0 TabBar.qml +TabButton 6.0 TabButton.qml +TextArea 6.0 TextArea.qml +TextField 6.0 TextField.qml +ToolBar 6.0 ToolBar.qml +ToolButton 6.0 ToolButton.qml +ToolSeparator 6.0 ToolSeparator.qml +ToolTip 6.0 ToolTip.qml +Tumbler 6.0 Tumbler.qml +VerticalHeaderView 6.0 VerticalHeaderView.qml diff --git a/src/imports/controls/imagine/imagine.pro b/src/imports/controls/imagine/imagine.pro index 4dcd080c..6a82f5e4 100644 --- a/src/imports/controls/imagine/imagine.pro +++ b/src/imports/controls/imagine/imagine.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2imaginestyleplugin TARGETPATH = QtQuick/Controls/Imagine QML_IMPORT_NAME = QtQuick.Controls.Imagine -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private diff --git a/src/imports/controls/imagine/impl/imagine-impl.pro b/src/imports/controls/imagine/impl/imagine-impl.pro index 9b45fd31..aeddd4cc 100644 --- a/src/imports/controls/imagine/impl/imagine-impl.pro +++ b/src/imports/controls/imagine/impl/imagine-impl.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2imaginestyleimplplugin TARGETPATH = QtQuick/Controls/Imagine/impl QML_IMPORT_NAME = QtQuick.Controls.Imagine.impl -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private diff --git a/src/imports/controls/imagine/qmldir b/src/imports/controls/imagine/qmldir index e3d7d8d5..65165bf4 100644 --- a/src/imports/controls/imagine/qmldir +++ b/src/imports/controls/imagine/qmldir @@ -60,3 +60,53 @@ SplitView 2.13 SplitView.qml # QtQuick.Controls 2.15 (new types in Qt 5.15) HorizontalHeaderView 2.15 HorizontalHeaderView.qml VerticalHeaderView 2.15 VerticalHeaderView.qml + +# Make sure we have types registered for Qt 6: QTBUG-85774, QTBUG-85685 +ApplicationWindow 6.0 ApplicationWindow.qml +BusyIndicator 6.0 BusyIndicator.qml +Button 6.0 Button.qml +CheckBox 6.0 CheckBox.qml +CheckDelegate 6.0 CheckDelegate.qml +ComboBox 6.0 ComboBox.qml +DelayButton 6.0 DelayButton.qml +Dial 6.0 Dial.qml +Dialog 6.0 Dialog.qml +DialogButtonBox 6.0 DialogButtonBox.qml +Drawer 6.0 Drawer.qml +Frame 6.0 Frame.qml +GroupBox 6.0 GroupBox.qml +HorizontalHeaderView 6.0 HorizontalHeaderView.qml +ItemDelegate 6.0 ItemDelegate.qml +Label 6.0 Label.qml +Menu 6.0 Menu.qml +MenuItem 6.0 MenuItem.qml +MenuSeparator 6.0 MenuSeparator.qml +Page 6.0 Page.qml +PageIndicator 6.0 PageIndicator.qml +Pane 6.0 Pane.qml +Popup 6.0 Popup.qml +ProgressBar 6.0 ProgressBar.qml +RadioButton 6.0 RadioButton.qml +RadioDelegate 6.0 RadioDelegate.qml +RangeSlider 6.0 RangeSlider.qml +RoundButton 6.0 RoundButton.qml +ScrollBar 6.0 ScrollBar.qml +ScrollIndicator 6.0 ScrollIndicator.qml +Slider 6.0 Slider.qml +SpinBox 6.0 SpinBox.qml +SplitView 6.0 SplitView.qml +StackView 6.0 StackView.qml +SwipeDelegate 6.0 SwipeDelegate.qml +SwipeView 6.0 SwipeView.qml +Switch 6.0 Switch.qml +SwitchDelegate 6.0 SwitchDelegate.qml +TabBar 6.0 TabBar.qml +TabButton 6.0 TabButton.qml +TextArea 6.0 TextArea.qml +TextField 6.0 TextField.qml +ToolBar 6.0 ToolBar.qml +ToolButton 6.0 ToolButton.qml +ToolSeparator 6.0 ToolSeparator.qml +ToolTip 6.0 ToolTip.qml +Tumbler 6.0 Tumbler.qml +VerticalHeaderView 6.0 VerticalHeaderView.qml diff --git a/src/imports/controls/material/impl/material-impl.pro b/src/imports/controls/material/impl/material-impl.pro index bc063d84..b35ab58a 100644 --- a/src/imports/controls/material/impl/material-impl.pro +++ b/src/imports/controls/material/impl/material-impl.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2materialstyleimplplugin TARGETPATH = QtQuick/Controls/Material/impl QML_IMPORT_NAME = QtQuick.Controls.Material.impl -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index 7ff3ea07..e8d9db52 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2materialstyleplugin TARGETPATH = QtQuick/Controls/Material QML_IMPORT_NAME = QtQuick.Controls.Material -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir index 39dae48a..ae8a26fb 100644 --- a/src/imports/controls/material/qmldir +++ b/src/imports/controls/material/qmldir @@ -64,3 +64,55 @@ SplitView 2.13 SplitView.qml # QtQuick.Controls 2.15 (new types in Qt 5.15) HorizontalHeaderView 2.15 HorizontalHeaderView.qml VerticalHeaderView 2.15 VerticalHeaderView.qml + +# Make sure we have types registered for Qt 6: QTBUG-85774, QTBUG-85685 +ApplicationWindow 6.0 ApplicationWindow.qml +BusyIndicator 6.0 BusyIndicator.qml +Button 6.0 Button.qml +CheckBox 6.0 CheckBox.qml +CheckDelegate 6.0 CheckDelegate.qml +ComboBox 6.0 ComboBox.qml +DelayButton 6.0 DelayButton.qml +Dial 6.0 Dial.qml +Dialog 6.0 Dialog.qml +DialogButtonBox 6.0 DialogButtonBox.qml +Drawer 6.0 Drawer.qml +Frame 6.0 Frame.qml +GroupBox 6.0 GroupBox.qml +HorizontalHeaderView 6.0 HorizontalHeaderView.qml +ItemDelegate 6.0 ItemDelegate.qml +Label 6.0 Label.qml +Menu 6.0 Menu.qml +MenuBar 6.0 MenuBar.qml +MenuBarItem 6.0 MenuBarItem.qml +MenuItem 6.0 MenuItem.qml +MenuSeparator 6.0 MenuSeparator.qml +Page 6.0 Page.qml +PageIndicator 6.0 PageIndicator.qml +Pane 6.0 Pane.qml +Popup 6.0 Popup.qml +ProgressBar 6.0 ProgressBar.qml +RadioButton 6.0 RadioButton.qml +RadioDelegate 6.0 RadioDelegate.qml +RangeSlider 6.0 RangeSlider.qml +RoundButton 6.0 RoundButton.qml +ScrollBar 6.0 ScrollBar.qml +ScrollIndicator 6.0 ScrollIndicator.qml +Slider 6.0 Slider.qml +SpinBox 6.0 SpinBox.qml +SplitView 6.0 SplitView.qml +StackView 6.0 StackView.qml +SwipeDelegate 6.0 SwipeDelegate.qml +SwipeView 6.0 SwipeView.qml +Switch 6.0 Switch.qml +SwitchDelegate 6.0 SwitchDelegate.qml +TabBar 6.0 TabBar.qml +TabButton 6.0 TabButton.qml +TextArea 6.0 TextArea.qml +TextField 6.0 TextField.qml +ToolBar 6.0 ToolBar.qml +ToolButton 6.0 ToolButton.qml +ToolSeparator 6.0 ToolSeparator.qml +ToolTip 6.0 ToolTip.qml +Tumbler 6.0 Tumbler.qml +VerticalHeaderView 6.0 VerticalHeaderView.qml diff --git a/src/imports/controls/universal/impl/universal-impl.pro b/src/imports/controls/universal/impl/universal-impl.pro index a27ae154..dd4aab46 100644 --- a/src/imports/controls/universal/impl/universal-impl.pro +++ b/src/imports/controls/universal/impl/universal-impl.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2universalstyleimplplugin TARGETPATH = QtQuick/Controls/Universal/impl QML_IMPORT_NAME = QtQuick.Controls.Universal.impl -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui qml-private quick-private quicktemplates2-private quickcontrols2impl-private diff --git a/src/imports/controls/universal/qmldir b/src/imports/controls/universal/qmldir index e2faf020..5891244a 100644 --- a/src/imports/controls/universal/qmldir +++ b/src/imports/controls/universal/qmldir @@ -63,3 +63,54 @@ SplitView 2.13 SplitView.qml # QtQuick.Controls 2.15 (new types in Qt 5.15) HorizontalHeaderView 2.15 HorizontalHeaderView.qml VerticalHeaderView 2.15 VerticalHeaderView.qml + +# Make sure we have types registered for Qt 6: QTBUG-85774, QTBUG-85685 +ApplicationWindow 6.0 ApplicationWindow.qml +BusyIndicator 6.0 BusyIndicator.qml +Button 6.0 Button.qml +CheckBox 6.0 CheckBox.qml +CheckDelegate 6.0 CheckDelegate.qml +ComboBox 6.0 ComboBox.qml +DelayButton 6.0 DelayButton.qml +Dial 6.0 Dial.qml +Dialog 6.0 Dialog.qml +DialogButtonBox 6.0 DialogButtonBox.qml +Drawer 6.0 Drawer.qml +Frame 6.0 Frame.qml +GroupBox 6.0 GroupBox.qml +HorizontalHeaderView 6.0 HorizontalHeaderView.qml +ItemDelegate 6.0 ItemDelegate.qml +Label 6.0 Label.qml +Menu 6.0 Menu.qml +MenuBar 6.0 MenuBar.qml +MenuBarItem 6.0 MenuBarItem.qml +MenuItem 6.0 MenuItem.qml +MenuSeparator 6.0 MenuSeparator.qml +Page 6.0 Page.qml +PageIndicator 6.0 PageIndicator.qml +Pane 6.0 Pane.qml +Popup 6.0 Popup.qml +ProgressBar 6.0 ProgressBar.qml +RadioButton 6.0 RadioButton.qml +RadioDelegate 6.0 RadioDelegate.qml +RangeSlider 6.0 RangeSlider.qml +RoundButton 6.0 RoundButton.qml +ScrollBar 6.0 ScrollBar.qml +ScrollIndicator 6.0 ScrollIndicator.qml +Slider 6.0 Slider.qml +SpinBox 6.0 SpinBox.qml +SplitView 6.0 SplitView.qml +StackView 6.0 StackView.qml +SwipeDelegate 6.0 SwipeDelegate.qml +Switch 6.0 Switch.qml +SwitchDelegate 6.0 SwitchDelegate.qml +TabBar 6.0 TabBar.qml +TabButton 6.0 TabButton.qml +TextArea 6.0 TextArea.qml +TextField 6.0 TextField.qml +ToolBar 6.0 ToolBar.qml +ToolButton 6.0 ToolButton.qml +ToolSeparator 6.0 ToolSeparator.qml +ToolTip 6.0 ToolTip.qml +Tumbler 6.0 Tumbler.qml +VerticalHeaderView 6.0 VerticalHeaderView.qml diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index f41e37b7..a8b98fa7 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -2,7 +2,7 @@ TARGET = qtquickcontrols2universalstyleplugin TARGETPATH = QtQuick/Controls/Universal QML_IMPORT_NAME = QtQuick.Controls.Universal -QML_IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private diff --git a/src/imports/controlsimpl/controlsimpl.pro b/src/imports/controlsimpl/controlsimpl.pro index 89d4e1bd..ed629ce9 100644 --- a/src/imports/controlsimpl/controlsimpl.pro +++ b/src/imports/controlsimpl/controlsimpl.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2implplugin TARGETPATH = QtQuick/Controls/impl -IMPORT_VERSION = 2.$$QT_MINOR_VERSION +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private quickcontrols2impl-private diff --git a/src/imports/templates/templates.pro b/src/imports/templates/templates.pro index 72e32c47..52e4d03a 100644 --- a/src/imports/templates/templates.pro +++ b/src/imports/templates/templates.pro @@ -1,6 +1,6 @@ TARGET = qtquicktemplates2plugin TARGETPATH = QtQuick/Templates -IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private diff --git a/src/quickcontrols2/quickcontrols2.pro b/src/quickcontrols2/quickcontrols2.pro index 8c2f9cba..686eed7b 100644 --- a/src/quickcontrols2/quickcontrols2.pro +++ b/src/quickcontrols2/quickcontrols2.pro @@ -19,7 +19,7 @@ SOURCES += \ QMLTYPES_FILENAME = plugins.qmltypes QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls QML_IMPORT_NAME = QtQuick.Controls -QML_IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION CONFIG += qmltypes install_qmltypes install_metatypes load(qt_module) diff --git a/src/quickcontrols2impl/quickcontrols2impl.pro b/src/quickcontrols2impl/quickcontrols2impl.pro index 7a7d2862..da5e804f 100644 --- a/src/quickcontrols2impl/quickcontrols2impl.pro +++ b/src/quickcontrols2impl/quickcontrols2impl.pro @@ -48,7 +48,7 @@ qtConfig(quick-listview):qtConfig(quick-pathview) { QMLTYPES_FILENAME = plugins.qmltypes QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Controls/impl QML_IMPORT_NAME = QtQuick.Controls.impl -QML_IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION CONFIG += qmltypes install_qmltypes install_metatypes load(qt_module) diff --git a/src/quicktemplates2/quicktemplates2.pro b/src/quicktemplates2/quicktemplates2.pro index 3567923e..06fa0ee7 100644 --- a/src/quicktemplates2/quicktemplates2.pro +++ b/src/quicktemplates2/quicktemplates2.pro @@ -16,5 +16,5 @@ load(qt_module) QMLTYPES_FILENAME = plugins.qmltypes QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Templates QML_IMPORT_NAME = QtQuick.Templates -QML_IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION CONFIG += qmltypes install_qmltypes install_metatypes -- cgit v1.2.3 From b47e26d29db05ecf87f74815e37e0bf7394d06ba Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 10 Aug 2020 16:25:26 +0200 Subject: Register QQuickDummyType as anonymous type This way we get to declare a QML_ADDED_IN_VERSION. This is necessary for version 2.x of the module to be found when version 6.x is registered. Task-number: QTBUG-85151 Change-Id: Ia156763ffa2ecc6a35f0421c68df85fba646cec7 Reviewed-by: Ulf Hermann --- src/quickcontrols2/qquickdummyregistration_p.h | 67 ++++++++++++++++++++++++++ src/quickcontrols2/quickcontrols2.pro | 1 + 2 files changed, 68 insertions(+) create mode 100644 src/quickcontrols2/qquickdummyregistration_p.h (limited to 'src') diff --git a/src/quickcontrols2/qquickdummyregistration_p.h b/src/quickcontrols2/qquickdummyregistration_p.h new file mode 100644 index 00000000..4d7fe5e4 --- /dev/null +++ b/src/quickcontrols2/qquickdummyregistration_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKDUMMYREGISTRATION_H +#define QQUICKDUMMYREGISTRATION_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +// QtQuick.Controls has no types, so if we didn't have this dummy type, +// we'd have no way of specifying the version when the module was added, +// and 6.0 would be the only version that gets registered: QTBUG-85151 +struct QQuickDummyType +{ + Q_GADGET + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) +}; + +QT_END_NAMESPACE + +#endif // QQUICKDUMMYREGISTRATION_H diff --git a/src/quickcontrols2/quickcontrols2.pro b/src/quickcontrols2/quickcontrols2.pro index 686eed7b..5383f8d8 100644 --- a/src/quickcontrols2/quickcontrols2.pro +++ b/src/quickcontrols2/quickcontrols2.pro @@ -8,6 +8,7 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII HEADERS += \ $$PWD/qtquickcontrols2global.h \ + $$PWD/qquickdummyregistration_p.h \ $$PWD/qquickstyle.h \ $$PWD/qquickstyle_p.h \ $$PWD/qquickstyleplugin_p.h -- cgit v1.2.3 From 80c5d0841e6f7c0c9aedfdc01b5d060ab2f66b7d Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 11 Aug 2020 11:57:24 +0200 Subject: Fix CMake build Task-number: QTBUG-82922 Change-Id: I75f4a553a6bb260f77bfa791f12fa42e80131e09 Reviewed-by: Fabian Kosmale --- src/CMakeLists.txt | 1 + src/imports/.prev_CMakeLists.txt | 8 +- src/imports/CMakeLists.txt | 7 + src/imports/controls/.prev_CMakeLists.txt | 115 +------- src/imports/controls/CMakeLists.txt | 283 +------------------ src/imports/controls/default/.prev_CMakeLists.txt | 308 +++++++++++++++++++++ src/imports/controls/default/CMakeLists.txt | 308 +++++++++++++++++++++ src/imports/controls/default/impl/CMakeLists.txt | 44 +++ src/imports/controls/fusion/.prev_CMakeLists.txt | 172 ++++++++++-- src/imports/controls/fusion/CMakeLists.txt | 135 ++++----- src/imports/controls/fusion/impl/CMakeLists.txt | 73 +++++ src/imports/controls/imagine/.prev_CMakeLists.txt | 119 ++++---- src/imports/controls/imagine/CMakeLists.txt | 119 ++++---- src/imports/controls/imagine/impl/CMakeLists.txt | 67 +++++ src/imports/controls/material/.prev_CMakeLists.txt | 181 ++++++++++-- src/imports/controls/material/CMakeLists.txt | 148 ++++------ src/imports/controls/material/impl/CMakeLists.txt | 81 ++++++ .../controls/universal/.prev_CMakeLists.txt | 173 +++++++++++- src/imports/controls/universal/CMakeLists.txt | 126 ++++----- src/imports/controls/universal/impl/CMakeLists.txt | 61 ++++ src/imports/controlsimpl/.prev_CMakeLists.txt | 37 +++ src/imports/controlsimpl/CMakeLists.txt | 37 +++ src/imports/platform/CMakeLists.txt | 4 +- src/imports/templates/.prev_CMakeLists.txt | 35 +++ src/imports/templates/CMakeLists.txt | 5 +- src/quickcontrols2/CMakeLists.txt | 38 +-- src/quickcontrols2impl/CMakeLists.txt | 64 +++++ src/quicktemplates2/CMakeLists.txt | 15 + 28 files changed, 1928 insertions(+), 836 deletions(-) create mode 100644 src/imports/controls/default/.prev_CMakeLists.txt create mode 100644 src/imports/controls/default/CMakeLists.txt create mode 100644 src/imports/controls/default/impl/CMakeLists.txt create mode 100644 src/imports/controls/fusion/impl/CMakeLists.txt create mode 100644 src/imports/controls/imagine/impl/CMakeLists.txt create mode 100644 src/imports/controls/material/impl/CMakeLists.txt create mode 100644 src/imports/controls/universal/impl/CMakeLists.txt create mode 100644 src/imports/controlsimpl/.prev_CMakeLists.txt create mode 100644 src/imports/controlsimpl/CMakeLists.txt create mode 100644 src/imports/templates/.prev_CMakeLists.txt create mode 100644 src/quickcontrols2impl/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c0dd97b..4ad5f89b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,4 +2,5 @@ add_subdirectory(quicktemplates2) add_subdirectory(quickcontrols2) +add_subdirectory(quickcontrols2impl) add_subdirectory(imports) diff --git a/src/imports/.prev_CMakeLists.txt b/src/imports/.prev_CMakeLists.txt index 9bec7cd4..473471c2 100644 --- a/src/imports/.prev_CMakeLists.txt +++ b/src/imports/.prev_CMakeLists.txt @@ -1,10 +1,16 @@ # Generated from imports.pro. add_subdirectory(controls) -add_subdirectory(calendar) +add_subdirectory(controlsimpl) add_subdirectory(platform) add_subdirectory(templates) +add_subdirectory(controls/default) +add_subdirectory(controls/default/impl) add_subdirectory(controls/fusion) +add_subdirectory(controls/fusion/impl) add_subdirectory(controls/imagine) +add_subdirectory(controls/imagine/impl) add_subdirectory(controls/material) +add_subdirectory(controls/material/impl) add_subdirectory(controls/universal) +add_subdirectory(controls/universal/impl) diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt index 46b803f7..473471c2 100644 --- a/src/imports/CMakeLists.txt +++ b/src/imports/CMakeLists.txt @@ -1,9 +1,16 @@ # Generated from imports.pro. add_subdirectory(controls) +add_subdirectory(controlsimpl) add_subdirectory(platform) add_subdirectory(templates) +add_subdirectory(controls/default) +add_subdirectory(controls/default/impl) add_subdirectory(controls/fusion) +add_subdirectory(controls/fusion/impl) add_subdirectory(controls/imagine) +add_subdirectory(controls/imagine/impl) add_subdirectory(controls/material) +add_subdirectory(controls/material/impl) add_subdirectory(controls/universal) +add_subdirectory(controls/universal/impl) diff --git a/src/imports/controls/.prev_CMakeLists.txt b/src/imports/controls/.prev_CMakeLists.txt index a8f8da6b..ca2ddb43 100644 --- a/src/imports/controls/.prev_CMakeLists.txt +++ b/src/imports/controls/.prev_CMakeLists.txt @@ -4,21 +4,17 @@ ## qtquickcontrols2plugin Plugin: ##################################################################### -add_qml_module(qtquickcontrols2plugin - TARGET_PATH "QtQuick/Controls" +qt_add_qml_module(qtquickcontrols2plugin URI "QtQuick.Controls" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "${CMAKE_PROJECT_VERSION}" DESIGNER_SUPPORTED CLASSNAME QtQuickControls2Plugin DEPENDENCIES QtQuick.Templates/2.5 SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.impl/auto SOURCES - qquickdefaultbusyindicator.cpp qquickdefaultbusyindicator_p.h - qquickdefaultdial.cpp qquickdefaultdial_p.h - qquickdefaultprogressbar.cpp qquickdefaultprogressbar_p.h - qquickdefaultstyle.cpp qquickdefaultstyle_p.h - qquickdefaulttheme.cpp qquickdefaulttheme_p.h qtquickcontrols2plugin.cpp DEFINES QT_NO_CAST_FROM_ASCII @@ -27,6 +23,7 @@ add_qml_module(qtquickcontrols2plugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -37,110 +34,14 @@ add_qml_module(qtquickcontrols2plugin Qt::Quick ) -# Resources: -set(qtquickcontrols2plugin_resource_files - "images/arrow-indicator.png" - "images/arrow-indicator@2x.png" - "images/arrow-indicator@3x.png" - "images/arrow-indicator@4x.png" - "images/check.png" - "images/check@2x.png" - "images/check@3x.png" - "images/check@4x.png" - "images/dial-indicator.png" - "images/dial-indicator@2x.png" - "images/dial-indicator@3x.png" - "images/dial-indicator@4x.png" - "images/double-arrow.png" - "images/double-arrow@2x.png" - "images/double-arrow@3x.png" - "images/double-arrow@4x.png" - "images/drop-indicator.png" - "images/drop-indicator@2x.png" - "images/drop-indicator@3x.png" - "images/drop-indicator@4x.png" -) - -add_qt_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" - PREFIX - "/qt-project.org/imports/QtQuick/Controls" - FILES - ${qtquickcontrols2plugin_resource_files} -) - - #### Keys ignored in scope 1:.:.:controls.pro:: -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" "$$QML_FILES" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/calendar/*.qdoc" "$$PWD/src/templates/*.qdoc" +# OTHER_FILES = "qmldir" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/templates/*.qdoc" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls" -# _REQUIREMENTS = "qtConfig(quickcontrols2-default)" ## Scopes: ##################################################################### - -set(qml_files - "AbstractButton.qml" - "Action.qml" - "ActionGroup.qml" - "ApplicationWindow.qml" - "BusyIndicator.qml" - "Button.qml" - "ButtonGroup.qml" - "CheckBox.qml" - "CheckDelegate.qml" - "ComboBox.qml" - "Container.qml" - "Control.qml" - "DelayButton.qml" - "Dial.qml" - "Dialog.qml" - "DialogButtonBox.qml" - "Drawer.qml" - "Frame.qml" - "GroupBox.qml" - "ItemDelegate.qml" - "Label.qml" - "Menu.qml" - "MenuBar.qml" - "MenuBarItem.qml" - "MenuItem.qml" - "MenuSeparator.qml" - "Page.qml" - "PageIndicator.qml" - "Pane.qml" - "Popup.qml" - "ProgressBar.qml" - "RadioButton.qml" - "RadioDelegate.qml" - "RangeSlider.qml" - "RoundButton.qml" - "ScrollBar.qml" - "ScrollIndicator.qml" - "ScrollView.qml" - "Slider.qml" - "SpinBox.qml" - "SplitView.qml" - "StackView.qml" - "SwipeDelegate.qml" - "Switch.qml" - "SwitchDelegate.qml" - "SwipeView.qml" - "TabBar.qml" - "TabButton.qml" - "TextArea.qml" - "TextField.qml" - "ToolBar.qml" - "ToolButton.qml" - "ToolSeparator.qml" - "ToolTip.qml" - "Tumbler.qml" -) - -qt6_target_qml_files(qtquickcontrols2plugin - FILES - ${qml_files} -) -add_qt_docs(qtquickcontrols2plugin +qt_add_docs(qtquickcontrols2plugin doc/qtquickcontrols.qdocconf ) diff --git a/src/imports/controls/CMakeLists.txt b/src/imports/controls/CMakeLists.txt index 567de0fd..4e48373e 100644 --- a/src/imports/controls/CMakeLists.txt +++ b/src/imports/controls/CMakeLists.txt @@ -7,18 +7,15 @@ qt_add_qml_module(qtquickcontrols2plugin TARGET_PATH "QtQuick/Controls" URI "QtQuick.Controls" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case DESIGNER_SUPPORTED CLASSNAME QtQuickControls2Plugin DEPENDENCIES QtQuick.Templates/2.5 SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.impl/auto SOURCES - qquickdefaultbusyindicator.cpp qquickdefaultbusyindicator_p.h - qquickdefaultdial.cpp qquickdefaultdial_p.h - qquickdefaultprogressbar.cpp qquickdefaultprogressbar_p.h - qquickdefaultstyle.cpp qquickdefaultstyle_p.h - qquickdefaulttheme.cpp qquickdefaulttheme_p.h qtquickcontrols2plugin.cpp DEFINES QT_NO_CAST_FROM_ASCII @@ -27,6 +24,7 @@ qt_add_qml_module(qtquickcontrols2plugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -37,282 +35,13 @@ qt_add_qml_module(qtquickcontrols2plugin Qt::Quick ) -# Resources: -set(qtquickcontrols2plugin_resource_files - "images/arrow-indicator.png" - "images/arrow-indicator@2x.png" - "images/arrow-indicator@3x.png" - "images/arrow-indicator@4x.png" - "images/check.png" - "images/check@2x.png" - "images/check@3x.png" - "images/check@4x.png" - "images/dial-indicator.png" - "images/dial-indicator@2x.png" - "images/dial-indicator@3x.png" - "images/dial-indicator@4x.png" - "images/double-arrow.png" - "images/double-arrow@2x.png" - "images/double-arrow@3x.png" - "images/double-arrow@4x.png" - "images/drop-indicator.png" - "images/drop-indicator@2x.png" - "images/drop-indicator@3x.png" - "images/drop-indicator@4x.png" -) - -qt_add_resource(qtquickcontrols2plugin "qtquickcontrols2plugin" - PREFIX - "/qt-project.org/imports/QtQuick/Controls" - FILES - ${qtquickcontrols2plugin_resource_files} -) - - #### Keys ignored in scope 1:.:.:controls.pro:: -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" "$$QML_FILES" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/templates/*.qdoc" +# OTHER_FILES = "qmldir" "$$PWD/snippets/*.qml" "$$PWD/src/*.qdoc" "$$PWD/src/templates/*.qdoc" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls" -# _REQUIREMENTS = "qtConfig(quickcontrols2-default)" ## Scopes: ##################################################################### - -set(qml_files - "AbstractButton.qml" - "Action.qml" - "ActionGroup.qml" - "ApplicationWindow.qml" - "BusyIndicator.qml" - "Button.qml" - "ButtonGroup.qml" - "CheckBox.qml" - "CheckDelegate.qml" - "ComboBox.qml" - "Container.qml" - "Control.qml" - "DelayButton.qml" - "Dial.qml" - "Dialog.qml" - "DialogButtonBox.qml" - "Drawer.qml" - "Frame.qml" - "GroupBox.qml" - "HorizontalHeaderView.qml" - "ItemDelegate.qml" - "Label.qml" - "Menu.qml" - "MenuBar.qml" - "MenuBarItem.qml" - "MenuItem.qml" - "MenuSeparator.qml" - "Page.qml" - "PageIndicator.qml" - "Pane.qml" - "Popup.qml" - "ProgressBar.qml" - "RadioButton.qml" - "RadioDelegate.qml" - "RangeSlider.qml" - "RoundButton.qml" - "ScrollBar.qml" - "ScrollIndicator.qml" - "ScrollView.qml" - "Slider.qml" - "SpinBox.qml" - "SplitView.qml" - "StackView.qml" - "SwipeDelegate.qml" - "Switch.qml" - "SwitchDelegate.qml" - "SwipeView.qml" - "TabBar.qml" - "TabButton.qml" - "TextArea.qml" - "TextField.qml" - "ToolBar.qml" - "ToolButton.qml" - "ToolSeparator.qml" - "ToolTip.qml" - "Tumbler.qml" - "VerticalHeaderView.qml" -) -set_source_files_properties(AbstractButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Action.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ActionGroup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ButtonGroup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Container.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Control.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(MenuBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(MenuBarItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ScrollView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(StackView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwipeView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) - -qt6_target_qml_files(qtquickcontrols2plugin - FILES - ${qml_files} -) qt_add_docs(qtquickcontrols2plugin doc/qtquickcontrols.qdocconf ) diff --git a/src/imports/controls/default/.prev_CMakeLists.txt b/src/imports/controls/default/.prev_CMakeLists.txt new file mode 100644 index 00000000..608f81b6 --- /dev/null +++ b/src/imports/controls/default/.prev_CMakeLists.txt @@ -0,0 +1,308 @@ +# Generated from default.pro. + +##################################################################### +## qtquickcontrols2defaultstyleplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2defaultstyleplugin + URI "QtQuick.Controls.Default" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2DefaultStylePlugin + DEPENDENCIES + QtQuick.Controls/2.5 + GENERATE_QMLTYPES + SOURCES + qquickdefaultstyle.cpp qquickdefaultstyle_p.h + qquickdefaulttheme.cpp qquickdefaulttheme_p.h + qtquickcontrols2defaultstyleplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickControls2Private + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(qtquickcontrols2defaultstyleplugin_resource_files + "images/arrow-indicator.png" + "images/arrow-indicator@2x.png" + "images/arrow-indicator@3x.png" + "images/arrow-indicator@4x.png" + "images/check.png" + "images/check@2x.png" + "images/check@3x.png" + "images/check@4x.png" + "images/dial-indicator.png" + "images/dial-indicator@2x.png" + "images/dial-indicator@3x.png" + "images/dial-indicator@4x.png" + "images/double-arrow.png" + "images/double-arrow@2x.png" + "images/double-arrow@3x.png" + "images/double-arrow@4x.png" + "images/drop-indicator.png" + "images/drop-indicator@2x.png" + "images/drop-indicator@3x.png" + "images/drop-indicator@4x.png" +) + +qt_add_resource(qtquickcontrols2defaultstyleplugin "qtquickcontrols2defaultstyleplugin" + PREFIX + "/qt-project.org/imports/QtQuick/Controls/Default" + FILES + ${qtquickcontrols2defaultstyleplugin_resource_files} +) + + +#### Keys ignored in scope 1:.:.:default.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Default" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# TARGETPATH = "QtQuick/Controls/Default" +# _REQUIREMENTS = "qtConfig(quickcontrols2-default)" + +set(qml_files + "AbstractButton.qml" + "Action.qml" + "ActionGroup.qml" + "ApplicationWindow.qml" + "BusyIndicator.qml" + "Button.qml" + "ButtonGroup.qml" + "CheckBox.qml" + "CheckDelegate.qml" + "ComboBox.qml" + "Container.qml" + "Control.qml" + "DelayButton.qml" + "Dial.qml" + "Dialog.qml" + "DialogButtonBox.qml" + "Drawer.qml" + "Frame.qml" + "GroupBox.qml" + "HorizontalHeaderView.qml" + "ItemDelegate.qml" + "Label.qml" + "Menu.qml" + "MenuBar.qml" + "MenuBarItem.qml" + "MenuItem.qml" + "MenuSeparator.qml" + "Page.qml" + "PageIndicator.qml" + "Pane.qml" + "Popup.qml" + "ProgressBar.qml" + "RadioButton.qml" + "RadioDelegate.qml" + "RangeSlider.qml" + "RoundButton.qml" + "ScrollBar.qml" + "ScrollIndicator.qml" + "ScrollView.qml" + "Slider.qml" + "SpinBox.qml" + "SplitView.qml" + "StackView.qml" + "SwipeDelegate.qml" + "Switch.qml" + "SwitchDelegate.qml" + "SwipeView.qml" + "TabBar.qml" + "TabButton.qml" + "TextArea.qml" + "TextField.qml" + "ToolBar.qml" + "ToolButton.qml" + "ToolSeparator.qml" + "ToolTip.qml" + "Tumbler.qml" + "VerticalHeaderView.qml" +) +set_source_files_properties(AbstractButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Action.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(ActionGroup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(ApplicationWindow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(BusyIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Button.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ButtonGroup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ComboBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Container.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Control.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(DelayButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Dial.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Dialog.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(DialogButtonBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Drawer.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Frame.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(GroupBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(HorizontalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) +set_source_files_properties(ItemDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Label.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Menu.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuBarItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Page.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(PageIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Pane.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Popup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ProgressBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RangeSlider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RoundButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ScrollBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Slider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SpinBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SplitView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.13;6.0" +) +set_source_files_properties(StackView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Switch.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwitchDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextArea.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextField.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ToolTip.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Tumbler.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(VerticalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) + +qt6_target_qml_files(qtquickcontrols2defaultstyleplugin + FILES + ${qml_files} +) diff --git a/src/imports/controls/default/CMakeLists.txt b/src/imports/controls/default/CMakeLists.txt new file mode 100644 index 00000000..336d04c9 --- /dev/null +++ b/src/imports/controls/default/CMakeLists.txt @@ -0,0 +1,308 @@ +# Generated from default.pro. + +##################################################################### +## qtquickcontrols2defaultstyleplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2defaultstyleplugin + URI "QtQuick.Controls.Default" + VERSION "6.0" # special case + CLASSNAME QtQuickControls2DefaultStylePlugin + DEPENDENCIES + QtQuick.Controls/2.5 + GENERATE_QMLTYPES + SOURCES + qquickdefaultstyle.cpp qquickdefaultstyle_p.h + qquickdefaulttheme.cpp qquickdefaulttheme_p.h + qtquickcontrols2defaultstyleplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickControls2Private + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(qtquickcontrols2defaultstyleplugin_resource_files + "images/arrow-indicator.png" + "images/arrow-indicator@2x.png" + "images/arrow-indicator@3x.png" + "images/arrow-indicator@4x.png" + "images/check.png" + "images/check@2x.png" + "images/check@3x.png" + "images/check@4x.png" + "images/dial-indicator.png" + "images/dial-indicator@2x.png" + "images/dial-indicator@3x.png" + "images/dial-indicator@4x.png" + "images/double-arrow.png" + "images/double-arrow@2x.png" + "images/double-arrow@3x.png" + "images/double-arrow@4x.png" + "images/drop-indicator.png" + "images/drop-indicator@2x.png" + "images/drop-indicator@3x.png" + "images/drop-indicator@4x.png" +) + +qt_add_resource(qtquickcontrols2defaultstyleplugin "qtquickcontrols2defaultstyleplugin" + PREFIX + "/qt-project.org/imports/QtQuick/Controls/Default" + FILES + ${qtquickcontrols2defaultstyleplugin_resource_files} +) + + +#### Keys ignored in scope 1:.:.:default.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Default" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# TARGETPATH = "QtQuick/Controls/Default" +# _REQUIREMENTS = "qtConfig(quickcontrols2-default)" + +set(qml_files + "AbstractButton.qml" + "Action.qml" + "ActionGroup.qml" + "ApplicationWindow.qml" + "BusyIndicator.qml" + "Button.qml" + "ButtonGroup.qml" + "CheckBox.qml" + "CheckDelegate.qml" + "ComboBox.qml" + "Container.qml" + "Control.qml" + "DelayButton.qml" + "Dial.qml" + "Dialog.qml" + "DialogButtonBox.qml" + "Drawer.qml" + "Frame.qml" + "GroupBox.qml" + "HorizontalHeaderView.qml" + "ItemDelegate.qml" + "Label.qml" + "Menu.qml" + "MenuBar.qml" + "MenuBarItem.qml" + "MenuItem.qml" + "MenuSeparator.qml" + "Page.qml" + "PageIndicator.qml" + "Pane.qml" + "Popup.qml" + "ProgressBar.qml" + "RadioButton.qml" + "RadioDelegate.qml" + "RangeSlider.qml" + "RoundButton.qml" + "ScrollBar.qml" + "ScrollIndicator.qml" + "ScrollView.qml" + "Slider.qml" + "SpinBox.qml" + "SplitView.qml" + "StackView.qml" + "SwipeDelegate.qml" + "Switch.qml" + "SwitchDelegate.qml" + "SwipeView.qml" + "TabBar.qml" + "TabButton.qml" + "TextArea.qml" + "TextField.qml" + "ToolBar.qml" + "ToolButton.qml" + "ToolSeparator.qml" + "ToolTip.qml" + "Tumbler.qml" + "VerticalHeaderView.qml" +) +set_source_files_properties(AbstractButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Action.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(ActionGroup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(ApplicationWindow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(BusyIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Button.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ButtonGroup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ComboBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Container.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Control.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(DelayButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Dial.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Dialog.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(DialogButtonBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Drawer.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Frame.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(GroupBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(HorizontalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) +set_source_files_properties(ItemDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Label.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Menu.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuBarItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Page.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(PageIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Pane.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Popup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ProgressBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RangeSlider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RoundButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ScrollBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Slider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SpinBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SplitView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.13;6.0" +) +set_source_files_properties(StackView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Switch.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwitchDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextArea.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextField.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ToolTip.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Tumbler.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(VerticalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) + +qt6_target_qml_files(qtquickcontrols2defaultstyleplugin + FILES + ${qml_files} +) diff --git a/src/imports/controls/default/impl/CMakeLists.txt b/src/imports/controls/default/impl/CMakeLists.txt new file mode 100644 index 00000000..d90ef86b --- /dev/null +++ b/src/imports/controls/default/impl/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from default-impl.pro. + +##################################################################### +## qtquickcontrols2defaultstyleimplplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2defaultstyleimplplugin + URI "QtQuick.Controls.Default.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2DefaultStyleImplPlugin + DEPENDENCIES + QtQuick.Templates/6.0 + QtQuick.Controls/6.0 + SKIP_TYPE_REGISTRATION + GENERATE_QMLTYPES + SOURCES + qquickdefaultbusyindicator.cpp qquickdefaultbusyindicator_p.h + qquickdefaultdial.cpp qquickdefaultdial_p.h + qquickdefaultprogressbar.cpp qquickdefaultprogressbar_p.h + qtquickcontrols2defaultstyleimplplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:default-impl.pro:: +# OTHER_FILES = "qmldir" +# QML_IMPORT_NAME = "QtQuick.Controls.Default.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# QT_FOR_CONFIG = "quickcontrols2-private" +# TARGETPATH = "QtQuick/Controls/Default/impl" +# _REQUIREMENTS = "qtConfig(quickcontrols2-default)" diff --git a/src/imports/controls/fusion/.prev_CMakeLists.txt b/src/imports/controls/fusion/.prev_CMakeLists.txt index 4c59e4f6..b9d5e58b 100644 --- a/src/imports/controls/fusion/.prev_CMakeLists.txt +++ b/src/imports/controls/fusion/.prev_CMakeLists.txt @@ -4,18 +4,14 @@ ## qtquickcontrols2fusionstyleplugin Plugin: ##################################################################### -add_qml_module(qtquickcontrols2fusionstyleplugin - TARGET_PATH "QtQuick/Controls/Fusion" +qt_add_qml_module(qtquickcontrols2fusionstyleplugin URI "QtQuick.Controls.Fusion" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QtQuickControls2FusionStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickfusionbusyindicator.cpp qquickfusionbusyindicator_p.h - qquickfusiondial.cpp qquickfusiondial_p.h - qquickfusionknob.cpp qquickfusionknob_p.h qquickfusionstyle.cpp qquickfusionstyle_p.h qquickfusiontheme.cpp qquickfusiontheme_p.h qtquickcontrols2fusionstyleplugin.cpp @@ -52,7 +48,7 @@ set(qtquickcontrols2fusionstyle_resource_files "images/progressmask@4x.png" ) -add_qt_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" +qt_add_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" PREFIX "/qt-project.org/imports/QtQuick/Controls/Fusion" FILES @@ -61,9 +57,9 @@ add_qt_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" #### Keys ignored in scope 1:.:.:fusion.pro:: -# IMPORT_NAME = "QtQuick.Controls.Fusion" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Fusion" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Fusion" # _REQUIREMENTS = "qtConfig(quickcontrols2-fusion)" @@ -71,10 +67,8 @@ set(qml_files "ApplicationWindow.qml" "BusyIndicator.qml" "Button.qml" - "ButtonPanel.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" "DelayButton.qml" "Dial.qml" @@ -83,6 +77,7 @@ set(qml_files "Drawer.qml" "Frame.qml" "GroupBox.qml" + "HorizontalHeaderView.qml" "ItemDelegate.qml" "Label.qml" "Menu.qml" @@ -97,19 +92,15 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" "ScrollBar.qml" "ScrollIndicator.qml" "Slider.qml" - "SliderGroove.qml" - "SliderHandle.qml" "SpinBox.qml" "SplitView.qml" "SwipeDelegate.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "Switch.qml" "TabBar.qml" "TabButton.qml" @@ -120,6 +111,151 @@ set(qml_files "ToolSeparator.qml" "ToolTip.qml" "Tumbler.qml" + "VerticalHeaderView.qml" +) +set_source_files_properties(ApplicationWindow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(BusyIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Button.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ComboBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(DelayButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Dial.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Dialog.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(DialogButtonBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Drawer.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Frame.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(GroupBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(HorizontalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) +set_source_files_properties(ItemDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Label.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Menu.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuBarItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Page.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(PageIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Pane.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Popup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ProgressBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RangeSlider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RoundButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ScrollBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Slider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SpinBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SplitView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.13;6.0" +) +set_source_files_properties(SwipeDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwitchDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Switch.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextArea.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextField.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ToolTip.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Tumbler.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(VerticalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2fusionstyleplugin diff --git a/src/imports/controls/fusion/CMakeLists.txt b/src/imports/controls/fusion/CMakeLists.txt index 5eb28d21..9d93aa89 100644 --- a/src/imports/controls/fusion/CMakeLists.txt +++ b/src/imports/controls/fusion/CMakeLists.txt @@ -7,15 +7,12 @@ qt_add_qml_module(qtquickcontrols2fusionstyleplugin TARGET_PATH "QtQuick/Controls/Fusion" URI "QtQuick.Controls.Fusion" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case CLASSNAME QtQuickControls2FusionStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickfusionbusyindicator.cpp qquickfusionbusyindicator_p.h - qquickfusiondial.cpp qquickfusiondial_p.h - qquickfusionknob.cpp qquickfusionknob_p.h qquickfusionstyle.cpp qquickfusionstyle_p.h qquickfusiontheme.cpp qquickfusiontheme_p.h qtquickcontrols2fusionstyleplugin.cpp @@ -61,9 +58,9 @@ qt_add_resource(qtquickcontrols2fusionstyleplugin "qtquickcontrols2fusionstyle" #### Keys ignored in scope 1:.:.:fusion.pro:: -# IMPORT_NAME = "QtQuick.Controls.Fusion" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Fusion" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Fusion" # _REQUIREMENTS = "qtConfig(quickcontrols2-fusion)" @@ -71,10 +68,8 @@ set(qml_files "ApplicationWindow.qml" "BusyIndicator.qml" "Button.qml" - "ButtonPanel.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" "DelayButton.qml" "Dial.qml" @@ -98,19 +93,15 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" "ScrollBar.qml" "ScrollIndicator.qml" "Slider.qml" - "SliderGroove.qml" - "SliderHandle.qml" "SpinBox.qml" "SplitView.qml" "SwipeDelegate.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "Switch.qml" "TabBar.qml" "TabButton.qml" @@ -124,166 +115,148 @@ set(qml_files "VerticalHeaderView.qml" ) set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ButtonPanel.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CheckIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.2;6.0" ) set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuBarItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RadioIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SliderGroove.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SliderHandle.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.13;6.0" ) set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwitchIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2fusionstyleplugin diff --git a/src/imports/controls/fusion/impl/CMakeLists.txt b/src/imports/controls/fusion/impl/CMakeLists.txt new file mode 100644 index 00000000..628c5f90 --- /dev/null +++ b/src/imports/controls/fusion/impl/CMakeLists.txt @@ -0,0 +1,73 @@ +# Generated from fusion-impl.pro. + +##################################################################### +## qtquickcontrols2fusionstyleimplplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2fusionstyleimplplugin + URI "QtQuick.Controls.Fusion.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2FusionStyleImpPlugin + GENERATE_QMLTYPES + SOURCES + qquickfusionbusyindicator.cpp qquickfusionbusyindicator_p.h + qquickfusiondial.cpp qquickfusiondial_p.h + qquickfusionknob.cpp qquickfusionknob_p.h + qtquickcontrols2fusionstyleimplplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:fusion-impl.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_FILES = "$$PWD/ButtonPanel.qml" "$$PWD/CheckIndicator.qml" "$$PWD/RadioIndicator.qml" "$$PWD/SliderGroove.qml" "$$PWD/SliderHandle.qml" "$$PWD/SwitchIndicator.qml" +# QML_IMPORT_NAME = "QtQuick.Controls.Fusion.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# QT_FOR_CONFIG = "quickcontrols2-private" +# TARGETPATH = "QtQuick/Controls/Fusion/impl" +# _REQUIREMENTS = "qtConfig(quickcontrols2-fusion)" + +set(qml_files + "ButtonPanel.qml" + "CheckIndicator.qml" + "RadioIndicator.qml" + "SliderGroove.qml" + "SliderHandle.qml" + "SwitchIndicator.qml" +) +set_source_files_properties(ButtonPanel.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) +set_source_files_properties(CheckIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) +set_source_files_properties(RadioIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) +set_source_files_properties(SliderGroove.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) +set_source_files_properties(SliderHandle.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) +set_source_files_properties(SwitchIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3" +) + +qt6_target_qml_files(qtquickcontrols2fusionstyleimplplugin + FILES + ${qml_files} +) diff --git a/src/imports/controls/imagine/.prev_CMakeLists.txt b/src/imports/controls/imagine/.prev_CMakeLists.txt index a7c0a59e..b1e1a959 100644 --- a/src/imports/controls/imagine/.prev_CMakeLists.txt +++ b/src/imports/controls/imagine/.prev_CMakeLists.txt @@ -5,18 +5,15 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2imaginestyleplugin - TARGET_PATH "QtQuick/Controls/Imagine" URI "QtQuick.Controls.Imagine" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QtQuickControls2ImagineStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickimageselector.cpp qquickimageselector_p.h qquickimaginestyle.cpp qquickimaginestyle_p.h qquickimaginetheme.cpp qquickimaginetheme_p.h - qquickninepatchimage.cpp qquickninepatchimage_p.h qtquickcontrols2imaginestyleplugin.cpp DEFINES QT_NO_CAST_FROM_ASCII @@ -25,6 +22,7 @@ qt_add_qml_module(qtquickcontrols2imaginestyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -49,9 +47,6 @@ endforeach() set(qmake_qtquickcontrols2imaginestyle_resource_files ${resource_glob_0} ${resource_glob_1} - "shaders/+glslcore/OpacityMask.frag" - "shaders/+qsb/OpacityMask.frag" - "shaders/OpacityMask.frag" ) qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imaginestyle" @@ -63,9 +58,9 @@ qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imagin #### Keys ignored in scope 1:.:.:imagine.pro:: -# IMPORT_NAME = "QtQuick.Controls.Imagine" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Imagine" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Imagine" # _REQUIREMENTS = "qtConfig(quickcontrols2-imagine)" @@ -89,7 +84,6 @@ set(qml_files "Menu.qml" "MenuItem.qml" "MenuSeparator.qml" - "OpacityMask.qml" "PageIndicator.qml" "Page.qml" "Pane.qml" @@ -121,151 +115,148 @@ set(qml_files "VerticalHeaderView.qml" ) set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.2;6.0" ) set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(OpacityMask.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.13;6.0" ) set_source_files_properties(StackView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2imaginestyleplugin diff --git a/src/imports/controls/imagine/CMakeLists.txt b/src/imports/controls/imagine/CMakeLists.txt index a7c0a59e..ce9b98cb 100644 --- a/src/imports/controls/imagine/CMakeLists.txt +++ b/src/imports/controls/imagine/CMakeLists.txt @@ -5,18 +5,15 @@ ##################################################################### qt_add_qml_module(qtquickcontrols2imaginestyleplugin - TARGET_PATH "QtQuick/Controls/Imagine" URI "QtQuick.Controls.Imagine" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case CLASSNAME QtQuickControls2ImagineStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickimageselector.cpp qquickimageselector_p.h qquickimaginestyle.cpp qquickimaginestyle_p.h qquickimaginetheme.cpp qquickimaginetheme_p.h - qquickninepatchimage.cpp qquickninepatchimage_p.h qtquickcontrols2imaginestyleplugin.cpp DEFINES QT_NO_CAST_FROM_ASCII @@ -25,6 +22,7 @@ qt_add_qml_module(qtquickcontrols2imaginestyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -49,9 +47,6 @@ endforeach() set(qmake_qtquickcontrols2imaginestyle_resource_files ${resource_glob_0} ${resource_glob_1} - "shaders/+glslcore/OpacityMask.frag" - "shaders/+qsb/OpacityMask.frag" - "shaders/OpacityMask.frag" ) qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imaginestyle" @@ -63,9 +58,9 @@ qt_add_resource(qtquickcontrols2imaginestyleplugin "qmake_qtquickcontrols2imagin #### Keys ignored in scope 1:.:.:imagine.pro:: -# IMPORT_NAME = "QtQuick.Controls.Imagine" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Imagine" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Imagine" # _REQUIREMENTS = "qtConfig(quickcontrols2-imagine)" @@ -89,7 +84,6 @@ set(qml_files "Menu.qml" "MenuItem.qml" "MenuSeparator.qml" - "OpacityMask.qml" "PageIndicator.qml" "Page.qml" "Pane.qml" @@ -121,151 +115,148 @@ set(qml_files "VerticalHeaderView.qml" ) set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.2;6.0" ) set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(OpacityMask.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.13;6.0" ) set_source_files_properties(StackView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2imaginestyleplugin diff --git a/src/imports/controls/imagine/impl/CMakeLists.txt b/src/imports/controls/imagine/impl/CMakeLists.txt new file mode 100644 index 00000000..a2e38302 --- /dev/null +++ b/src/imports/controls/imagine/impl/CMakeLists.txt @@ -0,0 +1,67 @@ +# Generated from imagine-impl.pro. + +##################################################################### +## qtquickcontrols2imaginestyleimplplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2imaginestyleimplplugin + URI "QtQuick.Controls.Imagine.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2ImagineStyleImplPlugin + GENERATE_QMLTYPES + SOURCES + qquickimageselector.cpp qquickimageselector_p.h + qquickninepatchimage.cpp qquickninepatchimage_p.h + qtquickcontrols2imaginestyleimplplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(qmake_qtquickcontrols2imaginestyleimpl_resource_files + "shaders/+glslcore/OpacityMask.frag" + "shaders/+qsb/OpacityMask.frag" + "shaders/OpacityMask.frag" +) + +qt_add_resource(qtquickcontrols2imaginestyleimplplugin "qmake_qtquickcontrols2imaginestyleimpl" + PREFIX + "qt-project.org/imports/QtQuick/Controls/Imagine/impl" + FILES + ${qmake_qtquickcontrols2imaginestyleimpl_resource_files} +) + + +#### Keys ignored in scope 1:.:.:imagine-impl.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_FILES = "$$PWD/OpacityMask.qml" +# QML_IMPORT_NAME = "QtQuick.Controls.Imagine.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# QT_FOR_CONFIG = "quickcontrols2-private" +# TARGETPATH = "QtQuick/Controls/Imagine/impl" +# _REQUIREMENTS = "qtConfig(quickcontrols2-imagine)" + +set(qml_files + "OpacityMask.qml" +) +set_source_files_properties(OpacityMask.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) + +qt6_target_qml_files(qtquickcontrols2imaginestyleimplplugin + FILES + ${qml_files} +) diff --git a/src/imports/controls/material/.prev_CMakeLists.txt b/src/imports/controls/material/.prev_CMakeLists.txt index 7039271f..123c89dc 100644 --- a/src/imports/controls/material/.prev_CMakeLists.txt +++ b/src/imports/controls/material/.prev_CMakeLists.txt @@ -4,18 +4,14 @@ ## qtquickcontrols2materialstyleplugin Plugin: ##################################################################### -add_qml_module(qtquickcontrols2materialstyleplugin - TARGET_PATH "QtQuick/Controls/Material" +qt_add_qml_module(qtquickcontrols2materialstyleplugin URI "QtQuick.Controls.Material" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QtQuickControls2MaterialStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickmaterialbusyindicator.cpp qquickmaterialbusyindicator_p.h - qquickmaterialprogressbar.cpp qquickmaterialprogressbar_p.h - qquickmaterialripple.cpp qquickmaterialripple_p.h qquickmaterialstyle.cpp qquickmaterialstyle_p.h qquickmaterialtheme.cpp qquickmaterialtheme_p.h qtquickcontrols2materialstyleplugin.cpp @@ -26,6 +22,7 @@ add_qml_module(qtquickcontrols2materialstyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -56,7 +53,7 @@ set(qtquickcontrols2materialstyleplugin_resource_files "shaders/RectangularGlow.frag" ) -add_qt_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialstyleplugin" +qt_add_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialstyleplugin" PREFIX "/qt-project.org/imports/QtQuick/Controls/Material" FILES @@ -65,30 +62,27 @@ add_qt_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialsty #### Keys ignored in scope 1:.:.:material.pro:: -# IMPORT_NAME = "QtQuick.Controls.Material" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Material" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Material" # _REQUIREMENTS = "qtConfig(quickcontrols2-material)" set(qml_files "ApplicationWindow.qml" - "BoxShadow.qml" "BusyIndicator.qml" "Button.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" - "CursorDelegate.qml" "DelayButton.qml" "Dial.qml" "Dialog.qml" "DialogButtonBox.qml" "Drawer.qml" - "ElevationEffect.qml" "Frame.qml" "GroupBox.qml" + "HorizontalHeaderView.qml" "ItemDelegate.qml" "Label.qml" "Menu.qml" @@ -103,14 +97,11 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" - "RectangularGlow.qml" "ScrollBar.qml" "ScrollIndicator.qml" "Slider.qml" - "SliderHandle.qml" "SpinBox.qml" "SplitView.qml" "StackView.qml" @@ -118,7 +109,6 @@ set(qml_files "SwipeView.qml" "Switch.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "TabBar.qml" "TabButton.qml" "TextArea.qml" @@ -128,6 +118,157 @@ set(qml_files "ToolSeparator.qml" "ToolTip.qml" "Tumbler.qml" + "VerticalHeaderView.qml" +) +set_source_files_properties(ApplicationWindow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(BusyIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Button.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ComboBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(DelayButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Dial.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Dialog.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(DialogButtonBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Drawer.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Frame.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(GroupBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(HorizontalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) +set_source_files_properties(ItemDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Label.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Menu.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuBarItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Page.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(PageIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Pane.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Popup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ProgressBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RangeSlider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RoundButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ScrollBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Slider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SpinBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SplitView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.13;6.0" +) +set_source_files_properties(StackView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Switch.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwitchDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextArea.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextField.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ToolTip.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Tumbler.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(VerticalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2materialstyleplugin diff --git a/src/imports/controls/material/CMakeLists.txt b/src/imports/controls/material/CMakeLists.txt index 8bcb9c5d..71030fe6 100644 --- a/src/imports/controls/material/CMakeLists.txt +++ b/src/imports/controls/material/CMakeLists.txt @@ -7,15 +7,12 @@ qt_add_qml_module(qtquickcontrols2materialstyleplugin TARGET_PATH "QtQuick/Controls/Material" URI "QtQuick.Controls.Material" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case CLASSNAME QtQuickControls2MaterialStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickmaterialbusyindicator.cpp qquickmaterialbusyindicator_p.h - qquickmaterialprogressbar.cpp qquickmaterialprogressbar_p.h - qquickmaterialripple.cpp qquickmaterialripple_p.h qquickmaterialstyle.cpp qquickmaterialstyle_p.h qquickmaterialtheme.cpp qquickmaterialtheme_p.h qtquickcontrols2materialstyleplugin.cpp @@ -26,6 +23,7 @@ qt_add_qml_module(qtquickcontrols2materialstyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -65,28 +63,24 @@ qt_add_resource(qtquickcontrols2materialstyleplugin "qtquickcontrols2materialsty #### Keys ignored in scope 1:.:.:material.pro:: -# IMPORT_NAME = "QtQuick.Controls.Material" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Material" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Material" # _REQUIREMENTS = "qtConfig(quickcontrols2-material)" set(qml_files "ApplicationWindow.qml" - "BoxShadow.qml" "BusyIndicator.qml" "Button.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" - "CursorDelegate.qml" "DelayButton.qml" "Dial.qml" "Dialog.qml" "DialogButtonBox.qml" "Drawer.qml" - "ElevationEffect.qml" "Frame.qml" "GroupBox.qml" "HorizontalHeaderView.qml" @@ -104,14 +98,11 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" - "RectangularGlow.qml" "ScrollBar.qml" "ScrollIndicator.qml" "Slider.qml" - "SliderHandle.qml" "SpinBox.qml" "SplitView.qml" "StackView.qml" @@ -119,7 +110,6 @@ set(qml_files "SwipeView.qml" "Switch.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "TabBar.qml" "TabButton.qml" "TextArea.qml" @@ -132,178 +122,154 @@ set(qml_files "VerticalHeaderView.qml" ) set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(BoxShadow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CheckIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CursorDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.2;6.0" ) set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(ElevationEffect.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuBarItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RadioIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RectangularGlow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SliderHandle.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.13;6.0" ) set_source_files_properties(StackView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwitchIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2materialstyleplugin diff --git a/src/imports/controls/material/impl/CMakeLists.txt b/src/imports/controls/material/impl/CMakeLists.txt new file mode 100644 index 00000000..bcb4f998 --- /dev/null +++ b/src/imports/controls/material/impl/CMakeLists.txt @@ -0,0 +1,81 @@ +# Generated from material-impl.pro. + +##################################################################### +## qtquickcontrols2materialstyleimplplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2materialstyleimplplugin + URI "QtQuick.Controls.Material.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2MaterialStyleImplPlugin + GENERATE_QMLTYPES + SOURCES + qquickmaterialbusyindicator.cpp qquickmaterialbusyindicator_p.h + qquickmaterialprogressbar.cpp qquickmaterialprogressbar_p.h + qquickmaterialripple.cpp qquickmaterialripple_p.h + qtquickcontrols2materialstyleimplplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:material-impl.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_FILES = "$$PWD/BoxShadow.qml" "$$PWD/CheckIndicator.qml" "$$PWD/CursorDelegate.qml" "$$PWD/ElevationEffect.qml" "$$PWD/RadioIndicator.qml" "$$PWD/RectangularGlow.qml" "$$PWD/SliderHandle.qml" "$$PWD/SwitchIndicator.qml" +# QML_IMPORT_NAME = "QtQuick.Controls.Material.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# QT_FOR_CONFIG = "quickcontrols2-private" +# TARGETPATH = "QtQuick/Controls/Material/impl" +# _REQUIREMENTS = "qtConfig(quickcontrols2-material)" + +set(qml_files + "BoxShadow.qml" + "CheckIndicator.qml" + "CursorDelegate.qml" + "ElevationEffect.qml" + "RadioIndicator.qml" + "RectangularGlow.qml" + "SliderHandle.qml" + "SwitchIndicator.qml" +) +set_source_files_properties(BoxShadow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(CheckIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(CursorDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(ElevationEffect.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(RadioIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(RectangularGlow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(SliderHandle.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(SwitchIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) + +qt6_target_qml_files(qtquickcontrols2materialstyleimplplugin + FILES + ${qml_files} +) diff --git a/src/imports/controls/universal/.prev_CMakeLists.txt b/src/imports/controls/universal/.prev_CMakeLists.txt index 45c15169..df0232e7 100644 --- a/src/imports/controls/universal/.prev_CMakeLists.txt +++ b/src/imports/controls/universal/.prev_CMakeLists.txt @@ -4,18 +4,14 @@ ## qtquickcontrols2universalstyleplugin Plugin: ##################################################################### -add_qml_module(qtquickcontrols2universalstyleplugin - TARGET_PATH "QtQuick/Controls/Universal" +qt_add_qml_module(qtquickcontrols2universalstyleplugin URI "QtQuick.Controls.Universal" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QtQuickControls2UniversalStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickuniversalbusyindicator.cpp qquickuniversalbusyindicator_p.h - qquickuniversalfocusrectangle.cpp qquickuniversalfocusrectangle_p.h - qquickuniversalprogressbar.cpp qquickuniversalprogressbar_p.h qquickuniversalstyle.cpp qquickuniversalstyle_p.h qquickuniversaltheme.cpp qquickuniversaltheme_p.h qtquickcontrols2universalstyleplugin.cpp @@ -26,6 +22,7 @@ add_qml_module(qtquickcontrols2universalstyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -56,7 +53,7 @@ set(qtquickcontrols2universalstyleplugin_resource_files "images/rightarrow@4x.png" ) -add_qt_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universalstyleplugin" +qt_add_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universalstyleplugin" PREFIX "/qt-project.org/imports/QtQuick/Controls/Universal" FILES @@ -65,9 +62,9 @@ add_qt_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universals #### Keys ignored in scope 1:.:.:universal.pro:: -# IMPORT_NAME = "QtQuick.Controls.Universal" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Universal" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Universal" # _REQUIREMENTS = "qtConfig(quickcontrols2-universal)" @@ -77,7 +74,6 @@ set(qml_files "Button.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" "DelayButton.qml" "Dial.qml" @@ -86,6 +82,7 @@ set(qml_files "Drawer.qml" "Frame.qml" "GroupBox.qml" + "HorizontalHeaderView.qml" "ItemDelegate.qml" "Label.qml" "Menu.qml" @@ -100,7 +97,6 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" "ScrollBar.qml" @@ -111,7 +107,6 @@ set(qml_files "StackView.qml" "SwipeDelegate.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "Switch.qml" "TabBar.qml" "TabButton.qml" @@ -122,6 +117,154 @@ set(qml_files "ToolSeparator.qml" "ToolTip.qml" "Tumbler.qml" + "VerticalHeaderView.qml" +) +set_source_files_properties(ApplicationWindow.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(BusyIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Button.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(CheckDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ComboBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(DelayButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.2;6.0" +) +set_source_files_properties(Dial.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Dialog.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(DialogButtonBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Drawer.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Frame.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(GroupBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(HorizontalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" +) +set_source_files_properties(ItemDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Label.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Menu.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuBarItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.3;6.0" +) +set_source_files_properties(MenuItem.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(MenuSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(Page.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(PageIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Pane.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Popup.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ProgressBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RadioDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RangeSlider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(RoundButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ScrollBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ScrollIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Slider.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SpinBox.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SplitView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.13;6.0" +) +set_source_files_properties(StackView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwipeDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(SwitchDelegate.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Switch.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TabButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextArea.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(TextField.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolBar.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolButton.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(ToolSeparator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.1;6.0" +) +set_source_files_properties(ToolTip.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(Tumbler.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0;6.0" +) +set_source_files_properties(VerticalHeaderView.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2universalstyleplugin diff --git a/src/imports/controls/universal/CMakeLists.txt b/src/imports/controls/universal/CMakeLists.txt index 53a3c9d0..f97a92e9 100644 --- a/src/imports/controls/universal/CMakeLists.txt +++ b/src/imports/controls/universal/CMakeLists.txt @@ -7,15 +7,12 @@ qt_add_qml_module(qtquickcontrols2universalstyleplugin TARGET_PATH "QtQuick/Controls/Universal" URI "QtQuick.Controls.Universal" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case CLASSNAME QtQuickControls2UniversalStylePlugin - DEPENDENCIES - QtQuick.Controls/2.5 - SKIP_TYPE_REGISTRATION + IMPORTS + QtQuick.Controls.Default/auto + GENERATE_QMLTYPES SOURCES - qquickuniversalbusyindicator.cpp qquickuniversalbusyindicator_p.h - qquickuniversalfocusrectangle.cpp qquickuniversalfocusrectangle_p.h - qquickuniversalprogressbar.cpp qquickuniversalprogressbar_p.h qquickuniversalstyle.cpp qquickuniversalstyle_p.h qquickuniversaltheme.cpp qquickuniversaltheme_p.h qtquickcontrols2universalstyleplugin.cpp @@ -26,6 +23,7 @@ qt_add_qml_module(qtquickcontrols2universalstyleplugin Qt::CorePrivate Qt::GuiPrivate Qt::QmlPrivate + Qt::QuickControls2ImplPrivate Qt::QuickControls2Private Qt::QuickPrivate Qt::QuickTemplates2Private @@ -65,9 +63,9 @@ qt_add_resource(qtquickcontrols2universalstyleplugin "qtquickcontrols2universals #### Keys ignored in scope 1:.:.:universal.pro:: -# IMPORT_NAME = "QtQuick.Controls.Universal" -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_IMPORT_NAME = "QtQuick.Controls.Universal" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Controls/Universal" # _REQUIREMENTS = "qtConfig(quickcontrols2-universal)" @@ -77,7 +75,6 @@ set(qml_files "Button.qml" "CheckBox.qml" "CheckDelegate.qml" - "CheckIndicator.qml" "ComboBox.qml" "DelayButton.qml" "Dial.qml" @@ -101,7 +98,6 @@ set(qml_files "ProgressBar.qml" "RadioButton.qml" "RadioDelegate.qml" - "RadioIndicator.qml" "RangeSlider.qml" "RoundButton.qml" "ScrollBar.qml" @@ -112,7 +108,6 @@ set(qml_files "StackView.qml" "SwipeDelegate.qml" "SwitchDelegate.qml" - "SwitchIndicator.qml" "Switch.qml" "TabBar.qml" "TabButton.qml" @@ -126,160 +121,151 @@ set(qml_files "VerticalHeaderView.qml" ) set_source_files_properties(ApplicationWindow.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(BusyIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Button.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(CheckDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(CheckIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ComboBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(DelayButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.2;6.0" ) set_source_files_properties(Dial.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Dialog.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(DialogButtonBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Drawer.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Frame.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(GroupBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(HorizontalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) set_source_files_properties(ItemDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Label.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Menu.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuBarItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.3;6.0" ) set_source_files_properties(MenuItem.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(MenuSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(Page.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(PageIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Pane.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Popup.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ProgressBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RadioDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(RadioIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RangeSlider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(RoundButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ScrollBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ScrollIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Slider.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SpinBox.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SplitView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.13;6.0" ) set_source_files_properties(StackView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwipeDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(SwitchDelegate.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE -) -set_source_files_properties(SwitchIndicator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Switch.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TabButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextArea.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(TextField.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolBar.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolButton.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(ToolSeparator.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.1;6.0" ) set_source_files_properties(ToolTip.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(Tumbler.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.0;6.0" ) set_source_files_properties(VerticalHeaderView.qml PROPERTIES - QT_QML_SKIP_QMLDIR_ENTRY TRUE + QT_QML_SOURCE_VERSION "2.15;6.0" ) qt6_target_qml_files(qtquickcontrols2universalstyleplugin diff --git a/src/imports/controls/universal/impl/CMakeLists.txt b/src/imports/controls/universal/impl/CMakeLists.txt new file mode 100644 index 00000000..6172b908 --- /dev/null +++ b/src/imports/controls/universal/impl/CMakeLists.txt @@ -0,0 +1,61 @@ +# Generated from universal-impl.pro. + +##################################################################### +## qtquickcontrols2universalstyleimplplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2universalstyleimplplugin + URI "QtQuick.Controls.Universal.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2UniversalStyleImplPlugin + GENERATE_QMLTYPES + SOURCES + qquickuniversalbusyindicator.cpp qquickuniversalbusyindicator_p.h + qquickuniversalfocusrectangle.cpp qquickuniversalfocusrectangle_p.h + qquickuniversalprogressbar.cpp qquickuniversalprogressbar_p.h + qtquickcontrols2universalstyleimplplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:universal-impl.pro:: +# OTHER_FILES = "qmldir" "$$QML_FILES" +# QML_FILES = "$$PWD/CheckIndicator.qml" "$$PWD/RadioIndicator.qml" "$$PWD/SwitchIndicator.qml" +# QML_IMPORT_NAME = "QtQuick.Controls.Universal.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# QT_FOR_CONFIG = "quickcontrols2-private" +# TARGETPATH = "QtQuick/Controls/Universal/impl" +# _REQUIREMENTS = "qtConfig(quickcontrols2-universal)" + +set(qml_files + "CheckIndicator.qml" + "RadioIndicator.qml" + "SwitchIndicator.qml" +) +set_source_files_properties(CheckIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(RadioIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) +set_source_files_properties(SwitchIndicator.qml PROPERTIES + QT_QML_SOURCE_VERSION "2.0" +) + +qt6_target_qml_files(qtquickcontrols2universalstyleimplplugin + FILES + ${qml_files} +) diff --git a/src/imports/controlsimpl/.prev_CMakeLists.txt b/src/imports/controlsimpl/.prev_CMakeLists.txt new file mode 100644 index 00000000..58f7ad8c --- /dev/null +++ b/src/imports/controlsimpl/.prev_CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from controlsimpl.pro. + +##################################################################### +## qtquickcontrols2implplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2implplugin + URI "QtQuick.Controls.impl" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickControls2ImplPlugin + DEPENDENCIES + QtQuick.Templates/2.5 + SKIP_TYPE_REGISTRATION + SOURCES + qtquickcontrols2implplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickControls2Private + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:controlsimpl.pro:: +# OTHER_FILES = "qmldir" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# TARGETPATH = "QtQuick/Controls/impl" diff --git a/src/imports/controlsimpl/CMakeLists.txt b/src/imports/controlsimpl/CMakeLists.txt new file mode 100644 index 00000000..7b65cccb --- /dev/null +++ b/src/imports/controlsimpl/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from controlsimpl.pro. + +##################################################################### +## qtquickcontrols2implplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcontrols2implplugin + URI "QtQuick.Controls.impl" + VERSION "6.0" # special case + CLASSNAME QtQuickControls2ImplPlugin + DEPENDENCIES + QtQuick.Templates/2.5 + SKIP_TYPE_REGISTRATION + SOURCES + qtquickcontrols2implplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickControls2ImplPrivate + Qt::QuickControls2Private + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:controlsimpl.pro:: +# OTHER_FILES = "qmldir" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# TARGETPATH = "QtQuick/Controls/impl" diff --git a/src/imports/platform/CMakeLists.txt b/src/imports/platform/CMakeLists.txt index b7ea06d3..0db2f60d 100644 --- a/src/imports/platform/CMakeLists.txt +++ b/src/imports/platform/CMakeLists.txt @@ -6,7 +6,7 @@ qt_add_qml_module(qtlabsplatformplugin URI "Qt.labs.platform" - VERSION "1.0" + VERSION "1.1" CLASSNAME QtLabsPlatformPlugin SKIP_TYPE_REGISTRATION SOURCES @@ -42,7 +42,7 @@ qt_add_qml_module(qtlabsplatformplugin ) #### Keys ignored in scope 1:.:.:platform.pro:: -# IMPORT_VERSION = "1.0" +# IMPORT_VERSION = "1.1" # OTHER_FILES = "qmldir" # TARGETPATH = "Qt/labs/platform" diff --git a/src/imports/templates/.prev_CMakeLists.txt b/src/imports/templates/.prev_CMakeLists.txt new file mode 100644 index 00000000..178906d7 --- /dev/null +++ b/src/imports/templates/.prev_CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from templates.pro. + +##################################################################### +## qtquicktemplates2plugin Plugin: +##################################################################### + +qt_add_qml_module(qtquicktemplates2plugin + URI "QtQuick.Templates" + VERSION "${CMAKE_PROJECT_VERSION}" + CLASSNAME QtQuickTemplates2Plugin + DEPENDENCIES + QtQuick.Window/2.2 + SKIP_TYPE_REGISTRATION + SOURCES + qtquicktemplates2plugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:templates.pro:: +# OTHER_FILES = "qmldir" +# QML_IMPORT_VERSION = "$$QT_VERSION" +# TARGETPATH = "QtQuick/Templates" diff --git a/src/imports/templates/CMakeLists.txt b/src/imports/templates/CMakeLists.txt index a1d95e94..f37f69a8 100644 --- a/src/imports/templates/CMakeLists.txt +++ b/src/imports/templates/CMakeLists.txt @@ -5,9 +5,8 @@ ##################################################################### qt_add_qml_module(qtquicktemplates2plugin - TARGET_PATH "QtQuick/Templates" URI "QtQuick.Templates" - VERSION "2.${CMAKE_PROJECT_VERSION_MINOR}" + VERSION "6.0" # special case CLASSNAME QtQuickTemplates2Plugin DEPENDENCIES QtQuick.Window/2.2 @@ -31,6 +30,6 @@ qt_add_qml_module(qtquicktemplates2plugin ) #### Keys ignored in scope 1:.:.:templates.pro:: -# IMPORT_VERSION = "2.$$QT_MINOR_VERSION" # OTHER_FILES = "qmldir" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Templates" diff --git a/src/quickcontrols2/CMakeLists.txt b/src/quickcontrols2/CMakeLists.txt index ec954c32..52e39cae 100644 --- a/src/quickcontrols2/CMakeLists.txt +++ b/src/quickcontrols2/CMakeLists.txt @@ -5,26 +5,12 @@ ##################################################################### qt_add_module(QuickControls2 + GENERATE_METATYPES SOURCES - qquickanimatednode.cpp qquickanimatednode_p.h - qquickattachedobject.cpp qquickattachedobject_p.h - qquickchecklabel.cpp qquickchecklabel_p.h - qquickclippedtext.cpp qquickclippedtext_p.h - qquickcolor.cpp qquickcolor_p.h - qquickcolorimage.cpp qquickcolorimage_p.h - qquickiconimage.cpp qquickiconimage_p.h - qquickiconimage_p_p.h - qquickiconlabel.cpp qquickiconlabel_p.h - qquickiconlabel_p_p.h - qquickitemgroup.cpp qquickitemgroup_p.h - qquickmnemoniclabel.cpp qquickmnemoniclabel_p.h - qquickpaddedrectangle.cpp qquickpaddedrectangle_p.h - qquickplaceholdertext.cpp qquickplaceholdertext_p.h + qquickdummyregistration_p.h qquickstyle.cpp qquickstyle.h qquickstyle_p.h qquickstyleplugin.cpp qquickstyleplugin_p.h - qquickstyleselector.cpp qquickstyleselector_p.h - qquickstyleselector_p_p.h - qtquickcontrols2global.h qtquickcontrols2global_p.h + qtquickcontrols2global.h DEFINES QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII @@ -42,11 +28,17 @@ qt_add_module(QuickControls2 #### Keys ignored in scope 1:.:.:quickcontrols2.pro:: # MODULE = "quickcontrols2" +# QMLTYPES_FILENAME = "plugins.qmltypes" +# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtQuick/Controls" +# QML_IMPORT_NAME = "QtQuick.Controls" +# QML_IMPORT_VERSION = "$$QT_VERSION" -## Scopes: -##################################################################### - -qt_extend_target(QuickControls2 CONDITION QT_FEATURE_quick_listview AND QT_FEATURE_quick_pathview - SOURCES - qquicktumblerview.cpp qquicktumblerview_p.h +set_target_properties(QuickControls2 PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION} + QT_QML_MODULE_URI QtQuick.Controls + QT_QMLTYPES_FILENAME plugins.qmltypes + QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtQuick/Controls" ) + +qt6_qml_type_registration(QuickControls2) diff --git a/src/quickcontrols2impl/CMakeLists.txt b/src/quickcontrols2impl/CMakeLists.txt new file mode 100644 index 00000000..48e3ab3d --- /dev/null +++ b/src/quickcontrols2impl/CMakeLists.txt @@ -0,0 +1,64 @@ +# Generated from quickcontrols2impl.pro. + +##################################################################### +## QuickControls2Impl Module: +##################################################################### + +qt_add_module(QuickControls2Impl + GENERATE_METATYPES + SOURCES + qquickanimatednode.cpp qquickanimatednode_p.h + qquickattachedobject.cpp qquickattachedobject_p.h + qquickchecklabel.cpp qquickchecklabel_p.h + qquickclippedtext.cpp qquickclippedtext_p.h + qquickcolor.cpp qquickcolor_p.h + qquickcolorimage.cpp qquickcolorimage_p.h + qquickiconimage.cpp qquickiconimage_p.h + qquickiconimage_p_p.h + qquickiconlabel.cpp qquickiconlabel_p.h + qquickiconlabel_p_p.h + qquickitemgroup.cpp qquickitemgroup_p.h + qquickmnemoniclabel.cpp qquickmnemoniclabel_p.h + qquickpaddedrectangle.cpp qquickpaddedrectangle_p.h + qquickplaceholdertext.cpp qquickplaceholdertext_p.h + qtquickcontrols2foreign_p.h + qtquickcontrols2implglobal_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:quickcontrols2impl.pro:: +# MODULE = "quickcontrols2impl" +# QMLTYPES_FILENAME = "plugins.qmltypes" +# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtQuick/Controls/impl" +# QML_IMPORT_NAME = "QtQuick.Controls.impl" +# QML_IMPORT_VERSION = "$$QT_VERSION" + +## Scopes: +##################################################################### + +qt_extend_target(QuickControls2Impl CONDITION QT_FEATURE_quick_listview AND QT_FEATURE_quick_pathview + SOURCES + qquicktumblerview.cpp qquicktumblerview_p.h +) + +set_target_properties(QuickControls2Impl PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION} + QT_QML_MODULE_URI QtQuick.Controls.impl + QT_QMLTYPES_FILENAME plugins.qmltypes + QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtQuick/Controls/impl" +) + +qt6_qml_type_registration(QuickControls2Impl) diff --git a/src/quicktemplates2/CMakeLists.txt b/src/quicktemplates2/CMakeLists.txt index 4b7f2ff9..ba48dd6e 100644 --- a/src/quicktemplates2/CMakeLists.txt +++ b/src/quicktemplates2/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### qt_add_module(QuickTemplates2 + GENERATE_METATYPES SOURCES qquickabstractbutton.cpp qquickabstractbutton_p.h qquickabstractbutton_p_p.h @@ -129,6 +130,10 @@ qt_add_module(QuickTemplates2 #### Keys ignored in scope 1:.:.:quicktemplates2.pro:: # MODULE = "quicktemplates2" +# QMLTYPES_FILENAME = "plugins.qmltypes" +# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtQuick/Templates" +# QML_IMPORT_NAME = "QtQuick.Templates" +# QML_IMPORT_VERSION = "$$QT_VERSION" ## Scopes: ##################################################################### @@ -147,3 +152,13 @@ qt_extend_target(QuickTemplates2 CONDITION QT_FEATURE_quick_listview AND QT_FEAT qquicktumbler.cpp qquicktumbler_p.h qquicktumbler_p_p.h ) + +set_target_properties(QuickTemplates2 PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION} + QT_QML_MODULE_URI QtQuick.Templates + QT_QMLTYPES_FILENAME plugins.qmltypes + QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtQuick/Templates" +) + +qt6_qml_type_registration(QuickTemplates2) -- cgit v1.2.3 From f51b569219f4fe9ee196c92958bb5dc9f3810678 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 13 Aug 2020 14:40:56 +0200 Subject: Remove all plugins.qmltypes files These files should now be automatically generated by both qmake and cmake. Task-number: QTBUG-82922 Change-Id: I3ba754bb343123442c7d56c9caf770a979489c7d Reviewed-by: Fabian Kosmale --- src/imports/controls/default/plugins.qmltypes | 895 ------- src/imports/controls/fusion/plugins.qmltypes | 414 --- src/imports/controls/imagine/plugins.qmltypes | 347 --- src/imports/controls/material/plugins.qmltypes | 459 ---- src/imports/controls/universal/plugins.qmltypes | 340 --- src/imports/platform/plugins.qmltypes | 492 ---- src/imports/templates/plugins.qmltypes | 3122 ----------------------- 7 files changed, 6069 deletions(-) delete mode 100644 src/imports/controls/default/plugins.qmltypes delete mode 100644 src/imports/controls/fusion/plugins.qmltypes delete mode 100644 src/imports/controls/imagine/plugins.qmltypes delete mode 100644 src/imports/controls/material/plugins.qmltypes delete mode 100644 src/imports/controls/universal/plugins.qmltypes delete mode 100644 src/imports/platform/plugins.qmltypes delete mode 100644 src/imports/templates/plugins.qmltypes (limited to 'src') diff --git a/src/imports/controls/default/plugins.qmltypes b/src/imports/controls/default/plugins.qmltypes deleted file mode 100644 index e8212c55..00000000 --- a/src/imports/controls/default/plugins.qmltypes +++ /dev/null @@ -1,895 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.15' - -Module { - dependencies: [ - "QtQuick 2.11", - "QtQuick.Templates 2.5", - "QtQuick.Window 2.2" - ] - Component { - name: "QQuickCheckLabel" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/CheckLabel 2.3"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickClippedText" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/ClippedText 2.2"] - exportMetaObjectRevisions: [0] - Property { name: "clipX"; type: "double" } - Property { name: "clipY"; type: "double" } - Property { name: "clipWidth"; type: "double" } - Property { name: "clipHeight"; type: "double" } - } - Component { - name: "QQuickColor" - prototype: "QObject" - exports: ["QtQuick.Controls.impl/Color 2.3"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Method { - name: "transparent" - type: "QColor" - Parameter { name: "color"; type: "QColor" } - Parameter { name: "opacity"; type: "double" } - } - Method { - name: "blend" - type: "QColor" - Parameter { name: "a"; type: "QColor" } - Parameter { name: "b"; type: "QColor" } - Parameter { name: "factor"; type: "double" } - } - } - Component { - name: "QQuickColorImage" - defaultProperty: "data" - prototype: "QQuickImage" - exports: ["QtQuick.Controls.impl/ColorImage 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "defaultColor"; type: "QColor" } - } - Component { - name: "QQuickDefaultBusyIndicator" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/BusyIndicatorImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "pen"; type: "QColor" } - Property { name: "fill"; type: "QColor" } - Property { name: "running"; type: "bool" } - } - Component { - name: "QQuickDefaultDial" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.impl/DialImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "progress"; type: "double" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickDefaultProgressBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/ProgressBarImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "indeterminate"; type: "bool" } - Property { name: "progress"; type: "double" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickDefaultStyle" - prototype: "QObject" - exports: ["QtQuick.Controls.impl/Default 2.1"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "backgroundColor"; type: "QColor"; isReadonly: true } - Property { name: "overlayModalColor"; type: "QColor"; isReadonly: true } - Property { name: "overlayDimColor"; type: "QColor"; isReadonly: true } - Property { name: "textColor"; type: "QColor"; isReadonly: true } - Property { name: "textDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "textLightColor"; type: "QColor"; isReadonly: true } - Property { name: "textLinkColor"; type: "QColor"; isReadonly: true } - Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true } - Property { name: "textDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "textDisabledLightColor"; type: "QColor"; isReadonly: true } - Property { name: "textPlaceholderColor"; type: "QColor"; isReadonly: true } - Property { name: "focusColor"; type: "QColor"; isReadonly: true } - Property { name: "focusLightColor"; type: "QColor"; isReadonly: true } - Property { name: "focusPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonCheckedFocusColor"; type: "QColor"; isReadonly: true } - Property { name: "toolButtonColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "tabButtonCheckedPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "delegateColor"; type: "QColor"; isReadonly: true } - Property { name: "delegatePressedColor"; type: "QColor"; isReadonly: true } - Property { name: "delegateFocusColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFrameColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFramePressedColor"; type: "QColor"; isReadonly: true } - Property { name: "indicatorFrameDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "frameDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "frameLightColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "progressBarColor"; type: "QColor"; isReadonly: true } - Property { name: "pageIndicatorColor"; type: "QColor"; isReadonly: true } - Property { name: "separatorColor"; type: "QColor"; isReadonly: true } - Property { name: "disabledDarkColor"; type: "QColor"; isReadonly: true } - Property { name: "disabledLightColor"; type: "QColor"; isReadonly: true } - } - Component { - name: "QQuickIconImage" - defaultProperty: "data" - prototype: "QQuickImage" - exports: ["QtQuick.Controls.impl/IconImage 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "name"; type: "string" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickIconLabel" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/IconLabel 2.3"] - exportMetaObjectRevisions: [0] - Enum { - name: "Display" - values: { - "IconOnly": 0, - "TextOnly": 1, - "TextBesideIcon": 2, - "TextUnderIcon": 3 - } - } - Property { name: "icon"; type: "QQuickIcon" } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "display"; type: "Display" } - Property { name: "spacing"; type: "double" } - Property { name: "mirrored"; type: "bool" } - Property { name: "alignment"; type: "Qt::Alignment" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - } - Component { - name: "QQuickImplicitSizeItem" - defaultProperty: "data" - prototype: "QQuickItem" - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickItemGroup" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - exports: ["QtQuick.Controls.impl/ItemGroup 2.2"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickMnemonicLabel" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/MnemonicLabel 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "text"; type: "string" } - Property { name: "mnemonicVisible"; type: "bool" } - } - Component { - name: "QQuickOverlay" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls/Overlay 2.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - attachedType: "QQuickOverlayAttached" - Property { name: "modal"; type: "QQmlComponent"; isPointer: true } - Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } - Signal { name: "pressed" } - Signal { name: "released" } - } - Component { - name: "QQuickPaddedRectangle" - defaultProperty: "data" - prototype: "QQuickRectangle" - exports: ["QtQuick.Controls.impl/PaddedRectangle 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "padding"; type: "double" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - } - Component { - name: "QQuickPlaceholderText" - defaultProperty: "data" - prototype: "QQuickText" - exports: ["QtQuick.Controls.impl/PlaceholderText 2.2"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickSplitHandleAttached" - prototype: "QObject" - exports: ["QtQuick.Controls/SplitHandle 2.13"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "hovered"; type: "bool"; isReadonly: true } - Property { name: "pressed"; type: "bool"; isReadonly: true } - } - Component { - name: "QQuickText" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4, - "AlignJustify": 8 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "TextStyle" - values: { - "Normal": 0, - "Outline": 1, - "Raised": 2, - "Sunken": 3 - } - } - Enum { - name: "TextFormat" - values: { - "PlainText": 0, - "RichText": 1, - "MarkdownText": 3, - "AutoText": 2, - "StyledText": 4 - } - } - Enum { - name: "TextElideMode" - values: { - "ElideLeft": 0, - "ElideRight": 1, - "ElideMiddle": 2, - "ElideNone": 3 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Enum { - name: "LineHeightMode" - values: { - "ProportionalHeight": 0, - "FixedHeight": 1 - } - } - Enum { - name: "FontSizeMode" - values: { - "FixedSize": 0, - "HorizontalFit": 1, - "VerticalFit": 2, - "Fit": 3 - } - } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "linkColor"; type: "QColor" } - Property { name: "style"; type: "TextStyle" } - Property { name: "styleColor"; type: "QColor" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "lineCount"; type: "int"; isReadonly: true } - Property { name: "truncated"; type: "bool"; isReadonly: true } - Property { name: "maximumLineCount"; type: "int" } - Property { name: "textFormat"; type: "TextFormat" } - Property { name: "elide"; type: "TextElideMode" } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "lineHeight"; type: "double" } - Property { name: "lineHeightMode"; type: "LineHeightMode" } - Property { name: "baseUrl"; type: "QUrl" } - Property { name: "minimumPixelSize"; type: "int" } - Property { name: "minimumPointSize"; type: "int" } - Property { name: "fontSizeMode"; type: "FontSizeMode" } - Property { name: "renderType"; type: "RenderType" } - Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } - Property { name: "padding"; revision: 6; type: "double" } - Property { name: "topPadding"; revision: 6; type: "double" } - Property { name: "leftPadding"; revision: 6; type: "double" } - Property { name: "rightPadding"; revision: 6; type: "double" } - Property { name: "bottomPadding"; revision: 6; type: "double" } - Property { name: "fontInfo"; revision: 9; type: "QJSValue"; isReadonly: true } - Property { name: "advance"; revision: 10; type: "QSizeF"; isReadonly: true } - Signal { - name: "textChanged" - Parameter { name: "text"; type: "string" } - } - Signal { - name: "linkActivated" - Parameter { name: "link"; type: "string" } - } - Signal { - name: "linkHovered" - revision: 2 - Parameter { name: "link"; type: "string" } - } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "styleChanged" - Parameter { name: "style"; type: "QQuickText::TextStyle" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::VAlignment" } - } - Signal { - name: "textFormatChanged" - Parameter { name: "textFormat"; type: "QQuickText::TextFormat" } - } - Signal { - name: "elideModeChanged" - Parameter { name: "mode"; type: "QQuickText::TextElideMode" } - } - Signal { name: "contentSizeChanged" } - Signal { - name: "contentWidthChanged" - Parameter { name: "contentWidth"; type: "double" } - } - Signal { - name: "contentHeightChanged" - Parameter { name: "contentHeight"; type: "double" } - } - Signal { - name: "lineHeightChanged" - Parameter { name: "lineHeight"; type: "double" } - } - Signal { - name: "lineHeightModeChanged" - Parameter { name: "mode"; type: "LineHeightMode" } - } - Signal { - name: "lineLaidOut" - Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } - } - Signal { name: "paddingChanged"; revision: 6 } - Signal { name: "topPaddingChanged"; revision: 6 } - Signal { name: "leftPaddingChanged"; revision: 6 } - Signal { name: "rightPaddingChanged"; revision: 6 } - Signal { name: "bottomPaddingChanged"; revision: 6 } - Signal { name: "fontInfoChanged"; revision: 9 } - Method { name: "doLayout" } - Method { name: "forceLayout"; revision: 9 } - Method { - name: "linkAt" - revision: 3 - type: "string" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickTumblerView" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.impl/TumblerView 2.1"] - exportMetaObjectRevisions: [0] - Property { name: "model"; type: "QVariant" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "path"; type: "QQuickPath"; isPointer: true } - } - Component { - prototype: "QQuickAbstractButton" - name: "QtQuick.Controls/AbstractButton 2.0" - exports: ["QtQuick.Controls/AbstractButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickAction" - name: "QtQuick.Controls/Action 2.3" - exports: ["QtQuick.Controls/Action 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - } - Component { - prototype: "QQuickActionGroup" - name: "QtQuick.Controls/ActionGroup 2.3" - exports: ["QtQuick.Controls/ActionGroup 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "actions" - } - Component { - prototype: "QQuickApplicationWindow" - name: "QtQuick.Controls/ApplicationWindow 2.0" - exports: ["QtQuick.Controls/ApplicationWindow 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickBusyIndicator" - name: "QtQuick.Controls/BusyIndicator 2.0" - exports: ["QtQuick.Controls/BusyIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickButton" - name: "QtQuick.Controls/Button 2.0" - exports: ["QtQuick.Controls/Button 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickButtonGroup" - name: "QtQuick.Controls/ButtonGroup 2.0" - exports: ["QtQuick.Controls/ButtonGroup 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - } - Component { - prototype: "QQuickCheckBox" - name: "QtQuick.Controls/CheckBox 2.0" - exports: ["QtQuick.Controls/CheckBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickCheckDelegate" - name: "QtQuick.Controls/CheckDelegate 2.0" - exports: ["QtQuick.Controls/CheckDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickComboBox" - name: "QtQuick.Controls/ComboBox 2.0" - exports: ["QtQuick.Controls/ComboBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickContainer" - name: "QtQuick.Controls/Container 2.0" - exports: ["QtQuick.Controls/Container 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickControl" - name: "QtQuick.Controls/Control 2.0" - exports: ["QtQuick.Controls/Control 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDelayButton" - name: "QtQuick.Controls/DelayButton 2.2" - exports: ["QtQuick.Controls/DelayButton 2.2"] - exportMetaObjectRevisions: [2] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDial" - name: "QtQuick.Controls/Dial 2.0" - exports: ["QtQuick.Controls/Dial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickDialog" - name: "QtQuick.Controls/Dialog 2.1" - exports: ["QtQuick.Controls/Dialog 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickDialogButtonBox" - name: "QtQuick.Controls/DialogButtonBox 2.1" - exports: ["QtQuick.Controls/DialogButtonBox 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickDrawer" - name: "QtQuick.Controls/Drawer 2.0" - exports: ["QtQuick.Controls/Drawer 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickFrame" - name: "QtQuick.Controls/Frame 2.0" - exports: ["QtQuick.Controls/Frame 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickGroupBox" - name: "QtQuick.Controls/GroupBox 2.0" - exports: ["QtQuick.Controls/GroupBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickHorizontalHeaderView" - name: "QtQuick.Controls/HorizontalHeaderView 2.15" - exports: ["QtQuick.Controls/HorizontalHeaderView 2.15"] - exportMetaObjectRevisions: [15] - isComposite: true - defaultProperty: "flickableData" - } - Component { - prototype: "QQuickItemDelegate" - name: "QtQuick.Controls/ItemDelegate 2.0" - exports: ["QtQuick.Controls/ItemDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickLabel" - name: "QtQuick.Controls/Label 2.0" - exports: ["QtQuick.Controls/Label 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenu" - name: "QtQuick.Controls/Menu 2.0" - exports: ["QtQuick.Controls/Menu 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickMenuBar" - name: "QtQuick.Controls/MenuBar 2.3" - exports: ["QtQuick.Controls/MenuBar 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickMenuBarItem" - name: "QtQuick.Controls/MenuBarItem 2.3" - exports: ["QtQuick.Controls/MenuBarItem 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenuItem" - name: "QtQuick.Controls/MenuItem 2.0" - exports: ["QtQuick.Controls/MenuItem 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickMenuSeparator" - name: "QtQuick.Controls/MenuSeparator 2.1" - exports: ["QtQuick.Controls/MenuSeparator 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickPage" - name: "QtQuick.Controls/Page 2.0" - exports: ["QtQuick.Controls/Page 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickPageIndicator" - name: "QtQuick.Controls/PageIndicator 2.0" - exports: ["QtQuick.Controls/PageIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickPane" - name: "QtQuick.Controls/Pane 2.0" - exports: ["QtQuick.Controls/Pane 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickPopup" - name: "QtQuick.Controls/Popup 2.0" - exports: ["QtQuick.Controls/Popup 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickProgressBar" - name: "QtQuick.Controls/ProgressBar 2.0" - exports: ["QtQuick.Controls/ProgressBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRadioButton" - name: "QtQuick.Controls/RadioButton 2.0" - exports: ["QtQuick.Controls/RadioButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRadioDelegate" - name: "QtQuick.Controls/RadioDelegate 2.0" - exports: ["QtQuick.Controls/RadioDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRangeSlider" - name: "QtQuick.Controls/RangeSlider 2.0" - exports: ["QtQuick.Controls/RangeSlider 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickRoundButton" - name: "QtQuick.Controls/RoundButton 2.1" - exports: ["QtQuick.Controls/RoundButton 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollBar" - name: "QtQuick.Controls/ScrollBar 2.0" - exports: ["QtQuick.Controls/ScrollBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollIndicator" - name: "QtQuick.Controls/ScrollIndicator 2.0" - exports: ["QtQuick.Controls/ScrollIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickScrollView" - name: "QtQuick.Controls/ScrollView 2.2" - exports: ["QtQuick.Controls/ScrollView 2.2"] - exportMetaObjectRevisions: [2] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickSlider" - name: "QtQuick.Controls/Slider 2.0" - exports: ["QtQuick.Controls/Slider 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSpinBox" - name: "QtQuick.Controls/SpinBox 2.0" - exports: ["QtQuick.Controls/SpinBox 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSplitView" - name: "QtQuick.Controls/SplitView 2.13" - exports: ["QtQuick.Controls/SplitView 2.13"] - exportMetaObjectRevisions: [13] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickStackView" - name: "QtQuick.Controls/StackView 2.0" - exports: ["QtQuick.Controls/StackView 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwipeDelegate" - name: "QtQuick.Controls/SwipeDelegate 2.0" - exports: ["QtQuick.Controls/SwipeDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwipeView" - name: "QtQuick.Controls/SwipeView 2.0" - exports: ["QtQuick.Controls/SwipeView 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickSwitch" - name: "QtQuick.Controls/Switch 2.0" - exports: ["QtQuick.Controls/Switch 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickSwitchDelegate" - name: "QtQuick.Controls/SwitchDelegate 2.0" - exports: ["QtQuick.Controls/SwitchDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTabBar" - name: "QtQuick.Controls/TabBar 2.0" - exports: ["QtQuick.Controls/TabBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickTabButton" - name: "QtQuick.Controls/TabButton 2.0" - exports: ["QtQuick.Controls/TabButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTextArea" - name: "QtQuick.Controls/TextArea 2.0" - exports: ["QtQuick.Controls/TextArea 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickTextField" - name: "QtQuick.Controls/TextField 2.0" - exports: ["QtQuick.Controls/TextField 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolBar" - name: "QtQuick.Controls/ToolBar 2.0" - exports: ["QtQuick.Controls/ToolBar 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickToolButton" - name: "QtQuick.Controls/ToolButton 2.0" - exports: ["QtQuick.Controls/ToolButton 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolSeparator" - name: "QtQuick.Controls/ToolSeparator 2.1" - exports: ["QtQuick.Controls/ToolSeparator 2.1"] - exportMetaObjectRevisions: [1] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickToolTip" - name: "QtQuick.Controls/ToolTip 2.0" - exports: ["QtQuick.Controls/ToolTip 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "contentData" - } - Component { - prototype: "QQuickTumbler" - name: "QtQuick.Controls/Tumbler 2.0" - exports: ["QtQuick.Controls/Tumbler 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickVerticalHeaderView" - name: "QtQuick.Controls/VerticalHeaderView 2.15" - exports: ["QtQuick.Controls/VerticalHeaderView 2.15"] - exportMetaObjectRevisions: [15] - isComposite: true - defaultProperty: "flickableData" - } -} diff --git a/src/imports/controls/fusion/plugins.qmltypes b/src/imports/controls/fusion/plugins.qmltypes deleted file mode 100644 index 681b8b90..00000000 --- a/src/imports/controls/fusion/plugins.qmltypes +++ /dev/null @@ -1,414 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Fusion 2.15' - -Module { - dependencies: ["QtQuick.Controls 2.0"] - Component { - name: "QQuickFusionBusyIndicator" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.Fusion.impl/BusyIndicatorImpl 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "running"; type: "bool" } - } - Component { - name: "QQuickFusionDial" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.Fusion.impl/DialImpl 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "highlight"; type: "bool" } - Property { name: "palette"; type: "QPalette" } - } - Component { - name: "QQuickFusionKnob" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.Fusion.impl/KnobImpl 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "palette"; type: "QPalette" } - } - Component { - name: "QQuickFusionStyle" - prototype: "QObject" - exports: ["QtQuick.Controls.Fusion.impl/Fusion 2.3"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "lightShade"; type: "QColor"; isReadonly: true } - Property { name: "darkShade"; type: "QColor"; isReadonly: true } - Property { name: "topShadow"; type: "QColor"; isReadonly: true } - Property { name: "innerContrastLine"; type: "QColor"; isReadonly: true } - Method { - name: "highlight" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "highlightedText" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "outline" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "highlightedOutline" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "tabFrameColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "buttonColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - Parameter { name: "highlighted"; type: "bool" } - Parameter { name: "down"; type: "bool" } - Parameter { name: "hovered"; type: "bool" } - } - Method { - name: "buttonColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - Parameter { name: "highlighted"; type: "bool" } - Parameter { name: "down"; type: "bool" } - } - Method { - name: "buttonColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - Parameter { name: "highlighted"; type: "bool" } - } - Method { - name: "buttonColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "buttonOutline" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - Parameter { name: "highlighted"; type: "bool" } - Parameter { name: "enabled"; type: "bool" } - } - Method { - name: "buttonOutline" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - Parameter { name: "highlighted"; type: "bool" } - } - Method { - name: "buttonOutline" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - Method { - name: "gradientStart" - type: "QColor" - Parameter { name: "baseColor"; type: "QColor" } - } - Method { - name: "gradientStop" - type: "QColor" - Parameter { name: "baseColor"; type: "QColor" } - } - Method { - name: "mergedColors" - type: "QColor" - Parameter { name: "colorA"; type: "QColor" } - Parameter { name: "colorB"; type: "QColor" } - Parameter { name: "factor"; type: "int" } - } - Method { - name: "mergedColors" - type: "QColor" - Parameter { name: "colorA"; type: "QColor" } - Parameter { name: "colorB"; type: "QColor" } - } - Method { - name: "grooveColor" - type: "QColor" - Parameter { name: "palette"; type: "QPalette" } - } - } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 11 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickPaintedItem" - defaultProperty: "data" - prototype: "QQuickItem" - Enum { - name: "RenderTarget" - values: { - "Image": 0, - "FramebufferObject": 1, - "InvertedYFramebufferObject": 2 - } - } - Enum { - name: "PerformanceHints" - values: { - "FastFBOResizing": 1 - } - } - Property { name: "contentsSize"; type: "QSize" } - Property { name: "fillColor"; type: "QColor" } - Property { name: "contentsScale"; type: "double" } - Property { name: "renderTarget"; type: "RenderTarget" } - Property { name: "textureSize"; type: "QSize" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/ButtonPanel 2.3" - exports: ["QtQuick.Controls.Fusion.impl/ButtonPanel 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "highlighted"; type: "bool" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/RadioIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/SliderGroove 2.3" - exports: ["QtQuick.Controls.Fusion.impl/SliderGroove 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "offset"; type: "double" } - Property { name: "progress"; type: "double" } - Property { name: "visualProgress"; type: "double" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" - exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "palette"; type: "QVariant" } - Property { name: "pressed"; type: "bool" } - Property { name: "hovered"; type: "bool" } - Property { name: "vertical"; type: "bool" } - Property { name: "visualFocus"; type: "bool" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } - } -} diff --git a/src/imports/controls/imagine/plugins.qmltypes b/src/imports/controls/imagine/plugins.qmltypes deleted file mode 100644 index 785b6dba..00000000 --- a/src/imports/controls/imagine/plugins.qmltypes +++ /dev/null @@ -1,347 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Imagine 2.15' - -Module { - dependencies: ["QtQuick.Controls 2.0"] - Component { - name: "QQuickAnimatedImageSelector" - prototype: "QQuickImageSelector" - exports: ["QtQuick.Controls.Imagine.impl/AnimatedImageSelector 2.3"] - exportMetaObjectRevisions: [0] - } - Component { name: "QQuickAttachedObject"; prototype: "QObject" } - Component { - name: "QQuickImage" - defaultProperty: "data" - prototype: "QQuickImageBase" - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "FillMode" - values: { - "Stretch": 0, - "PreserveAspectFit": 1, - "PreserveAspectCrop": 2, - "Tile": 3, - "TileVertically": 4, - "TileHorizontally": 5, - "Pad": 6 - } - } - Property { name: "fillMode"; type: "FillMode" } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "mipmap"; revision: 3; type: "bool" } - Property { name: "autoTransform"; revision: 5; type: "bool" } - Property { name: "sourceClipRect"; revision: 15; type: "QRectF" } - Signal { name: "paintedGeometryChanged" } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "VAlignment" } - } - Signal { - name: "mipmapChanged" - revision: 3 - Parameter { type: "bool" } - } - Signal { name: "autoTransformChanged"; revision: 5 } - } - Component { - name: "QQuickImageBase" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "LoadPixmapOptions" - values: { - "NoOption": 0, - "HandleDPR": 1, - "UseProviderOptions": 2 - } - } - Enum { - name: "Status" - values: { - "Null": 0, - "Ready": 1, - "Loading": 2, - "Error": 3 - } - } - Property { name: "status"; type: "Status"; isReadonly: true } - Property { name: "source"; type: "QUrl" } - Property { name: "progress"; type: "double"; isReadonly: true } - Property { name: "asynchronous"; type: "bool" } - Property { name: "cache"; type: "bool" } - Property { name: "sourceSize"; type: "QSize" } - Property { name: "mirror"; type: "bool" } - Property { name: "currentFrame"; revision: 14; type: "int" } - Property { name: "frameCount"; revision: 14; type: "int"; isReadonly: true } - Property { name: "colorSpace"; revision: 15; type: "QColorSpace" } - Signal { - name: "sourceChanged" - Parameter { type: "QUrl" } - } - Signal { - name: "statusChanged" - Parameter { type: "QQuickImageBase::Status" } - } - Signal { - name: "progressChanged" - Parameter { name: "progress"; type: "double" } - } - Signal { name: "currentFrameChanged"; revision: 14 } - Signal { name: "frameCountChanged"; revision: 14 } - Signal { name: "sourceClipRectChanged"; revision: 15 } - Signal { name: "colorSpaceChanged"; revision: 15 } - } - Component { - name: "QQuickImageSelector" - prototype: "QObject" - exports: ["QtQuick.Controls.Imagine.impl/ImageSelector 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "source"; type: "QUrl"; isReadonly: true } - Property { name: "name"; type: "string" } - Property { name: "path"; type: "string" } - Property { name: "states"; type: "QVariantList" } - Property { name: "separator"; type: "string" } - Property { name: "cache"; type: "bool" } - } - Component { - name: "QQuickImagineStyle" - prototype: "QQuickAttachedObject" - exports: ["QtQuick.Controls.Imagine/Imagine 2.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "path"; type: "string" } - Property { name: "url"; type: "QUrl"; isReadonly: true } - } - Component { - name: "QQuickImplicitSizeItem" - defaultProperty: "data" - prototype: "QQuickItem" - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 11 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickNinePatchImage" - defaultProperty: "data" - prototype: "QQuickImage" - exports: ["QtQuick.Controls.Imagine.impl/NinePatchImage 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "topPadding"; type: "double"; isReadonly: true } - Property { name: "leftPadding"; type: "double"; isReadonly: true } - Property { name: "rightPadding"; type: "double"; isReadonly: true } - Property { name: "bottomPadding"; type: "double"; isReadonly: true } - Property { name: "topInset"; type: "double"; isReadonly: true } - Property { name: "leftInset"; type: "double"; isReadonly: true } - Property { name: "rightInset"; type: "double"; isReadonly: true } - Property { name: "bottomInset"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickNinePatchImageSelector" - prototype: "QQuickImageSelector" - exports: ["QtQuick.Controls.Imagine.impl/NinePatchImageSelector 2.3"] - exportMetaObjectRevisions: [0] - } -} diff --git a/src/imports/controls/material/plugins.qmltypes b/src/imports/controls/material/plugins.qmltypes deleted file mode 100644 index e290e0ea..00000000 --- a/src/imports/controls/material/plugins.qmltypes +++ /dev/null @@ -1,459 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.15' - -Module { - dependencies: ["QtQuick.Controls 2.0"] - Component { name: "QQuickAttachedObject"; prototype: "QObject" } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 11 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickMaterialBusyIndicator" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.Material.impl/BusyIndicatorImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "running"; type: "bool" } - } - Component { - name: "QQuickMaterialProgressBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.Material.impl/ProgressBarImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "progress"; type: "double" } - Property { name: "indeterminate"; type: "bool" } - } - Component { - name: "QQuickMaterialRipple" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.Material.impl/Ripple 2.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "Trigger" - values: { - "Press": 0, - "Release": 1 - } - } - Property { name: "color"; type: "QColor" } - Property { name: "clipRadius"; type: "double" } - Property { name: "pressed"; type: "bool" } - Property { name: "active"; type: "bool" } - Property { name: "anchor"; type: "QQuickItem"; isPointer: true } - Property { name: "trigger"; type: "Trigger" } - } - Component { - name: "QQuickMaterialStyle" - prototype: "QQuickAttachedObject" - exports: ["QtQuick.Controls.Material/Material 2.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Theme" - values: { - "Light": 0, - "Dark": 1, - "System": 2 - } - } - Enum { - name: "Variant" - values: { - "Normal": 0, - "Dense": 1 - } - } - Enum { - name: "Color" - values: { - "Red": 0, - "Pink": 1, - "Purple": 2, - "DeepPurple": 3, - "Indigo": 4, - "Blue": 5, - "LightBlue": 6, - "Cyan": 7, - "Teal": 8, - "Green": 9, - "LightGreen": 10, - "Lime": 11, - "Yellow": 12, - "Amber": 13, - "Orange": 14, - "DeepOrange": 15, - "Brown": 16, - "Grey": 17, - "BlueGrey": 18 - } - } - Enum { - name: "Shade" - values: { - "Shade50": 0, - "Shade100": 1, - "Shade200": 2, - "Shade300": 3, - "Shade400": 4, - "Shade500": 5, - "Shade600": 6, - "Shade700": 7, - "Shade800": 8, - "Shade900": 9, - "ShadeA100": 10, - "ShadeA200": 11, - "ShadeA400": 12, - "ShadeA700": 13 - } - } - Property { name: "theme"; type: "Theme" } - Property { name: "primary"; type: "QVariant" } - Property { name: "accent"; type: "QVariant" } - Property { name: "foreground"; type: "QVariant" } - Property { name: "background"; type: "QVariant" } - Property { name: "elevation"; type: "int" } - Property { name: "primaryColor"; type: "QColor"; isReadonly: true } - Property { name: "accentColor"; type: "QColor"; isReadonly: true } - Property { name: "backgroundColor"; type: "QColor"; isReadonly: true } - Property { name: "primaryTextColor"; type: "QColor"; isReadonly: true } - Property { name: "primaryHighlightedTextColor"; type: "QColor"; isReadonly: true } - Property { name: "secondaryTextColor"; type: "QColor"; isReadonly: true } - Property { name: "hintTextColor"; type: "QColor"; isReadonly: true } - Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true } - Property { name: "dropShadowColor"; type: "QColor"; isReadonly: true } - Property { name: "dividerColor"; type: "QColor"; isReadonly: true } - Property { name: "iconColor"; type: "QColor"; isReadonly: true } - Property { name: "iconDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonColor"; type: "QColor"; isReadonly: true } - Property { name: "buttonDisabledColor"; type: "QColor"; isReadonly: true } - Property { name: "highlightedButtonColor"; type: "QColor"; isReadonly: true } - Property { name: "frameColor"; type: "QColor"; isReadonly: true } - Property { name: "rippleColor"; type: "QColor"; isReadonly: true } - Property { name: "highlightedRippleColor"; type: "QColor"; isReadonly: true } - Property { name: "switchUncheckedTrackColor"; type: "QColor"; isReadonly: true } - Property { name: "switchCheckedTrackColor"; type: "QColor"; isReadonly: true } - Property { name: "switchUncheckedHandleColor"; type: "QColor"; isReadonly: true } - Property { name: "switchCheckedHandleColor"; type: "QColor"; isReadonly: true } - Property { name: "switchDisabledTrackColor"; type: "QColor"; isReadonly: true } - Property { name: "switchDisabledHandleColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarHoveredColor"; type: "QColor"; isReadonly: true } - Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true } - Property { name: "dialogColor"; type: "QColor"; isReadonly: true } - Property { name: "backgroundDimColor"; type: "QColor"; isReadonly: true } - Property { name: "listHighlightColor"; type: "QColor"; isReadonly: true } - Property { name: "tooltipColor"; type: "QColor"; isReadonly: true } - Property { name: "toolBarColor"; type: "QColor"; isReadonly: true } - Property { name: "toolTextColor"; type: "QColor"; isReadonly: true } - Property { name: "spinBoxDisabledIconColor"; type: "QColor"; isReadonly: true } - Property { name: "sliderDisabledColor"; revision: 15; type: "QColor"; isReadonly: true } - Property { name: "touchTarget"; type: "int"; isReadonly: true } - Property { name: "buttonHeight"; type: "int"; isReadonly: true } - Property { name: "delegateHeight"; type: "int"; isReadonly: true } - Property { name: "dialogButtonBoxHeight"; type: "int"; isReadonly: true } - Property { name: "frameVerticalPadding"; type: "int"; isReadonly: true } - Property { name: "menuItemHeight"; type: "int"; isReadonly: true } - Property { name: "menuItemVerticalPadding"; type: "int"; isReadonly: true } - Property { name: "switchDelegateVerticalPadding"; type: "int"; isReadonly: true } - Property { name: "tooltipHeight"; type: "int"; isReadonly: true } - Signal { name: "paletteChanged" } - Method { - name: "color" - type: "QColor" - Parameter { name: "color"; type: "Color" } - Parameter { name: "shade"; type: "Shade" } - } - Method { - name: "color" - type: "QColor" - Parameter { name: "color"; type: "Color" } - } - Method { - name: "shade" - type: "QColor" - Parameter { name: "color"; type: "QColor" } - Parameter { name: "shade"; type: "Shade" } - } - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/BoxShadow 2.0" - exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "offsetX"; type: "int" } - Property { name: "offsetY"; type: "int" } - Property { name: "blurRadius"; type: "int" } - Property { name: "spreadRadius"; type: "int" } - Property { name: "source"; type: "QQuickItem"; isPointer: true } - Property { name: "fullWidth"; type: "bool" } - Property { name: "fullHeight"; type: "bool" } - Property { name: "glowRadius"; type: "double" } - Property { name: "spread"; type: "double" } - Property { name: "color"; type: "QColor" } - Property { name: "cornerRadius"; type: "double" } - Property { name: "cached"; type: "bool" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "checkState"; type: "int" } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Material.impl/CursorDelegate 2.0" - exports: ["QtQuick.Controls.Material.impl/CursorDelegate 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0" - exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "source"; type: "QVariant" } - Property { name: "elevation"; type: "int" } - Property { name: "fullWidth"; type: "bool" } - Property { name: "fullHeight"; type: "bool" } - Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "_shadows"; type: "QVariant"; isReadonly: true } - Property { name: "_shadow"; type: "QVariant"; isReadonly: true } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/RectangularGlow 2.0" - exports: ["QtQuick.Controls.Material.impl/RectangularGlow 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "glowRadius"; type: "double" } - Property { name: "spread"; type: "double" } - Property { name: "color"; type: "QColor" } - Property { name: "cornerRadius"; type: "double" } - Property { name: "cached"; type: "bool" } - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/SliderHandle 2.0" - exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "value"; type: "double" } - Property { name: "handleHasFocus"; type: "bool" } - Property { name: "handlePressed"; type: "bool" } - Property { name: "handleHovered"; type: "bool" } - Property { name: "initialSize"; type: "int"; isReadonly: true } - Property { name: "control"; type: "QVariant"; isReadonly: true } - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } - } -} diff --git a/src/imports/controls/universal/plugins.qmltypes b/src/imports/controls/universal/plugins.qmltypes deleted file mode 100644 index c38e39e1..00000000 --- a/src/imports/controls/universal/plugins.qmltypes +++ /dev/null @@ -1,340 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Universal 2.15' - -Module { - dependencies: ["QtQuick.Controls 2.0"] - Component { name: "QQuickAttachedObject"; prototype: "QObject" } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 11 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickPaintedItem" - defaultProperty: "data" - prototype: "QQuickItem" - Enum { - name: "RenderTarget" - values: { - "Image": 0, - "FramebufferObject": 1, - "InvertedYFramebufferObject": 2 - } - } - Enum { - name: "PerformanceHints" - values: { - "FastFBOResizing": 1 - } - } - Property { name: "contentsSize"; type: "QSize" } - Property { name: "fillColor"; type: "QColor" } - Property { name: "contentsScale"; type: "double" } - Property { name: "renderTarget"; type: "RenderTarget" } - Property { name: "textureSize"; type: "QSize" } - } - Component { - name: "QQuickUniversalBusyIndicator" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.Universal.impl/BusyIndicatorImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "count"; type: "int" } - Property { name: "color"; type: "QColor" } - } - Component { - name: "QQuickUniversalFocusRectangle" - defaultProperty: "data" - prototype: "QQuickPaintedItem" - exports: ["QtQuick.Controls.Universal.impl/FocusRectangle 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickUniversalProgressBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Controls.Universal.impl/ProgressBarImpl 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "progress"; type: "double" } - Property { name: "indeterminate"; type: "bool" } - } - Component { - name: "QQuickUniversalStyle" - prototype: "QQuickAttachedObject" - exports: ["QtQuick.Controls.Universal/Universal 2.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Theme" - values: { - "Light": 0, - "Dark": 1, - "System": 2 - } - } - Enum { - name: "Color" - values: { - "Lime": 0, - "Green": 1, - "Emerald": 2, - "Teal": 3, - "Cyan": 4, - "Cobalt": 5, - "Indigo": 6, - "Violet": 7, - "Pink": 8, - "Magenta": 9, - "Crimson": 10, - "Red": 11, - "Orange": 12, - "Amber": 13, - "Yellow": 14, - "Brown": 15, - "Olive": 16, - "Steel": 17, - "Mauve": 18, - "Taupe": 19 - } - } - Property { name: "theme"; type: "Theme" } - Property { name: "accent"; type: "QVariant" } - Property { name: "foreground"; type: "QVariant" } - Property { name: "background"; type: "QVariant" } - Property { name: "altHighColor"; type: "QColor"; isReadonly: true } - Property { name: "altLowColor"; type: "QColor"; isReadonly: true } - Property { name: "altMediumColor"; type: "QColor"; isReadonly: true } - Property { name: "altMediumHighColor"; type: "QColor"; isReadonly: true } - Property { name: "altMediumLowColor"; type: "QColor"; isReadonly: true } - Property { name: "baseHighColor"; type: "QColor"; isReadonly: true } - Property { name: "baseLowColor"; type: "QColor"; isReadonly: true } - Property { name: "baseMediumColor"; type: "QColor"; isReadonly: true } - Property { name: "baseMediumHighColor"; type: "QColor"; isReadonly: true } - Property { name: "baseMediumLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeAltLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeBlackHighColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeBlackLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeBlackMediumLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeBlackMediumColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeDisabledHighColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeDisabledLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeHighColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeMediumColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeMediumLowColor"; type: "QColor"; isReadonly: true } - Property { name: "chromeWhiteColor"; type: "QColor"; isReadonly: true } - Property { name: "listLowColor"; type: "QColor"; isReadonly: true } - Property { name: "listMediumColor"; type: "QColor"; isReadonly: true } - Signal { name: "paletteChanged" } - Method { - name: "color" - type: "QColor" - Parameter { name: "color"; type: "Color" } - } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Universal.impl/CheckIndicator 2.0" - exports: ["QtQuick.Controls.Universal.impl/CheckIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "partiallyChecked"; type: "bool"; isReadonly: true } - } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0" - exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QVariant" } - } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Universal.impl/SwitchIndicator 2.0" - exports: ["QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - } -} diff --git a/src/imports/platform/plugins.qmltypes b/src/imports/platform/plugins.qmltypes deleted file mode 100644 index e9312047..00000000 --- a/src/imports/platform/plugins.qmltypes +++ /dev/null @@ -1,492 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable Qt.labs.platform 1.1' - -Module { - dependencies: ["QtQuick 2.0"] - Component { - name: "QPlatformDialogHelper" - prototype: "QObject" - exports: ["Qt.labs.platform/StandardButton 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "StandardButtons" - values: { - "NoButton": 0, - "Ok": 1024, - "Save": 2048, - "SaveAll": 4096, - "Open": 8192, - "Yes": 16384, - "YesToAll": 32768, - "No": 65536, - "NoToAll": 131072, - "Abort": 262144, - "Retry": 524288, - "Ignore": 1048576, - "Close": 2097152, - "Cancel": 4194304, - "Discard": 8388608, - "Help": 16777216, - "Apply": 33554432, - "Reset": 67108864, - "RestoreDefaults": 134217728, - "FirstButton": 1024, - "LastButton": 134217728, - "LowestBit": 10, - "HighestBit": 27 - } - } - Enum { - name: "ButtonRole" - values: { - "InvalidRole": -1, - "AcceptRole": 0, - "RejectRole": 1, - "DestructiveRole": 2, - "ActionRole": 3, - "HelpRole": 4, - "YesRole": 5, - "NoRole": 6, - "ResetRole": 7, - "ApplyRole": 8, - "NRoles": 9, - "RoleMask": 268435455, - "AlternateRole": 268435456, - "Stretch": 536870912, - "Reverse": 1073741824, - "EOL": -1 - } - } - Enum { - name: "ButtonLayout" - values: { - "UnknownLayout": -1, - "WinLayout": 0, - "MacLayout": 1, - "KdeLayout": 2, - "GnomeLayout": 3, - "MacModelessLayout": 4, - "AndroidLayout": 5 - } - } - Signal { name: "accept" } - Signal { name: "reject" } - } - Component { - name: "QQuickPlatformColorDialog" - defaultProperty: "data" - prototype: "QQuickPlatformDialog" - exports: ["Qt.labs.platform/ColorDialog 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "color"; type: "QColor" } - Property { name: "currentColor"; type: "QColor" } - Property { name: "options"; type: "QColorDialogOptions::ColorDialogOptions" } - } - Component { - name: "QQuickPlatformDialog" - defaultProperty: "data" - prototype: "QObject" - exports: ["Qt.labs.platform/Dialog 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "StandardCode" - values: { - "Rejected": 0, - "Accepted": 1 - } - } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "parentWindow"; type: "QWindow"; isPointer: true } - Property { name: "title"; type: "string" } - Property { name: "flags"; type: "Qt::WindowFlags" } - Property { name: "modality"; type: "Qt::WindowModality" } - Property { name: "visible"; type: "bool" } - Property { name: "result"; type: "int" } - Signal { name: "accepted" } - Signal { name: "rejected" } - Method { name: "open" } - Method { name: "close" } - Method { name: "accept" } - Method { name: "reject" } - Method { - name: "done" - Parameter { name: "result"; type: "int" } - } - } - Component { - name: "QQuickPlatformFileDialog" - defaultProperty: "data" - prototype: "QQuickPlatformDialog" - exports: ["Qt.labs.platform/FileDialog 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "FileMode" - values: { - "OpenFile": 0, - "OpenFiles": 1, - "SaveFile": 2 - } - } - Property { name: "fileMode"; type: "FileMode" } - Property { name: "file"; type: "QUrl" } - Property { name: "files"; type: "QList" } - Property { name: "currentFile"; type: "QUrl" } - Property { name: "currentFiles"; type: "QList" } - Property { name: "folder"; type: "QUrl" } - Property { name: "options"; type: "QFileDialogOptions::FileDialogOptions" } - Property { name: "nameFilters"; type: "QStringList" } - Property { - name: "selectedNameFilter" - type: "QQuickPlatformFileNameFilter" - isReadonly: true - isPointer: true - } - Property { name: "defaultSuffix"; type: "string" } - Property { name: "acceptLabel"; type: "string" } - Property { name: "rejectLabel"; type: "string" } - } - Component { - name: "QQuickPlatformFileNameFilter" - prototype: "QObject" - Property { name: "index"; type: "int" } - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "extensions"; type: "QStringList"; isReadonly: true } - Signal { - name: "indexChanged" - Parameter { name: "index"; type: "int" } - } - Signal { - name: "nameChanged" - Parameter { name: "name"; type: "string" } - } - Signal { - name: "extensionsChanged" - Parameter { name: "extensions"; type: "QStringList" } - } - } - Component { - name: "QQuickPlatformFolderDialog" - defaultProperty: "data" - prototype: "QQuickPlatformDialog" - exports: ["Qt.labs.platform/FolderDialog 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "folder"; type: "QUrl" } - Property { name: "currentFolder"; type: "QUrl" } - Property { name: "options"; type: "QFileDialogOptions::FileDialogOptions" } - Property { name: "acceptLabel"; type: "string" } - Property { name: "rejectLabel"; type: "string" } - } - Component { - name: "QQuickPlatformFontDialog" - defaultProperty: "data" - prototype: "QQuickPlatformDialog" - exports: ["Qt.labs.platform/FontDialog 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "font"; type: "QFont" } - Property { name: "currentFont"; type: "QFont" } - Property { name: "options"; type: "QFontDialogOptions::FontDialogOptions" } - } - Component { - name: "QQuickPlatformIcon" - Property { name: "source"; type: "QUrl" } - Property { name: "name"; type: "string" } - Property { name: "mask"; type: "bool" } - } - Component { - name: "QQuickPlatformMenu" - defaultProperty: "data" - prototype: "QObject" - exports: ["Qt.labs.platform/Menu 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "items"; type: "QQuickPlatformMenuItem"; isList: true; isReadonly: true } - Property { name: "menuBar"; type: "QQuickPlatformMenuBar"; isReadonly: true; isPointer: true } - Property { name: "parentMenu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true } - Property { - name: "systemTrayIcon" - type: "QQuickPlatformSystemTrayIcon" - isReadonly: true - isPointer: true - } - Property { name: "menuItem"; type: "QQuickPlatformMenuItem"; isReadonly: true; isPointer: true } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "minimumWidth"; type: "int" } - Property { name: "type"; type: "QPlatformMenu::MenuType" } - Property { name: "title"; type: "string" } - Property { name: "iconSource"; type: "QUrl" } - Property { name: "iconName"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "icon"; revision: 1; type: "QQuickPlatformIcon" } - Signal { name: "aboutToShow" } - Signal { name: "aboutToHide" } - Signal { name: "iconChanged"; revision: 1 } - Method { - name: "open" - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - Method { name: "close" } - Method { - name: "addItem" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { - name: "insertItem" - Parameter { name: "index"; type: "int" } - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { - name: "removeItem" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { - name: "addMenu" - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { - name: "insertMenu" - Parameter { name: "index"; type: "int" } - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { - name: "removeMenu" - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { name: "clear" } - } - Component { - name: "QQuickPlatformMenuBar" - defaultProperty: "data" - prototype: "QObject" - exports: ["Qt.labs.platform/MenuBar 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "menus"; type: "QQuickPlatformMenu"; isList: true; isReadonly: true } - Property { name: "window"; type: "QWindow"; isPointer: true } - Method { - name: "addMenu" - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { - name: "insertMenu" - Parameter { name: "index"; type: "int" } - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { - name: "removeMenu" - Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - } - Method { name: "clear" } - } - Component { - name: "QQuickPlatformMenuItem" - prototype: "QObject" - exports: [ - "Qt.labs.platform/MenuItem 1.0", - "Qt.labs.platform/MenuItem 1.1" - ] - exportMetaObjectRevisions: [0, 1] - Property { name: "menu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true } - Property { name: "subMenu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true } - Property { name: "group"; type: "QQuickPlatformMenuItemGroup"; isPointer: true } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "separator"; type: "bool" } - Property { name: "checkable"; type: "bool" } - Property { name: "checked"; type: "bool" } - Property { name: "role"; type: "QPlatformMenuItem::MenuRole" } - Property { name: "text"; type: "string" } - Property { name: "iconSource"; type: "QUrl" } - Property { name: "iconName"; type: "string" } - Property { name: "shortcut"; type: "QVariant" } - Property { name: "font"; type: "QFont" } - Property { name: "icon"; revision: 1; type: "QQuickPlatformIcon" } - Signal { name: "triggered" } - Signal { name: "hovered" } - Signal { name: "iconChanged"; revision: 1 } - Method { name: "toggle" } - } - Component { - name: "QQuickPlatformMenuItemGroup" - prototype: "QObject" - exports: ["Qt.labs.platform/MenuItemGroup 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "exclusive"; type: "bool" } - Property { name: "checkedItem"; type: "QQuickPlatformMenuItem"; isPointer: true } - Property { name: "items"; type: "QQuickPlatformMenuItem"; isList: true; isReadonly: true } - Signal { - name: "triggered" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Signal { - name: "hovered" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { - name: "addItem" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { - name: "removeItem" - Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true } - } - Method { name: "clear" } - } - Component { - name: "QQuickPlatformMenuSeparator" - prototype: "QQuickPlatformMenuItem" - exports: ["Qt.labs.platform/MenuSeparator 1.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickPlatformMessageDialog" - defaultProperty: "data" - prototype: "QQuickPlatformDialog" - exports: ["Qt.labs.platform/MessageDialog 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "text"; type: "string" } - Property { name: "informativeText"; type: "string" } - Property { name: "detailedText"; type: "string" } - Property { name: "buttons"; type: "QPlatformDialogHelper::StandardButtons" } - Signal { - name: "clicked" - Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" } - } - Signal { name: "okClicked" } - Signal { name: "saveClicked" } - Signal { name: "saveAllClicked" } - Signal { name: "openClicked" } - Signal { name: "yesClicked" } - Signal { name: "yesToAllClicked" } - Signal { name: "noClicked" } - Signal { name: "noToAllClicked" } - Signal { name: "abortClicked" } - Signal { name: "retryClicked" } - Signal { name: "ignoreClicked" } - Signal { name: "closeClicked" } - Signal { name: "cancelClicked" } - Signal { name: "discardClicked" } - Signal { name: "helpClicked" } - Signal { name: "applyClicked" } - Signal { name: "resetClicked" } - Signal { name: "restoreDefaultsClicked" } - } - Component { - name: "QQuickPlatformStandardPaths" - prototype: "QObject" - exports: ["Qt.labs.platform/StandardPaths 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Method { - name: "displayName" - type: "string" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - } - Method { - name: "findExecutable" - type: "QUrl" - Parameter { name: "executableName"; type: "string" } - Parameter { name: "paths"; type: "QStringList" } - } - Method { - name: "findExecutable" - type: "QUrl" - Parameter { name: "executableName"; type: "string" } - } - Method { - name: "locate" - type: "QUrl" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - Parameter { name: "fileName"; type: "string" } - Parameter { name: "options"; type: "QStandardPaths::LocateOptions" } - } - Method { - name: "locate" - type: "QUrl" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - Parameter { name: "fileName"; type: "string" } - } - Method { - name: "locateAll" - type: "QList" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - Parameter { name: "fileName"; type: "string" } - Parameter { name: "options"; type: "QStandardPaths::LocateOptions" } - } - Method { - name: "locateAll" - type: "QList" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - Parameter { name: "fileName"; type: "string" } - } - Method { - name: "setTestModeEnabled" - Parameter { name: "testMode"; type: "bool" } - } - Method { - name: "standardLocations" - type: "QList" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - } - Method { - name: "writableLocation" - type: "QUrl" - Parameter { name: "type"; type: "QStandardPaths::StandardLocation" } - } - } - Component { - name: "QQuickPlatformSystemTrayIcon" - prototype: "QObject" - exports: [ - "Qt.labs.platform/SystemTrayIcon 1.0", - "Qt.labs.platform/SystemTrayIcon 1.1" - ] - exportMetaObjectRevisions: [0, 1] - Property { name: "available"; type: "bool"; isReadonly: true } - Property { name: "supportsMessages"; type: "bool"; isReadonly: true } - Property { name: "visible"; type: "bool" } - Property { name: "iconSource"; type: "QUrl" } - Property { name: "iconName"; type: "string" } - Property { name: "tooltip"; type: "string" } - Property { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true } - Property { name: "geometry"; revision: 1; type: "QRect"; isReadonly: true } - Property { name: "icon"; revision: 1; type: "QQuickPlatformIcon" } - Signal { - name: "activated" - Parameter { name: "reason"; type: "QPlatformSystemTrayIcon::ActivationReason" } - } - Signal { name: "messageClicked" } - Signal { name: "geometryChanged"; revision: 1 } - Signal { name: "iconChanged"; revision: 1 } - Method { name: "show" } - Method { name: "hide" } - Method { - name: "showMessage" - Parameter { name: "title"; type: "string" } - Parameter { name: "message"; type: "string" } - Parameter { name: "iconType"; type: "QPlatformSystemTrayIcon::MessageIcon" } - Parameter { name: "msecs"; type: "int" } - } - Method { - name: "showMessage" - Parameter { name: "title"; type: "string" } - Parameter { name: "message"; type: "string" } - Parameter { name: "iconType"; type: "QPlatformSystemTrayIcon::MessageIcon" } - } - Method { - name: "showMessage" - Parameter { name: "title"; type: "string" } - Parameter { name: "message"; type: "string" } - } - } -} diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes deleted file mode 100644 index 42c04c80..00000000 --- a/src/imports/templates/plugins.qmltypes +++ /dev/null @@ -1,3122 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Templates 2.15' - -Module { - dependencies: ["QtQuick 2.9", "QtQuick.Window 2.2"] - Component { - name: "QQuickAbstractButton" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/AbstractButton 2.0", - "QtQuick.Templates/AbstractButton 2.2", - "QtQuick.Templates/AbstractButton 2.3", - "QtQuick.Templates/AbstractButton 2.4", - "QtQuick.Templates/AbstractButton 2.5" - ] - exportMetaObjectRevisions: [0, 2, 3, 4, 5] - Enum { - name: "Display" - values: { - "IconOnly": 0, - "TextOnly": 1, - "TextBesideIcon": 2, - "TextUnderIcon": 3 - } - } - Property { name: "text"; type: "string" } - Property { name: "down"; type: "bool" } - Property { name: "pressed"; type: "bool"; isReadonly: true } - Property { name: "checked"; type: "bool" } - Property { name: "checkable"; type: "bool" } - Property { name: "autoExclusive"; type: "bool" } - Property { name: "autoRepeat"; type: "bool" } - Property { name: "indicator"; type: "QQuickItem"; isPointer: true } - Property { name: "icon"; revision: 3; type: "QQuickIcon" } - Property { name: "display"; revision: 3; type: "Display" } - Property { name: "action"; revision: 3; type: "QQuickAction"; isPointer: true } - Property { name: "autoRepeatDelay"; revision: 4; type: "int" } - Property { name: "autoRepeatInterval"; revision: 4; type: "int" } - Property { name: "pressX"; revision: 4; type: "double"; isReadonly: true } - Property { name: "pressY"; revision: 4; type: "double"; isReadonly: true } - Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "pressed" } - Signal { name: "released" } - Signal { name: "canceled" } - Signal { name: "clicked" } - Signal { name: "pressAndHold" } - Signal { name: "doubleClicked" } - Signal { name: "toggled"; revision: 2 } - Signal { name: "iconChanged"; revision: 3 } - Signal { name: "displayChanged"; revision: 3 } - Signal { name: "actionChanged"; revision: 3 } - Signal { name: "autoRepeatDelayChanged"; revision: 4 } - Signal { name: "autoRepeatIntervalChanged"; revision: 4 } - Signal { name: "pressXChanged"; revision: 4 } - Signal { name: "pressYChanged"; revision: 4 } - Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } - Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } - Method { name: "toggle" } - } - Component { - name: "QQuickAction" - prototype: "QObject" - exports: ["QtQuick.Templates/Action 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "text"; type: "string" } - Property { name: "icon"; type: "QQuickIcon" } - Property { name: "enabled"; type: "bool" } - Property { name: "checked"; type: "bool" } - Property { name: "checkable"; type: "bool" } - Property { name: "shortcut"; type: "QVariant" } - Signal { - name: "textChanged" - Parameter { name: "text"; type: "string" } - } - Signal { - name: "iconChanged" - Parameter { name: "icon"; type: "QQuickIcon" } - } - Signal { - name: "enabledChanged" - Parameter { name: "enabled"; type: "bool" } - } - Signal { - name: "checkedChanged" - Parameter { name: "checked"; type: "bool" } - } - Signal { - name: "checkableChanged" - Parameter { name: "checkable"; type: "bool" } - } - Signal { - name: "shortcutChanged" - Parameter { name: "shortcut"; type: "QKeySequence" } - } - Signal { - name: "toggled" - Parameter { name: "source"; type: "QObject"; isPointer: true } - } - Signal { name: "toggled" } - Signal { - name: "triggered" - Parameter { name: "source"; type: "QObject"; isPointer: true } - } - Signal { name: "triggered" } - Method { - name: "toggle" - Parameter { name: "source"; type: "QObject"; isPointer: true } - } - Method { name: "toggle" } - Method { - name: "trigger" - Parameter { name: "source"; type: "QObject"; isPointer: true } - } - Method { name: "trigger" } - } - Component { - name: "QQuickActionGroup" - defaultProperty: "actions" - prototype: "QObject" - exports: ["QtQuick.Templates/ActionGroup 2.3"] - exportMetaObjectRevisions: [0] - attachedType: "QQuickActionGroupAttached" - Property { name: "checkedAction"; type: "QQuickAction"; isPointer: true } - Property { name: "actions"; type: "QQuickAction"; isList: true; isReadonly: true } - Property { name: "exclusive"; type: "bool" } - Property { name: "enabled"; type: "bool" } - Signal { - name: "triggered" - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - Method { - name: "addAction" - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - Method { - name: "removeAction" - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - } - Component { - name: "QQuickActionGroupAttached" - prototype: "QObject" - Property { name: "group"; type: "QQuickActionGroup"; isPointer: true } - } - Component { - name: "QQuickApplicationWindow" - defaultProperty: "contentData" - prototype: "QQuickWindowQmlImpl" - exports: [ - "QtQuick.Templates/ApplicationWindow 2.0", - "QtQuick.Templates/ApplicationWindow 2.3" - ] - exportMetaObjectRevisions: [0, 3] - attachedType: "QQuickApplicationWindowAttached" - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "activeFocusControl"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "header"; type: "QQuickItem"; isPointer: true } - Property { name: "footer"; type: "QQuickItem"; isPointer: true } - Property { name: "overlay"; type: "QQuickOverlay"; isReadonly: true; isPointer: true } - Property { name: "font"; type: "QFont" } - Property { name: "locale"; type: "QLocale" } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "menuBar"; revision: 3; type: "QQuickItem"; isPointer: true } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "menuBarChanged"; revision: 3 } - } - Component { - name: "QQuickApplicationWindowAttached" - prototype: "QObject" - Property { name: "window"; type: "QQuickApplicationWindow"; isReadonly: true; isPointer: true } - Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "activeFocusControl"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "header"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "footer"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "overlay"; type: "QQuickOverlay"; isReadonly: true; isPointer: true } - Property { name: "menuBar"; type: "QQuickItem"; isReadonly: true; isPointer: true } - } - Component { - name: "QQuickBusyIndicator" - defaultProperty: "data" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/BusyIndicator 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "running"; type: "bool" } - } - Component { - name: "QQuickButton" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/Button 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "highlighted"; type: "bool" } - Property { name: "flat"; type: "bool" } - } - Component { - name: "QQuickButtonGroup" - prototype: "QObject" - exports: [ - "QtQuick.Templates/ButtonGroup 2.0", - "QtQuick.Templates/ButtonGroup 2.1", - "QtQuick.Templates/ButtonGroup 2.3", - "QtQuick.Templates/ButtonGroup 2.4" - ] - exportMetaObjectRevisions: [0, 1, 3, 4] - attachedType: "QQuickButtonGroupAttached" - Property { name: "checkedButton"; type: "QQuickAbstractButton"; isPointer: true } - Property { name: "buttons"; type: "QQuickAbstractButton"; isList: true; isReadonly: true } - Property { name: "exclusive"; revision: 3; type: "bool" } - Property { name: "checkState"; revision: 4; type: "Qt::CheckState" } - Signal { - name: "clicked" - revision: 1 - Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true } - } - Signal { name: "exclusiveChanged"; revision: 3 } - Signal { name: "checkStateChanged"; revision: 4 } - Method { - name: "addButton" - Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true } - } - Method { - name: "removeButton" - Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true } - } - } - Component { - name: "QQuickButtonGroupAttached" - prototype: "QObject" - Property { name: "group"; type: "QQuickButtonGroup"; isPointer: true } - } - Component { - name: "QQuickCheckBox" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: [ - "QtQuick.Templates/CheckBox 2.0", - "QtQuick.Templates/CheckBox 2.4" - ] - exportMetaObjectRevisions: [0, 4] - Property { name: "tristate"; type: "bool" } - Property { name: "checkState"; type: "Qt::CheckState" } - Property { name: "nextCheckState"; revision: 4; type: "QJSValue" } - Signal { name: "nextCheckStateChanged"; revision: 4 } - } - Component { - name: "QQuickCheckDelegate" - defaultProperty: "data" - prototype: "QQuickItemDelegate" - exports: [ - "QtQuick.Templates/CheckDelegate 2.0", - "QtQuick.Templates/CheckDelegate 2.4" - ] - exportMetaObjectRevisions: [0, 4] - Property { name: "tristate"; type: "bool" } - Property { name: "checkState"; type: "Qt::CheckState" } - Property { name: "nextCheckState"; revision: 4; type: "QJSValue" } - Signal { name: "nextCheckStateChanged"; revision: 4 } - } - Component { - name: "QQuickComboBox" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/ComboBox 2.0", - "QtQuick.Templates/ComboBox 2.1", - "QtQuick.Templates/ComboBox 2.14", - "QtQuick.Templates/ComboBox 2.15", - "QtQuick.Templates/ComboBox 2.2", - "QtQuick.Templates/ComboBox 2.5" - ] - exportMetaObjectRevisions: [0, 1, 14, 15, 2, 5] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "model"; type: "QVariant" } - Property { name: "delegateModel"; type: "QQmlInstanceModel"; isReadonly: true; isPointer: true } - Property { name: "pressed"; type: "bool" } - Property { name: "highlightedIndex"; type: "int"; isReadonly: true } - Property { name: "currentIndex"; type: "int" } - Property { name: "currentText"; type: "string"; isReadonly: true } - Property { name: "displayText"; type: "string" } - Property { name: "textRole"; type: "string" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "indicator"; type: "QQuickItem"; isPointer: true } - Property { name: "popup"; type: "QQuickPopup"; isPointer: true } - Property { name: "flat"; revision: 1; type: "bool" } - Property { name: "down"; revision: 2; type: "bool" } - Property { name: "editable"; revision: 2; type: "bool" } - Property { name: "editText"; revision: 2; type: "string" } - Property { name: "validator"; revision: 2; type: "QValidator"; isPointer: true } - Property { name: "inputMethodHints"; revision: 2; type: "Qt::InputMethodHints" } - Property { name: "inputMethodComposing"; revision: 2; type: "bool"; isReadonly: true } - Property { name: "acceptableInput"; revision: 2; type: "bool"; isReadonly: true } - Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "currentValue"; revision: 14; type: "QVariant"; isReadonly: true } - Property { name: "valueRole"; revision: 14; type: "string" } - Property { name: "selectTextByMouse"; revision: 15; type: "bool" } - Signal { - name: "activated" - Parameter { name: "index"; type: "int" } - } - Signal { - name: "highlighted" - Parameter { name: "index"; type: "int" } - } - Signal { name: "flatChanged"; revision: 1 } - Signal { name: "accepted"; revision: 2 } - Signal { name: "downChanged"; revision: 2 } - Signal { name: "editableChanged"; revision: 2 } - Signal { name: "editTextChanged"; revision: 2 } - Signal { name: "validatorChanged"; revision: 2 } - Signal { name: "inputMethodHintsChanged"; revision: 2 } - Signal { name: "inputMethodComposingChanged"; revision: 2 } - Signal { name: "acceptableInputChanged"; revision: 2 } - Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } - Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } - Signal { name: "valueRoleChanged"; revision: 14 } - Signal { name: "currentValueChanged"; revision: 14 } - Signal { name: "selectTextByMouseChanged"; revision: 15 } - Method { name: "incrementCurrentIndex" } - Method { name: "decrementCurrentIndex" } - Method { name: "selectAll"; revision: 2 } - Method { - name: "textAt" - type: "string" - Parameter { name: "index"; type: "int" } - } - Method { - name: "find" - type: "int" - Parameter { name: "text"; type: "string" } - Parameter { name: "flags"; type: "Qt::MatchFlags" } - } - Method { - name: "find" - type: "int" - Parameter { name: "text"; type: "string" } - } - Method { - name: "valueAt" - revision: 14 - type: "QVariant" - Parameter { name: "index"; type: "int" } - } - Method { - name: "indexOfValue" - revision: 14 - type: "int" - Parameter { name: "value"; type: "QVariant" } - } - } - Component { - name: "QQuickContainer" - defaultProperty: "contentData" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/Container 2.0", - "QtQuick.Templates/Container 2.1", - "QtQuick.Templates/Container 2.3", - "QtQuick.Templates/Container 2.5" - ] - exportMetaObjectRevisions: [0, 1, 3, 5] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "contentModel"; type: "QVariant"; isReadonly: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "currentIndex"; type: "int" } - Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "contentWidth"; revision: 5; type: "double" } - Property { name: "contentHeight"; revision: 5; type: "double" } - Signal { name: "contentWidthChanged"; revision: 5 } - Signal { name: "contentHeightChanged"; revision: 5 } - Method { - name: "setCurrentIndex" - Parameter { name: "index"; type: "int" } - } - Method { name: "incrementCurrentIndex"; revision: 1 } - Method { name: "decrementCurrentIndex"; revision: 1 } - Method { - name: "itemAt" - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "addItem" - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Method { - name: "insertItem" - Parameter { name: "index"; type: "int" } - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Method { - name: "moveItem" - Parameter { name: "from"; type: "int" } - Parameter { name: "to"; type: "int" } - } - Method { - name: "removeItem" - Parameter { name: "item"; type: "QVariant" } - } - Method { - name: "takeItem" - revision: 3 - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - } - } - Component { name: "QQuickContentItem"; defaultProperty: "data"; prototype: "QQuickItem" } - Component { - name: "QQuickControl" - defaultProperty: "data" - prototype: "QQuickItem" - exports: [ - "QtQuick.Templates/Control 2.0", - "QtQuick.Templates/Control 2.3", - "QtQuick.Templates/Control 2.5" - ] - exportMetaObjectRevisions: [0, 3, 5] - Property { name: "font"; type: "QFont" } - Property { name: "availableWidth"; type: "double"; isReadonly: true } - Property { name: "availableHeight"; type: "double"; isReadonly: true } - Property { name: "padding"; type: "double" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - Property { name: "spacing"; type: "double" } - Property { name: "locale"; type: "QLocale" } - Property { name: "mirrored"; type: "bool"; isReadonly: true } - Property { name: "focusPolicy"; type: "Qt::FocusPolicy" } - Property { name: "focusReason"; type: "Qt::FocusReason" } - Property { name: "visualFocus"; type: "bool"; isReadonly: true } - Property { name: "hovered"; type: "bool"; isReadonly: true } - Property { name: "hoverEnabled"; type: "bool" } - Property { name: "wheelEnabled"; type: "bool" } - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "horizontalPadding"; revision: 5; type: "double" } - Property { name: "verticalPadding"; revision: 5; type: "double" } - Property { name: "implicitContentWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitContentHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "topInset"; revision: 5; type: "double" } - Property { name: "leftInset"; revision: 5; type: "double" } - Property { name: "rightInset"; revision: 5; type: "double" } - Property { name: "bottomInset"; revision: 5; type: "double" } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "horizontalPaddingChanged"; revision: 5 } - Signal { name: "verticalPaddingChanged"; revision: 5 } - Signal { name: "implicitContentWidthChanged"; revision: 5 } - Signal { name: "implicitContentHeightChanged"; revision: 5 } - Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } - Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } - Signal { name: "topInsetChanged"; revision: 5 } - Signal { name: "leftInsetChanged"; revision: 5 } - Signal { name: "rightInsetChanged"; revision: 5 } - Signal { name: "bottomInsetChanged"; revision: 5 } - } - Component { - name: "QQuickDelayButton" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/DelayButton 2.2"] - exportMetaObjectRevisions: [0] - Property { name: "delay"; type: "int" } - Property { name: "progress"; type: "double" } - Property { name: "transition"; type: "QQuickTransition"; isPointer: true } - Signal { name: "activated" } - } - Component { - name: "QQuickDial" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/Dial 2.0", - "QtQuick.Templates/Dial 2.2", - "QtQuick.Templates/Dial 2.5" - ] - exportMetaObjectRevisions: [0, 2, 5] - Enum { - name: "SnapMode" - values: { - "NoSnap": 0, - "SnapAlways": 1, - "SnapOnRelease": 2 - } - } - Enum { - name: "InputMode" - values: { - "Circular": 0, - "Horizontal": 1, - "Vertical": 2 - } - } - Property { name: "from"; type: "double" } - Property { name: "to"; type: "double" } - Property { name: "value"; type: "double" } - Property { name: "position"; type: "double"; isReadonly: true } - Property { name: "angle"; type: "double"; isReadonly: true } - Property { name: "stepSize"; type: "double" } - Property { name: "snapMode"; type: "SnapMode" } - Property { name: "wrap"; type: "bool" } - Property { name: "pressed"; type: "bool"; isReadonly: true } - Property { name: "handle"; type: "QQuickItem"; isPointer: true } - Property { name: "live"; revision: 2; type: "bool" } - Property { name: "inputMode"; revision: 5; type: "InputMode" } - Signal { name: "moved"; revision: 2 } - Signal { name: "liveChanged"; revision: 2 } - Signal { name: "inputModeChanged"; revision: 5 } - Method { name: "increase" } - Method { name: "decrease" } - } - Component { - name: "QQuickDialog" - defaultProperty: "contentData" - prototype: "QQuickPopup" - exports: [ - "QtQuick.Templates/Dialog 2.1", - "QtQuick.Templates/Dialog 2.3", - "QtQuick.Templates/Dialog 2.5" - ] - exportMetaObjectRevisions: [0, 3, 5] - Enum { - name: "StandardCode" - values: { - "Rejected": 0, - "Accepted": 1 - } - } - Property { name: "title"; type: "string" } - Property { name: "header"; type: "QQuickItem"; isPointer: true } - Property { name: "footer"; type: "QQuickItem"; isPointer: true } - Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" } - Property { name: "result"; revision: 3; type: "int" } - Property { name: "implicitHeaderWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitHeaderHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitFooterWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitFooterHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "accepted" } - Signal { name: "rejected" } - Signal { name: "applied"; revision: 3 } - Signal { name: "reset"; revision: 3 } - Signal { name: "discarded"; revision: 3 } - Signal { name: "helpRequested"; revision: 3 } - Signal { name: "resultChanged"; revision: 3 } - Method { name: "accept" } - Method { name: "reject" } - Method { - name: "done" - Parameter { name: "result"; type: "int" } - } - Method { - name: "standardButton" - revision: 3 - type: "QQuickAbstractButton*" - Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" } - } - } - Component { - name: "QQuickDialogButtonBox" - defaultProperty: "contentData" - prototype: "QQuickContainer" - exports: [ - "QtQuick.Templates/DialogButtonBox 2.1", - "QtQuick.Templates/DialogButtonBox 2.3", - "QtQuick.Templates/DialogButtonBox 2.5" - ] - exportMetaObjectRevisions: [0, 3, 5] - attachedType: "QQuickDialogButtonBoxAttached" - Enum { - name: "Position" - values: { - "Header": 0, - "Footer": 1 - } - } - Property { name: "position"; type: "Position" } - Property { name: "alignment"; type: "Qt::Alignment" } - Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "buttonLayout"; revision: 5; type: "QPlatformDialogHelper::ButtonLayout" } - Signal { name: "accepted" } - Signal { name: "rejected" } - Signal { name: "helpRequested" } - Signal { - name: "clicked" - Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true } - } - Signal { name: "applied"; revision: 3 } - Signal { name: "reset"; revision: 3 } - Signal { name: "discarded"; revision: 3 } - Signal { name: "buttonLayoutChanged"; revision: 5 } - Method { - name: "standardButton" - type: "QQuickAbstractButton*" - Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" } - } - } - Component { - name: "QQuickDialogButtonBoxAttached" - prototype: "QObject" - Property { name: "buttonBox"; type: "QQuickDialogButtonBox"; isReadonly: true; isPointer: true } - Property { name: "buttonRole"; type: "QPlatformDialogHelper::ButtonRole" } - } - Component { - name: "QQuickDrawer" - defaultProperty: "contentData" - prototype: "QQuickPopup" - exports: [ - "QtQuick.Templates/Drawer 2.0", - "QtQuick.Templates/Drawer 2.2" - ] - exportMetaObjectRevisions: [0, 2] - Property { name: "edge"; type: "Qt::Edge" } - Property { name: "position"; type: "double" } - Property { name: "dragMargin"; type: "double" } - Property { name: "interactive"; revision: 2; type: "bool" } - Signal { name: "interactiveChanged"; revision: 2 } - } - Component { - name: "QQuickFrame" - defaultProperty: "contentData" - prototype: "QQuickPane" - exports: ["QtQuick.Templates/Frame 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickGroupBox" - defaultProperty: "contentData" - prototype: "QQuickFrame" - exports: [ - "QtQuick.Templates/GroupBox 2.0", - "QtQuick.Templates/GroupBox 2.5" - ] - exportMetaObjectRevisions: [0, 5] - Property { name: "title"; type: "string" } - Property { name: "label"; type: "QQuickItem"; isPointer: true } - Property { name: "implicitLabelWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitLabelHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "implicitLabelWidthChanged"; revision: 5 } - Signal { name: "implicitLabelHeightChanged"; revision: 5 } - } - Component { - name: "QQuickHeaderViewBase" - defaultProperty: "flickableData" - prototype: "QQuickTableView" - Property { name: "textRole"; type: "string" } - } - Component { - name: "QQuickHorizontalHeaderView" - defaultProperty: "flickableData" - prototype: "QQuickHeaderViewBase" - exports: ["QtQuick.Templates/HorizontalHeaderView 2.15"] - exportMetaObjectRevisions: [0] - attachedType: "QQuickTableViewAttached" - } - Component { - name: "QQuickIcon" - Property { name: "name"; type: "string" } - Property { name: "source"; type: "QUrl" } - Property { name: "width"; type: "int" } - Property { name: "height"; type: "int" } - Property { name: "color"; type: "QColor" } - Property { name: "cache"; type: "bool" } - } - Component { - name: "QQuickImplicitSizeItem" - defaultProperty: "data" - prototype: "QQuickItem" - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 11 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 4 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickItemDelegate" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/ItemDelegate 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "highlighted"; type: "bool" } - } - Component { - name: "QQuickLabel" - defaultProperty: "data" - prototype: "QQuickText" - exports: [ - "QtQuick.Templates/Label 2.0", - "QtQuick.Templates/Label 2.3", - "QtQuick.Templates/Label 2.5" - ] - exportMetaObjectRevisions: [0, 3, 5] - Property { name: "font"; type: "QFont" } - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "topInset"; revision: 5; type: "double" } - Property { name: "leftInset"; revision: 5; type: "double" } - Property { name: "rightInset"; revision: 5; type: "double" } - Property { name: "bottomInset"; revision: 5; type: "double" } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } - Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } - Signal { name: "topInsetChanged"; revision: 5 } - Signal { name: "leftInsetChanged"; revision: 5 } - Signal { name: "rightInsetChanged"; revision: 5 } - Signal { name: "bottomInsetChanged"; revision: 5 } - } - Component { - name: "QQuickMenu" - defaultProperty: "contentData" - prototype: "QQuickPopup" - exports: ["QtQuick.Templates/Menu 2.0", "QtQuick.Templates/Menu 2.3"] - exportMetaObjectRevisions: [0, 3] - Property { name: "contentModel"; type: "QVariant"; isReadonly: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "title"; type: "string" } - Property { name: "count"; revision: 3; type: "int"; isReadonly: true } - Property { name: "cascade"; revision: 3; type: "bool" } - Property { name: "overlap"; revision: 3; type: "double" } - Property { name: "delegate"; revision: 3; type: "QQmlComponent"; isPointer: true } - Property { name: "currentIndex"; revision: 3; type: "int" } - Signal { - name: "titleChanged" - Parameter { name: "title"; type: "string" } - } - Signal { name: "countChanged"; revision: 3 } - Signal { - name: "cascadeChanged" - revision: 3 - Parameter { name: "cascade"; type: "bool" } - } - Signal { name: "overlapChanged"; revision: 3 } - Signal { name: "delegateChanged"; revision: 3 } - Signal { name: "currentIndexChanged"; revision: 3 } - Method { - name: "itemAt" - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "addItem" - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Method { - name: "insertItem" - Parameter { name: "index"; type: "int" } - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Method { - name: "moveItem" - Parameter { name: "from"; type: "int" } - Parameter { name: "to"; type: "int" } - } - Method { - name: "removeItem" - Parameter { name: "item"; type: "QVariant" } - } - Method { - name: "takeItem" - revision: 3 - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "menuAt" - revision: 3 - type: "QQuickMenu*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "addMenu" - revision: 3 - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "insertMenu" - revision: 3 - Parameter { name: "index"; type: "int" } - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "removeMenu" - revision: 3 - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "takeMenu" - revision: 3 - type: "QQuickMenu*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "actionAt" - revision: 3 - type: "QQuickAction*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "addAction" - revision: 3 - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - Method { - name: "insertAction" - revision: 3 - Parameter { name: "index"; type: "int" } - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - Method { - name: "removeAction" - revision: 3 - Parameter { name: "action"; type: "QQuickAction"; isPointer: true } - } - Method { - name: "takeAction" - revision: 3 - type: "QQuickAction*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "popup" - revision: 3 - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - Method { name: "dismiss"; revision: 3 } - } - Component { - name: "QQuickMenuBar" - defaultProperty: "contentData" - prototype: "QQuickContainer" - exports: ["QtQuick.Templates/MenuBar 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "contentWidth"; type: "double" } - Property { name: "contentHeight"; type: "double" } - Property { name: "menus"; type: "QQuickMenu"; isList: true; isReadonly: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Method { - name: "menuAt" - type: "QQuickMenu*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "addMenu" - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "insertMenu" - Parameter { name: "index"; type: "int" } - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "removeMenu" - Parameter { name: "menu"; type: "QQuickMenu"; isPointer: true } - } - Method { - name: "takeMenu" - type: "QQuickMenu*" - Parameter { name: "index"; type: "int" } - } - } - Component { - name: "QQuickMenuBarItem" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/MenuBarItem 2.3"] - exportMetaObjectRevisions: [0] - Property { name: "menuBar"; type: "QQuickMenuBar"; isReadonly: true; isPointer: true } - Property { name: "menu"; type: "QQuickMenu"; isPointer: true } - Property { name: "highlighted"; type: "bool" } - Signal { name: "triggered" } - } - Component { - name: "QQuickMenuItem" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: [ - "QtQuick.Templates/MenuItem 2.0", - "QtQuick.Templates/MenuItem 2.3" - ] - exportMetaObjectRevisions: [0, 3] - Property { name: "highlighted"; type: "bool" } - Property { name: "arrow"; revision: 3; type: "QQuickItem"; isPointer: true } - Property { name: "menu"; revision: 3; type: "QQuickMenu"; isReadonly: true; isPointer: true } - Property { name: "subMenu"; revision: 3; type: "QQuickMenu"; isReadonly: true; isPointer: true } - Signal { name: "triggered" } - Signal { name: "arrowChanged"; revision: 3 } - Signal { name: "menuChanged"; revision: 3 } - Signal { name: "subMenuChanged"; revision: 3 } - } - Component { - name: "QQuickMenuSeparator" - defaultProperty: "data" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/MenuSeparator 2.1"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickOverlay" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtQuick.Templates/Overlay 2.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - attachedType: "QQuickOverlayAttached" - Property { name: "modal"; type: "QQmlComponent"; isPointer: true } - Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } - Signal { name: "pressed" } - Signal { name: "released" } - } - Component { - name: "QQuickOverlayAttached" - prototype: "QObject" - Property { name: "overlay"; type: "QQuickOverlay"; isReadonly: true; isPointer: true } - Property { name: "modal"; type: "QQmlComponent"; isPointer: true } - Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } - Signal { name: "pressed" } - Signal { name: "released" } - } - Component { - name: "QQuickPage" - defaultProperty: "contentData" - prototype: "QQuickPane" - exports: [ - "QtQuick.Templates/Page 2.0", - "QtQuick.Templates/Page 2.1", - "QtQuick.Templates/Page 2.5" - ] - exportMetaObjectRevisions: [0, 1, 5] - Property { name: "title"; type: "string" } - Property { name: "header"; type: "QQuickItem"; isPointer: true } - Property { name: "footer"; type: "QQuickItem"; isPointer: true } - Property { name: "contentWidth"; revision: 1; type: "double" } - Property { name: "contentHeight"; revision: 1; type: "double" } - Property { name: "implicitHeaderWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitHeaderHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitFooterWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitFooterHeight"; revision: 5; type: "double"; isReadonly: true } - } - Component { - name: "QQuickPageIndicator" - defaultProperty: "data" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/PageIndicator 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "count"; type: "int" } - Property { name: "currentIndex"; type: "int" } - Property { name: "interactive"; type: "bool" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - } - Component { - name: "QQuickPane" - defaultProperty: "contentData" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/Pane 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "contentWidth"; type: "double" } - Property { name: "contentHeight"; type: "double" } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - } - Component { - name: "QQuickPopup" - defaultProperty: "contentData" - prototype: "QObject" - exports: [ - "QtQuick.Templates/Popup 2.0", - "QtQuick.Templates/Popup 2.1", - "QtQuick.Templates/Popup 2.3", - "QtQuick.Templates/Popup 2.5" - ] - exportMetaObjectRevisions: [0, 1, 3, 5] - Enum { - name: "ClosePolicy" - values: { - "NoAutoClose": 0, - "CloseOnPressOutside": 1, - "CloseOnPressOutsideParent": 2, - "CloseOnReleaseOutside": 4, - "CloseOnReleaseOutsideParent": 8, - "CloseOnEscape": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "contentWidth"; type: "double" } - Property { name: "contentHeight"; type: "double" } - Property { name: "availableWidth"; type: "double"; isReadonly: true } - Property { name: "availableHeight"; type: "double"; isReadonly: true } - Property { name: "margins"; type: "double" } - Property { name: "topMargin"; type: "double" } - Property { name: "leftMargin"; type: "double" } - Property { name: "rightMargin"; type: "double" } - Property { name: "bottomMargin"; type: "double" } - Property { name: "padding"; type: "double" } - Property { name: "topPadding"; type: "double" } - Property { name: "leftPadding"; type: "double" } - Property { name: "rightPadding"; type: "double" } - Property { name: "bottomPadding"; type: "double" } - Property { name: "locale"; type: "QLocale" } - Property { name: "font"; type: "QFont" } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "modal"; type: "bool" } - Property { name: "dim"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "opacity"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "closePolicy"; type: "ClosePolicy" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "enter"; type: "QQuickTransition"; isPointer: true } - Property { name: "exit"; type: "QQuickTransition"; isPointer: true } - Property { name: "spacing"; revision: 1; type: "double" } - Property { name: "opened"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "mirrored"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "enabled"; revision: 3; type: "bool" } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "horizontalPadding"; type: "double" } - Property { name: "verticalPadding"; type: "double" } - Property { - name: "anchors" - revision: 5 - type: "QQuickPopupAnchors" - isReadonly: true - isPointer: true - } - Property { name: "implicitContentWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitContentHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "topInset"; revision: 5; type: "double" } - Property { name: "leftInset"; revision: 5; type: "double" } - Property { name: "rightInset"; revision: 5; type: "double" } - Property { name: "bottomInset"; revision: 5; type: "double" } - Signal { name: "opened" } - Signal { name: "closed" } - Signal { name: "aboutToShow" } - Signal { name: "aboutToHide" } - Signal { - name: "windowChanged" - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "spacingChanged"; revision: 1 } - Signal { name: "openedChanged"; revision: 3 } - Signal { name: "mirroredChanged"; revision: 3 } - Signal { name: "enabledChanged"; revision: 3 } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "horizontalPaddingChanged"; revision: 5 } - Signal { name: "verticalPaddingChanged"; revision: 5 } - Signal { name: "implicitContentWidthChanged"; revision: 5 } - Signal { name: "implicitContentHeightChanged"; revision: 5 } - Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } - Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } - Signal { name: "topInsetChanged"; revision: 5 } - Signal { name: "leftInsetChanged"; revision: 5 } - Signal { name: "rightInsetChanged"; revision: 5 } - Signal { name: "bottomInsetChanged"; revision: 5 } - Method { name: "open" } - Method { name: "close" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { name: "forceActiveFocus" } - } - Component { - name: "QQuickPopupAnchors" - prototype: "QObject" - Property { name: "centerIn"; type: "QQuickItem"; isPointer: true } - } - Component { - name: "QQuickProgressBar" - defaultProperty: "data" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/ProgressBar 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "from"; type: "double" } - Property { name: "to"; type: "double" } - Property { name: "value"; type: "double" } - Property { name: "position"; type: "double"; isReadonly: true } - Property { name: "visualPosition"; type: "double"; isReadonly: true } - Property { name: "indeterminate"; type: "bool" } - } - Component { - name: "QQuickRadioButton" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/RadioButton 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickRadioDelegate" - defaultProperty: "data" - prototype: "QQuickItemDelegate" - exports: ["QtQuick.Templates/RadioDelegate 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickRangeSlider" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/RangeSlider 2.0", - "QtQuick.Templates/RangeSlider 2.1", - "QtQuick.Templates/RangeSlider 2.2", - "QtQuick.Templates/RangeSlider 2.3", - "QtQuick.Templates/RangeSlider 2.5" - ] - exportMetaObjectRevisions: [0, 1, 2, 3, 5] - Enum { - name: "SnapMode" - values: { - "NoSnap": 0, - "SnapAlways": 1, - "SnapOnRelease": 2 - } - } - Property { name: "from"; type: "double" } - Property { name: "to"; type: "double" } - Property { name: "first"; type: "QQuickRangeSliderNode"; isReadonly: true; isPointer: true } - Property { name: "second"; type: "QQuickRangeSliderNode"; isReadonly: true; isPointer: true } - Property { name: "stepSize"; type: "double" } - Property { name: "snapMode"; type: "SnapMode" } - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "live"; revision: 2; type: "bool" } - Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "touchDragThreshold"; revision: 5; type: "double" } - Signal { name: "liveChanged"; revision: 2 } - Signal { name: "touchDragThresholdChanged"; revision: 5 } - Method { - name: "setValues" - Parameter { name: "firstValue"; type: "double" } - Parameter { name: "secondValue"; type: "double" } - } - Method { - name: "valueAt" - revision: 5 - type: "double" - Parameter { name: "position"; type: "double" } - } - } - Component { - name: "QQuickRangeSliderNode" - prototype: "QObject" - Property { name: "value"; type: "double" } - Property { name: "position"; type: "double"; isReadonly: true } - Property { name: "visualPosition"; type: "double"; isReadonly: true } - Property { name: "handle"; type: "QQuickItem"; isPointer: true } - Property { name: "pressed"; type: "bool" } - Property { name: "hovered"; revision: 1; type: "bool" } - Property { name: "implicitHandleWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitHandleHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "hoveredChanged"; revision: 1 } - Signal { name: "moved" } - Method { name: "increase" } - Method { name: "decrease" } - } - Component { - name: "QQuickRoundButton" - defaultProperty: "data" - prototype: "QQuickButton" - exports: ["QtQuick.Templates/RoundButton 2.1"] - exportMetaObjectRevisions: [0] - Property { name: "radius"; type: "double" } - } - Component { - name: "QQuickScrollBar" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/ScrollBar 2.0", - "QtQuick.Templates/ScrollBar 2.2", - "QtQuick.Templates/ScrollBar 2.3", - "QtQuick.Templates/ScrollBar 2.4" - ] - exportMetaObjectRevisions: [0, 2, 3, 4] - attachedType: "QQuickScrollBarAttached" - Enum { - name: "SnapMode" - values: { - "NoSnap": 0, - "SnapAlways": 1, - "SnapOnRelease": 2 - } - } - Enum { - name: "Policy" - values: { - "AsNeeded": 0, - "AlwaysOff": 1, - "AlwaysOn": 2 - } - } - Property { name: "size"; type: "double" } - Property { name: "position"; type: "double" } - Property { name: "stepSize"; type: "double" } - Property { name: "active"; type: "bool" } - Property { name: "pressed"; type: "bool" } - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "snapMode"; revision: 2; type: "SnapMode" } - Property { name: "interactive"; revision: 2; type: "bool" } - Property { name: "policy"; revision: 2; type: "Policy" } - Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "minimumSize"; revision: 4; type: "double" } - Property { name: "visualSize"; revision: 4; type: "double"; isReadonly: true } - Property { name: "visualPosition"; revision: 4; type: "double"; isReadonly: true } - Signal { name: "snapModeChanged"; revision: 2 } - Signal { name: "interactiveChanged"; revision: 2 } - Signal { name: "policyChanged"; revision: 2 } - Signal { name: "minimumSizeChanged"; revision: 4 } - Signal { name: "visualSizeChanged"; revision: 4 } - Signal { name: "visualPositionChanged"; revision: 4 } - Method { name: "increase" } - Method { name: "decrease" } - Method { - name: "setSize" - Parameter { name: "size"; type: "double" } - } - Method { - name: "setPosition" - Parameter { name: "position"; type: "double" } - } - } - Component { - name: "QQuickScrollBarAttached" - prototype: "QObject" - Property { name: "horizontal"; type: "QQuickScrollBar"; isPointer: true } - Property { name: "vertical"; type: "QQuickScrollBar"; isPointer: true } - } - Component { - name: "QQuickScrollIndicator" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/ScrollIndicator 2.0", - "QtQuick.Templates/ScrollIndicator 2.3", - "QtQuick.Templates/ScrollIndicator 2.4" - ] - exportMetaObjectRevisions: [0, 3, 4] - attachedType: "QQuickScrollIndicatorAttached" - Property { name: "size"; type: "double" } - Property { name: "position"; type: "double" } - Property { name: "active"; type: "bool" } - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "minimumSize"; revision: 4; type: "double" } - Property { name: "visualSize"; revision: 4; type: "double"; isReadonly: true } - Property { name: "visualPosition"; revision: 4; type: "double"; isReadonly: true } - Signal { name: "minimumSizeChanged"; revision: 4 } - Signal { name: "visualSizeChanged"; revision: 4 } - Signal { name: "visualPositionChanged"; revision: 4 } - Method { - name: "setSize" - Parameter { name: "size"; type: "double" } - } - Method { - name: "setPosition" - Parameter { name: "position"; type: "double" } - } - } - Component { - name: "QQuickScrollIndicatorAttached" - prototype: "QObject" - Property { name: "horizontal"; type: "QQuickScrollIndicator"; isPointer: true } - Property { name: "vertical"; type: "QQuickScrollIndicator"; isPointer: true } - } - Component { - name: "QQuickScrollView" - defaultProperty: "contentData" - prototype: "QQuickPane" - exports: ["QtQuick.Templates/ScrollView 2.2"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickSlider" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/Slider 2.0", - "QtQuick.Templates/Slider 2.1", - "QtQuick.Templates/Slider 2.2", - "QtQuick.Templates/Slider 2.3", - "QtQuick.Templates/Slider 2.5" - ] - exportMetaObjectRevisions: [0, 1, 2, 3, 5] - Enum { - name: "SnapMode" - values: { - "NoSnap": 0, - "SnapAlways": 1, - "SnapOnRelease": 2 - } - } - Property { name: "from"; type: "double" } - Property { name: "to"; type: "double" } - Property { name: "value"; type: "double" } - Property { name: "position"; type: "double"; isReadonly: true } - Property { name: "visualPosition"; type: "double"; isReadonly: true } - Property { name: "stepSize"; type: "double" } - Property { name: "snapMode"; type: "SnapMode" } - Property { name: "pressed"; type: "bool" } - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "handle"; type: "QQuickItem"; isPointer: true } - Property { name: "live"; revision: 2; type: "bool" } - Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "touchDragThreshold"; revision: 5; type: "double" } - Property { name: "implicitHandleWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitHandleHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "moved"; revision: 2 } - Signal { name: "liveChanged"; revision: 2 } - Signal { name: "touchDragThresholdChanged"; revision: 5 } - Signal { name: "implicitHandleWidthChanged"; revision: 5 } - Signal { name: "implicitHandleHeightChanged"; revision: 5 } - Method { name: "increase" } - Method { name: "decrease" } - Method { - name: "valueAt" - revision: 1 - type: "double" - Parameter { name: "position"; type: "double" } - } - } - Component { - name: "QQuickSpinBox" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/SpinBox 2.0", - "QtQuick.Templates/SpinBox 2.1", - "QtQuick.Templates/SpinBox 2.2", - "QtQuick.Templates/SpinBox 2.3", - "QtQuick.Templates/SpinBox 2.4", - "QtQuick.Templates/SpinBox 2.5" - ] - exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5] - Property { name: "from"; type: "int" } - Property { name: "to"; type: "int" } - Property { name: "value"; type: "int" } - Property { name: "stepSize"; type: "int" } - Property { name: "editable"; type: "bool" } - Property { name: "validator"; type: "QValidator"; isPointer: true } - Property { name: "textFromValue"; type: "QJSValue" } - Property { name: "valueFromText"; type: "QJSValue" } - Property { name: "up"; type: "QQuickSpinButton"; isReadonly: true; isPointer: true } - Property { name: "down"; type: "QQuickSpinButton"; isReadonly: true; isPointer: true } - Property { name: "inputMethodHints"; revision: 2; type: "Qt::InputMethodHints" } - Property { name: "inputMethodComposing"; revision: 2; type: "bool"; isReadonly: true } - Property { name: "wrap"; revision: 3; type: "bool" } - Property { name: "displayText"; revision: 4; type: "string"; isReadonly: true } - Signal { name: "valueModified"; revision: 2 } - Signal { name: "inputMethodHintsChanged"; revision: 2 } - Signal { name: "inputMethodComposingChanged"; revision: 2 } - Signal { name: "wrapChanged"; revision: 3 } - Signal { name: "displayTextChanged"; revision: 4 } - Method { name: "increase" } - Method { name: "decrease" } - } - Component { - name: "QQuickSpinButton" - prototype: "QObject" - Property { name: "pressed"; type: "bool" } - Property { name: "indicator"; type: "QQuickItem"; isPointer: true } - Property { name: "hovered"; revision: 1; type: "bool" } - Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } - Signal { name: "hoveredChanged"; revision: 1 } - Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } - Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } - } - Component { - name: "QQuickSplitHandleAttached" - prototype: "QObject" - exports: ["QtQuick.Templates/SplitHandle 2.13"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "hovered"; type: "bool"; isReadonly: true } - Property { name: "pressed"; type: "bool"; isReadonly: true } - } - Component { - name: "QQuickSplitView" - defaultProperty: "contentData" - prototype: "QQuickContainer" - exports: ["QtQuick.Templates/SplitView 2.13"] - exportMetaObjectRevisions: [0] - attachedType: "QQuickSplitViewAttached" - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "resizing"; type: "bool"; isReadonly: true } - Property { name: "handle"; type: "QQmlComponent"; isPointer: true } - Method { name: "saveState"; type: "QVariant" } - Method { - name: "restoreState" - type: "bool" - Parameter { name: "state"; type: "QVariant" } - } - } - Component { - name: "QQuickSplitViewAttached" - prototype: "QObject" - Property { name: "view"; type: "QQuickSplitView"; isReadonly: true; isPointer: true } - Property { name: "minimumWidth"; type: "double" } - Property { name: "minimumHeight"; type: "double" } - Property { name: "preferredWidth"; type: "double" } - Property { name: "preferredHeight"; type: "double" } - Property { name: "maximumWidth"; type: "double" } - Property { name: "maximumHeight"; type: "double" } - Property { name: "fillHeight"; type: "bool" } - Property { name: "fillWidth"; type: "bool" } - } - Component { - name: "QQuickStackView" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/StackView 2.0", - "QtQuick.Templates/StackView 2.1" - ] - exportMetaObjectRevisions: [0, 1] - attachedType: "QQuickStackViewAttached" - Enum { - name: "Status" - values: { - "Inactive": 0, - "Deactivating": 1, - "Activating": 2, - "Active": 3 - } - } - Enum { - name: "LoadBehavior" - values: { - "DontLoad": 0, - "ForceLoad": 1 - } - } - Enum { - name: "Operation" - values: { - "Transition": -1, - "Immediate": 0, - "PushTransition": 1, - "ReplaceTransition": 2, - "PopTransition": 3 - } - } - Property { name: "busy"; type: "bool"; isReadonly: true } - Property { name: "depth"; type: "int"; isReadonly: true } - Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "initialItem"; type: "QJSValue" } - Property { name: "popEnter"; type: "QQuickTransition"; isPointer: true } - Property { name: "popExit"; type: "QQuickTransition"; isPointer: true } - Property { name: "pushEnter"; type: "QQuickTransition"; isPointer: true } - Property { name: "pushExit"; type: "QQuickTransition"; isPointer: true } - Property { name: "replaceEnter"; type: "QQuickTransition"; isPointer: true } - Property { name: "replaceExit"; type: "QQuickTransition"; isPointer: true } - Property { name: "empty"; revision: 3; type: "bool"; isReadonly: true } - Signal { name: "emptyChanged"; revision: 3 } - Method { - name: "clear" - Parameter { name: "operation"; type: "Operation" } - } - Method { name: "clear" } - Method { - name: "get" - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - Parameter { name: "behavior"; type: "LoadBehavior" } - } - Method { - name: "get" - type: "QQuickItem*" - Parameter { name: "index"; type: "int" } - } - Method { - name: "find" - type: "QQuickItem*" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "behavior"; type: "LoadBehavior" } - } - Method { - name: "find" - type: "QQuickItem*" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "push" - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "pop" - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "replace" - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - } - Component { - name: "QQuickStackViewAttached" - prototype: "QObject" - Property { name: "index"; type: "int"; isReadonly: true } - Property { name: "view"; type: "QQuickStackView"; isReadonly: true; isPointer: true } - Property { name: "status"; type: "QQuickStackView::Status"; isReadonly: true } - Property { name: "visible"; type: "bool" } - Signal { name: "activated" } - Signal { name: "activating" } - Signal { name: "deactivated" } - Signal { name: "deactivating" } - Signal { name: "removed" } - } - Component { - name: "QQuickSwipe" - prototype: "QObject" - Property { name: "position"; type: "double" } - Property { name: "complete"; type: "bool"; isReadonly: true } - Property { name: "left"; type: "QQmlComponent"; isPointer: true } - Property { name: "behind"; type: "QQmlComponent"; isPointer: true } - Property { name: "right"; type: "QQmlComponent"; isPointer: true } - Property { name: "leftItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "behindItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "rightItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "enabled"; type: "bool" } - Property { name: "transition"; type: "QQuickTransition"; isPointer: true } - Signal { name: "completed" } - Signal { name: "opened" } - Signal { name: "closed" } - Method { name: "close"; revision: 1 } - Method { - name: "open" - revision: 2 - Parameter { name: "side"; type: "QQuickSwipeDelegate::Side" } - } - } - Component { - name: "QQuickSwipeDelegate" - defaultProperty: "data" - prototype: "QQuickItemDelegate" - exports: [ - "QtQuick.Templates/SwipeDelegate 2.0", - "QtQuick.Templates/SwipeDelegate 2.1", - "QtQuick.Templates/SwipeDelegate 2.2" - ] - exportMetaObjectRevisions: [0, 1, 2] - attachedType: "QQuickSwipeDelegateAttached" - Enum { - name: "Side" - values: { - "Left": 1, - "Right": -1 - } - } - Property { name: "swipe"; type: "QQuickSwipe"; isReadonly: true; isPointer: true } - } - Component { - name: "QQuickSwipeDelegateAttached" - prototype: "QObject" - Property { name: "pressed"; type: "bool"; isReadonly: true } - Signal { name: "clicked" } - } - Component { - name: "QQuickSwipeView" - defaultProperty: "contentData" - prototype: "QQuickContainer" - exports: [ - "QtQuick.Templates/SwipeView 2.0", - "QtQuick.Templates/SwipeView 2.1", - "QtQuick.Templates/SwipeView 2.2" - ] - exportMetaObjectRevisions: [0, 1, 2] - attachedType: "QQuickSwipeViewAttached" - Property { name: "interactive"; revision: 1; type: "bool" } - Property { name: "orientation"; revision: 2; type: "Qt::Orientation" } - Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } - Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } - Signal { name: "interactiveChanged"; revision: 1 } - Signal { name: "orientationChanged"; revision: 2 } - } - Component { - name: "QQuickSwipeViewAttached" - prototype: "QObject" - Property { name: "index"; type: "int"; isReadonly: true } - Property { name: "isCurrentItem"; type: "bool"; isReadonly: true } - Property { name: "view"; type: "QQuickSwipeView"; isReadonly: true; isPointer: true } - Property { name: "isNextItem"; revision: 1; type: "bool"; isReadonly: true } - Property { name: "isPreviousItem"; revision: 1; type: "bool"; isReadonly: true } - } - Component { - name: "QQuickSwitch" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/Switch 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "position"; type: "double" } - Property { name: "visualPosition"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickSwitchDelegate" - defaultProperty: "data" - prototype: "QQuickItemDelegate" - exports: ["QtQuick.Templates/SwitchDelegate 2.0"] - exportMetaObjectRevisions: [0] - Property { name: "position"; type: "double" } - Property { name: "visualPosition"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickTabBar" - defaultProperty: "contentData" - prototype: "QQuickContainer" - exports: [ - "QtQuick.Templates/TabBar 2.0", - "QtQuick.Templates/TabBar 2.2" - ] - exportMetaObjectRevisions: [0, 2] - attachedType: "QQuickTabBarAttached" - Enum { - name: "Position" - values: { - "Header": 0, - "Footer": 1 - } - } - Property { name: "position"; type: "Position" } - Property { name: "contentWidth"; revision: 2; type: "double" } - Property { name: "contentHeight"; revision: 2; type: "double" } - } - Component { - name: "QQuickTabBarAttached" - prototype: "QObject" - Property { name: "index"; type: "int"; isReadonly: true } - Property { name: "tabBar"; type: "QQuickTabBar"; isReadonly: true; isPointer: true } - Property { name: "position"; type: "QQuickTabBar::Position"; isReadonly: true } - } - Component { - name: "QQuickTabButton" - defaultProperty: "data" - prototype: "QQuickAbstractButton" - exports: ["QtQuick.Templates/TabButton 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickTableView" - defaultProperty: "flickableData" - prototype: "QQuickFlickable" - exports: ["QtQuick.Templates/__TableView__ 2.15"] - exportMetaObjectRevisions: [15] - attachedType: "QQuickTableViewAttached" - Property { name: "rows"; type: "int"; isReadonly: true } - Property { name: "columns"; type: "int"; isReadonly: true } - Property { name: "rowSpacing"; type: "double" } - Property { name: "columnSpacing"; type: "double" } - Property { name: "rowHeightProvider"; type: "QJSValue" } - Property { name: "columnWidthProvider"; type: "QJSValue" } - Property { name: "model"; type: "QVariant" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "reuseItems"; type: "bool" } - Property { name: "contentWidth"; type: "double" } - Property { name: "contentHeight"; type: "double" } - Property { name: "syncView"; revision: 14; type: "QQuickTableView"; isPointer: true } - Property { name: "syncDirection"; revision: 14; type: "Qt::Orientations" } - Signal { name: "syncViewChanged"; revision: 14 } - Signal { name: "syncDirectionChanged"; revision: 14 } - Method { name: "forceLayout" } - } - Component { - name: "QQuickTableViewAttached" - prototype: "QObject" - Property { name: "view"; type: "QQuickTableView"; isReadonly: true; isPointer: true } - Signal { name: "pooled" } - Signal { name: "reused" } - } - Component { - name: "QQuickText" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4, - "AlignJustify": 8 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "TextStyle" - values: { - "Normal": 0, - "Outline": 1, - "Raised": 2, - "Sunken": 3 - } - } - Enum { - name: "TextFormat" - values: { - "PlainText": 0, - "RichText": 1, - "MarkdownText": 3, - "AutoText": 2, - "StyledText": 4 - } - } - Enum { - name: "TextElideMode" - values: { - "ElideLeft": 0, - "ElideRight": 1, - "ElideMiddle": 2, - "ElideNone": 3 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Enum { - name: "LineHeightMode" - values: { - "ProportionalHeight": 0, - "FixedHeight": 1 - } - } - Enum { - name: "FontSizeMode" - values: { - "FixedSize": 0, - "HorizontalFit": 1, - "VerticalFit": 2, - "Fit": 3 - } - } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "linkColor"; type: "QColor" } - Property { name: "style"; type: "TextStyle" } - Property { name: "styleColor"; type: "QColor" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "lineCount"; type: "int"; isReadonly: true } - Property { name: "truncated"; type: "bool"; isReadonly: true } - Property { name: "maximumLineCount"; type: "int" } - Property { name: "textFormat"; type: "TextFormat" } - Property { name: "elide"; type: "TextElideMode" } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "lineHeight"; type: "double" } - Property { name: "lineHeightMode"; type: "LineHeightMode" } - Property { name: "baseUrl"; type: "QUrl" } - Property { name: "minimumPixelSize"; type: "int" } - Property { name: "minimumPointSize"; type: "int" } - Property { name: "fontSizeMode"; type: "FontSizeMode" } - Property { name: "renderType"; type: "RenderType" } - Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } - Property { name: "padding"; revision: 6; type: "double" } - Property { name: "topPadding"; revision: 6; type: "double" } - Property { name: "leftPadding"; revision: 6; type: "double" } - Property { name: "rightPadding"; revision: 6; type: "double" } - Property { name: "bottomPadding"; revision: 6; type: "double" } - Property { name: "fontInfo"; revision: 9; type: "QJSValue"; isReadonly: true } - Property { name: "advance"; revision: 10; type: "QSizeF"; isReadonly: true } - Signal { - name: "textChanged" - Parameter { name: "text"; type: "string" } - } - Signal { - name: "linkActivated" - Parameter { name: "link"; type: "string" } - } - Signal { - name: "linkHovered" - revision: 2 - Parameter { name: "link"; type: "string" } - } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "styleChanged" - Parameter { name: "style"; type: "QQuickText::TextStyle" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickText::VAlignment" } - } - Signal { - name: "textFormatChanged" - Parameter { name: "textFormat"; type: "QQuickText::TextFormat" } - } - Signal { - name: "elideModeChanged" - Parameter { name: "mode"; type: "QQuickText::TextElideMode" } - } - Signal { name: "contentSizeChanged" } - Signal { - name: "contentWidthChanged" - Parameter { name: "contentWidth"; type: "double" } - } - Signal { - name: "contentHeightChanged" - Parameter { name: "contentHeight"; type: "double" } - } - Signal { - name: "lineHeightChanged" - Parameter { name: "lineHeight"; type: "double" } - } - Signal { - name: "lineHeightModeChanged" - Parameter { name: "mode"; type: "LineHeightMode" } - } - Signal { - name: "lineLaidOut" - Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } - } - Signal { name: "paddingChanged"; revision: 6 } - Signal { name: "topPaddingChanged"; revision: 6 } - Signal { name: "leftPaddingChanged"; revision: 6 } - Signal { name: "rightPaddingChanged"; revision: 6 } - Signal { name: "bottomPaddingChanged"; revision: 6 } - Signal { name: "fontInfoChanged"; revision: 9 } - Method { name: "doLayout" } - Method { name: "forceLayout"; revision: 9 } - Method { - name: "linkAt" - revision: 3 - type: "string" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickTextArea" - defaultProperty: "data" - prototype: "QQuickTextEdit" - exports: [ - "QtQuick.Templates/TextArea 2.0", - "QtQuick.Templates/TextArea 2.1", - "QtQuick.Templates/TextArea 2.3", - "QtQuick.Templates/TextArea 2.5" - ] - exportMetaObjectRevisions: [0, 1, 3, 5] - attachedType: "QQuickTextAreaAttached" - Property { name: "font"; type: "QFont" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "placeholderText"; type: "string" } - Property { name: "focusReason"; type: "Qt::FocusReason" } - Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true } - Property { name: "hoverEnabled"; revision: 1; type: "bool" } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } - Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "topInset"; revision: 5; type: "double" } - Property { name: "leftInset"; revision: 5; type: "double" } - Property { name: "rightInset"; revision: 5; type: "double" } - Property { name: "bottomInset"; revision: 5; type: "double" } - Signal { name: "implicitWidthChanged3" } - Signal { name: "implicitHeightChanged3" } - Signal { - name: "pressAndHold" - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { - name: "pressed" - revision: 1 - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { - name: "released" - revision: 1 - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { name: "hoveredChanged"; revision: 1 } - Signal { name: "hoverEnabledChanged"; revision: 1 } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "placeholderTextColorChanged"; revision: 5 } - Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } - Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } - Signal { name: "topInsetChanged"; revision: 5 } - Signal { name: "leftInsetChanged"; revision: 5 } - Signal { name: "rightInsetChanged"; revision: 5 } - Signal { name: "bottomInsetChanged"; revision: 5 } - } - Component { - name: "QQuickTextAreaAttached" - prototype: "QObject" - Property { name: "flickable"; type: "QQuickTextArea"; isPointer: true } - } - Component { - name: "QQuickTextEdit" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4, - "AlignJustify": 8 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "TextFormat" - values: { - "PlainText": 0, - "RichText": 1, - "AutoText": 2, - "MarkdownText": 3 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "SelectionMode" - values: { - "SelectCharacters": 0, - "SelectWords": 1 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Property { name: "text"; type: "string" } - Property { name: "color"; type: "QColor" } - Property { name: "selectionColor"; type: "QColor" } - Property { name: "selectedTextColor"; type: "QColor" } - Property { name: "font"; type: "QFont" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "lineCount"; type: "int"; isReadonly: true } - Property { name: "length"; type: "int"; isReadonly: true } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "textFormat"; type: "TextFormat" } - Property { name: "readOnly"; type: "bool" } - Property { name: "cursorVisible"; type: "bool" } - Property { name: "cursorPosition"; type: "int" } - Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true } - Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "overwriteMode"; type: "bool" } - Property { name: "selectionStart"; type: "int"; isReadonly: true } - Property { name: "selectionEnd"; type: "int"; isReadonly: true } - Property { name: "selectedText"; type: "string"; isReadonly: true } - Property { name: "activeFocusOnPress"; type: "bool" } - Property { name: "persistentSelection"; type: "bool" } - Property { name: "textMargin"; type: "double" } - Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" } - Property { name: "selectByKeyboard"; revision: 1; type: "bool" } - Property { name: "selectByMouse"; type: "bool" } - Property { name: "mouseSelectionMode"; type: "SelectionMode" } - Property { name: "canPaste"; type: "bool"; isReadonly: true } - Property { name: "canUndo"; type: "bool"; isReadonly: true } - Property { name: "canRedo"; type: "bool"; isReadonly: true } - Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true } - Property { name: "baseUrl"; type: "QUrl" } - Property { name: "renderType"; type: "RenderType" } - Property { - name: "textDocument" - revision: 1 - type: "QQuickTextDocument" - isReadonly: true - isPointer: true - } - Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } - Property { name: "padding"; revision: 6; type: "double" } - Property { name: "topPadding"; revision: 6; type: "double" } - Property { name: "leftPadding"; revision: 6; type: "double" } - Property { name: "rightPadding"; revision: 6; type: "double" } - Property { name: "bottomPadding"; revision: 6; type: "double" } - Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true } - Property { name: "tabStopDistance"; revision: 10; type: "double" } - Signal { name: "preeditTextChanged"; revision: 7 } - Signal { name: "contentSizeChanged" } - Signal { - name: "colorChanged" - Parameter { name: "color"; type: "QColor" } - } - Signal { - name: "selectionColorChanged" - Parameter { name: "color"; type: "QColor" } - } - Signal { - name: "selectedTextColorChanged" - Parameter { name: "color"; type: "QColor" } - } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickTextEdit::HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickTextEdit::VAlignment" } - } - Signal { - name: "textFormatChanged" - Parameter { name: "textFormat"; type: "QQuickTextEdit::TextFormat" } - } - Signal { - name: "readOnlyChanged" - Parameter { name: "isReadOnly"; type: "bool" } - } - Signal { - name: "cursorVisibleChanged" - Parameter { name: "isCursorVisible"; type: "bool" } - } - Signal { - name: "overwriteModeChanged" - Parameter { name: "overwriteMode"; type: "bool" } - } - Signal { - name: "activeFocusOnPressChanged" - Parameter { name: "activeFocusOnPressed"; type: "bool" } - } - Signal { - name: "persistentSelectionChanged" - Parameter { name: "isPersistentSelection"; type: "bool" } - } - Signal { - name: "textMarginChanged" - Parameter { name: "textMargin"; type: "double" } - } - Signal { - name: "selectByKeyboardChanged" - revision: 1 - Parameter { name: "selectByKeyboard"; type: "bool" } - } - Signal { - name: "selectByMouseChanged" - Parameter { name: "selectByMouse"; type: "bool" } - } - Signal { - name: "mouseSelectionModeChanged" - Parameter { name: "mode"; type: "QQuickTextEdit::SelectionMode" } - } - Signal { - name: "linkActivated" - Parameter { name: "link"; type: "string" } - } - Signal { - name: "linkHovered" - revision: 2 - Parameter { name: "link"; type: "string" } - } - Signal { name: "editingFinished"; revision: 6 } - Signal { name: "paddingChanged"; revision: 6 } - Signal { name: "topPaddingChanged"; revision: 6 } - Signal { name: "leftPaddingChanged"; revision: 6 } - Signal { name: "rightPaddingChanged"; revision: 6 } - Signal { name: "bottomPaddingChanged"; revision: 6 } - Signal { - name: "tabStopDistanceChanged" - revision: 10 - Parameter { name: "distance"; type: "double" } - } - Method { name: "selectAll" } - Method { name: "selectWord" } - Method { - name: "select" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { name: "deselect" } - Method { - name: "isRightToLeft" - type: "bool" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { name: "cut" } - Method { name: "copy" } - Method { name: "paste" } - Method { name: "undo" } - Method { name: "redo" } - Method { - name: "insert" - Parameter { name: "position"; type: "int" } - Parameter { name: "text"; type: "string" } - } - Method { - name: "remove" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { - name: "append" - revision: 2 - Parameter { name: "text"; type: "string" } - } - Method { name: "clear"; revision: 7 } - Method { - name: "inputMethodQuery" - revision: 4 - type: "QVariant" - Parameter { name: "query"; type: "Qt::InputMethodQuery" } - Parameter { name: "argument"; type: "QVariant" } - } - Method { - name: "positionToRectangle" - type: "QRectF" - Parameter { type: "int" } - } - Method { - name: "positionAt" - type: "int" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - Method { - name: "moveCursorSelection" - Parameter { name: "pos"; type: "int" } - } - Method { - name: "moveCursorSelection" - Parameter { name: "pos"; type: "int" } - Parameter { name: "mode"; type: "SelectionMode" } - } - Method { - name: "getText" - type: "string" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { - name: "getFormattedText" - type: "string" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { - name: "linkAt" - revision: 3 - type: "string" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickTextField" - defaultProperty: "data" - prototype: "QQuickTextInput" - exports: [ - "QtQuick.Templates/TextField 2.0", - "QtQuick.Templates/TextField 2.1", - "QtQuick.Templates/TextField 2.3", - "QtQuick.Templates/TextField 2.5" - ] - exportMetaObjectRevisions: [0, 1, 3, 5] - Property { name: "font"; type: "QFont" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "background"; type: "QQuickItem"; isPointer: true } - Property { name: "placeholderText"; type: "string" } - Property { name: "focusReason"; type: "Qt::FocusReason" } - Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true } - Property { name: "hoverEnabled"; revision: 1; type: "bool" } - Property { name: "palette"; revision: 3; type: "QPalette" } - Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } - Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } - Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } - Property { name: "topInset"; revision: 5; type: "double" } - Property { name: "leftInset"; revision: 5; type: "double" } - Property { name: "rightInset"; revision: 5; type: "double" } - Property { name: "bottomInset"; revision: 5; type: "double" } - Signal { name: "implicitWidthChanged3" } - Signal { name: "implicitHeightChanged3" } - Signal { - name: "pressAndHold" - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { - name: "pressed" - revision: 1 - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { - name: "released" - revision: 1 - Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true } - } - Signal { name: "hoveredChanged"; revision: 1 } - Signal { name: "hoverEnabledChanged"; revision: 1 } - Signal { name: "paletteChanged"; revision: 3 } - Signal { name: "placeholderTextColorChanged"; revision: 5 } - Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } - Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } - Signal { name: "topInsetChanged"; revision: 5 } - Signal { name: "leftInsetChanged"; revision: 5 } - Signal { name: "rightInsetChanged"; revision: 5 } - Signal { name: "bottomInsetChanged"; revision: 5 } - } - Component { - name: "QQuickTextInput" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - Enum { - name: "EchoMode" - values: { - "Normal": 0, - "NoEcho": 1, - "Password": 2, - "PasswordEchoOnEdit": 3 - } - } - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "SelectionMode" - values: { - "SelectCharacters": 0, - "SelectWords": 1 - } - } - Enum { - name: "CursorPosition" - values: { - "CursorBetweenCharacters": 0, - "CursorOnCharacter": 1 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Property { name: "text"; type: "string" } - Property { name: "length"; type: "int"; isReadonly: true } - Property { name: "color"; type: "QColor" } - Property { name: "selectionColor"; type: "QColor" } - Property { name: "selectedTextColor"; type: "QColor" } - Property { name: "font"; type: "QFont" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "readOnly"; type: "bool" } - Property { name: "cursorVisible"; type: "bool" } - Property { name: "cursorPosition"; type: "int" } - Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true } - Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "overwriteMode"; type: "bool" } - Property { name: "selectionStart"; type: "int"; isReadonly: true } - Property { name: "selectionEnd"; type: "int"; isReadonly: true } - Property { name: "selectedText"; type: "string"; isReadonly: true } - Property { name: "maximumLength"; type: "int" } - Property { name: "validator"; type: "QValidator"; isPointer: true } - Property { name: "inputMask"; type: "string" } - Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" } - Property { name: "acceptableInput"; type: "bool"; isReadonly: true } - Property { name: "echoMode"; type: "EchoMode" } - Property { name: "activeFocusOnPress"; type: "bool" } - Property { name: "passwordCharacter"; type: "string" } - Property { name: "passwordMaskDelay"; revision: 4; type: "int" } - Property { name: "displayText"; type: "string"; isReadonly: true } - Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true } - Property { name: "autoScroll"; type: "bool" } - Property { name: "selectByMouse"; type: "bool" } - Property { name: "mouseSelectionMode"; type: "SelectionMode" } - Property { name: "persistentSelection"; type: "bool" } - Property { name: "canPaste"; type: "bool"; isReadonly: true } - Property { name: "canUndo"; type: "bool"; isReadonly: true } - Property { name: "canRedo"; type: "bool"; isReadonly: true } - Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "renderType"; type: "RenderType" } - Property { name: "padding"; revision: 6; type: "double" } - Property { name: "topPadding"; revision: 6; type: "double" } - Property { name: "leftPadding"; revision: 6; type: "double" } - Property { name: "rightPadding"; revision: 6; type: "double" } - Property { name: "bottomPadding"; revision: 6; type: "double" } - Signal { name: "accepted" } - Signal { name: "editingFinished"; revision: 2 } - Signal { name: "textEdited"; revision: 9 } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickTextInput::HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "QQuickTextInput::VAlignment" } - } - Signal { - name: "readOnlyChanged" - Parameter { name: "isReadOnly"; type: "bool" } - } - Signal { - name: "cursorVisibleChanged" - Parameter { name: "isCursorVisible"; type: "bool" } - } - Signal { - name: "overwriteModeChanged" - Parameter { name: "overwriteMode"; type: "bool" } - } - Signal { - name: "maximumLengthChanged" - Parameter { name: "maximumLength"; type: "int" } - } - Signal { - name: "inputMaskChanged" - Parameter { name: "inputMask"; type: "string" } - } - Signal { - name: "echoModeChanged" - Parameter { name: "echoMode"; type: "QQuickTextInput::EchoMode" } - } - Signal { - name: "passwordMaskDelayChanged" - revision: 4 - Parameter { name: "delay"; type: "int" } - } - Signal { name: "preeditTextChanged"; revision: 7 } - Signal { - name: "activeFocusOnPressChanged" - Parameter { name: "activeFocusOnPress"; type: "bool" } - } - Signal { - name: "autoScrollChanged" - Parameter { name: "autoScroll"; type: "bool" } - } - Signal { - name: "selectByMouseChanged" - Parameter { name: "selectByMouse"; type: "bool" } - } - Signal { - name: "mouseSelectionModeChanged" - Parameter { name: "mode"; type: "QQuickTextInput::SelectionMode" } - } - Signal { name: "contentSizeChanged" } - Signal { name: "paddingChanged"; revision: 6 } - Signal { name: "topPaddingChanged"; revision: 6 } - Signal { name: "leftPaddingChanged"; revision: 6 } - Signal { name: "rightPaddingChanged"; revision: 6 } - Signal { name: "bottomPaddingChanged"; revision: 6 } - Method { name: "selectAll" } - Method { name: "selectWord" } - Method { - name: "select" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { name: "deselect" } - Method { - name: "isRightToLeft" - type: "bool" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { name: "cut" } - Method { name: "copy" } - Method { name: "paste" } - Method { name: "undo" } - Method { name: "redo" } - Method { - name: "insert" - Parameter { name: "position"; type: "int" } - Parameter { name: "text"; type: "string" } - } - Method { - name: "remove" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - Method { - name: "ensureVisible" - revision: 4 - Parameter { name: "position"; type: "int" } - } - Method { name: "clear"; revision: 7 } - Method { - name: "positionAt" - Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "positionToRectangle" - type: "QRectF" - Parameter { name: "pos"; type: "int" } - } - Method { - name: "moveCursorSelection" - Parameter { name: "pos"; type: "int" } - } - Method { - name: "moveCursorSelection" - Parameter { name: "pos"; type: "int" } - Parameter { name: "mode"; type: "SelectionMode" } - } - Method { - name: "inputMethodQuery" - revision: 4 - type: "QVariant" - Parameter { name: "query"; type: "Qt::InputMethodQuery" } - Parameter { name: "argument"; type: "QVariant" } - } - Method { - name: "getText" - type: "string" - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - } - } - Component { - name: "QQuickToolBar" - defaultProperty: "contentData" - prototype: "QQuickPane" - exports: ["QtQuick.Templates/ToolBar 2.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "Position" - values: { - "Header": 0, - "Footer": 1 - } - } - Property { name: "position"; type: "Position" } - } - Component { - name: "QQuickToolButton" - defaultProperty: "data" - prototype: "QQuickButton" - exports: ["QtQuick.Templates/ToolButton 2.0"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QQuickToolSeparator" - defaultProperty: "data" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/ToolSeparator 2.1"] - exportMetaObjectRevisions: [0] - Property { name: "orientation"; type: "Qt::Orientation" } - Property { name: "horizontal"; type: "bool"; isReadonly: true } - Property { name: "vertical"; type: "bool"; isReadonly: true } - } - Component { - name: "QQuickToolTip" - defaultProperty: "contentData" - prototype: "QQuickPopup" - exports: [ - "QtQuick.Templates/ToolTip 2.0", - "QtQuick.Templates/ToolTip 2.5" - ] - exportMetaObjectRevisions: [0, 5] - attachedType: "QQuickToolTipAttached" - Property { name: "delay"; type: "int" } - Property { name: "timeout"; type: "int" } - Property { name: "text"; type: "string" } - Method { - name: "show" - revision: 5 - Parameter { name: "text"; type: "string" } - Parameter { name: "ms"; type: "int" } - } - Method { - name: "show" - revision: 5 - Parameter { name: "text"; type: "string" } - } - Method { name: "hide"; revision: 5 } - } - Component { - name: "QQuickToolTipAttached" - prototype: "QObject" - Property { name: "text"; type: "string" } - Property { name: "delay"; type: "int" } - Property { name: "timeout"; type: "int" } - Property { name: "visible"; type: "bool" } - Property { name: "toolTip"; type: "QQuickToolTip"; isReadonly: true; isPointer: true } - Method { - name: "show" - Parameter { name: "text"; type: "string" } - Parameter { name: "ms"; type: "int" } - } - Method { - name: "show" - Parameter { name: "text"; type: "string" } - } - Method { name: "hide" } - } - Component { - name: "QQuickTumbler" - defaultProperty: "data" - prototype: "QQuickControl" - exports: [ - "QtQuick.Templates/Tumbler 2.0", - "QtQuick.Templates/Tumbler 2.1", - "QtQuick.Templates/Tumbler 2.2" - ] - exportMetaObjectRevisions: [0, 1, 2] - attachedType: "QQuickTumblerAttached" - Enum { - name: "PositionMode" - values: { - "Beginning": 0, - "Center": 1, - "End": 2, - "Visible": 3, - "Contain": 4, - "SnapPosition": 5 - } - } - Property { name: "model"; type: "QVariant" } - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "currentIndex"; type: "int" } - Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "visibleItemCount"; type: "int" } - Property { name: "wrap"; revision: 1; type: "bool" } - Property { name: "moving"; revision: 2; type: "bool"; isReadonly: true } - Signal { name: "wrapChanged"; revision: 1 } - Signal { name: "movingChanged"; revision: 2 } - Method { - name: "positionViewAtIndex" - revision: 5 - Parameter { name: "index"; type: "int" } - Parameter { name: "mode"; type: "PositionMode" } - } - } - Component { - name: "QQuickTumblerAttached" - prototype: "QObject" - Property { name: "tumbler"; type: "QQuickTumbler"; isReadonly: true; isPointer: true } - Property { name: "displacement"; type: "double"; isReadonly: true } - } - Component { - name: "QQuickVerticalHeaderView" - defaultProperty: "flickableData" - prototype: "QQuickHeaderViewBase" - exports: ["QtQuick.Templates/VerticalHeaderView 2.15"] - exportMetaObjectRevisions: [0] - attachedType: "QQuickTableViewAttached" - } - Component { - name: "QQuickWindow" - defaultProperty: "data" - prototype: "QWindow" - Enum { - name: "CreateTextureOptions" - values: { - "TextureHasAlphaChannel": 1, - "TextureHasMipmaps": 2, - "TextureOwnsGLTexture": 4, - "TextureCanUseAtlas": 8, - "TextureIsOpaque": 16 - } - } - Enum { - name: "SceneGraphError" - values: { - "ContextNotAvailable": 1 - } - } - Enum { - name: "TextRenderType" - values: { - "QtTextRendering": 0, - "NativeTextRendering": 1 - } - } - Enum { - name: "NativeObjectType" - values: { - "NativeObjectTexture": 0 - } - } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "color"; type: "QColor" } - Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { - name: "activeFocusItem" - revision: 1 - type: "QQuickItem" - isReadonly: true - isPointer: true - } - Signal { name: "frameSwapped" } - Signal { - name: "openglContextCreated" - revision: 2 - Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true } - } - Signal { name: "sceneGraphInitialized" } - Signal { name: "sceneGraphInvalidated" } - Signal { name: "beforeSynchronizing" } - Signal { name: "afterSynchronizing"; revision: 2 } - Signal { name: "beforeRendering" } - Signal { name: "afterRendering" } - Signal { name: "afterAnimating"; revision: 2 } - Signal { name: "sceneGraphAboutToStop"; revision: 2 } - Signal { - name: "closing" - revision: 1 - Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true } - } - Signal { - name: "colorChanged" - Parameter { type: "QColor" } - } - Signal { name: "activeFocusItemChanged"; revision: 1 } - Signal { - name: "sceneGraphError" - revision: 2 - Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" } - Parameter { name: "message"; type: "string" } - } - Signal { name: "beforeRenderPassRecording"; revision: 14 } - Signal { name: "afterRenderPassRecording"; revision: 14 } - Method { name: "update" } - Method { name: "releaseResources" } - } - Component { - name: "QQuickWindowQmlImpl" - defaultProperty: "data" - prototype: "QQuickWindow" - Property { name: "visible"; type: "bool" } - Property { name: "visibility"; type: "Visibility" } - Property { name: "screen"; revision: 3; type: "QObject"; isPointer: true } - Signal { - name: "visibleChanged" - Parameter { name: "arg"; type: "bool" } - } - Signal { - name: "visibilityChanged" - Parameter { name: "visibility"; type: "QWindow::Visibility" } - } - Signal { name: "screenChanged"; revision: 3 } - } - Component { - name: "QWindow" - prototype: "QObject" - Enum { - name: "Visibility" - values: { - "Hidden": 0, - "AutomaticVisibility": 1, - "Windowed": 2, - "Minimized": 3, - "Maximized": 4, - "FullScreen": 5 - } - } - Enum { - name: "AncestorMode" - values: { - "ExcludeTransients": 0, - "IncludeTransients": 1 - } - } - Property { name: "title"; type: "string" } - Property { name: "modality"; type: "Qt::WindowModality" } - Property { name: "flags"; type: "Qt::WindowFlags" } - Property { name: "x"; type: "int" } - Property { name: "y"; type: "int" } - Property { name: "width"; type: "int" } - Property { name: "height"; type: "int" } - Property { name: "minimumWidth"; type: "int" } - Property { name: "minimumHeight"; type: "int" } - Property { name: "maximumWidth"; type: "int" } - Property { name: "maximumHeight"; type: "int" } - Property { name: "visible"; type: "bool" } - Property { name: "active"; revision: 1; type: "bool"; isReadonly: true } - Property { name: "visibility"; revision: 1; type: "Visibility" } - Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" } - Property { name: "opacity"; revision: 1; type: "double" } - Property { name: "transientParent"; revision: 13; type: "QWindow"; isPointer: true } - Signal { - name: "screenChanged" - Parameter { name: "screen"; type: "QScreen"; isPointer: true } - } - Signal { - name: "modalityChanged" - Parameter { name: "modality"; type: "Qt::WindowModality" } - } - Signal { - name: "windowStateChanged" - Parameter { name: "windowState"; type: "Qt::WindowState" } - } - Signal { - name: "windowTitleChanged" - revision: 2 - Parameter { name: "title"; type: "string" } - } - Signal { - name: "xChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "yChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "widthChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "heightChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "minimumWidthChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "minimumHeightChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "maximumWidthChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "maximumHeightChanged" - Parameter { name: "arg"; type: "int" } - } - Signal { - name: "visibleChanged" - Parameter { name: "arg"; type: "bool" } - } - Signal { - name: "visibilityChanged" - revision: 1 - Parameter { name: "visibility"; type: "QWindow::Visibility" } - } - Signal { name: "activeChanged"; revision: 1 } - Signal { - name: "contentOrientationChanged" - Parameter { name: "orientation"; type: "Qt::ScreenOrientation" } - } - Signal { - name: "focusObjectChanged" - Parameter { name: "object"; type: "QObject"; isPointer: true } - } - Signal { - name: "opacityChanged" - revision: 1 - Parameter { name: "opacity"; type: "double" } - } - Signal { - name: "transientParentChanged" - revision: 13 - Parameter { name: "transientParent"; type: "QWindow"; isPointer: true } - } - Method { name: "requestActivate"; revision: 1 } - Method { - name: "setVisible" - Parameter { name: "visible"; type: "bool" } - } - Method { name: "show" } - Method { name: "hide" } - Method { name: "showMinimized" } - Method { name: "showMaximized" } - Method { name: "showFullScreen" } - Method { name: "showNormal" } - Method { name: "close"; type: "bool" } - Method { name: "raise" } - Method { name: "lower" } - Method { - name: "startSystemResize" - type: "bool" - Parameter { name: "edges"; type: "Qt::Edges" } - } - Method { name: "startSystemMove"; type: "bool" } - Method { - name: "setTitle" - Parameter { type: "string" } - } - Method { - name: "setX" - Parameter { name: "arg"; type: "int" } - } - Method { - name: "setY" - Parameter { name: "arg"; type: "int" } - } - Method { - name: "setWidth" - Parameter { name: "arg"; type: "int" } - } - Method { - name: "setHeight" - Parameter { name: "arg"; type: "int" } - } - Method { - name: "setGeometry" - Parameter { name: "posx"; type: "int" } - Parameter { name: "posy"; type: "int" } - Parameter { name: "w"; type: "int" } - Parameter { name: "h"; type: "int" } - } - Method { - name: "setGeometry" - Parameter { name: "rect"; type: "QRect" } - } - Method { - name: "setMinimumWidth" - Parameter { name: "w"; type: "int" } - } - Method { - name: "setMinimumHeight" - Parameter { name: "h"; type: "int" } - } - Method { - name: "setMaximumWidth" - Parameter { name: "w"; type: "int" } - } - Method { - name: "setMaximumHeight" - Parameter { name: "h"; type: "int" } - } - Method { - name: "alert" - revision: 1 - Parameter { name: "msec"; type: "int" } - } - Method { name: "requestUpdate"; revision: 3 } - } -} -- cgit v1.2.3