2024-08-25 04:08:24 +00:00
|
|
|
#include <QIcon>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QSize>
|
|
|
|
#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 "qpushbutton.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qpushbutton.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new() {
|
|
|
|
return new QPushButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new2(const char* text, size_t text_Strlen) {
|
|
|
|
QString text_QString = QString::fromUtf8(text, text_Strlen);
|
|
|
|
return new QPushButton(text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new3(QIcon* icon, const char* text, size_t text_Strlen) {
|
|
|
|
QString text_QString = QString::fromUtf8(text, text_Strlen);
|
|
|
|
return new QPushButton(*icon, text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new4(QWidget* parent) {
|
|
|
|
return new QPushButton(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new5(const char* text, size_t text_Strlen, QWidget* parent) {
|
|
|
|
QString text_QString = QString::fromUtf8(text, text_Strlen);
|
|
|
|
return new QPushButton(text_QString, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPushButton* QPushButton_new6(QIcon* icon, const char* text, size_t text_Strlen, QWidget* parent) {
|
|
|
|
QString text_QString = QString::fromUtf8(text, text_Strlen);
|
|
|
|
return new QPushButton(*icon, text_QString, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QMetaObject* QPushButton_MetaObject(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return (QMetaObject*) const_cast<const QPushButton*>(self)->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPushButton_Tr(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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 QPushButton_TrUtf8(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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();
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize* QPushButton_SizeHint(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QSize ret = const_cast<const QPushButton*>(self)->sizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QSize*>(new QSize(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize* QPushButton_MinimumSizeHint(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QSize ret = const_cast<const QPushButton*>(self)->minimumSizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QSize*>(new QSize(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPushButton_AutoDefault(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPushButton*>(self)->autoDefault();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPushButton_SetAutoDefault(QPushButton* self, bool autoDefault) {
|
|
|
|
self->setAutoDefault(autoDefault);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPushButton_IsDefault(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPushButton*>(self)->isDefault();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPushButton_SetDefault(QPushButton* self, bool defaultVal) {
|
|
|
|
self->setDefault(defaultVal);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPushButton_SetMenu(QPushButton* self, QMenu* menu) {
|
|
|
|
self->setMenu(menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
QMenu* QPushButton_Menu(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPushButton*>(self)->menu();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPushButton_SetFlat(QPushButton* self, bool flat) {
|
|
|
|
self->setFlat(flat);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPushButton_IsFlat(QPushButton* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPushButton*>(self)->isFlat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPushButton_ShowMenu(QPushButton* self) {
|
|
|
|
self->showMenu();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPushButton_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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 QPushButton_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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 QPushButton_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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 QPushButton_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QPushButton::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 QPushButton_Delete(QPushButton* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|