Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QQUICKIMAGESELECTOR_P_H
6
#
define
QQUICKIMAGESELECTOR_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
/
qobject
.
h
>
21
#
include
<
QtCore
/
qvariant
.
h
>
22
#
include
<
QtQml
/
qqmlproperty
.
h
>
23
#
include
<
QtQml
/
qqmlparserstatus
.
h
>
24
#
include
<
QtQml
/
private
/
qqmlpropertyvalueinterceptor_p
.
h
>
25
#
include
<
QtQml
/
qqmlproperty
.
h
>
26
#
include
<
QtQml
/
qqml
.
h
>
27
28
QT_BEGIN_NAMESPACE
29
30
class
QQuickImageSelector :
public
QObject,
public
QQmlParserStatus,
public
QQmlPropertyValueInterceptor
31
{
32
Q_OBJECT
33
Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged FINAL)
34
Q_PROPERTY(QString name READ name WRITE setName FINAL)
35
Q_PROPERTY(QString path READ path WRITE setPath FINAL)
36
Q_PROPERTY(QVariantList states READ states WRITE setStates FINAL)
37
Q_PROPERTY(QString separator READ separator WRITE setSeparator FINAL)
38
Q_PROPERTY(
bool
cache READ cache WRITE setCache FINAL)
39
Q_INTERFACES(QQmlParserStatus QQmlPropertyValueInterceptor)
40
QML_NAMED_ELEMENT(ImageSelector)
41
QML_ADDED_IN_VERSION(2, 3)
42
43
public
:
44
explicit
QQuickImageSelector(QObject *parent =
nullptr
);
45
46
QUrl source()
const
;
47
void
setSource(
const
QUrl &source);
48
49
QString name()
const
;
50
void
setName(
const
QString &name);
51
52
QString path()
const
;
53
void
setPath(
const
QString &path);
54
55
QVariantList states()
const
;
56
void
setStates(
const
QVariantList &states);
57
58
QString separator()
const
;
59
void
setSeparator(
const
QString &separator);
60
61
bool
cache()
const
;
62
void
setCache(
bool
cache);
63
64
void
write(
const
QVariant &value) override;
65
void
setTarget(
const
QQmlProperty &property) override;
66
67
Q_SIGNALS:
68
void
sourceChanged();
69
70
protected
:
71
void
classBegin() override;
72
void
componentComplete() override;
73
74
virtual
QStringList fileExtensions()
const
;
75
76
QString cacheKey()
const
;
77
void
updateSource();
78
void
setUrl(
const
QUrl &url);
79
bool
updateActiveStates();
80
int
calculateScore(
const
QStringList &states)
const
;
81
82
private
:
83
bool
m_cache =
false
;
84
bool
m_complete =
false
;
85
QUrl m_source;
86
QString m_path;
87
QString m_name;
88
QString m_separator = QLatin1String(
"-"
);
89
QVariantList m_allStates;
90
QStringList m_activeStates;
91
QQmlProperty m_property;
92
};
93
94
class
QQuickNinePatchImageSelector
:
public
QQuickImageSelector
95
{
96
Q_OBJECT
97
QML_NAMED_ELEMENT(NinePatchImageSelector)
98
QML_ADDED_IN_VERSION
(2, 3)
99
100
public
:
101
explicit
QQuickNinePatchImageSelector
(
QObject
*
parent
=
nullptr
);
102
103
protected
:
104
QStringList
fileExtensions
()
const
override
;
105
};
106
107
class
QQuickAnimatedImageSelector
:
public
QQuickImageSelector
108
{
109
Q_OBJECT
110
QML_NAMED_ELEMENT(AnimatedImageSelector)
111
QML_ADDED_IN_VERSION
(2, 3)
112
113
public
:
114
explicit
QQuickAnimatedImageSelector
(
QObject
*
parent
=
nullptr
);
115
116
protected
:
117
QStringList
fileExtensions
()
const
override
;
118
};
119
120
QT_END_NAMESPACE
121
122
#
endif
// QQUICKIMAGESELECTOR_P_H
QQuickAnimatedImageSelector
Definition
qquickimageselector_p.h:108
QQuickAnimatedImageSelector::fileExtensions
QStringList fileExtensions() const override
Definition
qquickimageselector.cpp:312
QQuickNinePatchImageSelector
Definition
qquickimageselector_p.h:95
QQuickNinePatchImageSelector::fileExtensions
QStringList fileExtensions() const override
Definition
qquickimageselector.cpp:301
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_STATIC_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
cacheSize
static int cacheSize()
Definition
qquickimageselector.cpp:26
permutations
static QList< QStringList > permutations(const QStringList &input, int count=-1)
Definition
qquickimageselector.cpp:35
DEFAULT_CACHE
static QT_BEGIN_NAMESPACE const int DEFAULT_CACHE
Definition
qquickimageselector.cpp:24
findFile
static QString findFile(const QDir &dir, const QString &baseName, const QStringList &extensions)
Definition
qquickimageselector.cpp:67
qtdeclarative
src
quickcontrolsimpl
qquickimageselector_p.h
Generated on
for Qt by
1.18.0