mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 09:28:36 +00:00
211 lines
7.6 KiB
C++
211 lines
7.6 KiB
C++
#include <QAbstractButton>
|
|
#include <QDialogButtonBox>
|
|
#include <QList>
|
|
#include <QMetaObject>
|
|
#include <QPushButton>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QWidget>
|
|
#include "qdialogbuttonbox.h"
|
|
#include "gen_qdialogbuttonbox.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new() {
|
|
return new QDialogButtonBox();
|
|
}
|
|
|
|
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) {
|
|
return new QDialogButtonBox(parent);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
QMetaObject* QDialogButtonBox_MetaObject(const QDialogButtonBox* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_Tr(const char* s) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_TrUtf8(const char* s) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
void QDialogButtonBox_SetOrientation(QDialogButtonBox* self, uintptr_t orientation) {
|
|
self->setOrientation(static_cast<Qt::Orientation>(orientation));
|
|
}
|
|
|
|
uintptr_t QDialogButtonBox_Orientation(const QDialogButtonBox* self) {
|
|
Qt::Orientation _ret = self->orientation();
|
|
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, struct miqt_string* text, uintptr_t role) {
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
|
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));
|
|
}
|
|
|
|
void QDialogButtonBox_RemoveButton(QDialogButtonBox* self, QAbstractButton* button) {
|
|
self->removeButton(button);
|
|
}
|
|
|
|
void QDialogButtonBox_Clear(QDialogButtonBox* self) {
|
|
self->clear();
|
|
}
|
|
|
|
struct miqt_array* QDialogButtonBox_Buttons(const QDialogButtonBox* self) {
|
|
QList<QAbstractButton*> _ret = self->buttons();
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
QAbstractButton** _arr = static_cast<QAbstractButton**>(malloc(sizeof(QAbstractButton*) * _ret.length()));
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
_arr[i] = _ret[i];
|
|
}
|
|
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;
|
|
}
|
|
|
|
uintptr_t QDialogButtonBox_ButtonRole(const QDialogButtonBox* self, QAbstractButton* button) {
|
|
QDialogButtonBox::ButtonRole _ret = self->buttonRole(button);
|
|
return static_cast<uintptr_t>(_ret);
|
|
}
|
|
|
|
void QDialogButtonBox_SetStandardButtons(QDialogButtonBox* self, int buttons) {
|
|
self->setStandardButtons(static_cast<QDialogButtonBox::StandardButtons>(buttons));
|
|
}
|
|
|
|
int QDialogButtonBox_StandardButtons(const QDialogButtonBox* self) {
|
|
QDialogButtonBox::StandardButtons _ret = self->standardButtons();
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
uintptr_t QDialogButtonBox_StandardButton(const QDialogButtonBox* self, QAbstractButton* button) {
|
|
QDialogButtonBox::StandardButton _ret = self->standardButton(button);
|
|
return static_cast<uintptr_t>(_ret);
|
|
}
|
|
|
|
QPushButton* QDialogButtonBox_Button(const QDialogButtonBox* self, uintptr_t which) {
|
|
return self->button(static_cast<QDialogButtonBox::StandardButton>(which));
|
|
}
|
|
|
|
void QDialogButtonBox_SetCenterButtons(QDialogButtonBox* self, bool center) {
|
|
self->setCenterButtons(center);
|
|
}
|
|
|
|
bool QDialogButtonBox_CenterButtons(const QDialogButtonBox* self) {
|
|
return 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<void (QDialogButtonBox::*)(QAbstractButton*)>(&QDialogButtonBox::clicked), self, [=](QAbstractButton* button) {
|
|
QAbstractButton* sigval1 = button;
|
|
miqt_exec_callback_QDialogButtonBox_Clicked(slot, sigval1);
|
|
});
|
|
}
|
|
|
|
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_QDialogButtonBox_Accepted(slot);
|
|
});
|
|
}
|
|
|
|
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_QDialogButtonBox_HelpRequested(slot);
|
|
});
|
|
}
|
|
|
|
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_QDialogButtonBox_Rejected(slot);
|
|
});
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_Tr2(const char* s, const char* c) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_Tr3(const char* s, const char* c, int n) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_TrUtf82(const char* s, const char* c) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
struct miqt_string* QDialogButtonBox_TrUtf83(const char* s, const char* c, int n) {
|
|
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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
void QDialogButtonBox_Delete(QDialogButtonBox* self) {
|
|
delete self;
|
|
}
|
|
|