5#include <QtQmlModels/private/qqmladaptormodel_p.h>
119 if (!m_value.
isValid() && m_row < 0 && m_column < 0)
122 bool roleMatched =
true;
124 roleMatched = (
value == m_value);
126 bool valueOk =
false;
127 bool mValueOk =
false;
128 roleMatched = (
value.toInt(&valueOk) == m_value.
toInt(&mValueOk) && valueOk && mValueOk);
133 const bool rowMatched = (m_row < 0 ) ?
true : m_row ==
row;
134 const bool columnMatched = (m_column < 0 ) ?
true : m_column ==
column;
135 return roleMatched && rowMatched && columnMatched;
236 q->delegateChanged();
242 return q->m_choices.
size();
256 q->m_choices.clear();
257 q->delegateChanged();
266 q->m_choices[
index] = choice;
269 q->delegateChanged();
277 q->delegateChanged();
289 if (
v.canConvert(
QMetaType(QMetaType::QVariantMap)))
290 v =
v.toMap().value(m_role);
291 else if (
v.canConvert(
QMetaType(QMetaType::QObjectStar)))
297 for (
int i = 0;
i < m_choices.
size(); ++
i) {
308#include "moc_qqmldelegatecomponent_p.cpp"
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QQmlComponent class encapsulates a QML component definition.
void setRoleValue(const QVariant &roleValue)
virtual bool match(int row, int column, const QVariant &value) const
void setDelegate(QQmlComponent *delegate)
\qmlproperty Component Qt.labs.qmlmodels::DelegateChoice::delegate This property holds the delegate t...
void setRole(const QString &role)
Allows a view to use different delegates for different types of items in the model.
static void choices_removeLast(QQmlListProperty< QQmlDelegateChoice > *)
static void choices_clear(QQmlListProperty< QQmlDelegateChoice > *)
static void choices_replace(QQmlListProperty< QQmlDelegateChoice > *, qsizetype, QQmlDelegateChoice *)
QQmlComponent * delegate(QQmlAdaptorModel *adaptorModel, int row, int column=-1) const override
static qsizetype choices_count(QQmlListProperty< QQmlDelegateChoice > *)
static QQmlDelegateChoice * choices_at(QQmlListProperty< QQmlDelegateChoice > *, qsizetype)
QQmlListProperty< QQmlDelegateChoice > choices
\qmlproperty list<DelegateChoice> Qt.labs.qmlmodels::DelegateChooser::choices \qmldefault
static void choices_append(QQmlListProperty< QQmlDelegateChoice > *, QQmlDelegateChoice *)
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isNull() const
Returns true if this string is null; otherwise returns false.
QByteArray toUtf8() const &
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
#define QStringLiteral(str)
myObject disconnect()
[26]