#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gen_qstandarditemmodel.h" #include "_cgo_export.h" QStandardItem* QStandardItem_new() { return new QStandardItem(); } QStandardItem* QStandardItem_new2(struct miqt_string text) { QString text_QString = QString::fromUtf8(text.data, text.len); return new QStandardItem(text_QString); } QStandardItem* QStandardItem_new3(QIcon* icon, struct miqt_string text) { QString text_QString = QString::fromUtf8(text.data, text.len); return new QStandardItem(*icon, text_QString); } QStandardItem* QStandardItem_new4(int rows) { return new QStandardItem(static_cast(rows)); } QStandardItem* QStandardItem_new5(int rows, int columns) { return new QStandardItem(static_cast(rows), static_cast(columns)); } QVariant* QStandardItem_Data(const QStandardItem* self) { return new QVariant(self->data()); } void QStandardItem_MultiData(const QStandardItem* self, QModelRoleDataSpan* roleDataSpan) { self->multiData(*roleDataSpan); } void QStandardItem_SetData(QStandardItem* self, QVariant* value) { self->setData(*value); } void QStandardItem_ClearData(QStandardItem* self) { self->clearData(); } struct miqt_string QStandardItem_Text(const QStandardItem* self) { QString _ret = self->text(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetText(QStandardItem* self, struct miqt_string text) { QString text_QString = QString::fromUtf8(text.data, text.len); self->setText(text_QString); } QIcon* QStandardItem_Icon(const QStandardItem* self) { return new QIcon(self->icon()); } void QStandardItem_SetIcon(QStandardItem* self, QIcon* icon) { self->setIcon(*icon); } struct miqt_string QStandardItem_ToolTip(const QStandardItem* self) { QString _ret = self->toolTip(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetToolTip(QStandardItem* self, struct miqt_string toolTip) { QString toolTip_QString = QString::fromUtf8(toolTip.data, toolTip.len); self->setToolTip(toolTip_QString); } struct miqt_string QStandardItem_StatusTip(const QStandardItem* self) { QString _ret = self->statusTip(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetStatusTip(QStandardItem* self, struct miqt_string statusTip) { QString statusTip_QString = QString::fromUtf8(statusTip.data, statusTip.len); self->setStatusTip(statusTip_QString); } struct miqt_string QStandardItem_WhatsThis(const QStandardItem* self) { QString _ret = self->whatsThis(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetWhatsThis(QStandardItem* self, struct miqt_string whatsThis) { QString whatsThis_QString = QString::fromUtf8(whatsThis.data, whatsThis.len); self->setWhatsThis(whatsThis_QString); } QSize* QStandardItem_SizeHint(const QStandardItem* self) { return new QSize(self->sizeHint()); } void QStandardItem_SetSizeHint(QStandardItem* self, QSize* sizeHint) { self->setSizeHint(*sizeHint); } QFont* QStandardItem_Font(const QStandardItem* self) { return new QFont(self->font()); } void QStandardItem_SetFont(QStandardItem* self, QFont* font) { self->setFont(*font); } int QStandardItem_TextAlignment(const QStandardItem* self) { Qt::Alignment _ret = self->textAlignment(); return static_cast(_ret); } void QStandardItem_SetTextAlignment(QStandardItem* self, int textAlignment) { self->setTextAlignment(static_cast(textAlignment)); } QBrush* QStandardItem_Background(const QStandardItem* self) { return new QBrush(self->background()); } void QStandardItem_SetBackground(QStandardItem* self, QBrush* brush) { self->setBackground(*brush); } QBrush* QStandardItem_Foreground(const QStandardItem* self) { return new QBrush(self->foreground()); } void QStandardItem_SetForeground(QStandardItem* self, QBrush* brush) { self->setForeground(*brush); } int QStandardItem_CheckState(const QStandardItem* self) { Qt::CheckState _ret = self->checkState(); return static_cast(_ret); } void QStandardItem_SetCheckState(QStandardItem* self, int checkState) { self->setCheckState(static_cast(checkState)); } struct miqt_string QStandardItem_AccessibleText(const QStandardItem* self) { QString _ret = self->accessibleText(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetAccessibleText(QStandardItem* self, struct miqt_string accessibleText) { QString accessibleText_QString = QString::fromUtf8(accessibleText.data, accessibleText.len); self->setAccessibleText(accessibleText_QString); } struct miqt_string QStandardItem_AccessibleDescription(const QStandardItem* self) { QString _ret = self->accessibleDescription(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItem_SetAccessibleDescription(QStandardItem* self, struct miqt_string accessibleDescription) { QString accessibleDescription_QString = QString::fromUtf8(accessibleDescription.data, accessibleDescription.len); self->setAccessibleDescription(accessibleDescription_QString); } int QStandardItem_Flags(const QStandardItem* self) { Qt::ItemFlags _ret = self->flags(); return static_cast(_ret); } void QStandardItem_SetFlags(QStandardItem* self, int flags) { self->setFlags(static_cast(flags)); } bool QStandardItem_IsEnabled(const QStandardItem* self) { return self->isEnabled(); } void QStandardItem_SetEnabled(QStandardItem* self, bool enabled) { self->setEnabled(enabled); } bool QStandardItem_IsEditable(const QStandardItem* self) { return self->isEditable(); } void QStandardItem_SetEditable(QStandardItem* self, bool editable) { self->setEditable(editable); } bool QStandardItem_IsSelectable(const QStandardItem* self) { return self->isSelectable(); } void QStandardItem_SetSelectable(QStandardItem* self, bool selectable) { self->setSelectable(selectable); } bool QStandardItem_IsCheckable(const QStandardItem* self) { return self->isCheckable(); } void QStandardItem_SetCheckable(QStandardItem* self, bool checkable) { self->setCheckable(checkable); } bool QStandardItem_IsAutoTristate(const QStandardItem* self) { return self->isAutoTristate(); } void QStandardItem_SetAutoTristate(QStandardItem* self, bool tristate) { self->setAutoTristate(tristate); } bool QStandardItem_IsUserTristate(const QStandardItem* self) { return self->isUserTristate(); } void QStandardItem_SetUserTristate(QStandardItem* self, bool tristate) { self->setUserTristate(tristate); } bool QStandardItem_IsDragEnabled(const QStandardItem* self) { return self->isDragEnabled(); } void QStandardItem_SetDragEnabled(QStandardItem* self, bool dragEnabled) { self->setDragEnabled(dragEnabled); } bool QStandardItem_IsDropEnabled(const QStandardItem* self) { return self->isDropEnabled(); } void QStandardItem_SetDropEnabled(QStandardItem* self, bool dropEnabled) { self->setDropEnabled(dropEnabled); } QStandardItem* QStandardItem_Parent(const QStandardItem* self) { return self->parent(); } int QStandardItem_Row(const QStandardItem* self) { return self->row(); } int QStandardItem_Column(const QStandardItem* self) { return self->column(); } QModelIndex* QStandardItem_Index(const QStandardItem* self) { return new QModelIndex(self->index()); } QStandardItemModel* QStandardItem_Model(const QStandardItem* self) { return self->model(); } int QStandardItem_RowCount(const QStandardItem* self) { return self->rowCount(); } void QStandardItem_SetRowCount(QStandardItem* self, int rows) { self->setRowCount(static_cast(rows)); } int QStandardItem_ColumnCount(const QStandardItem* self) { return self->columnCount(); } void QStandardItem_SetColumnCount(QStandardItem* self, int columns) { self->setColumnCount(static_cast(columns)); } bool QStandardItem_HasChildren(const QStandardItem* self) { return self->hasChildren(); } QStandardItem* QStandardItem_Child(const QStandardItem* self, int row) { return self->child(static_cast(row)); } void QStandardItem_SetChild(QStandardItem* self, int row, int column, QStandardItem* item) { self->setChild(static_cast(row), static_cast(column), item); } void QStandardItem_SetChild2(QStandardItem* self, int row, QStandardItem* item) { self->setChild(static_cast(row), item); } void QStandardItem_InsertRow(QStandardItem* self, int row, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->insertRow(static_cast(row), items_QList); } void QStandardItem_InsertColumn(QStandardItem* self, int column, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->insertColumn(static_cast(column), items_QList); } void QStandardItem_InsertRows(QStandardItem* self, int row, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->insertRows(static_cast(row), items_QList); } void QStandardItem_InsertRows2(QStandardItem* self, int row, int count) { self->insertRows(static_cast(row), static_cast(count)); } void QStandardItem_InsertColumns(QStandardItem* self, int column, int count) { self->insertColumns(static_cast(column), static_cast(count)); } void QStandardItem_RemoveRow(QStandardItem* self, int row) { self->removeRow(static_cast(row)); } void QStandardItem_RemoveColumn(QStandardItem* self, int column) { self->removeColumn(static_cast(column)); } void QStandardItem_RemoveRows(QStandardItem* self, int row, int count) { self->removeRows(static_cast(row), static_cast(count)); } void QStandardItem_RemoveColumns(QStandardItem* self, int column, int count) { self->removeColumns(static_cast(column), static_cast(count)); } void QStandardItem_AppendRow(QStandardItem* self, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->appendRow(items_QList); } void QStandardItem_AppendRows(QStandardItem* self, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->appendRows(items_QList); } void QStandardItem_AppendColumn(QStandardItem* self, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->appendColumn(items_QList); } void QStandardItem_InsertRow2(QStandardItem* self, int row, QStandardItem* item) { self->insertRow(static_cast(row), item); } void QStandardItem_AppendRowWithItem(QStandardItem* self, QStandardItem* item) { self->appendRow(item); } QStandardItem* QStandardItem_TakeChild(QStandardItem* self, int row) { return self->takeChild(static_cast(row)); } struct miqt_array /* of QStandardItem* */ QStandardItem_TakeRow(QStandardItem* self, int row) { QList _ret = self->takeRow(static_cast(row)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of QStandardItem* */ QStandardItem_TakeColumn(QStandardItem* self, int column) { QList _ret = self->takeColumn(static_cast(column)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } void QStandardItem_SortChildren(QStandardItem* self, int column) { self->sortChildren(static_cast(column)); } QStandardItem* QStandardItem_Clone(const QStandardItem* self) { return self->clone(); } int QStandardItem_Type(const QStandardItem* self) { return self->type(); } void QStandardItem_Read(QStandardItem* self, QDataStream* in) { self->read(*in); } void QStandardItem_Write(const QStandardItem* self, QDataStream* out) { self->write(*out); } bool QStandardItem_OperatorLesser(const QStandardItem* self, QStandardItem* other) { return self->operator<(*other); } QVariant* QStandardItem_Data1(const QStandardItem* self, int role) { return new QVariant(self->data(static_cast(role))); } void QStandardItem_SetData2(QStandardItem* self, QVariant* value, int role) { self->setData(*value, static_cast(role)); } QStandardItem* QStandardItem_Child2(const QStandardItem* self, int row, int column) { return self->child(static_cast(row), static_cast(column)); } QStandardItem* QStandardItem_TakeChild2(QStandardItem* self, int row, int column) { return self->takeChild(static_cast(row), static_cast(column)); } void QStandardItem_SortChildren2(QStandardItem* self, int column, int order) { self->sortChildren(static_cast(column), static_cast(order)); } void QStandardItem_Delete(QStandardItem* self) { delete self; } QStandardItemModel* QStandardItemModel_new() { return new QStandardItemModel(); } QStandardItemModel* QStandardItemModel_new2(int rows, int columns) { return new QStandardItemModel(static_cast(rows), static_cast(columns)); } QStandardItemModel* QStandardItemModel_new3(QObject* parent) { return new QStandardItemModel(parent); } QStandardItemModel* QStandardItemModel_new4(int rows, int columns, QObject* parent) { return new QStandardItemModel(static_cast(rows), static_cast(columns), parent); } QMetaObject* QStandardItemModel_MetaObject(const QStandardItemModel* self) { return (QMetaObject*) self->metaObject(); } void* QStandardItemModel_Metacast(QStandardItemModel* self, const char* param1) { return self->qt_metacast(param1); } struct miqt_string QStandardItemModel_Tr(const char* s) { QString _ret = QStandardItemModel::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QStandardItemModel_SetItemRoleNames(QStandardItemModel* self, struct miqt_map /* of int to struct miqt_string */ roleNames) { QHash roleNames_QMap; roleNames_QMap.reserve(roleNames.len); int* roleNames_karr = static_cast(roleNames.keys); struct miqt_string* roleNames_varr = static_cast(roleNames.values); for(size_t i = 0; i < roleNames.len; ++i) { QByteArray roleNames_varr_i_QByteArray(roleNames_varr[i].data, roleNames_varr[i].len); roleNames_QMap[static_cast(roleNames_karr[i])] = roleNames_varr_i_QByteArray; } self->setItemRoleNames(roleNames_QMap); } struct miqt_map /* of int to struct miqt_string */ QStandardItemModel_RoleNames(const QStandardItemModel* self) { QHash _ret = self->roleNames(); // Convert QMap<> from C++ memory to manually-managed C memory int* _karr = static_cast(malloc(sizeof(int) * _ret.size())); struct miqt_string* _varr = static_cast(malloc(sizeof(struct miqt_string) * _ret.size())); int _ctr = 0; for (auto _itr = _ret.keyValueBegin(); _itr != _ret.keyValueEnd(); ++_itr) { _karr[_ctr] = _itr->first; QByteArray _hashval_qb = _itr->second; struct miqt_string _hashval_ms; _hashval_ms.len = _hashval_qb.length(); _hashval_ms.data = static_cast(malloc(_hashval_ms.len)); memcpy(_hashval_ms.data, _hashval_qb.data(), _hashval_ms.len); _varr[_ctr] = _hashval_ms; _ctr++; } struct miqt_map _out; _out.len = _ret.size(); _out.keys = static_cast(_karr); _out.values = static_cast(_varr); return _out; } QModelIndex* QStandardItemModel_Index(const QStandardItemModel* self, int row, int column) { return new QModelIndex(self->index(static_cast(row), static_cast(column))); } QModelIndex* QStandardItemModel_Parent(const QStandardItemModel* self, QModelIndex* child) { return new QModelIndex(self->parent(*child)); } int QStandardItemModel_RowCount(const QStandardItemModel* self) { return self->rowCount(); } int QStandardItemModel_ColumnCount(const QStandardItemModel* self) { return self->columnCount(); } bool QStandardItemModel_HasChildren(const QStandardItemModel* self) { return self->hasChildren(); } QVariant* QStandardItemModel_Data(const QStandardItemModel* self, QModelIndex* index) { return new QVariant(self->data(*index)); } void QStandardItemModel_MultiData(const QStandardItemModel* self, QModelIndex* index, QModelRoleDataSpan* roleDataSpan) { self->multiData(*index, *roleDataSpan); } bool QStandardItemModel_SetData(QStandardItemModel* self, QModelIndex* index, QVariant* value) { return self->setData(*index, *value); } bool QStandardItemModel_ClearItemData(QStandardItemModel* self, QModelIndex* index) { return self->clearItemData(*index); } QVariant* QStandardItemModel_HeaderData(const QStandardItemModel* self, int section, int orientation) { return new QVariant(self->headerData(static_cast(section), static_cast(orientation))); } bool QStandardItemModel_SetHeaderData(QStandardItemModel* self, int section, int orientation, QVariant* value) { return self->setHeaderData(static_cast(section), static_cast(orientation), *value); } bool QStandardItemModel_InsertRows(QStandardItemModel* self, int row, int count) { return self->insertRows(static_cast(row), static_cast(count)); } bool QStandardItemModel_InsertColumns(QStandardItemModel* self, int column, int count) { return self->insertColumns(static_cast(column), static_cast(count)); } bool QStandardItemModel_RemoveRows(QStandardItemModel* self, int row, int count) { return self->removeRows(static_cast(row), static_cast(count)); } bool QStandardItemModel_RemoveColumns(QStandardItemModel* self, int column, int count) { return self->removeColumns(static_cast(column), static_cast(count)); } int QStandardItemModel_Flags(const QStandardItemModel* self, QModelIndex* index) { Qt::ItemFlags _ret = self->flags(*index); return static_cast(_ret); } int QStandardItemModel_SupportedDropActions(const QStandardItemModel* self) { Qt::DropActions _ret = self->supportedDropActions(); return static_cast(_ret); } struct miqt_map /* of int to QVariant* */ QStandardItemModel_ItemData(const QStandardItemModel* self, QModelIndex* index) { QMap _ret = self->itemData(*index); // Convert QMap<> from C++ memory to manually-managed C memory int* _karr = static_cast(malloc(sizeof(int) * _ret.size())); QVariant** _varr = static_cast(malloc(sizeof(QVariant*) * _ret.size())); int _ctr = 0; for (auto _itr = _ret.keyValueBegin(); _itr != _ret.keyValueEnd(); ++_itr) { _karr[_ctr] = _itr->first; _varr[_ctr] = new QVariant(_itr->second); _ctr++; } struct miqt_map _out; _out.len = _ret.size(); _out.keys = static_cast(_karr); _out.values = static_cast(_varr); return _out; } bool QStandardItemModel_SetItemData(QStandardItemModel* self, QModelIndex* index, struct miqt_map /* of int to QVariant* */ roles) { QMap roles_QMap; int* roles_karr = static_cast(roles.keys); QVariant** roles_varr = static_cast(roles.values); for(size_t i = 0; i < roles.len; ++i) { roles_QMap[static_cast(roles_karr[i])] = *(roles_varr[i]); } return self->setItemData(*index, roles_QMap); } void QStandardItemModel_Clear(QStandardItemModel* self) { self->clear(); } void QStandardItemModel_Sort(QStandardItemModel* self, int column) { self->sort(static_cast(column)); } QStandardItem* QStandardItemModel_ItemFromIndex(const QStandardItemModel* self, QModelIndex* index) { return self->itemFromIndex(*index); } QModelIndex* QStandardItemModel_IndexFromItem(const QStandardItemModel* self, QStandardItem* item) { return new QModelIndex(self->indexFromItem(item)); } QStandardItem* QStandardItemModel_Item(const QStandardItemModel* self, int row) { return self->item(static_cast(row)); } void QStandardItemModel_SetItem(QStandardItemModel* self, int row, int column, QStandardItem* item) { self->setItem(static_cast(row), static_cast(column), item); } void QStandardItemModel_SetItem2(QStandardItemModel* self, int row, QStandardItem* item) { self->setItem(static_cast(row), item); } QStandardItem* QStandardItemModel_InvisibleRootItem(const QStandardItemModel* self) { return self->invisibleRootItem(); } QStandardItem* QStandardItemModel_HorizontalHeaderItem(const QStandardItemModel* self, int column) { return self->horizontalHeaderItem(static_cast(column)); } void QStandardItemModel_SetHorizontalHeaderItem(QStandardItemModel* self, int column, QStandardItem* item) { self->setHorizontalHeaderItem(static_cast(column), item); } QStandardItem* QStandardItemModel_VerticalHeaderItem(const QStandardItemModel* self, int row) { return self->verticalHeaderItem(static_cast(row)); } void QStandardItemModel_SetVerticalHeaderItem(QStandardItemModel* self, int row, QStandardItem* item) { self->setVerticalHeaderItem(static_cast(row), item); } void QStandardItemModel_SetHorizontalHeaderLabels(QStandardItemModel* self, struct miqt_array /* of struct miqt_string */ labels) { QStringList labels_QList; labels_QList.reserve(labels.len); struct miqt_string* labels_arr = static_cast(labels.data); for(size_t i = 0; i < labels.len; ++i) { QString labels_arr_i_QString = QString::fromUtf8(labels_arr[i].data, labels_arr[i].len); labels_QList.push_back(labels_arr_i_QString); } self->setHorizontalHeaderLabels(labels_QList); } void QStandardItemModel_SetVerticalHeaderLabels(QStandardItemModel* self, struct miqt_array /* of struct miqt_string */ labels) { QStringList labels_QList; labels_QList.reserve(labels.len); struct miqt_string* labels_arr = static_cast(labels.data); for(size_t i = 0; i < labels.len; ++i) { QString labels_arr_i_QString = QString::fromUtf8(labels_arr[i].data, labels_arr[i].len); labels_QList.push_back(labels_arr_i_QString); } self->setVerticalHeaderLabels(labels_QList); } void QStandardItemModel_SetRowCount(QStandardItemModel* self, int rows) { self->setRowCount(static_cast(rows)); } void QStandardItemModel_SetColumnCount(QStandardItemModel* self, int columns) { self->setColumnCount(static_cast(columns)); } void QStandardItemModel_AppendRow(QStandardItemModel* self, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->appendRow(items_QList); } void QStandardItemModel_AppendColumn(QStandardItemModel* self, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->appendColumn(items_QList); } void QStandardItemModel_AppendRowWithItem(QStandardItemModel* self, QStandardItem* item) { self->appendRow(item); } void QStandardItemModel_InsertRow(QStandardItemModel* self, int row, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->insertRow(static_cast(row), items_QList); } void QStandardItemModel_InsertColumn(QStandardItemModel* self, int column, struct miqt_array /* of QStandardItem* */ items) { QList items_QList; items_QList.reserve(items.len); QStandardItem** items_arr = static_cast(items.data); for(size_t i = 0; i < items.len; ++i) { items_QList.push_back(items_arr[i]); } self->insertColumn(static_cast(column), items_QList); } void QStandardItemModel_InsertRow2(QStandardItemModel* self, int row, QStandardItem* item) { self->insertRow(static_cast(row), item); } bool QStandardItemModel_InsertRowWithRow(QStandardItemModel* self, int row) { return self->insertRow(static_cast(row)); } bool QStandardItemModel_InsertColumnWithColumn(QStandardItemModel* self, int column) { return self->insertColumn(static_cast(column)); } QStandardItem* QStandardItemModel_TakeItem(QStandardItemModel* self, int row) { return self->takeItem(static_cast(row)); } struct miqt_array /* of QStandardItem* */ QStandardItemModel_TakeRow(QStandardItemModel* self, int row) { QList _ret = self->takeRow(static_cast(row)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of QStandardItem* */ QStandardItemModel_TakeColumn(QStandardItemModel* self, int column) { QList _ret = self->takeColumn(static_cast(column)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } QStandardItem* QStandardItemModel_TakeHorizontalHeaderItem(QStandardItemModel* self, int column) { return self->takeHorizontalHeaderItem(static_cast(column)); } QStandardItem* QStandardItemModel_TakeVerticalHeaderItem(QStandardItemModel* self, int row) { return self->takeVerticalHeaderItem(static_cast(row)); } QStandardItem* QStandardItemModel_ItemPrototype(const QStandardItemModel* self) { return (QStandardItem*) self->itemPrototype(); } void QStandardItemModel_SetItemPrototype(QStandardItemModel* self, QStandardItem* item) { self->setItemPrototype(item); } struct miqt_array /* of QStandardItem* */ QStandardItemModel_FindItems(const QStandardItemModel* self, struct miqt_string text) { QString text_QString = QString::fromUtf8(text.data, text.len); QList _ret = self->findItems(text_QString); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } int QStandardItemModel_SortRole(const QStandardItemModel* self) { return self->sortRole(); } void QStandardItemModel_SetSortRole(QStandardItemModel* self, int role) { self->setSortRole(static_cast(role)); } struct miqt_array /* of struct miqt_string */ QStandardItemModel_MimeTypes(const QStandardItemModel* self) { QStringList _ret = self->mimeTypes(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); struct miqt_string _lv_ms; _lv_ms.len = _lv_b.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } QMimeData* QStandardItemModel_MimeData(const QStandardItemModel* self, struct miqt_array /* of QModelIndex* */ indexes) { QModelIndexList indexes_QList; indexes_QList.reserve(indexes.len); QModelIndex** indexes_arr = static_cast(indexes.data); for(size_t i = 0; i < indexes.len; ++i) { indexes_QList.push_back(*(indexes_arr[i])); } return self->mimeData(indexes_QList); } bool QStandardItemModel_DropMimeData(QStandardItemModel* self, QMimeData* data, int action, int row, int column, QModelIndex* parent) { return self->dropMimeData(data, static_cast(action), static_cast(row), static_cast(column), *parent); } void QStandardItemModel_ItemChanged(QStandardItemModel* self, QStandardItem* item) { self->itemChanged(item); } void QStandardItemModel_connect_ItemChanged(QStandardItemModel* self, intptr_t slot) { QStandardItemModel::connect(self, static_cast(&QStandardItemModel::itemChanged), self, [=](QStandardItem* item) { QStandardItem* sigval1 = item; miqt_exec_callback_QStandardItemModel_ItemChanged(slot, sigval1); }); } struct miqt_string QStandardItemModel_Tr2(const char* s, const char* c) { QString _ret = QStandardItemModel::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QStandardItemModel_Tr3(const char* s, const char* c, int n) { QString _ret = QStandardItemModel::tr(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } QModelIndex* QStandardItemModel_Index3(const QStandardItemModel* self, int row, int column, QModelIndex* parent) { return new QModelIndex(self->index(static_cast(row), static_cast(column), *parent)); } int QStandardItemModel_RowCount1(const QStandardItemModel* self, QModelIndex* parent) { return self->rowCount(*parent); } int QStandardItemModel_ColumnCount1(const QStandardItemModel* self, QModelIndex* parent) { return self->columnCount(*parent); } bool QStandardItemModel_HasChildren1(const QStandardItemModel* self, QModelIndex* parent) { return self->hasChildren(*parent); } QVariant* QStandardItemModel_Data2(const QStandardItemModel* self, QModelIndex* index, int role) { return new QVariant(self->data(*index, static_cast(role))); } bool QStandardItemModel_SetData3(QStandardItemModel* self, QModelIndex* index, QVariant* value, int role) { return self->setData(*index, *value, static_cast(role)); } QVariant* QStandardItemModel_HeaderData3(const QStandardItemModel* self, int section, int orientation, int role) { return new QVariant(self->headerData(static_cast(section), static_cast(orientation), static_cast(role))); } bool QStandardItemModel_SetHeaderData4(QStandardItemModel* self, int section, int orientation, QVariant* value, int role) { return self->setHeaderData(static_cast(section), static_cast(orientation), *value, static_cast(role)); } bool QStandardItemModel_InsertRows3(QStandardItemModel* self, int row, int count, QModelIndex* parent) { return self->insertRows(static_cast(row), static_cast(count), *parent); } bool QStandardItemModel_InsertColumns3(QStandardItemModel* self, int column, int count, QModelIndex* parent) { return self->insertColumns(static_cast(column), static_cast(count), *parent); } bool QStandardItemModel_RemoveRows3(QStandardItemModel* self, int row, int count, QModelIndex* parent) { return self->removeRows(static_cast(row), static_cast(count), *parent); } bool QStandardItemModel_RemoveColumns3(QStandardItemModel* self, int column, int count, QModelIndex* parent) { return self->removeColumns(static_cast(column), static_cast(count), *parent); } void QStandardItemModel_Sort2(QStandardItemModel* self, int column, int order) { self->sort(static_cast(column), static_cast(order)); } QStandardItem* QStandardItemModel_Item2(const QStandardItemModel* self, int row, int column) { return self->item(static_cast(row), static_cast(column)); } bool QStandardItemModel_InsertRow22(QStandardItemModel* self, int row, QModelIndex* parent) { return self->insertRow(static_cast(row), *parent); } bool QStandardItemModel_InsertColumn2(QStandardItemModel* self, int column, QModelIndex* parent) { return self->insertColumn(static_cast(column), *parent); } QStandardItem* QStandardItemModel_TakeItem2(QStandardItemModel* self, int row, int column) { return self->takeItem(static_cast(row), static_cast(column)); } struct miqt_array /* of QStandardItem* */ QStandardItemModel_FindItems2(const QStandardItemModel* self, struct miqt_string text, int flags) { QString text_QString = QString::fromUtf8(text.data, text.len); QList _ret = self->findItems(text_QString, static_cast(flags)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of QStandardItem* */ QStandardItemModel_FindItems3(const QStandardItemModel* self, struct miqt_string text, int flags, int column) { QString text_QString = QString::fromUtf8(text.data, text.len); QList _ret = self->findItems(text_QString, static_cast(flags), static_cast(column)); // Convert QList<> from C++ memory to manually-managed C memory QStandardItem** _arr = static_cast(malloc(sizeof(QStandardItem*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } void QStandardItemModel_Delete(QStandardItemModel* self) { delete self; }