2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractButton>
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QPushButton>
|
2024-08-25 04:08:24 +00:00
|
|
|
#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 "qdialogbuttonbox.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qdialogbuttonbox.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new() {
|
|
|
|
return new QDialogButtonBox();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QDialogButtonBox* QDialogButtonBox_new2(uintptr_t orientation) {
|
|
|
|
return new QDialogButtonBox(static_cast<Qt::Orientation>(orientation));
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new3(int buttons) {
|
|
|
|
return new QDialogButtonBox(static_cast<QDialogButtonBox::StandardButtons>(buttons));
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new4(int buttons, uintptr_t orientation) {
|
|
|
|
return new QDialogButtonBox(static_cast<QDialogButtonBox::StandardButtons>(buttons), static_cast<Qt::Orientation>(orientation));
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new5(QWidget* parent) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QDialogButtonBox(parent);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QDialogButtonBox* QDialogButtonBox_new6(uintptr_t orientation, QWidget* parent) {
|
|
|
|
return new QDialogButtonBox(static_cast<Qt::Orientation>(orientation), parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new7(int buttons, QWidget* parent) {
|
|
|
|
return new QDialogButtonBox(static_cast<QDialogButtonBox::StandardButtons>(buttons), parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new8(int buttons, uintptr_t orientation, QWidget* parent) {
|
|
|
|
return new QDialogButtonBox(static_cast<QDialogButtonBox::StandardButtons>(buttons), static_cast<Qt::Orientation>(orientation), parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QDialogButtonBox_MetaObject(const QDialogButtonBox* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_Tr(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
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<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_TrUtf8(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
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<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_SetOrientation(QDialogButtonBox* self, uintptr_t orientation) {
|
|
|
|
self->setOrientation(static_cast<Qt::Orientation>(orientation));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QDialogButtonBox_Orientation(const QDialogButtonBox* self) {
|
|
|
|
Qt::Orientation ret = self->orientation();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_AddButton(QDialogButtonBox* self, QAbstractButton* button, uintptr_t role) {
|
|
|
|
self->addButton(button, static_cast<QDialogButtonBox::ButtonRole>(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<QDialogButtonBox::ButtonRole>(role));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QDialogButtonBox_AddButtonWithButton(QDialogButtonBox* self, uintptr_t button) {
|
|
|
|
return self->addButton(static_cast<QDialogButtonBox::StandardButton>(button));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDialogButtonBox_RemoveButton(QDialogButtonBox* self, QAbstractButton* button) {
|
|
|
|
self->removeButton(button);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_Clear(QDialogButtonBox* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QDialogButtonBox_Buttons(const QDialogButtonBox* self, QAbstractButton*** _out, size_t* _out_len) {
|
|
|
|
QList<QAbstractButton*> ret = self->buttons();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QAbstractButton** __out = static_cast<QAbstractButton**>(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();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QDialogButtonBox_ButtonRole(const QDialogButtonBox* self, QAbstractButton* button) {
|
|
|
|
QDialogButtonBox::ButtonRole ret = self->buttonRole(button);
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_SetStandardButtons(QDialogButtonBox* self, int buttons) {
|
|
|
|
self->setStandardButtons(static_cast<QDialogButtonBox::StandardButtons>(buttons));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QDialogButtonBox_StandardButtons(const QDialogButtonBox* self) {
|
|
|
|
QDialogButtonBox::StandardButtons ret = self->standardButtons();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<int>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QDialogButtonBox_StandardButton(const QDialogButtonBox* self, QAbstractButton* button) {
|
|
|
|
QDialogButtonBox::StandardButton ret = self->standardButton(button);
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPushButton* QDialogButtonBox_Button(const QDialogButtonBox* self, uintptr_t which) {
|
|
|
|
return self->button(static_cast<QDialogButtonBox::StandardButton>(which));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDialogButtonBox_SetCenterButtons(QDialogButtonBox* self, bool center) {
|
|
|
|
self->setCenterButtons(center);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDialogButtonBox_CenterButtons(const QDialogButtonBox* self) {
|
|
|
|
return self->centerButtons();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_Clicked(QDialogButtonBox* self, QAbstractButton* button) {
|
|
|
|
self->clicked(button);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_connect_Clicked(QDialogButtonBox* self, void* slot) {
|
|
|
|
QDialogButtonBox::connect(self, static_cast<void (QDialogButtonBox::*)(QAbstractButton*)>(&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<void (QDialogButtonBox::*)()>(&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<void (QDialogButtonBox::*)()>(&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<void (QDialogButtonBox::*)()>(&QDialogButtonBox::rejected), self, [=]() {
|
|
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
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<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QDialogButtonBox::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();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
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<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDialogButtonBox_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QDialogButtonBox::trUtf8(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();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDialogButtonBox_Delete(QDialogButtonBox* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|