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_PRIVATE_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 | Q_SIGNALS: |
45 | void nameChanged(); |
46 | void colorChanged(); |
47 | |
48 | protected: |
49 | void componentComplete() override; |
50 | void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; |
51 | void itemChange(ItemChange change, const ItemChangeData &value) override; |
52 | void pixmapChange() override; |
53 | |
54 | private: |
55 | Q_DISABLE_COPY(QQuickIconImage) |
56 | Q_DECLARE_PRIVATE(QQuickIconImage) |
57 | }; |
58 | |
59 | QT_END_NAMESPACE |
60 | |
61 | QML_DECLARE_TYPE(QQuickIconImage) |
62 | |
63 | #endif // QQUICKICONIMAGE_P_H |
64 |