#include #include #include #include #include #include #include #include #include #include "qstringlistmodel.h" #include "gen_qstringlistmodel.h" #include "_cgo_export.h" QStringListModel* QStringListModel_new() { return new QStringListModel(); } QStringListModel* QStringListModel_new2(struct miqt_array* /* of struct miqt_string* */ strings) { QList strings_QList; strings_QList.reserve(strings->len); miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { strings_QList.push_back(QString::fromUtf8(& strings_arr[i]->data, strings_arr[i]->len)); } return new QStringListModel(strings_QList); } QStringListModel* QStringListModel_new3(QObject* parent) { return new QStringListModel(parent); } QStringListModel* QStringListModel_new4(struct miqt_array* /* of struct miqt_string* */ strings, QObject* parent) { QList strings_QList; strings_QList.reserve(strings->len); miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { strings_QList.push_back(QString::fromUtf8(& strings_arr[i]->data, strings_arr[i]->len)); } return new QStringListModel(strings_QList, parent); } QMetaObject* QStringListModel_MetaObject(const QStringListModel* self) { return (QMetaObject*) self->metaObject(); } struct miqt_string* QStringListModel_Tr(const char* s) { QString _ret = QStringListModel::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QStringListModel_TrUtf8(const char* s) { QString _ret = QStringListModel::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } int QStringListModel_RowCount(const QStringListModel* self) { return self->rowCount(); } QModelIndex* QStringListModel_Sibling(const QStringListModel* self, int row, int column, QModelIndex* idx) { QModelIndex _ret = self->sibling(static_cast(row), static_cast(column), *idx); // Copy-construct value returned type into heap-allocated copy return static_cast(new QModelIndex(_ret)); } QVariant* QStringListModel_Data(const QStringListModel* self, QModelIndex* index) { QVariant _ret = self->data(*index); // Copy-construct value returned type into heap-allocated copy return static_cast(new QVariant(_ret)); } bool QStringListModel_SetData(QStringListModel* self, QModelIndex* index, QVariant* value) { return self->setData(*index, *value); } int QStringListModel_Flags(const QStringListModel* self, QModelIndex* index) { Qt::ItemFlags _ret = self->flags(*index); return static_cast(_ret); } bool QStringListModel_InsertRows(QStringListModel* self, int row, int count) { return self->insertRows(static_cast(row), static_cast(count)); } bool QStringListModel_RemoveRows(QStringListModel* self, int row, int count) { return self->removeRows(static_cast(row), static_cast(count)); } bool QStringListModel_MoveRows(QStringListModel* self, QModelIndex* sourceParent, int sourceRow, int count, QModelIndex* destinationParent, int destinationChild) { return self->moveRows(*sourceParent, static_cast(sourceRow), static_cast(count), *destinationParent, static_cast(destinationChild)); } void QStringListModel_Sort(QStringListModel* self, int column) { self->sort(static_cast(column)); } struct miqt_array* QStringListModel_StringList(const QStringListModel* self) { QStringList _ret = self->stringList(); // Convert QStringList 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(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } void QStringListModel_SetStringList(QStringListModel* self, struct miqt_array* /* of struct miqt_string* */ strings) { QList strings_QList; strings_QList.reserve(strings->len); miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { strings_QList.push_back(QString::fromUtf8(& strings_arr[i]->data, strings_arr[i]->len)); } self->setStringList(strings_QList); } int QStringListModel_SupportedDropActions(const QStringListModel* self) { Qt::DropActions _ret = self->supportedDropActions(); return static_cast(_ret); } struct miqt_string* QStringListModel_Tr2(const char* s, const char* c) { QString _ret = QStringListModel::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QStringListModel_Tr3(const char* s, const char* c, int n) { QString _ret = QStringListModel::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(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QStringListModel_TrUtf82(const char* s, const char* c) { QString _ret = QStringListModel::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QStringListModel_TrUtf83(const char* s, const char* c, int n) { QString _ret = QStringListModel::trUtf8(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(); return miqt_strdup(_b.data(), _b.length()); } int QStringListModel_RowCount1(const QStringListModel* self, QModelIndex* parent) { return self->rowCount(*parent); } QVariant* QStringListModel_Data2(const QStringListModel* self, QModelIndex* index, int role) { QVariant _ret = self->data(*index, static_cast(role)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QVariant(_ret)); } bool QStringListModel_SetData3(QStringListModel* self, QModelIndex* index, QVariant* value, int role) { return self->setData(*index, *value, static_cast(role)); } bool QStringListModel_InsertRows3(QStringListModel* self, int row, int count, QModelIndex* parent) { return self->insertRows(static_cast(row), static_cast(count), *parent); } bool QStringListModel_RemoveRows3(QStringListModel* self, int row, int count, QModelIndex* parent) { return self->removeRows(static_cast(row), static_cast(count), *parent); } void QStringListModel_Sort2(QStringListModel* self, int column, uintptr_t order) { self->sort(static_cast(column), static_cast(order)); } void QStringListModel_Delete(QStringListModel* self) { delete self; }