miqt/qt6/gen_qerrormessage.cpp

79 lines
2.4 KiB
C++
Raw Normal View History

2024-10-20 05:21:03 +00:00
#include <QErrorMessage>
#include <QMetaObject>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QWidget>
#include <qerrormessage.h>
#include "gen_qerrormessage.h"
#include "_cgo_export.h"
QErrorMessage* QErrorMessage_new(QWidget* parent) {
return new QErrorMessage(parent);
2024-10-20 05:21:03 +00:00
}
QErrorMessage* QErrorMessage_new2() {
return new QErrorMessage();
2024-10-20 05:21:03 +00:00
}
QMetaObject* QErrorMessage_MetaObject(const QErrorMessage* self) {
return (QMetaObject*) self->metaObject();
}
void* QErrorMessage_Metacast(QErrorMessage* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QErrorMessage_Tr(const char* s) {
QString _ret = QErrorMessage::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;
}
QErrorMessage* QErrorMessage_QtHandler() {
return QErrorMessage::qtHandler();
}
void QErrorMessage_ShowMessage(QErrorMessage* self, struct miqt_string message) {
QString message_QString = QString::fromUtf8(message.data, message.len);
self->showMessage(message_QString);
}
void QErrorMessage_ShowMessage2(QErrorMessage* self, struct miqt_string message, struct miqt_string typeVal) {
QString message_QString = QString::fromUtf8(message.data, message.len);
QString typeVal_QString = QString::fromUtf8(typeVal.data, typeVal.len);
self->showMessage(message_QString, typeVal_QString);
}
struct miqt_string QErrorMessage_Tr2(const char* s, const char* c) {
QString _ret = QErrorMessage::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 QErrorMessage_Tr3(const char* s, const char* c, int n) {
QString _ret = QErrorMessage::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;
}
void QErrorMessage_Delete(QErrorMessage* self) {
delete self;
}