diff options
Diffstat (limited to 'src/settingsui/qtbuttonimageproviderplugin')
6 files changed, 88 insertions, 275 deletions
diff --git a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt index b8c0f0c..410caea 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt +++ b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt @@ -7,28 +7,20 @@ qt_internal_add_qml_module(qtbuttonimageproviderplugin VERSION "${CMAKE_PROJECT_VERSION}" CLASS_NAME QtButtonImageProviderQmlPlugin PLUGIN_TARGET qtbuttonimageproviderplugin - NO_GENERATE_PLUGIN_SOURCE NO_PLUGIN_OPTIONAL - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" + NO_GENERATE_PLUGIN_SOURCE + CLASS_NAME QtButtonImageProviderPlugin + PAST_MAJOR_VERSIONS 1 + DEPENDENCIES + QtQml SOURCES - plugin.cpp + plugin.cpp plugin_p.h qtbuttonimageprovider.cpp qtbuttonimageprovider.h PUBLIC_LIBRARIES Qt::Core Qt::Gui Qt::Qml Qt::Quick -) - -# Resources: -set(qtbuttonimageprovider_resource_files - "QtButton.qml" -) - -qt_internal_add_resource(qtbuttonimageproviderplugin "qtbuttonimageprovider" - PREFIX - "/" - FILES - ${qtbuttonimageprovider_resource_files} + QML_FILES + "QtButton.qml" ) diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp index c017a05..30ede2a 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp +++ b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp @@ -26,44 +26,4 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QQmlExtensionPlugin> -#include <QQmlEngine> - -#include "qtbuttonimageprovider.h" - -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtDeviceUtilities_QtButtonImageProvider); -#endif - Q_INIT_RESOURCE(qtbuttonimageprovider); -} - -QT_BEGIN_NAMESPACE - -class QtButtonImageProviderQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QtButtonImageProviderQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); } - - void registerTypes(const char *uri) override - { - Q_UNUSED(uri) - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.QtButtonImageProvider")); - qmlRegisterType(QUrl("qrc:/QtButton.qml"), uri, 1, 0, "QtButton"); - } - - void initializeEngine(QQmlEngine *engine, const char *uri) override - { - Q_UNUSED(uri); - QtButtonImageProvider *provider = new QtButtonImageProvider(); - engine->addImageProvider("QtButton", provider); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" +#include "plugin_p.h" diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h b/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h new file mode 100644 index 0000000..9fa479d --- /dev/null +++ b/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QTBUTTONIMAGEPROVIDERQMLPLUGIN_H +#define QTBUTTONIMAGEPROVIDERQMLPLUGIN_H + +#include <qqmlextensionplugin.h> +#include <qqmlengine.h> + +#include "qtbuttonimageprovider.h" + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +extern void qml_register_types_QtDeviceUtilities_QtButtonImageProvider(); + +QT_BEGIN_NAMESPACE + +struct QtButtonForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(QtButton) + QML_ADDED_IN_VERSION(1, 0) +}; + +class QtButtonImageProviderQmlPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtButtonImageProviderQmlPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { + volatile auto registration = &qml_register_types_QtDeviceUtilities_QtButtonImageProvider; + Q_UNUSED(registration); + } + + void initializeEngine(QQmlEngine *engine, const char *uri) override + { + Q_UNUSED(uri); + QtButtonImageProvider *provider = new QtButtonImageProvider(); + engine->addImageProvider("QtButton", provider); + } +}; + +QT_END_NAMESPACE +#endif //QTBUTTONIMAGEPROVIDERQMLPLUGIN_H diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes b/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes deleted file mode 100644 index 76ae3f9..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes +++ /dev/null @@ -1,210 +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 QtDeviceUtilities.QtButtonImageProvider 1.0' - -Module { - dependencies: [] - Component { - prototype: "QObject" - name: "QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0" - exports: ["QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "state"; type: "string" } - Property { name: "cutSize"; type: "int" } - Property { name: "fillColor"; type: "QColor" } - Property { name: "borderColor"; type: "QColor" } - Property { name: "text"; type: "string" } - Signal { name: "clicked" } - 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: 1; type: "bool" } - Property { name: "autoTransform"; revision: 2; type: "bool" } - Signal { name: "paintedGeometryChanged" } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "VAlignment" } - } - Signal { - name: "mipmapChanged" - revision: 1 - Parameter { type: "bool" } - } - 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" } - Signal { - name: "sourceChanged" - Parameter { type: "QUrl" } - } - Signal { - name: "statusChanged" - Parameter { type: "QQuickImageBase::Status" } - } - Signal { - name: "progressChanged" - Parameter { name: "progress"; type: "double" } - } - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - 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: "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: "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 } - } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 2 - 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" } - } - } -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/qmldir b/src/settingsui/qtbuttonimageproviderplugin/qmldir deleted file mode 100644 index 4107ed2..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module QtDeviceUtilities.QtButtonImageProvider -plugin qtbuttonimageproviderplugin -classname QtButtonImageProviderQmlPlugin diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc deleted file mode 100644 index b3b680c..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>QtButton.qml</file> - </qresource> -</RCC> |