| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QQUICKICONIMAGE_P_H |
| 5 | #define QQUICKICONIMAGE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtQuick/private/qquickimage_p.h> |
| 19 | #include <QtQuickControls2Impl/private/qtquickcontrols2implglobal_p.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class QQuickIconImagePrivate; |
| 24 | |
| 25 | class Q_QUICKCONTROLS2IMPL_EXPORT QQuickIconImage : public QQuickImage |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL) |
| 29 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL) |
| 30 | QML_NAMED_ELEMENT(IconImage) |
| 31 | QML_ADDED_IN_VERSION(2, 3) |
| 32 | |
| 33 | public: |
| 34 | explicit QQuickIconImage(QQuickItem *parent = nullptr); |
| 35 | |
| 36 | QString name() const; |
| 37 | void setName(const QString &name); |
| 38 | |
| 39 | QColor color() const; |
| 40 | void setColor(const QColor &color); |
| 41 | |
| 42 | void setSource(const QUrl &url) override; |
| 43 | |
| 44 | void snapPositionTo(QPointF pos); |
| 45 | |
| 46 | Q_SIGNALS: |
| 47 | void nameChanged(); |
| 48 | void colorChanged(); |
| 49 | |
| 50 | protected: |
| 51 | void componentComplete() override; |
| 52 | void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; |
| 53 | void itemChange(ItemChange change, const ItemChangeData &value) override; |
| 54 | void pixmapChange() override; |
| 55 | |
| 56 | private: |
| 57 | Q_DISABLE_COPY(QQuickIconImage) |
| 58 | Q_DECLARE_PRIVATE(QQuickIconImage) |
| 59 | }; |
| 60 | |
| 61 | QT_END_NAMESPACE |
| 62 | |
| 63 | #endif // QQUICKICONIMAGE_P_H |
| 64 | |