2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <QColumnView>
|
|
|
|
#include <QItemSelectionModel>
|
|
|
|
#include <QList>
|
|
|
|
#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-08-29 07:01:51 +00:00
|
|
|
#include "qcolumnview.h"
|
|
|
|
#include "gen_qcolumnview.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QColumnView* QColumnView_new() {
|
|
|
|
return new QColumnView();
|
|
|
|
}
|
|
|
|
|
|
|
|
QColumnView* QColumnView_new2(QWidget* parent) {
|
|
|
|
return new QColumnView(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QColumnView_MetaObject(const QColumnView* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColumnView_Tr(const char* s) {
|
|
|
|
QString _ret = QColumnView::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* QColumnView_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QColumnView::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
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_UpdatePreviewWidget(QColumnView* self, QModelIndex* index) {
|
|
|
|
self->updatePreviewWidget(*index);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_connect_UpdatePreviewWidget(QColumnView* self, void* slot) {
|
|
|
|
QColumnView::connect(self, static_cast<void (QColumnView::*)(const QModelIndex&)>(&QColumnView::updatePreviewWidget), self, [=](const QModelIndex& index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& index_ret = index;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(&index_ret);
|
|
|
|
miqt_exec_callback_QColumnView_UpdatePreviewWidget(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QColumnView_IndexAt(const QColumnView* self, QPoint* point) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QModelIndex _ret = self->indexAt(*point);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QModelIndex*>(new QModelIndex(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QColumnView_ScrollTo(QColumnView* self, QModelIndex* index) {
|
|
|
|
self->scrollTo(*index);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QColumnView_SizeHint(const QColumnView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSize _ret = self->sizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QSize*>(new QSize(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QColumnView_VisualRect(const QColumnView* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QRect _ret = self->visualRect(*index);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QRect*>(new QRect(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SetModel(QColumnView* self, QAbstractItemModel* model) {
|
|
|
|
self->setModel(model);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SetSelectionModel(QColumnView* self, QItemSelectionModel* selectionModel) {
|
|
|
|
self->setSelectionModel(selectionModel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SetRootIndex(QColumnView* self, QModelIndex* index) {
|
|
|
|
self->setRootIndex(*index);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SelectAll(QColumnView* self) {
|
|
|
|
self->selectAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SetResizeGripsVisible(QColumnView* self, bool visible) {
|
|
|
|
self->setResizeGripsVisible(visible);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QColumnView_ResizeGripsVisible(const QColumnView* self) {
|
|
|
|
return self->resizeGripsVisible();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QWidget* QColumnView_PreviewWidget(const QColumnView* self) {
|
|
|
|
return self->previewWidget();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColumnView_SetPreviewWidget(QColumnView* self, QWidget* widget) {
|
|
|
|
self->setPreviewWidget(widget);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QColumnView_SetColumnWidths(QColumnView* self, struct miqt_array* /* of int */ list) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<int> list_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
list_QList.reserve(list->len);
|
|
|
|
int* list_arr = static_cast<int*>(list->data);
|
|
|
|
for(size_t i = 0; i < list->len; ++i) {
|
|
|
|
list_QList.push_back(list_arr[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->setColumnWidths(list_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QColumnView_ColumnWidths(const QColumnView* self) {
|
|
|
|
QList<int> _ret = self->columnWidths();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
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-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColumnView_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QColumnView::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* QColumnView_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QColumnView::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* QColumnView_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QColumnView::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* QColumnView_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QColumnView::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-08-29 07:01:51 +00:00
|
|
|
void QColumnView_ScrollTo2(QColumnView* self, QModelIndex* index, uintptr_t hint) {
|
|
|
|
self->scrollTo(*index, static_cast<QAbstractItemView::ScrollHint>(hint));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QColumnView_Delete(QColumnView* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|