mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
162 lines
6.4 KiB
C++
162 lines
6.4 KiB
C++
#include <QAbstractItemDelegate>
|
|
#include <QAbstractItemModel>
|
|
#include <QAbstractItemView>
|
|
#include <QEvent>
|
|
#include <QHelpEvent>
|
|
#include <QList>
|
|
#include <QMetaObject>
|
|
#include <QModelIndex>
|
|
#include <QPainter>
|
|
#include <QSize>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QStyleOptionViewItem>
|
|
#include <QWidget>
|
|
#include <qabstractitemdelegate.h>
|
|
#include "gen_qabstractitemdelegate.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QMetaObject* QAbstractItemDelegate_MetaObject(const QAbstractItemDelegate* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QAbstractItemDelegate_Metacast(QAbstractItemDelegate* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QAbstractItemDelegate_Tr(const char* s) {
|
|
QString _ret = QAbstractItemDelegate::tr(s);
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
QByteArray _b = _ret.toUtf8();
|
|
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;
|
|
}
|
|
|
|
void QAbstractItemDelegate_Paint(const QAbstractItemDelegate* self, QPainter* painter, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
self->paint(painter, *option, *index);
|
|
}
|
|
|
|
QSize* QAbstractItemDelegate_SizeHint(const QAbstractItemDelegate* self, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
return new QSize(self->sizeHint(*option, *index));
|
|
}
|
|
|
|
QWidget* QAbstractItemDelegate_CreateEditor(const QAbstractItemDelegate* self, QWidget* parent, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
return self->createEditor(parent, *option, *index);
|
|
}
|
|
|
|
void QAbstractItemDelegate_DestroyEditor(const QAbstractItemDelegate* self, QWidget* editor, QModelIndex* index) {
|
|
self->destroyEditor(editor, *index);
|
|
}
|
|
|
|
void QAbstractItemDelegate_SetEditorData(const QAbstractItemDelegate* self, QWidget* editor, QModelIndex* index) {
|
|
self->setEditorData(editor, *index);
|
|
}
|
|
|
|
void QAbstractItemDelegate_SetModelData(const QAbstractItemDelegate* self, QWidget* editor, QAbstractItemModel* model, QModelIndex* index) {
|
|
self->setModelData(editor, model, *index);
|
|
}
|
|
|
|
void QAbstractItemDelegate_UpdateEditorGeometry(const QAbstractItemDelegate* self, QWidget* editor, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
self->updateEditorGeometry(editor, *option, *index);
|
|
}
|
|
|
|
bool QAbstractItemDelegate_EditorEvent(QAbstractItemDelegate* self, QEvent* event, QAbstractItemModel* model, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
return self->editorEvent(event, model, *option, *index);
|
|
}
|
|
|
|
bool QAbstractItemDelegate_HelpEvent(QAbstractItemDelegate* self, QHelpEvent* event, QAbstractItemView* view, QStyleOptionViewItem* option, QModelIndex* index) {
|
|
return self->helpEvent(event, view, *option, *index);
|
|
}
|
|
|
|
struct miqt_array /* of int */ QAbstractItemDelegate_PaintingRoles(const QAbstractItemDelegate* self) {
|
|
QList<int> _ret = self->paintingRoles();
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
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];
|
|
}
|
|
struct miqt_array _out;
|
|
_out.len = _ret.length();
|
|
_out.data = static_cast<void*>(_arr);
|
|
return _out;
|
|
}
|
|
|
|
void QAbstractItemDelegate_CommitData(QAbstractItemDelegate* self, QWidget* editor) {
|
|
self->commitData(editor);
|
|
}
|
|
|
|
void QAbstractItemDelegate_connect_CommitData(QAbstractItemDelegate* self, intptr_t slot) {
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*)>(&QAbstractItemDelegate::commitData), self, [=](QWidget* editor) {
|
|
QWidget* sigval1 = editor;
|
|
miqt_exec_callback_QAbstractItemDelegate_CommitData(slot, sigval1);
|
|
});
|
|
}
|
|
|
|
void QAbstractItemDelegate_CloseEditor(QAbstractItemDelegate* self, QWidget* editor) {
|
|
self->closeEditor(editor);
|
|
}
|
|
|
|
void QAbstractItemDelegate_connect_CloseEditor(QAbstractItemDelegate* self, intptr_t slot) {
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*, QAbstractItemDelegate::EndEditHint)>(&QAbstractItemDelegate::closeEditor), self, [=](QWidget* editor) {
|
|
QWidget* sigval1 = editor;
|
|
miqt_exec_callback_QAbstractItemDelegate_CloseEditor(slot, sigval1);
|
|
});
|
|
}
|
|
|
|
void QAbstractItemDelegate_SizeHintChanged(QAbstractItemDelegate* self, QModelIndex* param1) {
|
|
self->sizeHintChanged(*param1);
|
|
}
|
|
|
|
void QAbstractItemDelegate_connect_SizeHintChanged(QAbstractItemDelegate* self, intptr_t slot) {
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(const QModelIndex&)>(&QAbstractItemDelegate::sizeHintChanged), self, [=](const QModelIndex& param1) {
|
|
const QModelIndex& param1_ret = param1;
|
|
// Cast returned reference into pointer
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(¶m1_ret);
|
|
miqt_exec_callback_QAbstractItemDelegate_SizeHintChanged(slot, sigval1);
|
|
});
|
|
}
|
|
|
|
struct miqt_string QAbstractItemDelegate_Tr2(const char* s, const char* c) {
|
|
QString _ret = QAbstractItemDelegate::tr(s, c);
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
QByteArray _b = _ret.toUtf8();
|
|
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;
|
|
}
|
|
|
|
struct miqt_string QAbstractItemDelegate_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QAbstractItemDelegate::tr(s, c, static_cast<int>(n));
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
QByteArray _b = _ret.toUtf8();
|
|
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;
|
|
}
|
|
|
|
void QAbstractItemDelegate_CloseEditor2(QAbstractItemDelegate* self, QWidget* editor, int hint) {
|
|
self->closeEditor(editor, static_cast<QAbstractItemDelegate::EndEditHint>(hint));
|
|
}
|
|
|
|
void QAbstractItemDelegate_connect_CloseEditor2(QAbstractItemDelegate* self, intptr_t slot) {
|
|
QAbstractItemDelegate::connect(self, static_cast<void (QAbstractItemDelegate::*)(QWidget*, QAbstractItemDelegate::EndEditHint)>(&QAbstractItemDelegate::closeEditor), self, [=](QWidget* editor, QAbstractItemDelegate::EndEditHint hint) {
|
|
QWidget* sigval1 = editor;
|
|
QAbstractItemDelegate::EndEditHint hint_ret = hint;
|
|
int sigval2 = static_cast<int>(hint_ret);
|
|
miqt_exec_callback_QAbstractItemDelegate_CloseEditor2(slot, sigval1, sigval2);
|
|
});
|
|
}
|
|
|
|
void QAbstractItemDelegate_Delete(QAbstractItemDelegate* self) {
|
|
delete self;
|
|
}
|
|
|