2024-08-25 04:08:24 +00:00
|
|
|
#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>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QVariant>
|
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qlistwidget.h"
|
|
|
|
#include "gen_qlistwidget.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QListWidgetItem* QListWidgetItem_new() {
|
|
|
|
return new QListWidgetItem();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new2(struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QListWidgetItem(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new3(QIcon* icon, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new7(struct miqt_string* text, QListWidget* listview) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QListWidgetItem(text_QString, listview);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new8(struct miqt_string* text, QListWidget* listview, int typeVal) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QListWidgetItem(text_QString, listview, static_cast<int>(typeVal));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new9(QIcon* icon, struct miqt_string* text, QListWidget* listview) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QListWidgetItem(*icon, text_QString, listview);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_new10(QIcon* icon, struct miqt_string* text, QListWidget* listview, int typeVal) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QListWidgetItem(*icon, text_QString, listview, static_cast<int>(typeVal));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidgetItem* QListWidgetItem_Clone(const QListWidgetItem* self) {
|
|
|
|
return self->clone();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidget* QListWidgetItem_ListWidget(const QListWidgetItem* self) {
|
|
|
|
return self->listWidget();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetSelected(QListWidgetItem* self, bool selectVal) {
|
|
|
|
self->setSelected(selectVal);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidgetItem_IsSelected(const QListWidgetItem* self) {
|
|
|
|
return self->isSelected();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetHidden(QListWidgetItem* self, bool hide) {
|
|
|
|
self->setHidden(hide);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidgetItem_IsHidden(const QListWidgetItem* self) {
|
|
|
|
return self->isHidden();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidgetItem_Flags(const QListWidgetItem* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetFlags(QListWidgetItem* self, int flags) {
|
|
|
|
self->setFlags(static_cast<Qt::ItemFlags>(flags));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidgetItem_Text(const QListWidgetItem* self) {
|
|
|
|
QString _ret = self->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
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QListWidgetItem_SetText(QListWidgetItem* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setText(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIcon* QListWidgetItem_Icon(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QIcon(self->icon());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetIcon(QListWidgetItem* self, QIcon* icon) {
|
|
|
|
self->setIcon(*icon);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidgetItem_StatusTip(const QListWidgetItem* self) {
|
|
|
|
QString _ret = self->statusTip();
|
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
|
|
|
void QListWidgetItem_SetStatusTip(QListWidgetItem* self, struct miqt_string* statusTip) {
|
|
|
|
QString statusTip_QString = QString::fromUtf8(&statusTip->data, statusTip->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setStatusTip(statusTip_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidgetItem_ToolTip(const QListWidgetItem* self) {
|
|
|
|
QString _ret = self->toolTip();
|
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
|
|
|
void QListWidgetItem_SetToolTip(QListWidgetItem* self, struct miqt_string* toolTip) {
|
|
|
|
QString toolTip_QString = QString::fromUtf8(&toolTip->data, toolTip->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setToolTip(toolTip_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidgetItem_WhatsThis(const QListWidgetItem* self) {
|
|
|
|
QString _ret = self->whatsThis();
|
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
|
|
|
void QListWidgetItem_SetWhatsThis(QListWidgetItem* self, struct miqt_string* whatsThis) {
|
|
|
|
QString whatsThis_QString = QString::fromUtf8(&whatsThis->data, whatsThis->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setWhatsThis(whatsThis_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFont* QListWidgetItem_Font(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(self->font());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetFont(QListWidgetItem* self, QFont* font) {
|
|
|
|
self->setFont(*font);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidgetItem_TextAlignment(const QListWidgetItem* self) {
|
|
|
|
return self->textAlignment();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetTextAlignment(QListWidgetItem* self, int alignment) {
|
|
|
|
self->setTextAlignment(static_cast<int>(alignment));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QListWidgetItem_BackgroundColor(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->backgroundColor());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetBackgroundColor(QListWidgetItem* self, QColor* color) {
|
|
|
|
self->setBackgroundColor(*color);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QBrush* QListWidgetItem_Background(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QBrush(self->background());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetBackground(QListWidgetItem* self, QBrush* brush) {
|
|
|
|
self->setBackground(*brush);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QListWidgetItem_TextColor(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->textColor());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetTextColor(QListWidgetItem* self, QColor* color) {
|
|
|
|
self->setTextColor(*color);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QBrush* QListWidgetItem_Foreground(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QBrush(self->foreground());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetForeground(QListWidgetItem* self, QBrush* brush) {
|
|
|
|
self->setForeground(*brush);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QListWidgetItem_CheckState(const QListWidgetItem* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::CheckState _ret = self->checkState();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetCheckState(QListWidgetItem* self, uintptr_t state) {
|
|
|
|
self->setCheckState(static_cast<Qt::CheckState>(state));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QListWidgetItem_SizeHint(const QListWidgetItem* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->sizeHint());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetSizeHint(QListWidgetItem* self, QSize* size) {
|
|
|
|
self->setSizeHint(*size);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QListWidgetItem_Data(const QListWidgetItem* self, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_SetData(QListWidgetItem* self, int role, QVariant* value) {
|
|
|
|
self->setData(static_cast<int>(role), *value);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidgetItem_OperatorLesser(const QListWidgetItem* self, QListWidgetItem* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_Read(QListWidgetItem* self, QDataStream* in) {
|
|
|
|
self->read(*in);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QListWidgetItem_Write(const QListWidgetItem* self, QDataStream* out) {
|
|
|
|
self->write(*out);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_OperatorAssign(QListWidgetItem* self, QListWidgetItem* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidgetItem_Type(const QListWidgetItem* self) {
|
|
|
|
return self->type();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidgetItem_Delete(QListWidgetItem* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QListWidget* QListWidget_new() {
|
|
|
|
return new QListWidget();
|
|
|
|
}
|
|
|
|
|
|
|
|
QListWidget* QListWidget_new2(QWidget* parent) {
|
|
|
|
return new QListWidget(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QListWidget_MetaObject(const QListWidget* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidget_Tr(const char* s) {
|
|
|
|
QString _ret = QListWidget::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* QListWidget_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QListWidget::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
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_SetSelectionModel(QListWidget* self, QItemSelectionModel* selectionModel) {
|
|
|
|
self->setSelectionModel(selectionModel);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidgetItem* QListWidget_Item(const QListWidget* self, int row) {
|
|
|
|
return self->item(static_cast<int>(row));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidget_Row(const QListWidget* self, QListWidgetItem* item) {
|
|
|
|
return self->row(item);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_InsertItem(QListWidget* self, int row, QListWidgetItem* item) {
|
|
|
|
self->insertItem(static_cast<int>(row), item);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QListWidget_InsertItem2(QListWidget* self, int row, struct miqt_string* label) {
|
|
|
|
QString label_QString = QString::fromUtf8(&label->data, label->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->insertItem(static_cast<int>(row), label_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QListWidget_InsertItems(QListWidget* self, int row, struct miqt_array* /* of struct miqt_string* */ labels) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QString> labels_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
labels_QList.reserve(labels->len);
|
|
|
|
miqt_string** labels_arr = static_cast<miqt_string**>(labels->data);
|
|
|
|
for(size_t i = 0; i < labels->len; ++i) {
|
|
|
|
labels_QList.push_back(QString::fromUtf8(& labels_arr[i]->data, labels_arr[i]->len));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->insertItems(static_cast<int>(row), labels_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QListWidget_AddItem(QListWidget* self, struct miqt_string* label) {
|
|
|
|
QString label_QString = QString::fromUtf8(&label->data, label->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->addItem(label_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_AddItemWithItem(QListWidget* self, QListWidgetItem* item) {
|
|
|
|
self->addItem(item);
|
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QListWidget_AddItems(QListWidget* self, struct miqt_array* /* of struct miqt_string* */ labels) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QString> labels_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
labels_QList.reserve(labels->len);
|
|
|
|
miqt_string** labels_arr = static_cast<miqt_string**>(labels->data);
|
|
|
|
for(size_t i = 0; i < labels->len; ++i) {
|
|
|
|
labels_QList.push_back(QString::fromUtf8(& labels_arr[i]->data, labels_arr[i]->len));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->addItems(labels_QList);
|
|
|
|
}
|
|
|
|
|
|
|
|
QListWidgetItem* QListWidget_TakeItem(QListWidget* self, int row) {
|
|
|
|
return self->takeItem(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidget_Count(const QListWidget* self) {
|
|
|
|
return self->count();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidgetItem* QListWidget_CurrentItem(const QListWidget* self) {
|
|
|
|
return self->currentItem();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QListWidget_CurrentRow(const QListWidget* self) {
|
|
|
|
return self->currentRow();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidgetItem* QListWidget_ItemAt(const QListWidget* self, QPoint* p) {
|
|
|
|
return self->itemAt(*p);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QListWidgetItem* QListWidget_ItemAt2(const QListWidget* self, int x, int y) {
|
|
|
|
return self->itemAt(static_cast<int>(x), static_cast<int>(y));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QListWidget_VisualItemRect(const QListWidget* self, QListWidgetItem* item) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->visualItemRect(item));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QListWidget_SortItems(QListWidget* self) {
|
|
|
|
self->sortItems();
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QListWidget_SetSortingEnabled(QListWidget* self, bool enable) {
|
|
|
|
self->setSortingEnabled(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidget_IsSortingEnabled(const QListWidget* self) {
|
|
|
|
return self->isSortingEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidget_IsPersistentEditorOpen(const QListWidget* self, QListWidgetItem* item) {
|
|
|
|
return self->isPersistentEditorOpen(item);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QWidget* QListWidget_ItemWidget(const QListWidget* self, QListWidgetItem* item) {
|
|
|
|
return self->itemWidget(item);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_SetItemWidget(QListWidget* self, QListWidgetItem* item, QWidget* widget) {
|
|
|
|
self->setItemWidget(item, widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_RemoveItemWidget(QListWidget* self, QListWidgetItem* item) {
|
|
|
|
self->removeItemWidget(item);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidget_IsItemSelected(const QListWidget* self, QListWidgetItem* item) {
|
|
|
|
return self->isItemSelected(item);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QListWidget_SetItemSelected(QListWidget* self, QListWidgetItem* item, bool selectVal) {
|
|
|
|
self->setItemSelected(item, selectVal);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QListWidget_SelectedItems(const QListWidget* self) {
|
|
|
|
QList<QListWidgetItem*> _ret = self->selectedItems();
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem** _arr = static_cast<QListWidgetItem**>(malloc(sizeof(QListWidgetItem*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QListWidget_FindItems(const QListWidget* self, struct miqt_string* text, int flags) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
|
|
|
QList<QListWidgetItem*> _ret = self->findItems(text_QString, static_cast<Qt::MatchFlags>(flags));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem** _arr = static_cast<QListWidgetItem**>(malloc(sizeof(QListWidgetItem*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QListWidget_IsItemHidden(const QListWidget* self, QListWidgetItem* item) {
|
|
|
|
return self->isItemHidden(item);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemPressed(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemClicked(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemDoubleClicked(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemActivated(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemEntered(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = item;
|
|
|
|
miqt_exec_callback_QListWidget_ItemChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QListWidgetItem* sigval1 = current;
|
|
|
|
QListWidgetItem* sigval2 = previous;
|
|
|
|
miqt_exec_callback_QListWidget_CurrentItemChanged(slot, sigval1, sigval2);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QListWidget_CurrentTextChanged(QListWidget* self, struct miqt_string* currentText) {
|
|
|
|
QString currentText_QString = QString::fromUtf8(¤tText->data, currentText->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString currentText_ret = currentText;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray currentText_b = currentText_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(currentText_b.data(), currentText_b.length());
|
|
|
|
miqt_exec_callback_QListWidget_CurrentTextChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
int sigval1 = currentRow;
|
|
|
|
miqt_exec_callback_QListWidget_CurrentRowChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QListWidget_ItemSelectionChanged(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QListWidget_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QListWidget::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* QListWidget_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QListWidget::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* QListWidget_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QListWidget::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* QListWidget_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QListWidget::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
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QListWidget_Delete(QListWidget* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|