#include #include #include #include #include #include #include #include #include #include "qdialogbuttonbox.h" #include "gen_qdialogbuttonbox.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QDialogButtonBox* QDialogButtonBox_new() { return new QDialogButtonBox(); } QDialogButtonBox* QDialogButtonBox_new2(uintptr_t orientation) { return new QDialogButtonBox(static_cast(orientation)); } QDialogButtonBox* QDialogButtonBox_new3(int buttons) { return new QDialogButtonBox(static_cast(buttons)); } QDialogButtonBox* QDialogButtonBox_new4(int buttons, uintptr_t orientation) { return new QDialogButtonBox(static_cast(buttons), static_cast(orientation)); } QDialogButtonBox* QDialogButtonBox_new5(QWidget* parent) { return new QDialogButtonBox(parent); } QDialogButtonBox* QDialogButtonBox_new6(uintptr_t orientation, QWidget* parent) { return new QDialogButtonBox(static_cast(orientation), parent); } QDialogButtonBox* QDialogButtonBox_new7(int buttons, QWidget* parent) { return new QDialogButtonBox(static_cast(buttons), parent); } QDialogButtonBox* QDialogButtonBox_new8(int buttons, uintptr_t orientation, QWidget* parent) { return new QDialogButtonBox(static_cast(buttons), static_cast(orientation), parent); } QMetaObject* QDialogButtonBox_MetaObject(QDialogButtonBox* self) { return (QMetaObject*) const_cast(self)->metaObject(); } void QDialogButtonBox_Tr(const char* s, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_TrUtf8(const char* s, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_SetOrientation(QDialogButtonBox* self, uintptr_t orientation) { self->setOrientation(static_cast(orientation)); } uintptr_t QDialogButtonBox_Orientation(QDialogButtonBox* self) { Qt::Orientation ret = const_cast(self)->orientation(); return static_cast(ret); } void QDialogButtonBox_AddButton(QDialogButtonBox* self, QAbstractButton* button, uintptr_t role) { self->addButton(button, static_cast(role)); } QPushButton* QDialogButtonBox_AddButton2(QDialogButtonBox* self, const char* text, size_t text_Strlen, uintptr_t role) { QString text_QString = QString::fromUtf8(text, text_Strlen); return self->addButton(text_QString, static_cast(role)); } QPushButton* QDialogButtonBox_AddButtonWithButton(QDialogButtonBox* self, uintptr_t button) { return self->addButton(static_cast(button)); } void QDialogButtonBox_RemoveButton(QDialogButtonBox* self, QAbstractButton* button) { self->removeButton(button); } void QDialogButtonBox_Clear(QDialogButtonBox* self) { self->clear(); } void QDialogButtonBox_Buttons(QDialogButtonBox* self, QAbstractButton*** _out, size_t* _out_len) { QList ret = const_cast(self)->buttons(); // Convert QList<> from C++ memory to manually-managed C memory QAbstractButton** __out = static_cast(malloc(sizeof(QAbstractButton*) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = ret[i]; } *_out = __out; *_out_len = ret.length(); } uintptr_t QDialogButtonBox_ButtonRole(QDialogButtonBox* self, QAbstractButton* button) { QDialogButtonBox::ButtonRole ret = const_cast(self)->buttonRole(button); return static_cast(ret); } void QDialogButtonBox_SetStandardButtons(QDialogButtonBox* self, int buttons) { self->setStandardButtons(static_cast(buttons)); } int QDialogButtonBox_StandardButtons(QDialogButtonBox* self) { QDialogButtonBox::StandardButtons ret = const_cast(self)->standardButtons(); return static_cast(ret); } uintptr_t QDialogButtonBox_StandardButton(QDialogButtonBox* self, QAbstractButton* button) { QDialogButtonBox::StandardButton ret = const_cast(self)->standardButton(button); return static_cast(ret); } QPushButton* QDialogButtonBox_Button(QDialogButtonBox* self, uintptr_t which) { return const_cast(self)->button(static_cast(which)); } void QDialogButtonBox_SetCenterButtons(QDialogButtonBox* self, bool center) { self->setCenterButtons(center); } bool QDialogButtonBox_CenterButtons(QDialogButtonBox* self) { return const_cast(self)->centerButtons(); } void QDialogButtonBox_Clicked(QDialogButtonBox* self, QAbstractButton* button) { self->clicked(button); } void QDialogButtonBox_connect_Clicked(QDialogButtonBox* self, void* slot) { QDialogButtonBox::connect(self, static_cast(&QDialogButtonBox::clicked), self, [=](QAbstractButton* button) { miqt_exec_callback(slot, 0, nullptr); }); } void QDialogButtonBox_Accepted(QDialogButtonBox* self) { self->accepted(); } void QDialogButtonBox_connect_Accepted(QDialogButtonBox* self, void* slot) { QDialogButtonBox::connect(self, static_cast(&QDialogButtonBox::accepted), self, [=]() { miqt_exec_callback(slot, 0, nullptr); }); } void QDialogButtonBox_HelpRequested(QDialogButtonBox* self) { self->helpRequested(); } void QDialogButtonBox_connect_HelpRequested(QDialogButtonBox* self, void* slot) { QDialogButtonBox::connect(self, static_cast(&QDialogButtonBox::helpRequested), self, [=]() { miqt_exec_callback(slot, 0, nullptr); }); } void QDialogButtonBox_Rejected(QDialogButtonBox* self) { self->rejected(); } void QDialogButtonBox_connect_Rejected(QDialogButtonBox* self, void* slot) { QDialogButtonBox::connect(self, static_cast(&QDialogButtonBox::rejected), self, [=]() { miqt_exec_callback(slot, 0, nullptr); }); } void QDialogButtonBox_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::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(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QDialogButtonBox::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(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QDialogButtonBox_Delete(QDialogButtonBox* self) { delete self; }