4#ifndef QQMLDMLISTACCESSORDATA_P_H
5#define QQMLDMLISTACCESSORDATA_P_H
18#include <private/qqmladaptormodelenginedata_p.h>
19#include <private/qqmldelegatemodel_p_p.h>
20#include <private/qobject_p.h>
33 const QQmlRefPointer<QQmlDelegateModelItemMetaType> &
metaType,
77 return o.asReturnedValue();
91 bool cachedDataClean =
false;
104 QQmlAdaptorModelEngineData::setModelDataType<QQmlDMListAccessorData>(&
builder,
this);
149 template<
typename String>
152 if constexpr (std::is_same_v<String, QString>)
154 else if constexpr (std::is_same_v<String, QByteArray>)
156 else if constexpr (std::is_same_v<String, const char *>)
158 Q_UNREACHABLE_RETURN(
QString());
161 template<
typename String>
164 if constexpr (std::is_same_v<String, QString>)
166 else if constexpr (std::is_same_v<String, QByteArray>)
168 else if constexpr (std::is_same_v<String, const char *>)
173 template<
typename String>
177 if (
type == QMetaType::fromType<QVariantMap>())
180 if (
type == QMetaType::fromType<QVariantHash>())
183 const QMetaType::TypeFlags typeFlags =
type.
flags();
189 if (propertyIndex >= 0)
196 template<
typename String>
210 if (
type == QMetaType::fromType<QVariantMap>()) {
214 }
else if (
type == QMetaType::fromType<QVariantHash>()) {
228 template<
typename String>
232 if (
type == QMetaType::fromType<QVariantMap>()) {
234 }
else if (
type == QMetaType::fromType<QVariantHash>()) {
240 if (propertyIndex >= 0)
256 const QQmlRefPointer<QQmlDelegateModelItemMetaType> &
metaType,
267 for (
auto modelItem :
items) {
268 const int modelItemIndex = modelItem->index;
269 if (modelItemIndex < index || modelItemIndex >=
index +
count)
274 listModelItem->setModelData(updatedModelData);
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
T value(const Key &key) const noexcept
key_iterator keyBegin() const
key_iterator keyEnd() const
QScopedPointer< QMetaObject, QScopedPointerPodDeleter > metaObject
void setModelData(const QVariant &data)
QQmlDMListAccessorData(const QQmlRefPointer< QQmlDelegateModelItemMetaType > &metaType, VDMListDelegateDataType *dataType, int index, int row, int column, const QVariant &value)
bool resolveIndex(const QQmlAdaptorModel &model, int idx) override
~QQmlDMListAccessorData()
QVariant modelData() const
void setValue(const QString &role, const QVariant &value) override
static QV4::ReturnedValue get_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int)
static QV4::ReturnedValue set_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
QV4::ReturnedValue get() override
QV4::ExecutionEngine * v4
QQmlRefPointer< QQmlDelegateModelItemMetaType > const metaType
QVariant at(qsizetype) const
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
ObjectType::Data * allocate(Args &&... args)
void emitAllSignals(QQmlDMListAccessorData *accessor) const
void createMissingProperties(const QVariant *row)
int rowCount(const QQmlAdaptorModel &model) const override
bool notify(const QQmlAdaptorModel &model, const QList< QQmlDelegateModelItem * > &items, int index, int count, const QVector< int > &) const override
VDMListDelegateDataType(QQmlAdaptorModel *model)
int createProperty(const char *name, const char *) final
QMetaObject * toDynamicMetaObject(QObject *accessors) final
static const QMetaObject * metaObjectFromType(QMetaType type)
QMetaObjectBuilder builder
static QString toQString(const String &string)
QQmlDelegateModelItem * createItem(QQmlAdaptorModel &model, const QQmlRefPointer< QQmlDelegateModelItemMetaType > &metaType, int index, int row, int column) override
int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments) final
static QVariant value(const QVariant *row, const String &role)
void createPropertyIfMissing(const String &string)
QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const override
static QByteArray toUtf8(const String &string)
int columnCount(const QQmlAdaptorModel &model) const override
static void setValue(QVariant *row, const String &role, const QVariant &value)
void cleanup(QQmlAdaptorModel &) const override
QMap< QString, QString > map
[6]
cache insert(employee->id(), employee)
QSet< QString >::iterator it
QList< QVariant > arguments
Combined button and popup list for selecting options.
size_t qstrlen(const char *str)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define QT_ANONYMOUS_PROPERTY(...)
GLboolean GLboolean GLboolean b
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
QLatin1StringView QLatin1String
#define QStringLiteral(str)
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)
static constexpr ReturnedValue undefined()
MemoryManager * memoryManager
QV4::ReturnedValue fromVariant(const QVariant &)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
ReturnedValue throwTypeError()