From 9fc3659a678e6d1bd6b2514486bde1d1725963da Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 10 Apr 2017 11:22:34 +0200 Subject: Replace QQuickColorImageProvider with QQuickColorImage Now that QQuickImage is exported, we can colorize images using a simple QQuickImage subclass instead of using an image provider. The main issue with QQuickColorImageProvider was that it was based on QGuiApplication::devicePixelRatio(). Now each QQuickColorImage handles its device pixel ratio correctly depending on which screen it is on. Even though we now have to use two bindings (color and source) instead of encoding the color to the source, at the same time we can remove the sourceSize bindings that were added as image provider specific high DPI workarounds (ca87ab8). Task-number: QTBUG-58925 Change-Id: Iba14d2afe3bda540189682ba5be7c58d907d88f7 Reviewed-by: Mitch Curtis --- src/imports/controls/CheckIndicator.qml | 7 +- src/imports/controls/ComboBox.qml | 7 +- src/imports/controls/Dial.qml | 7 +- src/imports/controls/material/ComboBox.qml | 8 +-- .../qtquickcontrols2materialstyleplugin.cpp | 3 - src/imports/controls/qtquickcontrols2plugin.cpp | 7 +- src/imports/controls/universal/CheckIndicator.qml | 9 +-- src/imports/controls/universal/ComboBox.qml | 8 +-- src/imports/controls/universal/MenuItem.qml | 9 +-- src/imports/controls/universal/SpinBox.qml | 22 +++--- .../qtquickcontrols2universalstyleplugin.cpp | 4 -- src/quickcontrols2/qquickcolorimage.cpp | 77 +++++++++++++++++++++ src/quickcontrols2/qquickcolorimage_p.h | 80 ++++++++++++++++++++++ src/quickcontrols2/qquickcolorimageprovider.cpp | 80 ---------------------- src/quickcontrols2/qquickcolorimageprovider_p.h | 69 ------------------- src/quickcontrols2/quickcontrols2.pri | 4 +- 16 files changed, 199 insertions(+), 202 deletions(-) create mode 100644 src/quickcontrols2/qquickcolorimage.cpp create mode 100644 src/quickcontrols2/qquickcolorimage_p.h delete mode 100644 src/quickcontrols2/qquickcolorimageprovider.cpp delete mode 100644 src/quickcontrols2/qquickcolorimageprovider_p.h diff --git a/src/imports/controls/CheckIndicator.qml b/src/imports/controls/CheckIndicator.qml index 761f0440..2bc87fe6 100644 --- a/src/imports/controls/CheckIndicator.qml +++ b/src/imports/controls/CheckIndicator.qml @@ -55,12 +55,11 @@ Rectangle { : (control.down ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : "transparent" opacity: enabled ? 1 : 0.3 - Image { + ColorImage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "image://default/check/" + (control.visualFocus ? Default.focusColor : Default.textColor) - sourceSize.width: width - sourceSize.height: height + color: control.visualFocus ? Default.focusColor : Default.textColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" visible: control.checkState === Qt.Checked } diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 83492aef..e6a1e8a8 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -60,12 +60,11 @@ T.ComboBox { hoverEnabled: control.hoverEnabled } - indicator: Image { + indicator: ColorImage { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 - source: "image://default/double-arrow/" + (!control.editable && control.visualFocus ? Default.focusColor : Default.textColor) - sourceSize.width: width - sourceSize.height: height + color: !control.editable && control.visualFocus ? Default.focusColor : Default.textColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" opacity: enabled ? 1 : 0.3 } diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index 555ce340..db8203fe 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -53,15 +53,14 @@ T.Dial { opacity: control.enabled ? 1 : 0.3 } - handle: Image { + handle: ColorImage { id: handleItem x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 width: 14 height: 10 - source: "image://default/dial-indicator/" + (control.visualFocus ? Default.focusColor : Default.textColor) - sourceSize.width: width - sourceSize.height: height + color: control.visualFocus ? Default.focusColor : Default.textColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/dial-indicator.png" antialiasing: true opacity: control.enabled ? 1 : 0.3 transform: [ diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 2d2a479e..c2bdff65 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -36,6 +36,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.3 +import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T import QtQuick.Controls.Material 2.3 import QtQuick.Controls.Material.impl 2.3 @@ -66,12 +67,11 @@ T.ComboBox { hoverEnabled: control.hoverEnabled } - indicator: Image { + indicator: ColorImage { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 - source: "image://material/drop-indicator/" + (control.enabled ? control.Material.foreground : control.Material.hintTextColor) - sourceSize.width: width - sourceSize.height: height + color: control.enabled ? control.Material.foreground : control.Material.hintTextColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/drop-indicator.png" } contentItem: T.TextField { diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index 3f3a66b0..0c162d2c 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -44,7 +44,6 @@ #include #include -#include static inline void initResources() { @@ -86,8 +85,6 @@ void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, c { QQuickStylePlugin::initializeEngine(engine, uri); - engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Material/images"))); - QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 19d2c6d7..2014be79 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -37,13 +37,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) #include #endif @@ -175,9 +175,7 @@ static QObject *colorSingleton(QQmlEngine *engine, QJSEngine *scriptEngine) void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *uri) { - Q_UNUSED(uri); - - engine->addImageProvider(QStringLiteral("default"), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/images"))); + Q_UNUSED(engine); const QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... @@ -194,6 +192,7 @@ void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *ur qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); + qmlRegisterType(import, 2, 3, "ColorImage"); qmlRegisterType(import, 2, 3, "IconImage"); qmlRegisterSingletonType(import, 2, 3, "Color", colorSingleton); qmlRegisterType(import, 2, 3, "IconLabel"); diff --git a/src/imports/controls/universal/CheckIndicator.qml b/src/imports/controls/universal/CheckIndicator.qml index 2f0fe125..e9288bf9 100644 --- a/src/imports/controls/universal/CheckIndicator.qml +++ b/src/imports/controls/universal/CheckIndicator.qml @@ -36,6 +36,8 @@ import QtQuick 2.9 import QtQuick.Templates 2.3 as T +import QtQuick.Controls 2.3 +import QtQuick.Controls.impl 2.3 import QtQuick.Controls.Universal 2.3 Rectangle { @@ -53,14 +55,13 @@ Rectangle { property Item control readonly property bool partiallyChecked: control.checkState === Qt.PartiallyChecked - Image { + ColorImage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 visible: control.checkState === Qt.Checked - source: "image://universal/checkmark/" + (!control.enabled ? control.Universal.baseLowColor : control.Universal.chromeWhiteColor) - sourceSize.width: width - sourceSize.height: height + color: !control.enabled ? control.Universal.baseLowColor : control.Universal.chromeWhiteColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/checkmark.png" } Rectangle { diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 89391613..5ec5bbee 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -36,6 +36,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.3 +import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T import QtQuick.Controls.Universal 2.3 @@ -61,12 +62,11 @@ T.ComboBox { hoverEnabled: control.hoverEnabled } - indicator: Image { + indicator: ColorImage { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 - source: "image://universal/downarrow/" + (!control.enabled ? control.Universal.baseLowColor : control.Universal.baseMediumHighColor) - sourceSize.width: width - sourceSize.height: height + color: !control.enabled ? control.Universal.baseLowColor : control.Universal.baseMediumHighColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/downarrow.png" Rectangle { z: -1 diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index 469cf92b..48703528 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -36,6 +36,8 @@ import QtQuick 2.9 import QtQuick.Templates 2.3 as T +import QtQuick.Controls 2.3 +import QtQuick.Controls.impl 2.3 import QtQuick.Controls.Universal 2.3 T.MenuItem { @@ -66,14 +68,13 @@ T.MenuItem { verticalAlignment: Text.AlignVCenter } - indicator: Image { + indicator: ColorImage { 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 visible: control.checked - source: !control.checkable ? "" : "image://universal/checkmark/" + (!control.enabled ? control.Universal.baseLowColor : control.down ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor) - sourceSize.width: width - sourceSize.height: height + 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" } background: Rectangle { diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml index d3cdc030..499afc82 100644 --- a/src/imports/controls/universal/SpinBox.qml +++ b/src/imports/controls/universal/SpinBox.qml @@ -36,6 +36,8 @@ import QtQuick 2.9 import QtQuick.Templates 2.3 as T +import QtQuick.Controls 2.3 +import QtQuick.Controls.impl 2.3 import QtQuick.Controls.Universal 2.3 T.SpinBox { @@ -99,14 +101,12 @@ T.SpinBox { opacity: control.activeFocus && !control.up.pressed ? 0.4 : 1.0 } - Image { + ColorImage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "image://universal/" + (control.mirrored ? "left" : "right") + "arrow/" - + (!enabled ? control.Universal.chromeDisabledLowColor : - control.activeFocus ? control.Universal.chromeBlackHighColor : control.Universal.baseHighColor) - sourceSize.width: width - sourceSize.height: height + 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" } } @@ -127,14 +127,12 @@ T.SpinBox { opacity: control.activeFocus && !control.down.pressed ? 0.4 : 1.0 } - Image { + ColorImage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "image://universal/" + (control.mirrored ? "right" : "left") + "arrow/" - + (!enabled ? control.Universal.chromeDisabledLowColor : - control.activeFocus ? control.Universal.chromeBlackHighColor : control.Universal.baseHighColor) - sourceSize.width: width - sourceSize.height: height + 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" } } diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index 017a1aad..55255181 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -42,8 +42,6 @@ #include "qquickuniversalstyle_p.h" #include "qquickuniversaltheme_p.h" -#include - static inline void initResources() { Q_INIT_RESOURCE(qtquickcontrols2universalstyleplugin); @@ -84,8 +82,6 @@ void QtQuickControls2UniversalStylePlugin::initializeEngine(QQmlEngine *engine, { QQuickStylePlugin::initializeEngine(engine, uri); - engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Universal/images"))); - QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... diff --git a/src/quickcontrols2/qquickcolorimage.cpp b/src/quickcontrols2/qquickcolorimage.cpp new file mode 100644 index 00000000..cd3513bf --- /dev/null +++ b/src/quickcontrols2/qquickcolorimage.cpp @@ -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$ +** +****************************************************************************/ + +#include "qquickcolorimage_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickColorImage::QQuickColorImage(QQuickItem *parent) + : QQuickImage(parent), m_color(Qt::transparent) +{ +} + +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::pixmapChange() +{ + QQuickImage::pixmapChange(); + if (m_color.alpha() > 0) { + QQuickImageBasePrivate *d = static_cast(QQuickItemPrivate::get(this)); + QImage image = d->pix.image(); + 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 new file mode 100644 index 00000000..8b0f769d --- /dev/null +++ b/src/quickcontrols2/qquickcolorimage_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 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 NOTIFY colorChanged FINAL) + +public: + explicit QQuickColorImage(QQuickItem *parent = nullptr); + + QColor color() const; + void setColor(const QColor &color); + +Q_SIGNALS: + void colorChanged(); + +protected: + void pixmapChange() override; + +private: + QColor m_color; +}; + +QT_END_NAMESPACE + +#endif // QQUICKCOLORIMAGE_P_H diff --git a/src/quickcontrols2/qquickcolorimageprovider.cpp b/src/quickcontrols2/qquickcolorimageprovider.cpp deleted file mode 100644 index a6e941b3..00000000 --- a/src/quickcontrols2/qquickcolorimageprovider.cpp +++ /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$ -** -****************************************************************************/ - -#include "qquickcolorimageprovider_p.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QQuickColorImageProvider::QQuickColorImageProvider(const QString &path) - : QQuickImageProvider(Image), m_path(path) -{ -} - -QImage QQuickColorImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) -{ - Q_UNUSED(requestedSize); - - int sep = id.indexOf(QLatin1Char('/')); - const QStringRef name = id.leftRef(sep); - qreal dpr = qApp->primaryScreen()->devicePixelRatio(); - QString file = qt_findAtNxFile(m_path + QLatin1Char('/') + name + QLatin1String(".png"), dpr); - - QImage image(file); - if (image.isNull()) { - qWarning() << "QQuickColorImageProvider: unknown id:" << id; - return QImage(); - } - - if (size) - *size = image.size(); - - const QString color = id.mid(sep + 1); - if (!color.isEmpty()) { - QPainter painter(&image); - painter.setCompositionMode(QPainter::CompositionMode_SourceIn); - painter.fillRect(image.rect(), QColor(color)); - } - - return image; -} - -QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickcolorimageprovider_p.h b/src/quickcontrols2/qquickcolorimageprovider_p.h deleted file mode 100644 index 4b7a34b9..00000000 --- a/src/quickcontrols2/qquickcolorimageprovider_p.h +++ /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$ -** -****************************************************************************/ - -#ifndef QQUICKCOLORIMAGEPROVIDER_P_H -#define QQUICKCOLORIMAGEPROVIDER_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 QQuickColorImageProvider : public QQuickImageProvider -{ -public: - QQuickColorImageProvider(const QString &path); - - QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; - -private: - QString m_path; -}; - -QT_END_NAMESPACE - -#endif // QQUICKOCOLORIMAGEPROVIDER_P_H diff --git a/src/quickcontrols2/quickcontrols2.pri b/src/quickcontrols2/quickcontrols2.pri index 69e04ca1..7124027b 100644 --- a/src/quickcontrols2/quickcontrols2.pri +++ b/src/quickcontrols2/quickcontrols2.pri @@ -2,7 +2,7 @@ HEADERS += \ $$PWD/qquickanimatednode_p.h \ $$PWD/qquickattachedobject_p.h \ $$PWD/qquickcolor_p.h \ - $$PWD/qquickcolorimageprovider_p.h \ + $$PWD/qquickcolorimage_p.h \ $$PWD/qquickiconimage_p.h \ $$PWD/qquickiconimage_p_p.h \ $$PWD/qquickiconlabel_p.h \ @@ -20,7 +20,7 @@ SOURCES += \ $$PWD/qquickanimatednode.cpp \ $$PWD/qquickattachedobject.cpp \ $$PWD/qquickcolor.cpp \ - $$PWD/qquickcolorimageprovider.cpp \ + $$PWD/qquickcolorimage.cpp \ $$PWD/qquickiconimage.cpp \ $$PWD/qquickiconlabel.cpp \ $$PWD/qquickplaceholdertext.cpp \ -- cgit v1.2.3