2024-08-25 04:08:24 +00:00
|
|
|
#include <QList>
|
|
|
|
#include <QListView>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QRect>
|
|
|
|
#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 <QWidget>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qlistview.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qlistview.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-10-26 00:46:42 +00:00
|
|
|
QListView* QListView_new(QWidget* parent) {
|
|
|
|
return new QListView(parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-26 00:46:42 +00:00
|
|
|
QListView* QListView_new2() {
|
|
|
|
return new QListView();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QListView_MetaObject(const QListView* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QListView_Metacast(QListView* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QListView_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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 QListView_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QListView_SetMovement(QListView* self, int movement) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setMovement(static_cast<QListView::Movement>(movement));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QListView_Movement(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListView::Movement _ret = self->movement();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QListView_SetFlow(QListView* self, int flow) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setFlow(static_cast<QListView::Flow>(flow));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QListView_Flow(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListView::Flow _ret = self->flow();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QListView_SetWrapping(QListView* self, bool enable) {
|
|
|
|
self->setWrapping(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListView_IsWrapping(const QListView* self) {
|
|
|
|
return self->isWrapping();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QListView_SetResizeMode(QListView* self, int mode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setResizeMode(static_cast<QListView::ResizeMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QListView_ResizeMode(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListView::ResizeMode _ret = self->resizeMode();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QListView_SetLayoutMode(QListView* self, int mode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setLayoutMode(static_cast<QListView::LayoutMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QListView_LayoutMode(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListView::LayoutMode _ret = self->layoutMode();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetSpacing(QListView* self, int space) {
|
|
|
|
self->setSpacing(static_cast<int>(space));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListView_Spacing(const QListView* self) {
|
|
|
|
return self->spacing();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetBatchSize(QListView* self, int batchSize) {
|
|
|
|
self->setBatchSize(static_cast<int>(batchSize));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListView_BatchSize(const QListView* self) {
|
|
|
|
return self->batchSize();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetGridSize(QListView* self, QSize* size) {
|
|
|
|
self->setGridSize(*size);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QListView_GridSize(const QListView* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->gridSize());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QListView_SetViewMode(QListView* self, int mode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setViewMode(static_cast<QListView::ViewMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QListView_ViewMode(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListView::ViewMode _ret = self->viewMode();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QListView_ClearPropertyFlags(QListView* self) {
|
|
|
|
self->clearPropertyFlags();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListView_IsRowHidden(const QListView* self, int row) {
|
|
|
|
return self->isRowHidden(static_cast<int>(row));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetRowHidden(QListView* self, int row, bool hide) {
|
|
|
|
self->setRowHidden(static_cast<int>(row), hide);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetModelColumn(QListView* self, int column) {
|
|
|
|
self->setModelColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListView_ModelColumn(const QListView* self) {
|
|
|
|
return self->modelColumn();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetUniformItemSizes(QListView* self, bool enable) {
|
|
|
|
self->setUniformItemSizes(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListView_UniformItemSizes(const QListView* self) {
|
|
|
|
return self->uniformItemSizes();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetWordWrap(QListView* self, bool on) {
|
|
|
|
self->setWordWrap(on);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListView_WordWrap(const QListView* self) {
|
|
|
|
return self->wordWrap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetSelectionRectVisible(QListView* self, bool show) {
|
|
|
|
self->setSelectionRectVisible(show);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListView_IsSelectionRectVisible(const QListView* self) {
|
|
|
|
return self->isSelectionRectVisible();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetItemAlignment(QListView* self, int alignment) {
|
|
|
|
self->setItemAlignment(static_cast<Qt::Alignment>(alignment));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListView_ItemAlignment(const QListView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::Alignment _ret = self->itemAlignment();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QListView_VisualRect(const QListView* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->visualRect(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QListView_ScrollTo(QListView* self, QModelIndex* index) {
|
|
|
|
self->scrollTo(*index);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QListView_IndexAt(const QListView* self, QPoint* p) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->indexAt(*p));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_DoItemsLayout(QListView* self) {
|
|
|
|
self->doItemsLayout();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_Reset(QListView* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QListView_SetRootIndex(QListView* self, QModelIndex* index) {
|
|
|
|
self->setRootIndex(*index);
|
|
|
|
}
|
|
|
|
|
2024-11-04 07:18:27 +00:00
|
|
|
void QListView_IndexesMoved(QListView* self, struct miqt_array /* of QModelIndex* */ indexes) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QModelIndexList indexes_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
indexes_QList.reserve(indexes.len);
|
|
|
|
QModelIndex** indexes_arr = static_cast<QModelIndex**>(indexes.data);
|
|
|
|
for(size_t i = 0; i < indexes.len; ++i) {
|
2024-09-14 22:29:05 +00:00
|
|
|
indexes_QList.push_back(*(indexes_arr[i]));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->indexesMoved(indexes_QList);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QListView_connect_IndexesMoved(QListView* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QListView::connect(self, static_cast<void (QListView::*)(const QModelIndexList&)>(&QListView::indexesMoved), self, [=](const QModelIndexList& indexes) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndexList& indexes_ret = indexes;
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QModelIndex** indexes_arr = static_cast<QModelIndex**>(malloc(sizeof(QModelIndex*) * indexes_ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = indexes_ret.length(); i < e; ++i) {
|
|
|
|
indexes_arr[i] = new QModelIndex(indexes_ret[i]);
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array indexes_out;
|
|
|
|
indexes_out.len = indexes_ret.length();
|
|
|
|
indexes_out.data = static_cast<void*>(indexes_arr);
|
|
|
|
struct miqt_array sigval1 = indexes_out;
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QListView_IndexesMoved(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QListView_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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 QListView_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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 QListView_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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 QListView_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QListView::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-18 00:12:02 +00:00
|
|
|
void QListView_ScrollTo2(QListView* self, QModelIndex* index, int hint) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->scrollTo(*index, static_cast<QAbstractItemView::ScrollHint>(hint));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QListView_Delete(QListView* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|