mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
152 lines
3.7 KiB
C++
152 lines
3.7 KiB
C++
#include <QDialog>
|
|
#include <QMetaObject>
|
|
#include <QSize>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QWidget>
|
|
#include <qdialog.h>
|
|
#include "gen_qdialog.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QDialog* QDialog_new() {
|
|
return new QDialog();
|
|
}
|
|
|
|
QDialog* QDialog_new2(QWidget* parent) {
|
|
return new QDialog(parent);
|
|
}
|
|
|
|
QDialog* QDialog_new3(QWidget* parent, int f) {
|
|
return new QDialog(parent, static_cast<Qt::WindowFlags>(f));
|
|
}
|
|
|
|
QMetaObject* QDialog_MetaObject(const QDialog* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QDialog_Metacast(QDialog* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QDialog_Tr(const char* s) {
|
|
QString _ret = QDialog::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;
|
|
}
|
|
|
|
int QDialog_Result(const QDialog* self) {
|
|
return self->result();
|
|
}
|
|
|
|
void QDialog_SetVisible(QDialog* self, bool visible) {
|
|
self->setVisible(visible);
|
|
}
|
|
|
|
QSize* QDialog_SizeHint(const QDialog* self) {
|
|
return new QSize(self->sizeHint());
|
|
}
|
|
|
|
QSize* QDialog_MinimumSizeHint(const QDialog* self) {
|
|
return new QSize(self->minimumSizeHint());
|
|
}
|
|
|
|
void QDialog_SetSizeGripEnabled(QDialog* self, bool sizeGripEnabled) {
|
|
self->setSizeGripEnabled(sizeGripEnabled);
|
|
}
|
|
|
|
bool QDialog_IsSizeGripEnabled(const QDialog* self) {
|
|
return self->isSizeGripEnabled();
|
|
}
|
|
|
|
void QDialog_SetModal(QDialog* self, bool modal) {
|
|
self->setModal(modal);
|
|
}
|
|
|
|
void QDialog_SetResult(QDialog* self, int r) {
|
|
self->setResult(static_cast<int>(r));
|
|
}
|
|
|
|
void QDialog_Finished(QDialog* self, int result) {
|
|
self->finished(static_cast<int>(result));
|
|
}
|
|
|
|
void QDialog_connect_Finished(QDialog* self, intptr_t slot) {
|
|
QDialog::connect(self, static_cast<void (QDialog::*)(int)>(&QDialog::finished), self, [=](int result) {
|
|
int sigval1 = result;
|
|
miqt_exec_callback_QDialog_Finished(slot, sigval1);
|
|
});
|
|
}
|
|
|
|
void QDialog_Accepted(QDialog* self) {
|
|
self->accepted();
|
|
}
|
|
|
|
void QDialog_connect_Accepted(QDialog* self, intptr_t slot) {
|
|
QDialog::connect(self, static_cast<void (QDialog::*)()>(&QDialog::accepted), self, [=]() {
|
|
miqt_exec_callback_QDialog_Accepted(slot);
|
|
});
|
|
}
|
|
|
|
void QDialog_Rejected(QDialog* self) {
|
|
self->rejected();
|
|
}
|
|
|
|
void QDialog_connect_Rejected(QDialog* self, intptr_t slot) {
|
|
QDialog::connect(self, static_cast<void (QDialog::*)()>(&QDialog::rejected), self, [=]() {
|
|
miqt_exec_callback_QDialog_Rejected(slot);
|
|
});
|
|
}
|
|
|
|
void QDialog_Open(QDialog* self) {
|
|
self->open();
|
|
}
|
|
|
|
int QDialog_Exec(QDialog* self) {
|
|
return self->exec();
|
|
}
|
|
|
|
void QDialog_Done(QDialog* self, int param1) {
|
|
self->done(static_cast<int>(param1));
|
|
}
|
|
|
|
void QDialog_Accept(QDialog* self) {
|
|
self->accept();
|
|
}
|
|
|
|
void QDialog_Reject(QDialog* self) {
|
|
self->reject();
|
|
}
|
|
|
|
struct miqt_string QDialog_Tr2(const char* s, const char* c) {
|
|
QString _ret = QDialog::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 QDialog_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QDialog::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 QDialog_Delete(QDialog* self) {
|
|
delete self;
|
|
}
|
|
|