summaryrefslogtreecommitdiffstats
path: root/src/settingsui/qtbuttonimageproviderplugin
diff options
context:
space:
mode:
Diffstat (limited to 'src/settingsui/qtbuttonimageproviderplugin')
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt37
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/QtButton.qml58
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/plugin.cpp69
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes210
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/qmldir3
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp101
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h47
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc5
-rw-r--r--src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro18
9 files changed, 0 insertions, 548 deletions
diff --git a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt
deleted file mode 100644
index abe52e9..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-# Generated from qtbuttonimageproviderplugin.pro.
-
-#####################################################################
-## qtbuttonimageproviderplugin Plugin:
-#####################################################################
-
-qt_add_qml_module(qtbuttonimageproviderplugin
- URI "QtDeviceUtilities.QtButtonImageProvider"
- VERSION "${CMAKE_PROJECT_VERSION}"
- CLASSNAME QtButtonImageProviderQmlPlugin
- SKIP_TYPE_REGISTRATION
- SOURCES
- plugin.cpp
- qtbuttonimageprovider.cpp qtbuttonimageprovider.h
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
-)
-
-# Resources:
-set(qtbuttonimageprovider_resource_files
- "QtButton.qml"
-)
-
-qt_add_resource(qtbuttonimageproviderplugin "qtbuttonimageprovider"
- PREFIX
- "/"
- FILES
- ${qtbuttonimageprovider_resource_files}
-)
-
-
-#### Keys ignored in scope 1:.:.:qtbuttonimageproviderplugin.pro:<TRUE>:
-# QML_IMPORT_VERSION = "$$QT_VERSION"
-# TARGETPATH = "QtDeviceUtilities/QtButtonImageProvider"
diff --git a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml b/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml
deleted file mode 100644
index d65ae23..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-import QtQuick
-
-Image {
- id: root
- source: "image://QtButton/" + cutSize + "/" + fillColor + "/" + borderColor
- sourceSize: Qt.size(width, height)
- property string state: "enabled"
- property int cutSize: 10
- property color fillColor: viewSettings.buttonGreenColor
- property color borderColor: mouseArea.pressed ? viewSettings.buttonActiveColor : viewSettings.buttonGreenColor
- property alias text: buttonText.text
- signal clicked()
-
- width: buttonText.contentWidth + cutSize * 4
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: root.clicked()
- }
- Text {
- id: buttonText
- anchors.fill: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: parent.height * 0.65
- font.family: appFont
- color: "white"
- }
-}
diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp
deleted file mode 100644
index c017a05..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-#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"
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.cpp b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp
deleted file mode 100644
index 5bf162b..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 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$
-**
-****************************************************************************/
-#include <QQuickImageProvider>
-#include <QImage>
-#include <QPainter>
-#include <QPainterPath>
-
-#include "qtbuttonimageprovider.h"
-
-QtButtonImageProvider::QtButtonImageProvider()
- : QQuickImageProvider(QQuickImageProvider::Pixmap)
-{
-}
-
-QPixmap QtButtonImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
-{
- bool ok = false;
-
- QStringList params = id.split("/");
-
- int cutSize = params.at(0).toInt(&ok);
-
- if (!ok)
- cutSize = 10;
-
- QColor fillColor;
- QColor borderColor;
-
- if (params.length() > 1) {
- fillColor = QColor(params.at(1));
- }
-
- if (params.length() > 2)
- borderColor = QColor(params.at(2));
-
- if (!fillColor.isValid())
- fillColor = "#00eb00";
-
- if (!borderColor.isValid())
- borderColor ="white";
-
- int width = 100;
- int height = 50;
-
- if (size)
- *size = QSize(requestedSize.width(), requestedSize.height());
-
- QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width,
- requestedSize.height() > 0 ? requestedSize.height() : height);
- pixmap.fill(Qt::transparent);
-
- QPainter painter(&pixmap);
- const qreal borderPenWidth = 2;
- QPen borderPen(QBrush(borderColor), borderPenWidth);
- borderPen.setJoinStyle(Qt::MiterJoin);
- painter.setRenderHint(QPainter::Antialiasing, true);
- painter.setPen(borderPen);
- painter.setBrush(fillColor);
-
- QPainterPath path;
- qreal top = borderPenWidth - 1;
- qreal left = borderPenWidth - 1;
- qreal bottom = pixmap.height() - borderPenWidth;
- qreal right = pixmap.width() - borderPenWidth;
- path.moveTo(left + cutSize, top);
- path.lineTo(right, top);
- path.lineTo(right, bottom - cutSize);
- path.lineTo(right - cutSize, bottom);
- path.lineTo(left, bottom);
- path.lineTo(left, top + cutSize);
- path.lineTo(left + cutSize, top);
- painter.drawPath(path);
-
- return pixmap;
-}
diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h
deleted file mode 100644
index 94f410e..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 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 QTBUTTONIMAGEPROVIDER_H
-#define QTBUTTONIMAGEPROVIDER_H
-
-#include <QQuickImageProvider>
-#include <QPixmap>
-
-class QtButtonImageProvider : public QQuickImageProvider
-{
-public:
- QtButtonImageProvider();
-
- QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override;
-
- void setCutSize(int size) { m_cutSize = size; }
-private:
- int m_cutSize;
-};
-
-#endif // QTBUTTONIMAGEPROVIDER_H
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>
diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro
deleted file mode 100644
index ba26174..0000000
--- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-QT += qml quick
-CONFIG += no_cxx_module
-QML_IMPORT_VERSION = $$QT_VERSION
-
-TARGET = qtbuttonimageproviderplugin
-TARGETPATH = QtDeviceUtilities/QtButtonImageProvider
-
-SOURCES += \
- qtbuttonimageprovider.cpp \
- plugin.cpp
-
-HEADERS += \
- qtbuttonimageprovider.h
-
-RESOURCES += \
- qtbuttonimageprovider.qrc
-
-load(qml_plugin)