miqt/qt/gen_qtoolbutton.cpp

174 lines
4.9 KiB
C++
Raw Normal View History

#include <QAction>
#include <QMenu>
#include <QMetaObject>
#include <QSize>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QToolButton>
#include <QWidget>
#include <qtoolbutton.h>
2024-08-29 07:01:51 +00:00
#include "gen_qtoolbutton.h"
#include "_cgo_export.h"
QToolButton* QToolButton_new() {
return new QToolButton();
}
QToolButton* QToolButton_new2(QWidget* parent) {
return new QToolButton(parent);
}
QMetaObject* QToolButton_MetaObject(const QToolButton* self) {
return (QMetaObject*) self->metaObject();
}
void* QToolButton_Metacast(QToolButton* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QToolButton_Tr(const char* s) {
QString _ret = QToolButton::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;
}
struct miqt_string QToolButton_TrUtf8(const char* s) {
QString _ret = QToolButton::trUtf8(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;
}
QSize* QToolButton_SizeHint(const QToolButton* self) {
return new QSize(self->sizeHint());
}
QSize* QToolButton_MinimumSizeHint(const QToolButton* self) {
return new QSize(self->minimumSizeHint());
}
int QToolButton_ToolButtonStyle(const QToolButton* self) {
Qt::ToolButtonStyle _ret = self->toolButtonStyle();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
int QToolButton_ArrowType(const QToolButton* self) {
Qt::ArrowType _ret = self->arrowType();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QToolButton_SetArrowType(QToolButton* self, int typeVal) {
2024-08-29 07:01:51 +00:00
self->setArrowType(static_cast<Qt::ArrowType>(typeVal));
}
void QToolButton_SetMenu(QToolButton* self, QMenu* menu) {
self->setMenu(menu);
}
QMenu* QToolButton_Menu(const QToolButton* self) {
return self->menu();
2024-08-29 07:01:51 +00:00
}
void QToolButton_SetPopupMode(QToolButton* self, int mode) {
2024-08-29 07:01:51 +00:00
self->setPopupMode(static_cast<QToolButton::ToolButtonPopupMode>(mode));
}
int QToolButton_PopupMode(const QToolButton* self) {
QToolButton::ToolButtonPopupMode _ret = self->popupMode();
return static_cast<int>(_ret);
}
QAction* QToolButton_DefaultAction(const QToolButton* self) {
return self->defaultAction();
}
void QToolButton_SetAutoRaise(QToolButton* self, bool enable) {
self->setAutoRaise(enable);
}
bool QToolButton_AutoRaise(const QToolButton* self) {
return self->autoRaise();
}
void QToolButton_ShowMenu(QToolButton* self) {
self->showMenu();
}
void QToolButton_SetToolButtonStyle(QToolButton* self, int style) {
2024-08-29 07:01:51 +00:00
self->setToolButtonStyle(static_cast<Qt::ToolButtonStyle>(style));
}
void QToolButton_SetDefaultAction(QToolButton* self, QAction* defaultAction) {
self->setDefaultAction(defaultAction);
}
void QToolButton_Triggered(QToolButton* self, QAction* param1) {
self->triggered(param1);
}
void QToolButton_connect_Triggered(QToolButton* self, intptr_t slot) {
QToolButton::connect(self, static_cast<void (QToolButton::*)(QAction*)>(&QToolButton::triggered), self, [=](QAction* param1) {
QAction* sigval1 = param1;
miqt_exec_callback_QToolButton_Triggered(slot, sigval1);
});
}
struct miqt_string QToolButton_Tr2(const char* s, const char* c) {
QString _ret = QToolButton::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 QToolButton_Tr3(const char* s, const char* c, int n) {
QString _ret = QToolButton::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;
}
struct miqt_string QToolButton_TrUtf82(const char* s, const char* c) {
QString _ret = QToolButton::trUtf8(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 QToolButton_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QToolButton::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();
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 QToolButton_Delete(QToolButton* self) {
delete self;
}