aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/templates/qquicktemplates2valuetypeprovider.cpp159
-rw-r--r--src/imports/templates/qquicktemplates2valuetypeprovider_p.h68
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp22
-rw-r--r--src/imports/templates/templates.pro4
-rw-r--r--src/quicktemplates2/qquickpalette.cpp326
-rw-r--r--src/quicktemplates2/qquickpalette_p.h163
-rw-r--r--src/quicktemplates2/quicktemplates2.pri2
7 files changed, 744 insertions, 0 deletions
diff --git a/src/imports/templates/qquicktemplates2valuetypeprovider.cpp b/src/imports/templates/qquicktemplates2valuetypeprovider.cpp
new file mode 100644
index 00000000..6debdbc4
--- /dev/null
+++ b/src/imports/templates/qquicktemplates2valuetypeprovider.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure 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 "qquicktemplates2valuetypeprovider_p.h"
+
+#include <QtQml/private/qqmlvaluetype_p.h>
+#include <QtQuickTemplates2/private/qquickpalette_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
+ #define ASSERT_VALID_SIZE(size, min) Q_UNUSED(size)
+#else
+ #define ASSERT_VALID_SIZE(size, min) Q_ASSERT(size >= min)
+#endif
+
+const QMetaObject *QQuickTemplates2ValueTypeProvider::getMetaObjectForMetaType(int type)
+{
+ switch (type) {
+ case QMetaType::QPalette:
+ return &QQuickPalette::staticMetaObject;
+ default:
+ break;
+ }
+
+ return nullptr;
+}
+
+bool QQuickTemplates2ValueTypeProvider::init(int type, QVariant& dst)
+{
+ switch (type) {
+ case QMetaType::QPalette:
+ dst.setValue<QPalette>(QPalette());
+ return true;
+ default: break;
+ }
+
+ return false;
+}
+
+template<typename T>
+bool typedEqual(const void *lhs, const QVariant& rhs)
+{
+ return (*(reinterpret_cast<const T *>(lhs)) == rhs.value<T>());
+}
+
+bool QQuickTemplates2ValueTypeProvider::equal(int type, const void *lhs, const QVariant &rhs)
+{
+ switch (type) {
+ case QMetaType::QPalette:
+ return typedEqual<QPalette>(lhs, rhs);
+ default: break;
+ }
+
+ return false;
+}
+
+template<typename T>
+bool typedStore(const void *src, void *dst, size_t dstSize)
+{
+ ASSERT_VALID_SIZE(dstSize, sizeof(T));
+ const T *srcT = reinterpret_cast<const T *>(src);
+ T *dstT = reinterpret_cast<T *>(dst);
+ new (dstT) T(*srcT);
+ return true;
+}
+
+bool QQuickTemplates2ValueTypeProvider::store(int type, const void *src, void *dst, size_t dstSize)
+{
+ switch (type) {
+ case QMetaType::QPalette:
+ return typedStore<QPalette>(src, dst, dstSize);
+ default: break;
+ }
+
+ return false;
+}
+
+template<typename T>
+bool typedRead(const QVariant& src, int dstType, void *dst)
+{
+ T *dstT = reinterpret_cast<T *>(dst);
+ if (src.type() == static_cast<uint>(dstType)) {
+ *dstT = src.value<T>();
+ } else {
+ *dstT = T();
+ }
+ return true;
+}
+
+bool QQuickTemplates2ValueTypeProvider::read(const QVariant &src, void *dst, int dstType)
+{
+ switch (dstType) {
+ case QMetaType::QPalette:
+ return typedRead<QPalette>(src, dstType, dst);
+ default: break;
+ }
+
+ return false;
+}
+
+template<typename T>
+bool typedWrite(const void *src, QVariant& dst)
+{
+ const T *srcT = reinterpret_cast<const T *>(src);
+ if (dst.value<T>() != *srcT) {
+ dst = *srcT;
+ return true;
+ }
+ return false;
+}
+
+bool QQuickTemplates2ValueTypeProvider::write(int type, const void *src, QVariant& dst)
+{
+ switch (type) {
+ case QMetaType::QPalette:
+ return typedWrite<QPalette>(src, dst);
+ default: break;
+ }
+
+ return false;
+}
+
+#undef ASSERT_VALID_SIZE
+
+QT_END_NAMESPACE
diff --git a/src/imports/templates/qquicktemplates2valuetypeprovider_p.h b/src/imports/templates/qquicktemplates2valuetypeprovider_p.h
new file mode 100644
index 00000000..6b072029
--- /dev/null
+++ b/src/imports/templates/qquicktemplates2valuetypeprovider_p.h
@@ -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 Templates 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure 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 QQUICKTEMPLATES2VALUETYPEPROVIDER_P_H
+#define QQUICKTEMPLATES2VALUETYPEPROVIDER_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 <QtQml/private/qqmlglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickTemplates2ValueTypeProvider : public QQmlValueTypeProvider
+{
+public:
+ const QMetaObject *getMetaObjectForMetaType(int type) override;
+ bool init(int type, QVariant& dst) override;
+ bool equal(int type, const void *lhs, const QVariant &rhs) override;
+ bool store(int type, const void *src, void *dst, size_t dstSize) override;
+ bool read(const QVariant &src, void *dst, int dstType) override;
+ bool write(int type, const void *src, QVariant& dst) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKTEMPLATES2VALUETYPEPROVIDER_P_H
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index eea54894..e9ff17c8 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -35,6 +35,7 @@
****************************************************************************/
#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/private/qqmlglobal_p.h>
#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
#include <QtQuickTemplates2/private/qquickaction_p.h>
@@ -95,6 +96,8 @@
#include <QtQuickTemplates2/private/qquicktumbler_p.h>
#endif
+#include "qquicktemplates2valuetypeprovider_p.h"
+
static inline void initResources()
{
#ifdef QT_STATIC
@@ -111,6 +114,22 @@ extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher
QT_BEGIN_NAMESPACE
+static QQmlValueTypeProvider *valueTypeProvider()
+{
+ static QQuickTemplates2ValueTypeProvider provider;
+ return &provider;
+}
+
+static void initProviders()
+{
+ QQml_addValueTypeProvider(valueTypeProvider());
+}
+
+static void cleanupProviders()
+{
+ QQml_removeValueTypeProvider(valueTypeProvider());
+}
+
class QtQuickTemplates2Plugin: public QQmlExtensionPlugin
{
Q_OBJECT
@@ -131,6 +150,7 @@ private:
QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensionPlugin(parent)
{
initResources();
+ initProviders();
#if QT_CONFIG(shortcut)
originalContextMatcher = qt_quick_shortcut_context_matcher();
@@ -140,6 +160,8 @@ QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensio
QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin()
{
+ cleanupProviders();
+
#if QT_CONFIG(shortcut)
qt_quick_set_shortcut_context_matcher(originalContextMatcher);
#endif
diff --git a/src/imports/templates/templates.pro b/src/imports/templates/templates.pro
index 9a95812b..4ff0a76e 100644
--- a/src/imports/templates/templates.pro
+++ b/src/imports/templates/templates.pro
@@ -10,7 +10,11 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
OTHER_FILES += \
qmldir
+HEADERS += \
+ $$PWD/qquicktemplates2valuetypeprovider_p.h
+
SOURCES += \
+ $$PWD/qquicktemplates2valuetypeprovider.cpp \
$$PWD/qtquicktemplates2plugin.cpp
CONFIG += no_cxx_module
diff --git a/src/quicktemplates2/qquickpalette.cpp b/src/quicktemplates2/qquickpalette.cpp
new file mode 100644
index 00000000..018d6fdc
--- /dev/null
+++ b/src/quicktemplates2/qquickpalette.cpp
@@ -0,0 +1,326 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure 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 "qquickpalette_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QColor QQuickPalette::alternateBase() const
+{
+ return v.color(QPalette::AlternateBase);
+}
+
+void QQuickPalette::setAlternateBase(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::AlternateBase, color);
+}
+
+void QQuickPalette::resetAlternateBase()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::AlternateBase));
+}
+
+QColor QQuickPalette::base() const
+{
+ return v.color(QPalette::Base);
+}
+
+void QQuickPalette::setBase(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Base, color);
+}
+
+void QQuickPalette::resetBase()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Base));
+}
+
+QColor QQuickPalette::brightText() const
+{
+ return v.color(QPalette::BrightText);
+}
+
+void QQuickPalette::setBrightText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::BrightText, color);
+}
+
+void QQuickPalette::resetBrightText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::BrightText));
+}
+
+QColor QQuickPalette::button() const
+{
+ return v.color(QPalette::Button);
+}
+
+void QQuickPalette::setButton(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Button, color);
+}
+
+void QQuickPalette::resetButton()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Button));
+}
+
+QColor QQuickPalette::buttonText() const
+{
+ return v.color(QPalette::ButtonText);
+}
+
+void QQuickPalette::setButtonText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::ButtonText, color);
+}
+
+void QQuickPalette::resetButtonText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::ButtonText));
+}
+
+QColor QQuickPalette::dark() const
+{
+ return v.color(QPalette::Dark);
+}
+
+void QQuickPalette::setDark(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Dark, color);
+}
+
+void QQuickPalette::resetDark()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Dark));
+}
+
+QColor QQuickPalette::highlight() const
+{
+ return v.color(QPalette::Highlight);
+}
+
+void QQuickPalette::setHighlight(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Highlight, color);
+}
+
+void QQuickPalette::resetHighlight()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Highlight));
+}
+
+QColor QQuickPalette::highlightedText() const
+{
+ return v.color(QPalette::HighlightedText);
+}
+
+void QQuickPalette::setHighlightedText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::HighlightedText, color);
+}
+
+void QQuickPalette::resetHighlightedText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::HighlightedText));
+}
+
+QColor QQuickPalette::light() const
+{
+ return v.color(QPalette::Light);
+}
+
+void QQuickPalette::setLight(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Light, color);
+}
+
+void QQuickPalette::resetLight()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Light));
+}
+
+QColor QQuickPalette::link() const
+{
+ return v.color(QPalette::Link);
+}
+
+void QQuickPalette::setLink(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Link, color);
+}
+
+void QQuickPalette::resetLink()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Link));
+}
+
+QColor QQuickPalette::linkVisited() const
+{
+ return v.color(QPalette::LinkVisited);
+}
+
+void QQuickPalette::setLinkVisited(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::LinkVisited, color);
+}
+
+void QQuickPalette::resetLinkVisited()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::LinkVisited));
+}
+
+QColor QQuickPalette::mid() const
+{
+ return v.color(QPalette::Mid);
+}
+
+void QQuickPalette::setMid(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Mid, color);
+}
+
+void QQuickPalette::resetMid()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Mid));
+}
+
+QColor QQuickPalette::midlight() const
+{
+ return v.color(QPalette::Midlight);
+}
+
+void QQuickPalette::setMidlight(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Midlight, color);
+}
+
+void QQuickPalette::resetMidlight()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Midlight));
+}
+
+QColor QQuickPalette::shadow() const
+{
+ return v.color(QPalette::Shadow);
+}
+
+void QQuickPalette::setShadow(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Shadow, color);
+}
+
+void QQuickPalette::resetShadow()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Shadow));
+}
+
+QColor QQuickPalette::text() const
+{
+ return v.color(QPalette::Text);
+}
+
+void QQuickPalette::setText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Text, color);
+}
+
+void QQuickPalette::resetText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Text));
+}
+
+QColor QQuickPalette::toolTipBase() const
+{
+ return v.color(QPalette::ToolTipBase);
+}
+
+void QQuickPalette::setToolTipBase(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::ToolTipBase, color);
+}
+
+void QQuickPalette::resetToolTipBase()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::ToolTipBase));
+}
+
+QColor QQuickPalette::toolTipText() const
+{
+ return v.color(QPalette::ToolTipText);
+}
+
+void QQuickPalette::setToolTipText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::ToolTipText, color);
+}
+
+void QQuickPalette::resetToolTipText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::ToolTipText));
+}
+
+QColor QQuickPalette::window() const
+{
+ return v.color(QPalette::Window);
+}
+
+void QQuickPalette::setWindow(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::Window, color);
+}
+
+void QQuickPalette::resetWindow()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::Window));
+}
+
+QColor QQuickPalette::windowText() const
+{
+ return v.color(QPalette::WindowText);
+}
+
+void QQuickPalette::setWindowText(const QColor &color)
+{
+ v.setColor(QPalette::All, QPalette::WindowText, color);
+}
+
+void QQuickPalette::resetWindowText()
+{
+ v.resolve(v.resolve() & ~(1 << QPalette::WindowText));
+}
+
+QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickpalette_p.h b/src/quicktemplates2/qquickpalette_p.h
new file mode 100644
index 00000000..d43e78a6
--- /dev/null
+++ b/src/quicktemplates2/qquickpalette_p.h
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure 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 QQUICKPALETTE_P_H
+#define QQUICKPALETTE_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 <QtGui/qcolor.h>
+#include <QtGui/qpalette.h>
+#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPalette
+{
+ Q_GADGET
+ Q_PROPERTY(QColor alternateBase READ alternateBase WRITE setAlternateBase RESET resetAlternateBase FINAL)
+ Q_PROPERTY(QColor base READ base WRITE setBase RESET resetBase FINAL)
+ Q_PROPERTY(QColor brightText READ brightText WRITE setBrightText RESET resetBrightText FINAL)
+ Q_PROPERTY(QColor button READ button WRITE setButton RESET resetButton FINAL)
+ Q_PROPERTY(QColor buttonText READ buttonText WRITE setButtonText RESET resetButtonText FINAL)
+ Q_PROPERTY(QColor dark READ dark WRITE setDark RESET resetDark FINAL)
+ Q_PROPERTY(QColor highlight READ highlight WRITE setHighlight RESET resetHighlight FINAL)
+ Q_PROPERTY(QColor highlightedText READ highlightedText WRITE setHighlightedText RESET resetHighlightedText FINAL)
+ Q_PROPERTY(QColor light READ light WRITE setLight RESET resetLight FINAL)
+ Q_PROPERTY(QColor link READ link WRITE setLink RESET resetLink FINAL)
+ Q_PROPERTY(QColor linkVisited READ linkVisited WRITE setLinkVisited RESET resetLinkVisited FINAL)
+ Q_PROPERTY(QColor mid READ mid WRITE setMid RESET resetMid FINAL)
+ Q_PROPERTY(QColor midlight READ midlight WRITE setMidlight RESET resetMidlight FINAL)
+ Q_PROPERTY(QColor shadow READ shadow WRITE setShadow RESET resetShadow FINAL)
+ Q_PROPERTY(QColor text READ text WRITE setText RESET resetText FINAL)
+ Q_PROPERTY(QColor toolTipBase READ toolTipBase WRITE setToolTipBase RESET resetToolTipBase FINAL)
+ Q_PROPERTY(QColor toolTipText READ toolTipText WRITE setToolTipText RESET resetToolTipText FINAL)
+ Q_PROPERTY(QColor window READ window WRITE setWindow RESET resetWindow FINAL)
+ Q_PROPERTY(QColor windowText READ windowText WRITE setWindowText RESET resetWindowText FINAL)
+
+public:
+ QColor alternateBase() const;
+ void setAlternateBase(const QColor &color);
+ void resetAlternateBase();
+
+ QColor base() const;
+ void setBase(const QColor &color);
+ void resetBase();
+
+ QColor brightText() const;
+ void setBrightText(const QColor &color);
+ void resetBrightText();
+
+ QColor button() const;
+ void setButton(const QColor &color);
+ void resetButton();
+
+ QColor buttonText() const;
+ void setButtonText(const QColor &color);
+ void resetButtonText();
+
+ QColor dark() const;
+ void setDark(const QColor &color);
+ void resetDark();
+
+ QColor highlight() const;
+ void setHighlight(const QColor &color);
+ void resetHighlight();
+
+ QColor highlightedText() const;
+ void setHighlightedText(const QColor &color);
+ void resetHighlightedText();
+
+ QColor light() const;
+ void setLight(const QColor &color);
+ void resetLight();
+
+ QColor link() const;
+ void setLink(const QColor &color);
+ void resetLink();
+
+ QColor linkVisited() const;
+ void setLinkVisited(const QColor &color);
+ void resetLinkVisited();
+
+ QColor mid() const;
+ void setMid(const QColor &color);
+ void resetMid();
+
+ QColor midlight() const;
+ void setMidlight(const QColor &color);
+ void resetMidlight();
+
+ QColor shadow() const;
+ void setShadow(const QColor &color);
+ void resetShadow();
+
+ QColor text() const;
+ void setText(const QColor &color);
+ void resetText();
+
+ QColor toolTipBase() const;
+ void setToolTipBase(const QColor &color);
+ void resetToolTipBase();
+
+ QColor toolTipText() const;
+ void setToolTipText(const QColor &color);
+ void resetToolTipText();
+
+ QColor window() const;
+ void setWindow(const QColor &color);
+ void resetWindow();
+
+ QColor windowText() const;
+ void setWindowText(const QColor &color);
+ void resetWindowText();
+
+private:
+ QPalette v;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKPALETTE_P_H
diff --git a/src/quicktemplates2/quicktemplates2.pri b/src/quicktemplates2/quicktemplates2.pri
index e1a1a917..53a8b8c8 100644
--- a/src/quicktemplates2/quicktemplates2.pri
+++ b/src/quicktemplates2/quicktemplates2.pri
@@ -42,6 +42,7 @@ HEADERS += \
$$PWD/qquickpage_p.h \
$$PWD/qquickpageindicator_p.h \
$$PWD/qquickpagelayout_p_p.h \
+ $$PWD/qquickpalette_p.h \
$$PWD/qquickpane_p.h \
$$PWD/qquickpane_p_p.h \
$$PWD/qquickpopup_p.h \
@@ -113,6 +114,7 @@ SOURCES += \
$$PWD/qquickpage.cpp \
$$PWD/qquickpageindicator.cpp \
$$PWD/qquickpagelayout.cpp \
+ $$PWD/qquickpalette.cpp \
$$PWD/qquickpane.cpp \
$$PWD/qquickpopup.cpp \
$$PWD/qquickpopupitem.cpp \