#include #include #include #include #include #include #include #include #include #include #include "qlabel.h" #include "gen_qlabel.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QLabel* QLabel_new() { return new QLabel(); } QLabel* QLabel_new2(const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QLabel(text_QString); } QLabel* QLabel_new3(QWidget* parent) { return new QLabel(parent); } QLabel* QLabel_new4(QWidget* parent, int f) { return new QLabel(parent, static_cast(f)); } QLabel* QLabel_new5(const char* text, size_t text_Strlen, QWidget* parent) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QLabel(text_QString, parent); } QLabel* QLabel_new6(const char* text, size_t text_Strlen, QWidget* parent, int f) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QLabel(text_QString, parent, static_cast(f)); } QMetaObject* QLabel_MetaObject(const QLabel* self) { return (QMetaObject*) self->metaObject(); } void QLabel_Tr(const char* s, char** _out, int* _out_Strlen) { QString ret = QLabel::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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_TrUtf8(const char* s, char** _out, int* _out_Strlen) { QString ret = QLabel::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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_Text(const QLabel* self, char** _out, int* _out_Strlen) { QString ret = self->text(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } QPixmap* QLabel_Pixmap(const QLabel* self) { return (QPixmap*) self->pixmap(); } QPixmap* QLabel_PixmapWithQtReturnByValueConstant(const QLabel* self, uintptr_t param1) { QPixmap ret = self->pixmap(static_cast(param1)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixmap(ret)); } QPicture* QLabel_Picture(const QLabel* self) { return (QPicture*) self->picture(); } QPicture* QLabel_PictureWithQtReturnByValueConstant(const QLabel* self, uintptr_t param1) { QPicture ret = self->picture(static_cast(param1)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPicture(ret)); } QMovie* QLabel_Movie(const QLabel* self) { return self->movie(); } uintptr_t QLabel_TextFormat(const QLabel* self) { Qt::TextFormat ret = self->textFormat(); return static_cast(ret); } void QLabel_SetTextFormat(QLabel* self, uintptr_t textFormat) { self->setTextFormat(static_cast(textFormat)); } int QLabel_Alignment(const QLabel* self) { Qt::Alignment ret = self->alignment(); return static_cast(ret); } void QLabel_SetAlignment(QLabel* self, int alignment) { self->setAlignment(static_cast(alignment)); } void QLabel_SetWordWrap(QLabel* self, bool on) { self->setWordWrap(on); } bool QLabel_WordWrap(const QLabel* self) { return self->wordWrap(); } int QLabel_Indent(const QLabel* self) { return self->indent(); } void QLabel_SetIndent(QLabel* self, int indent) { self->setIndent(static_cast(indent)); } int QLabel_Margin(const QLabel* self) { return self->margin(); } void QLabel_SetMargin(QLabel* self, int margin) { self->setMargin(static_cast(margin)); } bool QLabel_HasScaledContents(const QLabel* self) { return self->hasScaledContents(); } void QLabel_SetScaledContents(QLabel* self, bool scaledContents) { self->setScaledContents(scaledContents); } QSize* QLabel_SizeHint(const QLabel* self) { QSize ret = self->sizeHint(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QSize(ret)); } QSize* QLabel_MinimumSizeHint(const QLabel* self) { QSize ret = self->minimumSizeHint(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QSize(ret)); } void QLabel_SetBuddy(QLabel* self, QWidget* buddy) { self->setBuddy(buddy); } QWidget* QLabel_Buddy(const QLabel* self) { return self->buddy(); } int QLabel_HeightForWidth(const QLabel* self, int param1) { return self->heightForWidth(static_cast(param1)); } bool QLabel_OpenExternalLinks(const QLabel* self) { return self->openExternalLinks(); } void QLabel_SetOpenExternalLinks(QLabel* self, bool open) { self->setOpenExternalLinks(open); } void QLabel_SetTextInteractionFlags(QLabel* self, int flags) { self->setTextInteractionFlags(static_cast(flags)); } int QLabel_TextInteractionFlags(const QLabel* self) { Qt::TextInteractionFlags ret = self->textInteractionFlags(); return static_cast(ret); } void QLabel_SetSelection(QLabel* self, int param1, int param2) { self->setSelection(static_cast(param1), static_cast(param2)); } bool QLabel_HasSelectedText(const QLabel* self) { return self->hasSelectedText(); } void QLabel_SelectedText(const QLabel* self, char** _out, int* _out_Strlen) { QString ret = self->selectedText(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } int QLabel_SelectionStart(const QLabel* self) { return self->selectionStart(); } void QLabel_SetText(QLabel* self, const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); self->setText(text_QString); } void QLabel_SetPixmap(QLabel* self, QPixmap* pixmap) { self->setPixmap(*pixmap); } void QLabel_SetPicture(QLabel* self, QPicture* picture) { self->setPicture(*picture); } void QLabel_SetMovie(QLabel* self, QMovie* movie) { self->setMovie(movie); } void QLabel_SetNum(QLabel* self, int num) { self->setNum(static_cast(num)); } void QLabel_SetNumWithNum(QLabel* self, double num) { self->setNum(static_cast(num)); } void QLabel_Clear(QLabel* self) { self->clear(); } void QLabel_LinkActivated(QLabel* self, const char* link, size_t link_Strlen) { QString link_QString = QString::fromUtf8(link, link_Strlen); self->linkActivated(link_QString); } void QLabel_connect_LinkActivated(QLabel* self, void* slot) { QLabel::connect(self, static_cast(&QLabel::linkActivated), self, [=](const QString& link) { miqt_exec_callback(slot, 0, nullptr); }); } void QLabel_LinkHovered(QLabel* self, const char* link, size_t link_Strlen) { QString link_QString = QString::fromUtf8(link, link_Strlen); self->linkHovered(link_QString); } void QLabel_connect_LinkHovered(QLabel* self, void* slot) { QLabel::connect(self, static_cast(&QLabel::linkHovered), self, [=](const QString& link) { miqt_exec_callback(slot, 0, nullptr); }); } void QLabel_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QLabel::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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QLabel::tr(s, c, static_cast(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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QLabel::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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QLabel::trUtf8(s, c, static_cast(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(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QLabel_Delete(QLabel* self) { delete self; }