2024-08-25 04:08:24 +00:00
|
|
|
#include <QKeySequence>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QShortcut>
|
|
|
|
#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 "qshortcut.h"
|
|
|
|
#include "gen_qshortcut.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QShortcut* QShortcut_new(QWidget* parent) {
|
|
|
|
return new QShortcut(parent);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QShortcut* QShortcut_new2(QKeySequence* key, QWidget* parent) {
|
|
|
|
return new QShortcut(*key, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QShortcut* QShortcut_new3(QKeySequence* key, QWidget* parent, const char* member) {
|
|
|
|
return new QShortcut(*key, parent, member);
|
|
|
|
}
|
|
|
|
|
|
|
|
QShortcut* QShortcut_new4(QKeySequence* key, QWidget* parent, const char* member, const char* ambiguousMember) {
|
|
|
|
return new QShortcut(*key, parent, member, ambiguousMember);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QShortcut* QShortcut_new5(QKeySequence* key, QWidget* parent, const char* member, const char* ambiguousMember, int shortcutContext) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QShortcut(*key, parent, member, ambiguousMember, static_cast<Qt::ShortcutContext>(shortcutContext));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QShortcut_MetaObject(const QShortcut* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QShortcut_Metacast(QShortcut* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QShortcut_Tr(const char* s) {
|
|
|
|
QString _ret = QShortcut::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* QShortcut_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QShortcut::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
|
|
|
}
|
|
|
|
|
|
|
|
void QShortcut_SetKey(QShortcut* self, QKeySequence* key) {
|
|
|
|
self->setKey(*key);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QKeySequence* QShortcut_Key(const QShortcut* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QKeySequence(self->key());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QShortcut_SetEnabled(QShortcut* self, bool enable) {
|
|
|
|
self->setEnabled(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QShortcut_IsEnabled(const QShortcut* self) {
|
|
|
|
return self->isEnabled();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QShortcut_SetContext(QShortcut* self, int context) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setContext(static_cast<Qt::ShortcutContext>(context));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QShortcut_Context(const QShortcut* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ShortcutContext _ret = self->context();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QShortcut_SetWhatsThis(QShortcut* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setWhatsThis(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QShortcut_WhatsThis(const QShortcut* self) {
|
|
|
|
QString _ret = self->whatsThis();
|
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 QShortcut_SetAutoRepeat(QShortcut* self, bool on) {
|
|
|
|
self->setAutoRepeat(on);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QShortcut_AutoRepeat(const QShortcut* self) {
|
|
|
|
return self->autoRepeat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QShortcut_Id(const QShortcut* self) {
|
|
|
|
return self->id();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QWidget* QShortcut_ParentWidget(const QShortcut* self) {
|
|
|
|
return self->parentWidget();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QShortcut_Activated(QShortcut* self) {
|
|
|
|
self->activated();
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QShortcut_connect_Activated(QShortcut* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QShortcut::connect(self, static_cast<void (QShortcut::*)()>(&QShortcut::activated), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QShortcut_Activated(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QShortcut_ActivatedAmbiguously(QShortcut* self) {
|
|
|
|
self->activatedAmbiguously();
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QShortcut_connect_ActivatedAmbiguously(QShortcut* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QShortcut::connect(self, static_cast<void (QShortcut::*)()>(&QShortcut::activatedAmbiguously), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QShortcut_ActivatedAmbiguously(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QShortcut_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QShortcut::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* QShortcut_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QShortcut::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* QShortcut_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QShortcut::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* QShortcut_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QShortcut::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 QShortcut_Delete(QShortcut* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|