#include #include #include #include #include #include #include #include #include #include #include #include #include "qcompleter.h" #include "gen_qcompleter.h" #include "_cgo_export.h" QCompleter* QCompleter_new() { return new QCompleter(); } QCompleter* QCompleter_new2(QAbstractItemModel* model) { return new QCompleter(model); } QCompleter* QCompleter_new3(struct miqt_array* /* of struct miqt_string* */ completions) { QList completions_QList; completions_QList.reserve(completions->len); miqt_string** completions_arr = static_cast(completions->data); for(size_t i = 0; i < completions->len; ++i) { completions_QList.push_back(QString::fromUtf8(& completions_arr[i]->data, completions_arr[i]->len)); } 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); } QCompleter* QCompleter_new6(struct miqt_array* /* of struct miqt_string* */ completions, QObject* parent) { QList completions_QList; completions_QList.reserve(completions->len); miqt_string** completions_arr = static_cast(completions->data); for(size_t i = 0; i < completions->len; ++i) { completions_QList.push_back(QString::fromUtf8(& completions_arr[i]->data, completions_arr[i]->len)); } return new QCompleter(completions_QList, parent); } QMetaObject* QCompleter_MetaObject(const QCompleter* self) { return (QMetaObject*) self->metaObject(); } struct miqt_string* QCompleter_Tr(const char* s) { QString _ret = QCompleter::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QCompleter_TrUtf8(const char* s) { QString _ret = QCompleter::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } void QCompleter_SetWidget(QCompleter* self, QWidget* widget) { self->setWidget(widget); } QWidget* QCompleter_Widget(const QCompleter* self) { return self->widget(); } void QCompleter_SetModel(QCompleter* self, QAbstractItemModel* c) { self->setModel(c); } QAbstractItemModel* QCompleter_Model(const QCompleter* self) { return self->model(); } void QCompleter_SetCompletionMode(QCompleter* self, uintptr_t mode) { self->setCompletionMode(static_cast(mode)); } uintptr_t QCompleter_CompletionMode(const QCompleter* self) { QCompleter::CompletionMode _ret = self->completionMode(); return static_cast(_ret); } void QCompleter_SetFilterMode(QCompleter* self, int filterMode) { self->setFilterMode(static_cast(filterMode)); } int QCompleter_FilterMode(const QCompleter* self) { Qt::MatchFlags _ret = self->filterMode(); return static_cast(_ret); } QAbstractItemView* QCompleter_Popup(const QCompleter* self) { return self->popup(); } void QCompleter_SetPopup(QCompleter* self, QAbstractItemView* popup) { self->setPopup(popup); } void QCompleter_SetCaseSensitivity(QCompleter* self, uintptr_t caseSensitivity) { self->setCaseSensitivity(static_cast(caseSensitivity)); } uintptr_t QCompleter_CaseSensitivity(const QCompleter* self) { Qt::CaseSensitivity _ret = self->caseSensitivity(); return static_cast(_ret); } void QCompleter_SetModelSorting(QCompleter* self, uintptr_t sorting) { self->setModelSorting(static_cast(sorting)); } uintptr_t QCompleter_ModelSorting(const QCompleter* self) { QCompleter::ModelSorting _ret = self->modelSorting(); return static_cast(_ret); } void QCompleter_SetCompletionColumn(QCompleter* self, int column) { self->setCompletionColumn(static_cast(column)); } int QCompleter_CompletionColumn(const QCompleter* self) { return self->completionColumn(); } void QCompleter_SetCompletionRole(QCompleter* self, int role) { self->setCompletionRole(static_cast(role)); } int QCompleter_CompletionRole(const QCompleter* self) { return self->completionRole(); } bool QCompleter_WrapAround(const QCompleter* self) { return self->wrapAround(); } int QCompleter_MaxVisibleItems(const QCompleter* self) { return self->maxVisibleItems(); } void QCompleter_SetMaxVisibleItems(QCompleter* self, int maxItems) { self->setMaxVisibleItems(static_cast(maxItems)); } int QCompleter_CompletionCount(const QCompleter* self) { return self->completionCount(); } bool QCompleter_SetCurrentRow(QCompleter* self, int row) { return self->setCurrentRow(static_cast(row)); } int QCompleter_CurrentRow(const QCompleter* self) { return self->currentRow(); } QModelIndex* QCompleter_CurrentIndex(const QCompleter* self) { QModelIndex _ret = self->currentIndex(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QModelIndex(_ret)); } struct miqt_string* QCompleter_CurrentCompletion(const QCompleter* self) { QString _ret = self->currentCompletion(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } QAbstractItemModel* QCompleter_CompletionModel(const QCompleter* self) { return self->completionModel(); } struct miqt_string* QCompleter_CompletionPrefix(const QCompleter* self) { QString _ret = self->completionPrefix(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } void QCompleter_SetCompletionPrefix(QCompleter* self, struct miqt_string* prefix) { QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len); self->setCompletionPrefix(prefix_QString); } void QCompleter_Complete(QCompleter* self) { self->complete(); } void QCompleter_SetWrapAround(QCompleter* self, bool wrap) { self->setWrapAround(wrap); } struct miqt_string* QCompleter_PathFromIndex(const QCompleter* self, QModelIndex* index) { QString _ret = self->pathFromIndex(*index); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_array* QCompleter_SplitPath(const QCompleter* self, struct miqt_string* path) { QString path_QString = QString::fromUtf8(&path->data, path->len); QStringList _ret = self->splitPath(path_QString); // Convert QStringList from C++ memory to manually-managed C memory struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } void QCompleter_Activated(QCompleter* self, struct miqt_string* text) { QString text_QString = QString::fromUtf8(&text->data, text->len); self->activated(text_QString); } void QCompleter_connect_Activated(QCompleter* self, void* slot) { QCompleter::connect(self, static_cast(&QCompleter::activated), self, [=](const QString& text) { 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(); struct miqt_string* sigval1 = miqt_strdup(text_b.data(), text_b.length()); miqt_exec_callback_QCompleter_Activated(slot, sigval1); }); } void QCompleter_ActivatedWithIndex(QCompleter* self, QModelIndex* index) { self->activated(*index); } void QCompleter_connect_ActivatedWithIndex(QCompleter* self, void* slot) { QCompleter::connect(self, static_cast(&QCompleter::activated), self, [=](const QModelIndex& index) { const QModelIndex& index_ret = index; // Cast returned reference into pointer QModelIndex* sigval1 = const_cast(&index_ret); miqt_exec_callback_QCompleter_ActivatedWithIndex(slot, sigval1); }); } void QCompleter_Highlighted(QCompleter* self, struct miqt_string* text) { QString text_QString = QString::fromUtf8(&text->data, text->len); self->highlighted(text_QString); } void QCompleter_connect_Highlighted(QCompleter* self, void* slot) { QCompleter::connect(self, static_cast(&QCompleter::highlighted), self, [=](const QString& text) { 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(); struct miqt_string* sigval1 = miqt_strdup(text_b.data(), text_b.length()); miqt_exec_callback_QCompleter_Highlighted(slot, sigval1); }); } void QCompleter_HighlightedWithIndex(QCompleter* self, QModelIndex* index) { self->highlighted(*index); } void QCompleter_connect_HighlightedWithIndex(QCompleter* self, void* slot) { QCompleter::connect(self, static_cast(&QCompleter::highlighted), self, [=](const QModelIndex& index) { const QModelIndex& index_ret = index; // Cast returned reference into pointer QModelIndex* sigval1 = const_cast(&index_ret); miqt_exec_callback_QCompleter_HighlightedWithIndex(slot, sigval1); }); } struct miqt_string* QCompleter_Tr2(const char* s, const char* c) { QString _ret = QCompleter::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QCompleter_Tr3(const char* s, const char* c, int n) { QString _ret = QCompleter::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(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QCompleter_TrUtf82(const char* s, const char* c) { QString _ret = QCompleter::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QCompleter_TrUtf83(const char* s, const char* c, int n) { QString _ret = QCompleter::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(); return miqt_strdup(_b.data(), _b.length()); } void QCompleter_Complete1(QCompleter* self, QRect* rect) { self->complete(*rect); } void QCompleter_Delete(QCompleter* self) { delete self; }