2024-08-25 04:08:24 +00:00
|
|
|
#include <QAction>
|
|
|
|
#include <QActionGroup>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qactiongroup.h"
|
|
|
|
#include "gen_qactiongroup.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QActionGroup* QActionGroup_new(QObject* parent) {
|
|
|
|
return new QActionGroup(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QActionGroup_MetaObject(const QActionGroup* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_Tr(const char* s) {
|
|
|
|
QString _ret = QActionGroup::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QActionGroup::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QActionGroup_AddAction(QActionGroup* self, QAction* a) {
|
|
|
|
return self->addAction(a);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QActionGroup_AddActionWithText(QActionGroup* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addAction(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QActionGroup_AddAction2(QActionGroup* self, QIcon* icon, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addAction(*icon, text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_RemoveAction(QActionGroup* self, QAction* a) {
|
|
|
|
self->removeAction(a);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QActionGroup_Actions(const QActionGroup* self) {
|
|
|
|
QList<QAction*> _ret = self->actions();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction** _arr = static_cast<QAction**>(malloc(sizeof(QAction*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QActionGroup_CheckedAction(const QActionGroup* self) {
|
|
|
|
return self->checkedAction();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QActionGroup_IsExclusive(const QActionGroup* self) {
|
|
|
|
return self->isExclusive();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QActionGroup_IsEnabled(const QActionGroup* self) {
|
|
|
|
return self->isEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QActionGroup_IsVisible(const QActionGroup* self) {
|
|
|
|
return self->isVisible();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QActionGroup_ExclusionPolicy(const QActionGroup* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QActionGroup::ExclusionPolicy _ret = self->exclusionPolicy();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_SetEnabled(QActionGroup* self, bool enabled) {
|
|
|
|
self->setEnabled(enabled);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_SetDisabled(QActionGroup* self, bool b) {
|
|
|
|
self->setDisabled(b);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_SetVisible(QActionGroup* self, bool visible) {
|
|
|
|
self->setVisible(visible);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_SetExclusive(QActionGroup* self, bool exclusive) {
|
|
|
|
self->setExclusive(exclusive);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QActionGroup_SetExclusionPolicy(QActionGroup* self, uintptr_t policy) {
|
|
|
|
self->setExclusionPolicy(static_cast<QActionGroup::ExclusionPolicy>(policy));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QActionGroup_Triggered(QActionGroup* self, QAction* param1) {
|
|
|
|
self->triggered(param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_connect_Triggered(QActionGroup* self, void* slot) {
|
|
|
|
QActionGroup::connect(self, static_cast<void (QActionGroup::*)(QAction*)>(&QActionGroup::triggered), self, [=](QAction* param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* sigval1 = param1;
|
|
|
|
miqt_exec_callback_QActionGroup_Triggered(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_Hovered(QActionGroup* self, QAction* param1) {
|
|
|
|
self->hovered(param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_connect_Hovered(QActionGroup* self, void* slot) {
|
|
|
|
QActionGroup::connect(self, static_cast<void (QActionGroup::*)(QAction*)>(&QActionGroup::hovered), self, [=](QAction* param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* sigval1 = param1;
|
|
|
|
miqt_exec_callback_QActionGroup_Hovered(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QActionGroup::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QActionGroup::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QActionGroup::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QActionGroup_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QActionGroup::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QActionGroup_Delete(QActionGroup* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|