2024-08-25 04:08:24 +00:00
|
|
|
#include <QLCDNumber>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QSize>
|
|
|
|
#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 "qlcdnumber.h"
|
|
|
|
#include "gen_qlcdnumber.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QLCDNumber* QLCDNumber_new() {
|
|
|
|
return new QLCDNumber();
|
|
|
|
}
|
|
|
|
|
|
|
|
QLCDNumber* QLCDNumber_new2(unsigned int numDigits) {
|
|
|
|
return new QLCDNumber(static_cast<uint>(numDigits));
|
|
|
|
}
|
|
|
|
|
|
|
|
QLCDNumber* QLCDNumber_new3(QWidget* parent) {
|
|
|
|
return new QLCDNumber(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QLCDNumber* QLCDNumber_new4(unsigned int numDigits, QWidget* parent) {
|
|
|
|
return new QLCDNumber(static_cast<uint>(numDigits), parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QLCDNumber_MetaObject(const QLCDNumber* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLCDNumber_Tr(const char* s) {
|
|
|
|
QString _ret = QLCDNumber::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* QLCDNumber_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QLCDNumber::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
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QLCDNumber_SmallDecimalPoint(const QLCDNumber* self) {
|
|
|
|
return self->smallDecimalPoint();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QLCDNumber_DigitCount(const QLCDNumber* self) {
|
|
|
|
return self->digitCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetDigitCount(QLCDNumber* self, int nDigits) {
|
|
|
|
self->setDigitCount(static_cast<int>(nDigits));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QLCDNumber_CheckOverflow(const QLCDNumber* self, double num) {
|
|
|
|
return self->checkOverflow(static_cast<double>(num));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QLCDNumber_CheckOverflowWithNum(const QLCDNumber* self, int num) {
|
|
|
|
return self->checkOverflow(static_cast<int>(num));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QLCDNumber_Mode(const QLCDNumber* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QLCDNumber::Mode _ret = self->mode();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetMode(QLCDNumber* self, uintptr_t mode) {
|
|
|
|
self->setMode(static_cast<QLCDNumber::Mode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QLCDNumber_SegmentStyle(const QLCDNumber* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QLCDNumber::SegmentStyle _ret = self->segmentStyle();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetSegmentStyle(QLCDNumber* self, uintptr_t segmentStyle) {
|
|
|
|
self->setSegmentStyle(static_cast<QLCDNumber::SegmentStyle>(segmentStyle));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QLCDNumber_Value(const QLCDNumber* self) {
|
|
|
|
return self->value();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QLCDNumber_IntValue(const QLCDNumber* self) {
|
|
|
|
return self->intValue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QLCDNumber_SizeHint(const QLCDNumber* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSize _ret = self->sizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QSize*>(new QSize(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QLCDNumber_Display(QLCDNumber* self, struct miqt_string* str) {
|
|
|
|
QString str_QString = QString::fromUtf8(&str->data, str->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->display(str_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_DisplayWithNum(QLCDNumber* self, int num) {
|
|
|
|
self->display(static_cast<int>(num));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_Display2(QLCDNumber* self, double num) {
|
|
|
|
self->display(static_cast<double>(num));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetHexMode(QLCDNumber* self) {
|
|
|
|
self->setHexMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetDecMode(QLCDNumber* self) {
|
|
|
|
self->setDecMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetOctMode(QLCDNumber* self) {
|
|
|
|
self->setOctMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetBinMode(QLCDNumber* self) {
|
|
|
|
self->setBinMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_SetSmallDecimalPoint(QLCDNumber* self, bool smallDecimalPoint) {
|
|
|
|
self->setSmallDecimalPoint(smallDecimalPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_Overflow(QLCDNumber* self) {
|
|
|
|
self->overflow();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLCDNumber_connect_Overflow(QLCDNumber* self, void* slot) {
|
|
|
|
QLCDNumber::connect(self, static_cast<void (QLCDNumber::*)()>(&QLCDNumber::overflow), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QLCDNumber_Overflow(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLCDNumber_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QLCDNumber::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* QLCDNumber_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QLCDNumber::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* QLCDNumber_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QLCDNumber::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* QLCDNumber_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QLCDNumber::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 QLCDNumber_Delete(QLCDNumber* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|