2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemDelegate>
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <QAbstractItemView>
|
|
|
|
#include <QEvent>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QFontMetrics>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QHelpEvent>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QPainter>
|
|
|
|
#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 <QStyleOptionViewItem>
|
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qabstractitemdelegate.h"
|
|
|
|
#include "gen_qabstractitemdelegate.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QAbstractItemDelegate_MetaObject(const QAbstractItemDelegate* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemDelegate_Tr(const char* s) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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* QAbstractItemDelegate_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QAbstractItemDelegate_Paint(const QAbstractItemDelegate* self, QPainter* painter, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
|
|
self->paint(painter, *option, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QAbstractItemDelegate_SizeHint(const QAbstractItemDelegate* self, QStyleOptionViewItem* option, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSize _ret = self->sizeHint(*option, *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<QSize*>(new QSize(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QWidget* QAbstractItemDelegate_CreateEditor(const QAbstractItemDelegate* self, QWidget* parent, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
|
|
return self->createEditor(parent, *option, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QAbstractItemDelegate_DestroyEditor(const QAbstractItemDelegate* self, QWidget* editor, QModelIndex* index) {
|
|
|
|
self->destroyEditor(editor, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QAbstractItemDelegate_SetEditorData(const QAbstractItemDelegate* self, QWidget* editor, QModelIndex* index) {
|
|
|
|
self->setEditorData(editor, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QAbstractItemDelegate_SetModelData(const QAbstractItemDelegate* self, QWidget* editor, QAbstractItemModel* model, QModelIndex* index) {
|
|
|
|
self->setModelData(editor, model, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QAbstractItemDelegate_UpdateEditorGeometry(const QAbstractItemDelegate* self, QWidget* editor, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
|
|
self->updateEditorGeometry(editor, *option, *index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAbstractItemDelegate_EditorEvent(QAbstractItemDelegate* self, QEvent* event, QAbstractItemModel* model, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
|
|
return self->editorEvent(event, model, *option, *index);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemDelegate_ElidedText(QFontMetrics* fontMetrics, int width, uintptr_t mode, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
|
|
|
QString _ret = QAbstractItemDelegate::elidedText(*fontMetrics, static_cast<int>(width), static_cast<Qt::TextElideMode>(mode), text_QString);
|
2024-08-29 07:01:51 +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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QAbstractItemDelegate_HelpEvent(QAbstractItemDelegate* self, QHelpEvent* event, QAbstractItemView* view, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
|
|
return self->helpEvent(event, view, *option, *index);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QAbstractItemDelegate_PaintingRoles(const QAbstractItemDelegate* self) {
|
|
|
|
QVector<int> _ret = self->paintingRoles();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemDelegate_CommitData(QAbstractItemDelegate* self, QWidget* editor) {
|
|
|
|
self->commitData(editor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemDelegate_connect_CommitData(QAbstractItemDelegate* self, void* slot) {
|
|
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*)>(&QAbstractItemDelegate::commitData), self, [=](QWidget* editor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QWidget* sigval1 = editor;
|
|
|
|
miqt_exec_callback_QAbstractItemDelegate_CommitData(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QAbstractItemDelegate_CloseEditor(QAbstractItemDelegate* self, QWidget* editor) {
|
|
|
|
self->closeEditor(editor);
|
|
|
|
}
|
|
|
|
|
2024-09-07 03:31:00 +00:00
|
|
|
void QAbstractItemDelegate_connect_CloseEditor(QAbstractItemDelegate* self, void* slot) {
|
|
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*, QAbstractItemDelegate::EndEditHint)>(&QAbstractItemDelegate::closeEditor), self, [=](QWidget* editor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QWidget* sigval1 = editor;
|
|
|
|
miqt_exec_callback_QAbstractItemDelegate_CloseEditor(slot, sigval1);
|
2024-09-07 03:31:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QAbstractItemDelegate_SizeHintChanged(QAbstractItemDelegate* self, QModelIndex* param1) {
|
|
|
|
self->sizeHintChanged(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemDelegate_connect_SizeHintChanged(QAbstractItemDelegate* self, void* slot) {
|
|
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(const QModelIndex&)>(&QAbstractItemDelegate::sizeHintChanged), self, [=](const QModelIndex& param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& param1_ret = param1;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(¶m1_ret);
|
|
|
|
miqt_exec_callback_QAbstractItemDelegate_SizeHintChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QAbstractItemDelegate_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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* QAbstractItemDelegate_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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* QAbstractItemDelegate_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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* QAbstractItemDelegate_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QAbstractItemDelegate::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 QAbstractItemDelegate_CloseEditor2(QAbstractItemDelegate* self, QWidget* editor, uintptr_t hint) {
|
|
|
|
self->closeEditor(editor, static_cast<QAbstractItemDelegate::EndEditHint>(hint));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAbstractItemDelegate_connect_CloseEditor2(QAbstractItemDelegate* self, void* slot) {
|
|
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*, QAbstractItemDelegate::EndEditHint)>(&QAbstractItemDelegate::closeEditor), self, [=](QWidget* editor, QAbstractItemDelegate::EndEditHint hint) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QWidget* sigval1 = editor;
|
|
|
|
QAbstractItemDelegate::EndEditHint hint_ret = hint;
|
|
|
|
uintptr_t sigval2 = static_cast<uintptr_t>(hint_ret);
|
|
|
|
miqt_exec_callback_QAbstractItemDelegate_CloseEditor2(slot, sigval1, sigval2);
|
2024-08-29 07:01:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QAbstractItemDelegate_Delete(QAbstractItemDelegate* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|