7#include <QtQml/qtqmlglobal.h>
8#include <QtQml/qqmllist.h>
9#include <QtQml/qjsengine.h>
10#include <QtCore/qobject.h>
11#include <QtCore/qstring.h>
39template<
typename List,
typename Value =
typename List::value_type>
48 return std::find(m_list->cbegin(), m_list->cend(),
value) != m_list->cend();
53 return std::find(m_list->cbegin() +
clamp(
start, m_list->size()), m_list->cend(),
value)
61 std::for_each(m_list->cbegin(), m_list->cend(), [&](
const Value &
value) {
66 result += m_engine->coerceValue<Value, QString>(value);
78 std::copy(m_list->cbegin() +
clamp(
start, m_list->size()), m_list->cend(),
79 std::back_inserter(
result));
89 std::copy(m_list->cbegin() + clampedStart, m_list->cbegin() + clampedEnd,
90 std::back_inserter(
result));
96 const auto begin = m_list->cbegin();
97 const auto end = m_list->cend();
103 return result > std::numeric_limits<int>::max() ? -1 : int(
result);
107 const auto begin = m_list->cbegin();
108 const auto end = m_list->cend();
114 return result > std::numeric_limits<int>::max() ? -1 : int(
result);
119 const auto begin = std::make_reverse_iterator(m_list->cend());
120 const auto end = std::make_reverse_iterator(m_list->cbegin());
123 return result > std::numeric_limits<int>::max() ? -1 : int(
result);
133 const auto begin = std::make_reverse_iterator(m_list->cbegin() + clampedStart + 1);
135 const auto end = std::make_reverse_iterator(m_list->cbegin());
138 return result > std::numeric_limits<int>::max() ? -1 : int(
result);
144 List *m_list =
nullptr;
157 if (!m_list->count || !m_list->at)
162 if (m_list->at(m_list,
i) ==
value)
170 if (!m_list->count || !m_list->at)
175 if (m_list->at(m_list,
i) ==
value)
184 if (!m_list->count || !m_list->at)
203 if (!m_list->count || !m_list->at)
211 result.append(m_list->at(m_list,
i));
216 if (!m_list->count || !m_list->at)
223 result.reserve(clampedEnd - clampedStart);
225 result.append(m_list->at(m_list,
i));
231 if (!m_list->count || !m_list->at)
235 = std::min(m_list->count(m_list),
qsizetype(std::numeric_limits<int>::max()));
237 if (m_list->at(m_list,
i) ==
value)
244 if (!m_list->count || !m_list->at)
251 if (m_list->at(m_list,
i) ==
value)
259 if (!m_list->count || !m_list->at)
262 for (
qsizetype i = m_list->count(m_list) - 1;
i >= 0; --
i) {
263 if (m_list->at(m_list,
i) ==
value)
264 return i > std::numeric_limits<int>::max() ? -1 : int(
i);
270 if (!m_list->count || !m_list->at)
279 if (m_list->at(m_list,
i) ==
value)
280 return i > std::numeric_limits<int>::max() ? -1 : int(
i);
The QJSEngine class provides an environment for evaluating JavaScript code.
QList< T > toList() const noexcept
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
QList< QObject * > QObjectList
GLenum GLuint GLintptr GLsizeiptr size
[1]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define QStringLiteral(str)
static qsizetype clamp(int start, qsizetype max, qsizetype min=0)
QObjectList slice() const
int lastIndexOf(const QObject *value, int start) const
QObjectList slice(int start) const
int indexOf(const QObject *value) const
bool includes(const QObject *value) const
int lastIndexOf(const QObject *value) const
QString join(const QString &separator=QStringLiteral(",")) const
int indexOf(const QObject *value, int start) const
QObjectList slice(int start, int end) const
bool includes(const QObject *value, int start) const
List slice(int start, int end) const
bool includes(const Value &value) const
QString join(const QString &separator=QStringLiteral(",")) const
List slice(int start) const
int indexOf(const Value &value, int start) const
int lastIndexOf(const Value &value) const
int indexOf(const Value &value) const
bool includes(const Value &value, int start) const
int lastIndexOf(const Value &value, int start) const