Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickicon_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKICON_P_H
6#define QQUICKICON_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qurl.h>
20#include <QtCore/qstring.h>
21#include <QtCore/qobjectdefs.h>
22#include <QtCore/qshareddata.h>
23#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
24#include <QtGui/qcolor.h>
25#include <QtQml/qqml.h>
26
27QT_BEGIN_NAMESPACE
28
29class QQuickIconPrivate;
30
31class Q_QUICKTEMPLATES2_EXPORT QQuickIcon
32{
33 Q_GADGET
34 Q_PROPERTY(QString name READ name WRITE setName RESET resetName FINAL)
35 Q_PROPERTY(QUrl source READ source WRITE setSource RESET resetSource FINAL)
36 Q_PROPERTY(int width READ width WRITE setWidth RESET resetWidth FINAL)
37 Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL)
38 Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL)
39 Q_PROPERTY(bool cache READ cache WRITE setCache RESET resetCache FINAL)
40 QML_ANONYMOUS
41 QML_ADDED_IN_VERSION(2, 3)
42
43public:
44 QQuickIcon();
45 QQuickIcon(const QQuickIcon &other);
46 ~QQuickIcon();
47
48 QQuickIcon& operator=(const QQuickIcon &other);
49 bool operator==(const QQuickIcon &other) const;
50 bool operator!=(const QQuickIcon &other) const;
51
52 bool isEmpty() const;
53
54 QString name() const;
55 void setName(const QString &name);
56 void resetName();
57
58 QUrl source() const;
59 void setSource(const QUrl &source);
60 void resetSource();
61 QUrl resolvedSource() const;
62 void ensureRelativeSourceResolved(const QObject *owner);
63
64 int width() const;
65 void setWidth(int width);
66 void resetWidth();
67
68 int height() const;
69 void setHeight(int height);
70 void resetHeight();
71
72 QColor color() const;
73 void setColor(const QColor &color);
74 void resetColor();
75
76 bool cache() const;
77 void setCache(bool cache);
78 void resetCache();
79
80 QQuickIcon resolve(const QQuickIcon &other) const;
81
82private:
83 QExplicitlySharedDataPointer<QQuickIconPrivate> d;
84};
85
86QT_END_NAMESPACE
87
88#endif // QQUICKICON_P_H