2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemModel>
|
2024-11-04 07:59:22 +00:00
|
|
|
#include <QMap>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QObject>
|
|
|
|
#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 <QTransposeProxyModel>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QVariant>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qtransposeproxymodel.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qtransposeproxymodel.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QTransposeProxyModel* QTransposeProxyModel_new() {
|
|
|
|
return new QTransposeProxyModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
QTransposeProxyModel* QTransposeProxyModel_new2(QObject* parent) {
|
|
|
|
return new QTransposeProxyModel(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QTransposeProxyModel_MetaObject(const QTransposeProxyModel* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QTransposeProxyModel_Metacast(QTransposeProxyModel* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTransposeProxyModel_SetSourceModel(QTransposeProxyModel* self, QAbstractItemModel* newSourceModel) {
|
|
|
|
self->setSourceModel(newSourceModel);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTransposeProxyModel_RowCount(const QTransposeProxyModel* self) {
|
|
|
|
return self->rowCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTransposeProxyModel_ColumnCount(const QTransposeProxyModel* self) {
|
|
|
|
return self->columnCount();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QVariant* QTransposeProxyModel_HeaderData(const QTransposeProxyModel* self, int section, int 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
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QTransposeProxyModel_SetHeaderData(QTransposeProxyModel* self, int section, int orientation, QVariant* value) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return self->setHeaderData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), *value);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-04 07:59:22 +00:00
|
|
|
bool QTransposeProxyModel_SetItemData(QTransposeProxyModel* self, QModelIndex* index, struct miqt_map roles) {
|
|
|
|
QMap<int, QVariant> roles_QMap;
|
|
|
|
int* roles_karr = static_cast<int*>(roles.keys);
|
|
|
|
QVariant** roles_varr = static_cast<QVariant**>(roles.values);
|
|
|
|
for(size_t i = 0; i < roles.len; ++i) {
|
|
|
|
roles_QMap[static_cast<int>(roles_karr[i])] = *(roles_varr[i]);
|
|
|
|
}
|
|
|
|
return self->setItemData(*index, roles_QMap);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QTransposeProxyModel_Span(const QTransposeProxyModel* 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-11-04 07:59:22 +00:00
|
|
|
struct miqt_map QTransposeProxyModel_ItemData(const QTransposeProxyModel* self, QModelIndex* index) {
|
|
|
|
QMap<int, QVariant> _ret = self->itemData(*index);
|
|
|
|
// Convert QMap<> from C++ memory to manually-managed C memory
|
|
|
|
int* _karr = static_cast<int*>(malloc(sizeof(int) * _ret.size()));
|
|
|
|
QVariant** _varr = static_cast<QVariant**>(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<void*>(_karr);
|
|
|
|
_out.values = static_cast<void*>(_varr);
|
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTransposeProxyModel_MapFromSource(const QTransposeProxyModel* self, QModelIndex* sourceIndex) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->mapFromSource(*sourceIndex));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTransposeProxyModel_MapToSource(const QTransposeProxyModel* self, QModelIndex* proxyIndex) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->mapToSource(*proxyIndex));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTransposeProxyModel_Parent(const QTransposeProxyModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->parent(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTransposeProxyModel_Index(const QTransposeProxyModel* 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
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_InsertRows(QTransposeProxyModel* self, int row, int count) {
|
|
|
|
return self->insertRows(static_cast<int>(row), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_RemoveRows(QTransposeProxyModel* self, int row, int count) {
|
|
|
|
return self->removeRows(static_cast<int>(row), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_MoveRows(QTransposeProxyModel* 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 QTransposeProxyModel_InsertColumns(QTransposeProxyModel* self, int column, int count) {
|
|
|
|
return self->insertColumns(static_cast<int>(column), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_RemoveColumns(QTransposeProxyModel* self, int column, int count) {
|
|
|
|
return self->removeColumns(static_cast<int>(column), static_cast<int>(count));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_MoveColumns(QTransposeProxyModel* 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));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QTransposeProxyModel_Sort(QTransposeProxyModel* self, int column) {
|
|
|
|
self->sort(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTransposeProxyModel_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QTransposeProxyModel::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTransposeProxyModel_RowCount1(const QTransposeProxyModel* self, QModelIndex* parent) {
|
|
|
|
return self->rowCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTransposeProxyModel_ColumnCount1(const QTransposeProxyModel* self, QModelIndex* parent) {
|
|
|
|
return self->columnCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QVariant* QTransposeProxyModel_HeaderData3(const QTransposeProxyModel* self, int section, int 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
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QTransposeProxyModel_SetHeaderData4(QTransposeProxyModel* self, int section, int orientation, QVariant* value, int role) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return self->setHeaderData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), *value, static_cast<int>(role));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTransposeProxyModel_Index3(const QTransposeProxyModel* 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
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_InsertRows3(QTransposeProxyModel* self, int row, int count, QModelIndex* parent) {
|
|
|
|
return self->insertRows(static_cast<int>(row), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_RemoveRows3(QTransposeProxyModel* self, int row, int count, QModelIndex* parent) {
|
|
|
|
return self->removeRows(static_cast<int>(row), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_InsertColumns3(QTransposeProxyModel* self, int column, int count, QModelIndex* parent) {
|
|
|
|
return self->insertColumns(static_cast<int>(column), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTransposeProxyModel_RemoveColumns3(QTransposeProxyModel* self, int column, int count, QModelIndex* parent) {
|
|
|
|
return self->removeColumns(static_cast<int>(column), static_cast<int>(count), *parent);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QTransposeProxyModel_Sort2(QTransposeProxyModel* self, int column, int order) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->sort(static_cast<int>(column), static_cast<Qt::SortOrder>(order));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QTransposeProxyModel_Delete(QTransposeProxyModel* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|