2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QMimeData>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QPersistentModelIndex>
|
|
|
|
#include <QSize>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QVariant>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qabstractitemmodel.h"
|
|
|
|
#include "gen_qabstractitemmodel.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QModelIndex* QModelIndex_new() {
|
|
|
|
return new QModelIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
QModelIndex* QModelIndex_new2(QModelIndex* param1) {
|
|
|
|
return new QModelIndex(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QModelIndex_Row(const QModelIndex* self) {
|
|
|
|
return self->row();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QModelIndex_Column(const QModelIndex* self) {
|
|
|
|
return self->column();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QModelIndex_InternalId(const QModelIndex* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
quintptr _ret = self->internalId();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QModelIndex_Parent(const QModelIndex* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->parent());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QModelIndex_Sibling(const QModelIndex* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QModelIndex_SiblingAtColumn(const QModelIndex* self, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->siblingAtColumn(static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QModelIndex_SiblingAtRow(const QModelIndex* self, int row) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->siblingAtRow(static_cast<int>(row)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QModelIndex_Child(const QModelIndex* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->child(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QModelIndex_Data(const QModelIndex* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QModelIndex_Flags(const QModelIndex* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAbstractItemModel* QModelIndex_Model(const QModelIndex* self) {
|
|
|
|
return (QAbstractItemModel*) self->model();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QModelIndex_IsValid(const QModelIndex* self) {
|
|
|
|
return self->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QModelIndex_OperatorEqual(const QModelIndex* self, QModelIndex* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QModelIndex_OperatorNotEqual(const QModelIndex* self, QModelIndex* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QModelIndex_OperatorLesser(const QModelIndex* self, QModelIndex* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QModelIndex_Data1(const QModelIndex* self, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QModelIndex_Delete(QModelIndex* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QPersistentModelIndex* QPersistentModelIndex_new() {
|
|
|
|
return new QPersistentModelIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPersistentModelIndex* QPersistentModelIndex_new2(QModelIndex* index) {
|
|
|
|
return new QPersistentModelIndex(*index);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPersistentModelIndex* QPersistentModelIndex_new3(QPersistentModelIndex* other) {
|
|
|
|
return new QPersistentModelIndex(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_OperatorLesser(const QPersistentModelIndex* self, QPersistentModelIndex* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_OperatorEqual(const QPersistentModelIndex* self, QPersistentModelIndex* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_OperatorNotEqual(const QPersistentModelIndex* self, QPersistentModelIndex* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPersistentModelIndex_OperatorAssign(QPersistentModelIndex* self, QPersistentModelIndex* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPersistentModelIndex_Swap(QPersistentModelIndex* self, QPersistentModelIndex* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_OperatorEqualWithOther(const QPersistentModelIndex* self, QModelIndex* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_OperatorNotEqualWithOther(const QPersistentModelIndex* self, QModelIndex* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPersistentModelIndex_OperatorAssignWithOther(QPersistentModelIndex* self, QModelIndex* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPersistentModelIndex_Row(const QPersistentModelIndex* self) {
|
|
|
|
return self->row();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPersistentModelIndex_Column(const QPersistentModelIndex* self) {
|
|
|
|
return self->column();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QPersistentModelIndex_InternalId(const QPersistentModelIndex* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
quintptr _ret = self->internalId();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QPersistentModelIndex_Parent(const QPersistentModelIndex* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->parent());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QPersistentModelIndex_Sibling(const QPersistentModelIndex* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QPersistentModelIndex_Child(const QPersistentModelIndex* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->child(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QPersistentModelIndex_Data(const QPersistentModelIndex* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPersistentModelIndex_Flags(const QPersistentModelIndex* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAbstractItemModel* QPersistentModelIndex_Model(const QPersistentModelIndex* self) {
|
|
|
|
return (QAbstractItemModel*) self->model();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPersistentModelIndex_IsValid(const QPersistentModelIndex* self) {
|
|
|
|
return self->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QPersistentModelIndex_Data1(const QPersistentModelIndex* self, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPersistentModelIndex_Delete(QPersistentModelIndex* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QAbstractItemModel_MetaObject(const QAbstractItemModel* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_Tr(const char* s) {
|
|
|
|
QString _ret = QAbstractItemModel::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QAbstractItemModel::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_HasIndex(const QAbstractItemModel* self, int row, int column) {
|
|
|
|
return self->hasIndex(static_cast<int>(row), static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractItemModel_Index(const QAbstractItemModel* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractItemModel_Parent(const QAbstractItemModel* self, QModelIndex* child) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->parent(*child));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractItemModel_Sibling(const QAbstractItemModel* self, int row, int column, QModelIndex* idx) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column), *idx));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_RowCount(const QAbstractItemModel* self) {
|
|
|
|
return self->rowCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_ColumnCount(const QAbstractItemModel* self) {
|
|
|
|
return self->columnCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_HasChildren(const QAbstractItemModel* self) {
|
|
|
|
return self->hasChildren();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QAbstractItemModel_Data(const QAbstractItemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_SetData(QAbstractItemModel* self, QModelIndex* index, QVariant* value) {
|
|
|
|
return self->setData(*index, *value);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QAbstractItemModel_HeaderData(const QAbstractItemModel* self, int section, uintptr_t orientation) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->headerData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_SetHeaderData(QAbstractItemModel* self, int section, uintptr_t orientation, QVariant* value) {
|
|
|
|
return self->setHeaderData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), *value);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QAbstractItemModel_MimeTypes(const QAbstractItemModel* self) {
|
|
|
|
QStringList _ret = self->mimeTypes();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
QMimeData* QAbstractItemModel_MimeData(const QAbstractItemModel* self, struct miqt_array* /* of QModelIndex* */ indexes) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QModelIndex> indexes_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
indexes_QList.reserve(indexes->len);
|
|
|
|
QModelIndex** indexes_arr = static_cast<QModelIndex**>(indexes->data);
|
|
|
|
for(size_t i = 0; i < indexes->len; ++i) {
|
|
|
|
indexes_QList.push_back(*(indexes_arr[i]));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->mimeData(indexes_QList);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_CanDropMimeData(const QAbstractItemModel* self, QMimeData* data, uintptr_t action, int row, int column, QModelIndex* parent) {
|
|
|
|
return self->canDropMimeData(data, static_cast<Qt::DropAction>(action), static_cast<int>(row), static_cast<int>(column), *parent);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_DropMimeData(QAbstractItemModel* self, QMimeData* data, uintptr_t action, int row, int column, QModelIndex* parent) {
|
|
|
|
return self->dropMimeData(data, static_cast<Qt::DropAction>(action), static_cast<int>(row), static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_SupportedDropActions(const QAbstractItemModel* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropActions _ret = self->supportedDropActions();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_SupportedDragActions(const QAbstractItemModel* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropActions _ret = self->supportedDragActions();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertRows(QAbstractItemModel* self, int row, int count) {
|
|
|
|
return self->insertRows(static_cast<int>(row), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertColumns(QAbstractItemModel* self, int column, int count) {
|
|
|
|
return self->insertColumns(static_cast<int>(column), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveRows(QAbstractItemModel* self, int row, int count) {
|
|
|
|
return self->removeRows(static_cast<int>(row), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveColumns(QAbstractItemModel* self, int column, int count) {
|
|
|
|
return self->removeColumns(static_cast<int>(column), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_MoveRows(QAbstractItemModel* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild) {
|
|
|
|
return self->moveRows(*sourceParent, static_cast<int>(sourceRow), static_cast<int>(count), *destinationParent, static_cast<int>(destinationChild));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_MoveColumns(QAbstractItemModel* self, QModelIndex* sourceParent, int sourceColumn, int count, QModelIndex* destinationParent, int destinationChild) {
|
|
|
|
return self->moveColumns(*sourceParent, static_cast<int>(sourceColumn), static_cast<int>(count), *destinationParent, static_cast<int>(destinationChild));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertRow(QAbstractItemModel* self, int row) {
|
|
|
|
return self->insertRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertColumn(QAbstractItemModel* self, int column) {
|
|
|
|
return self->insertColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveRow(QAbstractItemModel* self, int row) {
|
|
|
|
return self->removeRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveColumn(QAbstractItemModel* self, int column) {
|
|
|
|
return self->removeColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_MoveRow(QAbstractItemModel* self, QModelIndex* sourceParent, int sourceRow, QModelIndex* destinationParent, int destinationChild) {
|
|
|
|
return self->moveRow(*sourceParent, static_cast<int>(sourceRow), *destinationParent, static_cast<int>(destinationChild));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_MoveColumn(QAbstractItemModel* self, QModelIndex* sourceParent, int sourceColumn, QModelIndex* destinationParent, int destinationChild) {
|
|
|
|
return self->moveColumn(*sourceParent, static_cast<int>(sourceColumn), *destinationParent, static_cast<int>(destinationChild));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_FetchMore(QAbstractItemModel* self, QModelIndex* parent) {
|
|
|
|
self->fetchMore(*parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_CanFetchMore(const QAbstractItemModel* self, QModelIndex* parent) {
|
|
|
|
return self->canFetchMore(*parent);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_Flags(const QAbstractItemModel* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags(*index);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_Sort(QAbstractItemModel* self, int column) {
|
|
|
|
self->sort(static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractItemModel_Buddy(const QAbstractItemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->buddy(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QAbstractItemModel_Match(const QAbstractItemModel* self, QModelIndex* start, int role, QVariant* value) {
|
|
|
|
QModelIndexList _ret = self->match(*start, static_cast<int>(role), *value);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QModelIndex** _arr = static_cast<QModelIndex**>(malloc(sizeof(QModelIndex*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QModelIndex(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QAbstractItemModel_Span(const QAbstractItemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->span(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_CheckIndex(const QAbstractItemModel* self, QModelIndex* index) {
|
|
|
|
return self->checkIndex(*index);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QAbstractItemModel_DataChanged(QAbstractItemModel* self, QModelIndex* topLeft, QModelIndex* bottomRight) {
|
|
|
|
self->dataChanged(*topLeft, *bottomRight);
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemModel_connect_DataChanged(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QModelIndex&, const QModelIndex&, const QVector<int>&)>(&QAbstractItemModel::dataChanged), self, [=](const QModelIndex& topLeft, const QModelIndex& bottomRight) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& topLeft_ret = topLeft;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(&topLeft_ret);
|
|
|
|
const QModelIndex& bottomRight_ret = bottomRight;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval2 = const_cast<QModelIndex*>(&bottomRight_ret);
|
|
|
|
miqt_exec_callback_QAbstractItemModel_DataChanged(slot, sigval1, sigval2);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QAbstractItemModel_HeaderDataChanged(QAbstractItemModel* self, uintptr_t orientation, int first, int last) {
|
|
|
|
self->headerDataChanged(static_cast<Qt::Orientation>(orientation), static_cast<int>(first), static_cast<int>(last));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_connect_HeaderDataChanged(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(Qt::Orientation, int, int)>(&QAbstractItemModel::headerDataChanged), self, [=](Qt::Orientation orientation, int first, int last) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::Orientation orientation_ret = orientation;
|
|
|
|
uintptr_t sigval1 = static_cast<uintptr_t>(orientation_ret);
|
|
|
|
int sigval2 = first;
|
|
|
|
int sigval3 = last;
|
|
|
|
miqt_exec_callback_QAbstractItemModel_HeaderDataChanged(slot, sigval1, sigval2, sigval3);
|
2024-08-29 07:01:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_LayoutChanged(QAbstractItemModel* self) {
|
|
|
|
self->layoutChanged();
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemModel_connect_LayoutChanged(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutChanged), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutChanged(slot);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QAbstractItemModel_LayoutAboutToBeChanged(QAbstractItemModel* self) {
|
|
|
|
self->layoutAboutToBeChanged();
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemModel_connect_LayoutAboutToBeChanged(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutAboutToBeChanged), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutAboutToBeChanged(slot);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QAbstractItemModel_Submit(QAbstractItemModel* self) {
|
|
|
|
return self->submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_Revert(QAbstractItemModel* self) {
|
|
|
|
self->revert();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractItemModel::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractItemModel::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractItemModel::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemModel_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractItemModel::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_HasIndex3(const QAbstractItemModel* self, int row, int column, QModelIndex* parent) {
|
|
|
|
return self->hasIndex(static_cast<int>(row), static_cast<int>(column), *parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractItemModel_Index3(const QAbstractItemModel* self, int row, int column, QModelIndex* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column), *parent));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_RowCount1(const QAbstractItemModel* self, QModelIndex* parent) {
|
|
|
|
return self->rowCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractItemModel_ColumnCount1(const QAbstractItemModel* self, QModelIndex* parent) {
|
|
|
|
return self->columnCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_HasChildren1(const QAbstractItemModel* self, QModelIndex* parent) {
|
|
|
|
return self->hasChildren(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QAbstractItemModel_Data2(const QAbstractItemModel* self, QModelIndex* index, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(*index, static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_SetData3(QAbstractItemModel* self, QModelIndex* index, QVariant* value, int role) {
|
|
|
|
return self->setData(*index, *value, static_cast<int>(role));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QAbstractItemModel_HeaderData3(const QAbstractItemModel* self, int section, uintptr_t orientation, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->headerData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), static_cast<int>(role)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_SetHeaderData4(QAbstractItemModel* self, int section, uintptr_t orientation, QVariant* value, int role) {
|
|
|
|
return self->setHeaderData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), *value, static_cast<int>(role));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QAbstractItemModel_InsertRows3(QAbstractItemModel* self, int row, int count, QModelIndex* parent) {
|
|
|
|
return self->insertRows(static_cast<int>(row), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertColumns3(QAbstractItemModel* self, int column, int count, QModelIndex* parent) {
|
|
|
|
return self->insertColumns(static_cast<int>(column), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveRows3(QAbstractItemModel* self, int row, int count, QModelIndex* parent) {
|
|
|
|
return self->removeRows(static_cast<int>(row), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveColumns3(QAbstractItemModel* self, int column, int count, QModelIndex* parent) {
|
|
|
|
return self->removeColumns(static_cast<int>(column), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertRow2(QAbstractItemModel* self, int row, QModelIndex* parent) {
|
|
|
|
return self->insertRow(static_cast<int>(row), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_InsertColumn2(QAbstractItemModel* self, int column, QModelIndex* parent) {
|
|
|
|
return self->insertColumn(static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveRow2(QAbstractItemModel* self, int row, QModelIndex* parent) {
|
|
|
|
return self->removeRow(static_cast<int>(row), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemModel_RemoveColumn2(QAbstractItemModel* self, int column, QModelIndex* parent) {
|
|
|
|
return self->removeColumn(static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QAbstractItemModel_Sort2(QAbstractItemModel* self, int column, uintptr_t order) {
|
|
|
|
self->sort(static_cast<int>(column), static_cast<Qt::SortOrder>(order));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QAbstractItemModel_Match4(const QAbstractItemModel* self, QModelIndex* start, int role, QVariant* value, int hits) {
|
|
|
|
QModelIndexList _ret = self->match(*start, static_cast<int>(role), *value, static_cast<int>(hits));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QModelIndex** _arr = static_cast<QModelIndex**>(malloc(sizeof(QModelIndex*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QModelIndex(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QAbstractItemModel_Match5(const QAbstractItemModel* self, QModelIndex* start, int role, QVariant* value, int hits, int flags) {
|
|
|
|
QModelIndexList _ret = self->match(*start, static_cast<int>(role), *value, static_cast<int>(hits), static_cast<Qt::MatchFlags>(flags));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QModelIndex** _arr = static_cast<QModelIndex**>(malloc(sizeof(QModelIndex*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QModelIndex(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QAbstractItemModel_CheckIndex2(const QAbstractItemModel* self, QModelIndex* index, int options) {
|
|
|
|
return self->checkIndex(*index, static_cast<QAbstractItemModel::CheckIndexOptions>(options));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QAbstractItemModel_DataChanged3(QAbstractItemModel* self, QModelIndex* topLeft, QModelIndex* bottomRight, struct miqt_array* /* of int */ roles) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QVector<int> roles_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
roles_QList.reserve(roles->len);
|
|
|
|
int* roles_arr = static_cast<int*>(roles->data);
|
|
|
|
for(size_t i = 0; i < roles->len; ++i) {
|
|
|
|
roles_QList.push_back(roles_arr[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->dataChanged(*topLeft, *bottomRight, roles_QList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_connect_DataChanged3(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QModelIndex&, const QModelIndex&, const QVector<int>&)>(&QAbstractItemModel::dataChanged), self, [=](const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& topLeft_ret = topLeft;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(&topLeft_ret);
|
|
|
|
const QModelIndex& bottomRight_ret = bottomRight;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval2 = const_cast<QModelIndex*>(&bottomRight_ret);
|
|
|
|
const QVector<int>& roles_ret = roles;
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* roles_arr = static_cast<int*>(malloc(sizeof(int) * roles_ret.length()));
|
|
|
|
for (size_t i = 0, e = roles_ret.length(); i < e; ++i) {
|
|
|
|
roles_arr[i] = roles_ret[i];
|
|
|
|
}
|
|
|
|
struct miqt_array* roles_out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
roles_out->len = roles_ret.length();
|
|
|
|
roles_out->data = static_cast<void*>(roles_arr);
|
|
|
|
struct miqt_array* sigval3 = roles_out;
|
|
|
|
miqt_exec_callback_QAbstractItemModel_DataChanged3(slot, sigval1, sigval2, sigval3);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QAbstractItemModel_LayoutChanged1(QAbstractItemModel* self, struct miqt_array* /* of QPersistentModelIndex* */ parents) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QPersistentModelIndex> parents_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
parents_QList.reserve(parents->len);
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(parents->data);
|
|
|
|
for(size_t i = 0; i < parents->len; ++i) {
|
|
|
|
parents_QList.push_back(*(parents_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
self->layoutChanged(parents_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemModel_connect_LayoutChanged1(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutChanged), self, [=](const QList<QPersistentModelIndex>& parents) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QList<QPersistentModelIndex>& parents_ret = parents;
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(malloc(sizeof(QPersistentModelIndex*) * parents_ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = parents_ret.length(); i < e; ++i) {
|
|
|
|
parents_arr[i] = new QPersistentModelIndex(parents_ret[i]);
|
|
|
|
}
|
|
|
|
struct miqt_array* parents_out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
parents_out->len = parents_ret.length();
|
|
|
|
parents_out->data = static_cast<void*>(parents_arr);
|
|
|
|
struct miqt_array* sigval1 = parents_out;
|
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutChanged1(slot, sigval1);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QAbstractItemModel_LayoutChanged2(QAbstractItemModel* self, struct miqt_array* /* of QPersistentModelIndex* */ parents, uintptr_t hint) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QPersistentModelIndex> parents_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
parents_QList.reserve(parents->len);
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(parents->data);
|
|
|
|
for(size_t i = 0; i < parents->len; ++i) {
|
|
|
|
parents_QList.push_back(*(parents_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
self->layoutChanged(parents_QList, static_cast<QAbstractItemModel::LayoutChangeHint>(hint));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_connect_LayoutChanged2(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutChanged), self, [=](const QList<QPersistentModelIndex>& parents, QAbstractItemModel::LayoutChangeHint hint) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QList<QPersistentModelIndex>& parents_ret = parents;
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(malloc(sizeof(QPersistentModelIndex*) * parents_ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = parents_ret.length(); i < e; ++i) {
|
|
|
|
parents_arr[i] = new QPersistentModelIndex(parents_ret[i]);
|
|
|
|
}
|
|
|
|
struct miqt_array* parents_out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
parents_out->len = parents_ret.length();
|
|
|
|
parents_out->data = static_cast<void*>(parents_arr);
|
|
|
|
struct miqt_array* sigval1 = parents_out;
|
|
|
|
QAbstractItemModel::LayoutChangeHint hint_ret = hint;
|
|
|
|
uintptr_t sigval2 = static_cast<uintptr_t>(hint_ret);
|
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutChanged2(slot, sigval1, sigval2);
|
2024-08-29 07:01:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QAbstractItemModel_LayoutAboutToBeChanged1(QAbstractItemModel* self, struct miqt_array* /* of QPersistentModelIndex* */ parents) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QPersistentModelIndex> parents_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
parents_QList.reserve(parents->len);
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(parents->data);
|
|
|
|
for(size_t i = 0; i < parents->len; ++i) {
|
|
|
|
parents_QList.push_back(*(parents_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
self->layoutAboutToBeChanged(parents_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemModel_connect_LayoutAboutToBeChanged1(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutAboutToBeChanged), self, [=](const QList<QPersistentModelIndex>& parents) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QList<QPersistentModelIndex>& parents_ret = parents;
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(malloc(sizeof(QPersistentModelIndex*) * parents_ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = parents_ret.length(); i < e; ++i) {
|
|
|
|
parents_arr[i] = new QPersistentModelIndex(parents_ret[i]);
|
|
|
|
}
|
|
|
|
struct miqt_array* parents_out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
parents_out->len = parents_ret.length();
|
|
|
|
parents_out->data = static_cast<void*>(parents_arr);
|
|
|
|
struct miqt_array* sigval1 = parents_out;
|
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutAboutToBeChanged1(slot, sigval1);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QAbstractItemModel_LayoutAboutToBeChanged2(QAbstractItemModel* self, struct miqt_array* /* of QPersistentModelIndex* */ parents, uintptr_t hint) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QPersistentModelIndex> parents_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
parents_QList.reserve(parents->len);
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(parents->data);
|
|
|
|
for(size_t i = 0; i < parents->len; ++i) {
|
|
|
|
parents_QList.push_back(*(parents_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
self->layoutAboutToBeChanged(parents_QList, static_cast<QAbstractItemModel::LayoutChangeHint>(hint));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemModel_connect_LayoutAboutToBeChanged2(QAbstractItemModel* self, void* slot) {
|
|
|
|
QAbstractItemModel::connect(self, static_cast<void (QAbstractItemModel::*)(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint)>(&QAbstractItemModel::layoutAboutToBeChanged), self, [=](const QList<QPersistentModelIndex>& parents, QAbstractItemModel::LayoutChangeHint hint) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QList<QPersistentModelIndex>& parents_ret = parents;
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QPersistentModelIndex** parents_arr = static_cast<QPersistentModelIndex**>(malloc(sizeof(QPersistentModelIndex*) * parents_ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = parents_ret.length(); i < e; ++i) {
|
|
|
|
parents_arr[i] = new QPersistentModelIndex(parents_ret[i]);
|
|
|
|
}
|
|
|
|
struct miqt_array* parents_out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
parents_out->len = parents_ret.length();
|
|
|
|
parents_out->data = static_cast<void*>(parents_arr);
|
|
|
|
struct miqt_array* sigval1 = parents_out;
|
|
|
|
QAbstractItemModel::LayoutChangeHint hint_ret = hint;
|
|
|
|
uintptr_t sigval2 = static_cast<uintptr_t>(hint_ret);
|
|
|
|
miqt_exec_callback_QAbstractItemModel_LayoutAboutToBeChanged2(slot, sigval1, sigval2);
|
2024-08-29 07:01:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QAbstractItemModel_Delete(QAbstractItemModel* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QAbstractTableModel_MetaObject(const QAbstractTableModel* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_Tr(const char* s) {
|
|
|
|
QString _ret = QAbstractTableModel::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QAbstractTableModel::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractTableModel_Index(const QAbstractTableModel* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractTableModel_Sibling(const QAbstractTableModel* self, int row, int column, QModelIndex* idx) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column), *idx));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QAbstractTableModel_DropMimeData(QAbstractTableModel* self, QMimeData* data, uintptr_t action, int row, int column, QModelIndex* parent) {
|
|
|
|
return self->dropMimeData(data, static_cast<Qt::DropAction>(action), static_cast<int>(row), static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractTableModel_Flags(const QAbstractTableModel* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags(*index);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractTableModel::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractTableModel::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractTableModel::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractTableModel_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractTableModel::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractTableModel_Index3(const QAbstractTableModel* self, int row, int column, QModelIndex* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column), *parent));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractTableModel_Delete(QAbstractTableModel* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QAbstractListModel_MetaObject(const QAbstractListModel* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_Tr(const char* s) {
|
|
|
|
QString _ret = QAbstractListModel::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QAbstractListModel::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractListModel_Index(const QAbstractListModel* self, int row) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractListModel_Sibling(const QAbstractListModel* self, int row, int column, QModelIndex* idx) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column), *idx));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QAbstractListModel_DropMimeData(QAbstractListModel* self, QMimeData* data, uintptr_t action, int row, int column, QModelIndex* parent) {
|
|
|
|
return self->dropMimeData(data, static_cast<Qt::DropAction>(action), static_cast<int>(row), static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QAbstractListModel_Flags(const QAbstractListModel* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags(*index);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractListModel::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractListModel::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractListModel::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractListModel_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractListModel::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractListModel_Index2(const QAbstractListModel* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QAbstractListModel_Index3(const QAbstractListModel* self, int row, int column, QModelIndex* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column), *parent));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractListModel_Delete(QAbstractListModel* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|