2024-08-25 04:08:24 +00:00
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <QHeaderView>
|
|
|
|
#include <QItemSelectionModel>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#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 <QTableView>
|
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qtableview.h"
|
|
|
|
#include "gen_qtableview.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QTableView* QTableView_new() {
|
|
|
|
return new QTableView();
|
|
|
|
}
|
|
|
|
|
|
|
|
QTableView* QTableView_new2(QWidget* parent) {
|
|
|
|
return new QTableView(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QTableView_MetaObject(const QTableView* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTableView_Tr(const char* s) {
|
|
|
|
QString _ret = QTableView::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* QTableView_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QTableView::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 QTableView_SetModel(QTableView* self, QAbstractItemModel* model) {
|
|
|
|
self->setModel(model);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetRootIndex(QTableView* self, QModelIndex* index) {
|
|
|
|
self->setRootIndex(*index);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetSelectionModel(QTableView* self, QItemSelectionModel* selectionModel) {
|
|
|
|
self->setSelectionModel(selectionModel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_DoItemsLayout(QTableView* self) {
|
|
|
|
self->doItemsLayout();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QHeaderView* QTableView_HorizontalHeader(const QTableView* self) {
|
|
|
|
return self->horizontalHeader();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QHeaderView* QTableView_VerticalHeader(const QTableView* self) {
|
|
|
|
return self->verticalHeader();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetHorizontalHeader(QTableView* self, QHeaderView* header) {
|
|
|
|
self->setHorizontalHeader(header);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetVerticalHeader(QTableView* self, QHeaderView* header) {
|
|
|
|
self->setVerticalHeader(header);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_RowViewportPosition(const QTableView* self, int row) {
|
|
|
|
return self->rowViewportPosition(static_cast<int>(row));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_RowAt(const QTableView* self, int y) {
|
|
|
|
return self->rowAt(static_cast<int>(y));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetRowHeight(QTableView* self, int row, int height) {
|
|
|
|
self->setRowHeight(static_cast<int>(row), static_cast<int>(height));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_RowHeight(const QTableView* self, int row) {
|
|
|
|
return self->rowHeight(static_cast<int>(row));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_ColumnViewportPosition(const QTableView* self, int column) {
|
|
|
|
return self->columnViewportPosition(static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_ColumnAt(const QTableView* self, int x) {
|
|
|
|
return self->columnAt(static_cast<int>(x));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetColumnWidth(QTableView* self, int column, int width) {
|
|
|
|
self->setColumnWidth(static_cast<int>(column), static_cast<int>(width));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_ColumnWidth(const QTableView* self, int column) {
|
|
|
|
return self->columnWidth(static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_IsRowHidden(const QTableView* self, int row) {
|
|
|
|
return self->isRowHidden(static_cast<int>(row));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetRowHidden(QTableView* self, int row, bool hide) {
|
|
|
|
self->setRowHidden(static_cast<int>(row), hide);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_IsColumnHidden(const QTableView* self, int column) {
|
|
|
|
return self->isColumnHidden(static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetColumnHidden(QTableView* self, int column, bool hide) {
|
|
|
|
self->setColumnHidden(static_cast<int>(column), hide);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetSortingEnabled(QTableView* self, bool enable) {
|
|
|
|
self->setSortingEnabled(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_IsSortingEnabled(const QTableView* self) {
|
|
|
|
return self->isSortingEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_ShowGrid(const QTableView* self) {
|
|
|
|
return self->showGrid();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QTableView_GridStyle(const QTableView* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::PenStyle _ret = self->gridStyle();
|
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 QTableView_SetGridStyle(QTableView* self, int style) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setGridStyle(static_cast<Qt::PenStyle>(style));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetWordWrap(QTableView* self, bool on) {
|
|
|
|
self->setWordWrap(on);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_WordWrap(const QTableView* self) {
|
|
|
|
return self->wordWrap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetCornerButtonEnabled(QTableView* self, bool enable) {
|
|
|
|
self->setCornerButtonEnabled(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTableView_IsCornerButtonEnabled(const QTableView* self) {
|
|
|
|
return self->isCornerButtonEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QTableView_VisualRect(const QTableView* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->visualRect(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QTableView_ScrollTo(QTableView* self, QModelIndex* index) {
|
|
|
|
self->scrollTo(*index);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QTableView_IndexAt(const QTableView* self, QPoint* p) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->indexAt(*p));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SetSpan(QTableView* self, int row, int column, int rowSpan, int columnSpan) {
|
|
|
|
self->setSpan(static_cast<int>(row), static_cast<int>(column), static_cast<int>(rowSpan), static_cast<int>(columnSpan));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_RowSpan(const QTableView* self, int row, int column) {
|
|
|
|
return self->rowSpan(static_cast<int>(row), static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTableView_ColumnSpan(const QTableView* self, int row, int column) {
|
|
|
|
return self->columnSpan(static_cast<int>(row), static_cast<int>(column));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ClearSpans(QTableView* self) {
|
|
|
|
self->clearSpans();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SelectRow(QTableView* self, int row) {
|
|
|
|
self->selectRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SelectColumn(QTableView* self, int column) {
|
|
|
|
self->selectColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_HideRow(QTableView* self, int row) {
|
|
|
|
self->hideRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_HideColumn(QTableView* self, int column) {
|
|
|
|
self->hideColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ShowRow(QTableView* self, int row) {
|
|
|
|
self->showRow(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ShowColumn(QTableView* self, int column) {
|
|
|
|
self->showColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ResizeRowToContents(QTableView* self, int row) {
|
|
|
|
self->resizeRowToContents(static_cast<int>(row));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ResizeRowsToContents(QTableView* self) {
|
|
|
|
self->resizeRowsToContents();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ResizeColumnToContents(QTableView* self, int column) {
|
|
|
|
self->resizeColumnToContents(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_ResizeColumnsToContents(QTableView* self) {
|
|
|
|
self->resizeColumnsToContents();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTableView_SortByColumn(QTableView* self, int column) {
|
|
|
|
self->sortByColumn(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QTableView_SortByColumn2(QTableView* self, int column, int order) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->sortByColumn(static_cast<int>(column), static_cast<Qt::SortOrder>(order));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QTableView_SetShowGrid(QTableView* self, bool show) {
|
|
|
|
self->setShowGrid(show);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTableView_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QTableView::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* QTableView_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QTableView::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* QTableView_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QTableView::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* QTableView_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QTableView::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-09-18 00:12:02 +00:00
|
|
|
void QTableView_ScrollTo2(QTableView* self, QModelIndex* index, int hint) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->scrollTo(*index, static_cast<QAbstractItemView::ScrollHint>(hint));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QTableView_Delete(QTableView* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|