Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickimageselector_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QQUICKIMAGESELECTOR_P_H
5#define QQUICKIMAGESELECTOR_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 <QtCore/qurl.h>
19#include <QtCore/qobject.h>
20#include <QtCore/qvariant.h>
21#include <QtQml/qqmlproperty.h>
22#include <QtQml/qqmlparserstatus.h>
23#include <QtQml/private/qqmlpropertyvalueinterceptor_p.h>
24#include <QtQml/qqmlproperty.h>
25#include <QtQml/qqml.h>
26
28
30{
37 Q_PROPERTY(bool cache READ cache WRITE setCache FINAL)
39 QML_NAMED_ELEMENT(ImageSelector)
41
42public:
44
45 QUrl source() const;
46 void setSource(const QUrl &source);
47
48 QString name() const;
49 void setName(const QString &name);
50
51 QString path() const;
52 void setPath(const QString &path);
53
54 QVariantList states() const;
55 void setStates(const QVariantList &states);
56
57 QString separator() const;
58 void setSeparator(const QString &separator);
59
60 bool cache() const;
61 void setCache(bool cache);
62
63 void write(const QVariant &value) override;
64 void setTarget(const QQmlProperty &property) override;
65
68
69protected:
70 void classBegin() override;
71 void componentComplete() override;
72
73 virtual QStringList fileExtensions() const;
74
75 QString cacheKey() const;
76 void updateSource();
77 void setUrl(const QUrl &url);
78 bool updateActiveStates();
79 int calculateScore(const QStringList &states) const;
80
82 bool m_cache = false;
83 bool m_complete = false;
84 QUrl m_source;
85 QString m_path;
86 QString m_name;
87 QString m_separator = QLatin1String("-");
88 QVariantList m_allStates;
89 QStringList m_activeStates;
90 QQmlProperty m_property;
91};
92
94{
96 QML_NAMED_ELEMENT(NinePatchImageSelector)
98
99public:
100 explicit QQuickNinePatchImageSelector(QObject *parent = nullptr);
101
102protected:
103 QStringList fileExtensions() const override;
104};
105
107{
109 QML_NAMED_ELEMENT(AnimatedImageSelector)
111
112public:
113 explicit QQuickAnimatedImageSelector(QObject *parent = nullptr);
114
115protected:
116 QStringList fileExtensions() const override;
117};
118
120
121#endif // QQUICKIMAGESELECTOR_P_H
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QQmlParserStatus class provides updates on the QML parser state.
The QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
The QQmlProperty class abstracts accessing properties on objects created from QML.
void setSource(const QUrl &source)
void setPath(const QString &path)
int calculateScore(const QStringList &states) const
void write(const QVariant &value) override
This method will be called when a new value is assigned to the property being intercepted.
void setName(const QString &name)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void classBegin() override
Invoked after class creation, but before any properties have been set.
virtual QStringList fileExtensions() const
void setStates(const QVariantList &states)
void setSeparator(const QString &separator)
void setTarget(const QQmlProperty &property) override
Set the target property for the value interceptor.
void setUrl(const QUrl &url)
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint name
GLsizei GLsizei GLchar * source
GLsizei const GLchar *const * path
GLuint * states
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INTERFACES(x)
#define Q_SIGNALS
const char property[13]
Definition qwizard.cpp:101
#define explicit
QUrl url("example.com")
[constructor-url-reference]