2024-08-25 04:08:24 +00:00
|
|
|
#include <QFont>
|
|
|
|
#include <QPalette>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QToolTip>
|
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qtooltip.h"
|
|
|
|
#include "gen_qtooltip.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QToolTip_ShowText(QPoint* pos, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QToolTip::showText(*pos, text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QToolTip_ShowText2(QPoint* pos, struct miqt_string* text, QWidget* w, QRect* rect) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QToolTip::showText(*pos, text_QString, w, *rect);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QToolTip_ShowText3(QPoint* pos, struct miqt_string* text, QWidget* w, QRect* rect, int msecShowTime) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QToolTip::showText(*pos, text_QString, w, *rect, static_cast<int>(msecShowTime));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QToolTip_HideText() {
|
|
|
|
QToolTip::hideText();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QToolTip_IsVisible() {
|
|
|
|
return QToolTip::isVisible();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QToolTip_Text() {
|
|
|
|
QString _ret = QToolTip::text();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
QPalette* QToolTip_Palette() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QPalette _ret = QToolTip::palette();
|
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<QPalette*>(new QPalette(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QToolTip_SetPalette(QPalette* palette) {
|
|
|
|
QToolTip::setPalette(*palette);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QToolTip_Font() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFont _ret = QToolTip::font();
|
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<QFont*>(new QFont(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QToolTip_SetFont(QFont* font) {
|
|
|
|
QToolTip::setFont(*font);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QToolTip_ShowText32(QPoint* pos, struct miqt_string* text, QWidget* w) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QToolTip::showText(*pos, text_QString, w);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QToolTip_Delete(QToolTip* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|