miqt/qt/gen_qlistwidget.cpp

648 lines
22 KiB
C++
Raw Normal View History

#include <QBrush>
#include <QColor>
#include <QDataStream>
#include <QDropEvent>
#include <QFont>
#include <QIcon>
#include <QItemSelectionModel>
#include <QList>
#include <QListWidget>
#include <QListWidgetItem>
#include <QMetaObject>
#include <QPoint>
#include <QRect>
#include <QSize>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QVariant>
#include <QWidget>
2024-08-29 07:01:51 +00:00
#include "qlistwidget.h"
2024-08-29 07:01:51 +00:00
#include "gen_qlistwidget.h"
extern "C" {
extern void miqt_exec_callback(void* cb, int argc, void* argv);
}
QListWidgetItem* QListWidgetItem_new() {
return new QListWidgetItem();
}
QListWidgetItem* QListWidgetItem_new2(const char* text, size_t text_Strlen) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(text_QString);
}
QListWidgetItem* QListWidgetItem_new3(QIcon* icon, const char* text, size_t text_Strlen) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(*icon, text_QString);
}
QListWidgetItem* QListWidgetItem_new4(QListWidgetItem* other) {
return new QListWidgetItem(*other);
}
QListWidgetItem* QListWidgetItem_new5(QListWidget* listview) {
return new QListWidgetItem(listview);
}
QListWidgetItem* QListWidgetItem_new6(QListWidget* listview, int typeVal) {
return new QListWidgetItem(listview, static_cast<int>(typeVal));
}
QListWidgetItem* QListWidgetItem_new7(const char* text, size_t text_Strlen, QListWidget* listview) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(text_QString, listview);
}
QListWidgetItem* QListWidgetItem_new8(const char* text, size_t text_Strlen, QListWidget* listview, int typeVal) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(text_QString, listview, static_cast<int>(typeVal));
}
QListWidgetItem* QListWidgetItem_new9(QIcon* icon, const char* text, size_t text_Strlen, QListWidget* listview) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(*icon, text_QString, listview);
}
QListWidgetItem* QListWidgetItem_new10(QIcon* icon, const char* text, size_t text_Strlen, QListWidget* listview, int typeVal) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
return new QListWidgetItem(*icon, text_QString, listview, static_cast<int>(typeVal));
}
QListWidgetItem* QListWidgetItem_Clone(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->clone();
}
QListWidget* QListWidgetItem_ListWidget(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->listWidget();
}
void QListWidgetItem_SetSelected(QListWidgetItem* self, bool selectVal) {
self->setSelected(selectVal);
}
bool QListWidgetItem_IsSelected(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->isSelected();
}
void QListWidgetItem_SetHidden(QListWidgetItem* self, bool hide) {
self->setHidden(hide);
}
bool QListWidgetItem_IsHidden(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->isHidden();
}
int QListWidgetItem_Flags(QListWidgetItem* self) {
Qt::ItemFlags ret = const_cast<const QListWidgetItem*>(self)->flags();
return static_cast<int>(ret);
}
void QListWidgetItem_SetFlags(QListWidgetItem* self, int flags) {
self->setFlags(static_cast<Qt::ItemFlags>(flags));
}
void QListWidgetItem_Text(QListWidgetItem* self, char** _out, int* _out_Strlen) {
2024-08-29 07:01:51 +00:00
QString ret = const_cast<const QListWidgetItem*>(self)->text();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QListWidgetItem_SetText(QListWidgetItem* self, const char* text, size_t text_Strlen) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
self->setText(text_QString);
}
QIcon* QListWidgetItem_Icon(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QIcon ret = const_cast<const QListWidgetItem*>(self)->icon();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QIcon*>(new QIcon(ret));
}
void QListWidgetItem_SetIcon(QListWidgetItem* self, QIcon* icon) {
self->setIcon(*icon);
}
void QListWidgetItem_StatusTip(QListWidgetItem* self, char** _out, int* _out_Strlen) {
2024-08-29 07:01:51 +00:00
QString ret = const_cast<const QListWidgetItem*>(self)->statusTip();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QListWidgetItem_SetStatusTip(QListWidgetItem* self, const char* statusTip, size_t statusTip_Strlen) {
QString statusTip_QString = QString::fromUtf8(statusTip, statusTip_Strlen);
self->setStatusTip(statusTip_QString);
}
void QListWidgetItem_ToolTip(QListWidgetItem* self, char** _out, int* _out_Strlen) {
2024-08-29 07:01:51 +00:00
QString ret = const_cast<const QListWidgetItem*>(self)->toolTip();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QListWidgetItem_SetToolTip(QListWidgetItem* self, const char* toolTip, size_t toolTip_Strlen) {
QString toolTip_QString = QString::fromUtf8(toolTip, toolTip_Strlen);
self->setToolTip(toolTip_QString);
}
void QListWidgetItem_WhatsThis(QListWidgetItem* self, char** _out, int* _out_Strlen) {
2024-08-29 07:01:51 +00:00
QString ret = const_cast<const QListWidgetItem*>(self)->whatsThis();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QListWidgetItem_SetWhatsThis(QListWidgetItem* self, const char* whatsThis, size_t whatsThis_Strlen) {
QString whatsThis_QString = QString::fromUtf8(whatsThis, whatsThis_Strlen);
self->setWhatsThis(whatsThis_QString);
}
QFont* QListWidgetItem_Font(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QFont ret = const_cast<const QListWidgetItem*>(self)->font();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QFont*>(new QFont(ret));
}
void QListWidgetItem_SetFont(QListWidgetItem* self, QFont* font) {
self->setFont(*font);
}
int QListWidgetItem_TextAlignment(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->textAlignment();
}
void QListWidgetItem_SetTextAlignment(QListWidgetItem* self, int alignment) {
self->setTextAlignment(static_cast<int>(alignment));
}
QColor* QListWidgetItem_BackgroundColor(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QColor ret = const_cast<const QListWidgetItem*>(self)->backgroundColor();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QColor*>(new QColor(ret));
}
void QListWidgetItem_SetBackgroundColor(QListWidgetItem* self, QColor* color) {
self->setBackgroundColor(*color);
}
QBrush* QListWidgetItem_Background(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QBrush ret = const_cast<const QListWidgetItem*>(self)->background();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QBrush*>(new QBrush(ret));
}
void QListWidgetItem_SetBackground(QListWidgetItem* self, QBrush* brush) {
self->setBackground(*brush);
}
QColor* QListWidgetItem_TextColor(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QColor ret = const_cast<const QListWidgetItem*>(self)->textColor();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QColor*>(new QColor(ret));
}
void QListWidgetItem_SetTextColor(QListWidgetItem* self, QColor* color) {
self->setTextColor(*color);
}
QBrush* QListWidgetItem_Foreground(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QBrush ret = const_cast<const QListWidgetItem*>(self)->foreground();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QBrush*>(new QBrush(ret));
}
void QListWidgetItem_SetForeground(QListWidgetItem* self, QBrush* brush) {
self->setForeground(*brush);
}
2024-08-29 07:01:51 +00:00
uintptr_t QListWidgetItem_CheckState(QListWidgetItem* self) {
Qt::CheckState ret = const_cast<const QListWidgetItem*>(self)->checkState();
return static_cast<uintptr_t>(ret);
}
void QListWidgetItem_SetCheckState(QListWidgetItem* self, uintptr_t state) {
self->setCheckState(static_cast<Qt::CheckState>(state));
}
QSize* QListWidgetItem_SizeHint(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
QSize ret = const_cast<const QListWidgetItem*>(self)->sizeHint();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QSize*>(new QSize(ret));
}
void QListWidgetItem_SetSizeHint(QListWidgetItem* self, QSize* size) {
self->setSizeHint(*size);
}
QVariant* QListWidgetItem_Data(QListWidgetItem* self, int role) {
2024-08-29 07:01:51 +00:00
QVariant ret = const_cast<const QListWidgetItem*>(self)->data(static_cast<int>(role));
// Copy-construct value returned type into heap-allocated copy
return static_cast<QVariant*>(new QVariant(ret));
}
void QListWidgetItem_SetData(QListWidgetItem* self, int role, QVariant* value) {
self->setData(static_cast<int>(role), *value);
}
bool QListWidgetItem_OperatorLesser(QListWidgetItem* self, QListWidgetItem* other) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->operator<(*other);
}
void QListWidgetItem_Read(QListWidgetItem* self, QDataStream* in) {
self->read(*in);
}
void QListWidgetItem_Write(QListWidgetItem* self, QDataStream* out) {
2024-08-29 07:01:51 +00:00
const_cast<const QListWidgetItem*>(self)->write(*out);
}
void QListWidgetItem_OperatorAssign(QListWidgetItem* self, QListWidgetItem* other) {
self->operator=(*other);
}
int QListWidgetItem_Type(QListWidgetItem* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidgetItem*>(self)->type();
}
void QListWidgetItem_Delete(QListWidgetItem* self) {
delete self;
}
QListWidget* QListWidget_new() {
return new QListWidget();
}
QListWidget* QListWidget_new2(QWidget* parent) {
return new QListWidget(parent);
}
QMetaObject* QListWidget_MetaObject(QListWidget* self) {
2024-08-29 07:01:51 +00:00
return (QMetaObject*) const_cast<const QListWidget*>(self)->metaObject();
}
2024-08-29 07:01:51 +00:00
void QListWidget_Tr(const char* s, char** _out, int* _out_Strlen) {
QString ret = QListWidget::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
2024-08-29 07:01:51 +00:00
void QListWidget_TrUtf8(const char* s, char** _out, int* _out_Strlen) {
QString ret = QListWidget::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QListWidget_SetSelectionModel(QListWidget* self, QItemSelectionModel* selectionModel) {
self->setSelectionModel(selectionModel);
}
QListWidgetItem* QListWidget_Item(QListWidget* self, int row) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->item(static_cast<int>(row));
}
int QListWidget_Row(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->row(item);
}
void QListWidget_InsertItem(QListWidget* self, int row, QListWidgetItem* item) {
self->insertItem(static_cast<int>(row), item);
}
void QListWidget_InsertItem2(QListWidget* self, int row, const char* label, size_t label_Strlen) {
QString label_QString = QString::fromUtf8(label, label_Strlen);
self->insertItem(static_cast<int>(row), label_QString);
}
void QListWidget_InsertItems(QListWidget* self, int row, char** labels, uint64_t* labels_Lengths, size_t labels_len) {
QList<QString> labels_QList;
labels_QList.reserve(labels_len);
for(size_t i = 0; i < labels_len; ++i) {
labels_QList.push_back(QString::fromUtf8(labels[i], labels_Lengths[i]));
}
self->insertItems(static_cast<int>(row), labels_QList);
}
void QListWidget_AddItem(QListWidget* self, const char* label, size_t label_Strlen) {
QString label_QString = QString::fromUtf8(label, label_Strlen);
self->addItem(label_QString);
}
void QListWidget_AddItemWithItem(QListWidget* self, QListWidgetItem* item) {
self->addItem(item);
}
void QListWidget_AddItems(QListWidget* self, char** labels, uint64_t* labels_Lengths, size_t labels_len) {
QList<QString> labels_QList;
labels_QList.reserve(labels_len);
for(size_t i = 0; i < labels_len; ++i) {
labels_QList.push_back(QString::fromUtf8(labels[i], labels_Lengths[i]));
}
self->addItems(labels_QList);
}
QListWidgetItem* QListWidget_TakeItem(QListWidget* self, int row) {
return self->takeItem(static_cast<int>(row));
}
int QListWidget_Count(QListWidget* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->count();
}
QListWidgetItem* QListWidget_CurrentItem(QListWidget* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->currentItem();
}
void QListWidget_SetCurrentItem(QListWidget* self, QListWidgetItem* item) {
self->setCurrentItem(item);
}
2024-08-29 07:01:51 +00:00
void QListWidget_SetCurrentItem2(QListWidget* self, QListWidgetItem* item, int command) {
self->setCurrentItem(item, static_cast<QItemSelectionModel::SelectionFlags>(command));
}
int QListWidget_CurrentRow(QListWidget* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->currentRow();
}
void QListWidget_SetCurrentRow(QListWidget* self, int row) {
self->setCurrentRow(static_cast<int>(row));
}
2024-08-29 07:01:51 +00:00
void QListWidget_SetCurrentRow2(QListWidget* self, int row, int command) {
self->setCurrentRow(static_cast<int>(row), static_cast<QItemSelectionModel::SelectionFlags>(command));
}
QListWidgetItem* QListWidget_ItemAt(QListWidget* self, QPoint* p) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->itemAt(*p);
}
QListWidgetItem* QListWidget_ItemAt2(QListWidget* self, int x, int y) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->itemAt(static_cast<int>(x), static_cast<int>(y));
}
QRect* QListWidget_VisualItemRect(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
QRect ret = const_cast<const QListWidget*>(self)->visualItemRect(item);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QRect*>(new QRect(ret));
}
2024-08-29 07:01:51 +00:00
void QListWidget_SortItems(QListWidget* self) {
self->sortItems();
}
void QListWidget_SetSortingEnabled(QListWidget* self, bool enable) {
self->setSortingEnabled(enable);
}
bool QListWidget_IsSortingEnabled(QListWidget* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->isSortingEnabled();
}
void QListWidget_EditItem(QListWidget* self, QListWidgetItem* item) {
self->editItem(item);
}
void QListWidget_OpenPersistentEditor(QListWidget* self, QListWidgetItem* item) {
self->openPersistentEditor(item);
}
void QListWidget_ClosePersistentEditor(QListWidget* self, QListWidgetItem* item) {
self->closePersistentEditor(item);
}
bool QListWidget_IsPersistentEditorOpen(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->isPersistentEditorOpen(item);
}
QWidget* QListWidget_ItemWidget(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->itemWidget(item);
}
void QListWidget_SetItemWidget(QListWidget* self, QListWidgetItem* item, QWidget* widget) {
self->setItemWidget(item, widget);
}
void QListWidget_RemoveItemWidget(QListWidget* self, QListWidgetItem* item) {
self->removeItemWidget(item);
}
bool QListWidget_IsItemSelected(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->isItemSelected(item);
}
void QListWidget_SetItemSelected(QListWidget* self, QListWidgetItem* item, bool selectVal) {
self->setItemSelected(item, selectVal);
}
void QListWidget_SelectedItems(QListWidget* self, QListWidgetItem*** _out, size_t* _out_len) {
2024-08-29 07:01:51 +00:00
QList<QListWidgetItem*> ret = const_cast<const QListWidget*>(self)->selectedItems();
// Convert QList<> from C++ memory to manually-managed C memory
QListWidgetItem** __out = static_cast<QListWidgetItem**>(malloc(sizeof(QListWidgetItem*) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
__out[i] = ret[i];
}
*_out = __out;
*_out_len = ret.length();
}
void QListWidget_FindItems(QListWidget* self, const char* text, size_t text_Strlen, int flags, QListWidgetItem*** _out, size_t* _out_len) {
QString text_QString = QString::fromUtf8(text, text_Strlen);
QList<QListWidgetItem*> ret = const_cast<const QListWidget*>(self)->findItems(text_QString, static_cast<Qt::MatchFlags>(flags));
// Convert QList<> from C++ memory to manually-managed C memory
QListWidgetItem** __out = static_cast<QListWidgetItem**>(malloc(sizeof(QListWidgetItem*) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
__out[i] = ret[i];
}
*_out = __out;
*_out_len = ret.length();
}
bool QListWidget_IsItemHidden(QListWidget* self, QListWidgetItem* item) {
2024-08-29 07:01:51 +00:00
return const_cast<const QListWidget*>(self)->isItemHidden(item);
}
void QListWidget_SetItemHidden(QListWidget* self, QListWidgetItem* item, bool hide) {
self->setItemHidden(item, hide);
}
void QListWidget_DropEvent(QListWidget* self, QDropEvent* event) {
self->dropEvent(event);
}
2024-08-29 07:01:51 +00:00
void QListWidget_ScrollToItem(QListWidget* self, QListWidgetItem* item) {
self->scrollToItem(item);
}
void QListWidget_Clear(QListWidget* self) {
self->clear();
}
void QListWidget_ItemPressed(QListWidget* self, QListWidgetItem* item) {
self->itemPressed(item);
}
void QListWidget_connect_ItemPressed(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemPressed), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemClicked(QListWidget* self, QListWidgetItem* item) {
self->itemClicked(item);
}
void QListWidget_connect_ItemClicked(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemClicked), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemDoubleClicked(QListWidget* self, QListWidgetItem* item) {
self->itemDoubleClicked(item);
}
void QListWidget_connect_ItemDoubleClicked(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemDoubleClicked), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemActivated(QListWidget* self, QListWidgetItem* item) {
self->itemActivated(item);
}
void QListWidget_connect_ItemActivated(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemActivated), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemEntered(QListWidget* self, QListWidgetItem* item) {
self->itemEntered(item);
}
void QListWidget_connect_ItemEntered(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemEntered), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemChanged(QListWidget* self, QListWidgetItem* item) {
self->itemChanged(item);
}
void QListWidget_connect_ItemChanged(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*)>(&QListWidget::itemChanged), self, [=](QListWidgetItem* item) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_CurrentItemChanged(QListWidget* self, QListWidgetItem* current, QListWidgetItem* previous) {
self->currentItemChanged(current, previous);
}
void QListWidget_connect_CurrentItemChanged(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(QListWidgetItem*, QListWidgetItem*)>(&QListWidget::currentItemChanged), self, [=](QListWidgetItem* current, QListWidgetItem* previous) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_CurrentTextChanged(QListWidget* self, const char* currentText, size_t currentText_Strlen) {
QString currentText_QString = QString::fromUtf8(currentText, currentText_Strlen);
self->currentTextChanged(currentText_QString);
}
void QListWidget_connect_CurrentTextChanged(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(const QString&)>(&QListWidget::currentTextChanged), self, [=](const QString& currentText) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_CurrentRowChanged(QListWidget* self, int currentRow) {
self->currentRowChanged(static_cast<int>(currentRow));
}
void QListWidget_connect_CurrentRowChanged(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)(int)>(&QListWidget::currentRowChanged), self, [=](int currentRow) {
miqt_exec_callback(slot, 0, nullptr);
});
}
void QListWidget_ItemSelectionChanged(QListWidget* self) {
self->itemSelectionChanged();
}
void QListWidget_connect_ItemSelectionChanged(QListWidget* self, void* slot) {
QListWidget::connect(self, static_cast<void (QListWidget::*)()>(&QListWidget::itemSelectionChanged), self, [=]() {
miqt_exec_callback(slot, 0, nullptr);
});
}
2024-08-29 07:01:51 +00:00
void QListWidget_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) {
QString ret = QListWidget::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
2024-08-29 07:01:51 +00:00
void QListWidget_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
QString ret = QListWidget::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();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
2024-08-29 07:01:51 +00:00
void QListWidget_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) {
QString ret = QListWidget::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
2024-08-29 07:01:51 +00:00
void QListWidget_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
QString ret = QListWidget::trUtf8(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();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
2024-08-29 07:01:51 +00:00
void QListWidget_SortItems1(QListWidget* self, uintptr_t order) {
self->sortItems(static_cast<Qt::SortOrder>(order));
}
void QListWidget_ScrollToItem2(QListWidget* self, QListWidgetItem* item, uintptr_t hint) {
self->scrollToItem(item, static_cast<QAbstractItemView::ScrollHint>(hint));
}
void QListWidget_Delete(QListWidget* self) {
delete self;
}