2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <QAbstractItemView>
|
|
|
|
#include <QCompleter>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QObject>
|
|
|
|
#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 <QWidget>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qcompleter.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcompleter.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QCompleter* QCompleter_new() {
|
|
|
|
return new QCompleter();
|
|
|
|
}
|
|
|
|
|
|
|
|
QCompleter* QCompleter_new2(QAbstractItemModel* model) {
|
|
|
|
return new QCompleter(model);
|
|
|
|
}
|
|
|
|
|
2024-11-04 07:18:27 +00:00
|
|
|
QCompleter* QCompleter_new3(struct miqt_array /* of struct miqt_string */ completions) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList completions_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
completions_QList.reserve(completions.len);
|
|
|
|
struct miqt_string* completions_arr = static_cast<struct miqt_string*>(completions.data);
|
|
|
|
for(size_t i = 0; i < completions.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString completions_arr_i_QString = QString::fromUtf8(completions_arr[i].data, completions_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
completions_QList.push_back(completions_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
return new QCompleter(completions_QList);
|
|
|
|
}
|
|
|
|
|
|
|
|
QCompleter* QCompleter_new4(QObject* parent) {
|
|
|
|
return new QCompleter(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QCompleter* QCompleter_new5(QAbstractItemModel* model, QObject* parent) {
|
|
|
|
return new QCompleter(model, parent);
|
|
|
|
}
|
|
|
|
|
2024-11-04 07:18:27 +00:00
|
|
|
QCompleter* QCompleter_new6(struct miqt_array /* of struct miqt_string */ completions, QObject* parent) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList completions_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
completions_QList.reserve(completions.len);
|
|
|
|
struct miqt_string* completions_arr = static_cast<struct miqt_string*>(completions.data);
|
|
|
|
for(size_t i = 0; i < completions.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString completions_arr_i_QString = QString::fromUtf8(completions_arr[i].data, completions_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
completions_QList.push_back(completions_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
return new QCompleter(completions_QList, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QCompleter_MetaObject(const QCompleter* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QCompleter_Metacast(QCompleter* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetWidget(QCompleter* self, QWidget* widget) {
|
|
|
|
self->setWidget(widget);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QWidget* QCompleter_Widget(const QCompleter* self) {
|
|
|
|
return self->widget();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetModel(QCompleter* self, QAbstractItemModel* c) {
|
|
|
|
self->setModel(c);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAbstractItemModel* QCompleter_Model(const QCompleter* self) {
|
|
|
|
return self->model();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QCompleter_SetCompletionMode(QCompleter* self, int mode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setCompletionMode(static_cast<QCompleter::CompletionMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCompleter_CompletionMode(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCompleter::CompletionMode _ret = self->completionMode();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetFilterMode(QCompleter* self, int filterMode) {
|
|
|
|
self->setFilterMode(static_cast<Qt::MatchFlags>(filterMode));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_FilterMode(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::MatchFlags _ret = self->filterMode();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAbstractItemView* QCompleter_Popup(const QCompleter* self) {
|
|
|
|
return self->popup();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetPopup(QCompleter* self, QAbstractItemView* popup) {
|
|
|
|
self->setPopup(popup);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QCompleter_SetCaseSensitivity(QCompleter* self, int caseSensitivity) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setCaseSensitivity(static_cast<Qt::CaseSensitivity>(caseSensitivity));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCompleter_CaseSensitivity(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::CaseSensitivity _ret = self->caseSensitivity();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QCompleter_SetModelSorting(QCompleter* self, int sorting) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setModelSorting(static_cast<QCompleter::ModelSorting>(sorting));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCompleter_ModelSorting(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCompleter::ModelSorting _ret = self->modelSorting();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QCompleter_SetCompletionColumn(QCompleter* self, int column) {
|
|
|
|
self->setCompletionColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_CompletionColumn(const QCompleter* self) {
|
|
|
|
return self->completionColumn();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetCompletionRole(QCompleter* self, int role) {
|
|
|
|
self->setCompletionRole(static_cast<int>(role));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_CompletionRole(const QCompleter* self) {
|
|
|
|
return self->completionRole();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCompleter_WrapAround(const QCompleter* self) {
|
|
|
|
return self->wrapAround();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_MaxVisibleItems(const QCompleter* self) {
|
|
|
|
return self->maxVisibleItems();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetMaxVisibleItems(QCompleter* self, int maxItems) {
|
|
|
|
self->setMaxVisibleItems(static_cast<int>(maxItems));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_CompletionCount(const QCompleter* self) {
|
|
|
|
return self->completionCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCompleter_SetCurrentRow(QCompleter* self, int row) {
|
|
|
|
return self->setCurrentRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCompleter_CurrentRow(const QCompleter* self) {
|
|
|
|
return self->currentRow();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QCompleter_CurrentIndex(const QCompleter* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->currentIndex());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_CurrentCompletion(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->currentCompletion();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAbstractItemModel* QCompleter_CompletionModel(const QCompleter* self) {
|
|
|
|
return self->completionModel();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_CompletionPrefix(const QCompleter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->completionPrefix();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QCompleter_SetCompletionPrefix(QCompleter* self, struct miqt_string prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setCompletionPrefix(prefix_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_Complete(QCompleter* self) {
|
|
|
|
self->complete();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_SetWrapAround(QCompleter* self, bool wrap) {
|
|
|
|
self->setWrapAround(wrap);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_PathFromIndex(const QCompleter* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->pathFromIndex(*index);
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array QCompleter_SplitPath(const QCompleter* self, struct miqt_string path) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->splitPath(path_QString);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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 _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QCompleter_Activated(QCompleter* self, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->activated(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QCompleter_connect_Activated(QCompleter* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QCompleter::connect(self, static_cast<void (QCompleter::*)(const QString&)>(&QCompleter::activated), self, [=](const QString& text) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString text_ret = text;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray text_b = text_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string text_ms;
|
|
|
|
text_ms.len = text_b.length();
|
|
|
|
text_ms.data = static_cast<char*>(malloc(text_ms.len));
|
|
|
|
memcpy(text_ms.data, text_b.data(), text_ms.len);
|
|
|
|
struct miqt_string sigval1 = text_ms;
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QCompleter_Activated(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_ActivatedWithIndex(QCompleter* self, QModelIndex* index) {
|
|
|
|
self->activated(*index);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QCompleter_connect_ActivatedWithIndex(QCompleter* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QCompleter::connect(self, static_cast<void (QCompleter::*)(const QModelIndex&)>(&QCompleter::activated), self, [=](const QModelIndex& index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& index_ret = index;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(&index_ret);
|
|
|
|
miqt_exec_callback_QCompleter_ActivatedWithIndex(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QCompleter_Highlighted(QCompleter* self, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->highlighted(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QCompleter_connect_Highlighted(QCompleter* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QCompleter::connect(self, static_cast<void (QCompleter::*)(const QString&)>(&QCompleter::highlighted), self, [=](const QString& text) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString text_ret = text;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray text_b = text_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string text_ms;
|
|
|
|
text_ms.len = text_b.length();
|
|
|
|
text_ms.data = static_cast<char*>(malloc(text_ms.len));
|
|
|
|
memcpy(text_ms.data, text_b.data(), text_ms.len);
|
|
|
|
struct miqt_string sigval1 = text_ms;
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QCompleter_Highlighted(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_HighlightedWithIndex(QCompleter* self, QModelIndex* index) {
|
|
|
|
self->highlighted(*index);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QCompleter_connect_HighlightedWithIndex(QCompleter* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QCompleter::connect(self, static_cast<void (QCompleter::*)(const QModelIndex&)>(&QCompleter::highlighted), self, [=](const QModelIndex& index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QModelIndex& index_ret = index;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QModelIndex* sigval1 = const_cast<QModelIndex*>(&index_ret);
|
|
|
|
miqt_exec_callback_QCompleter_HighlightedWithIndex(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCompleter_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QCompleter::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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_Complete1(QCompleter* self, QRect* rect) {
|
|
|
|
self->complete(*rect);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCompleter_Delete(QCompleter* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|