#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gen_qgraphicswidget.h" #include "_cgo_export.h" QGraphicsWidget* QGraphicsWidget_new() { return new QGraphicsWidget(); } QGraphicsWidget* QGraphicsWidget_new2(QGraphicsItem* parent) { return new QGraphicsWidget(parent); } QGraphicsWidget* QGraphicsWidget_new3(QGraphicsItem* parent, int wFlags) { return new QGraphicsWidget(parent, static_cast(wFlags)); } QMetaObject* QGraphicsWidget_MetaObject(const QGraphicsWidget* self) { return (QMetaObject*) self->metaObject(); } void* QGraphicsWidget_Metacast(QGraphicsWidget* self, const char* param1) { return self->qt_metacast(param1); } struct miqt_string* QGraphicsWidget_Tr(const char* s) { QString _ret = QGraphicsWidget::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* QGraphicsWidget_TrUtf8(const char* s) { QString _ret = QGraphicsWidget::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()); } QGraphicsLayout* QGraphicsWidget_Layout(const QGraphicsWidget* self) { return self->layout(); } void QGraphicsWidget_SetLayout(QGraphicsWidget* self, QGraphicsLayout* layout) { self->setLayout(layout); } void QGraphicsWidget_AdjustSize(QGraphicsWidget* self) { self->adjustSize(); } int QGraphicsWidget_LayoutDirection(const QGraphicsWidget* self) { Qt::LayoutDirection _ret = self->layoutDirection(); return static_cast(_ret); } void QGraphicsWidget_SetLayoutDirection(QGraphicsWidget* self, int direction) { self->setLayoutDirection(static_cast(direction)); } void QGraphicsWidget_UnsetLayoutDirection(QGraphicsWidget* self) { self->unsetLayoutDirection(); } QStyle* QGraphicsWidget_Style(const QGraphicsWidget* self) { return self->style(); } void QGraphicsWidget_SetStyle(QGraphicsWidget* self, QStyle* style) { self->setStyle(style); } QFont* QGraphicsWidget_Font(const QGraphicsWidget* self) { return new QFont(self->font()); } void QGraphicsWidget_SetFont(QGraphicsWidget* self, QFont* font) { self->setFont(*font); } QPalette* QGraphicsWidget_Palette(const QGraphicsWidget* self) { return new QPalette(self->palette()); } void QGraphicsWidget_SetPalette(QGraphicsWidget* self, QPalette* palette) { self->setPalette(*palette); } bool QGraphicsWidget_AutoFillBackground(const QGraphicsWidget* self) { return self->autoFillBackground(); } void QGraphicsWidget_SetAutoFillBackground(QGraphicsWidget* self, bool enabled) { self->setAutoFillBackground(enabled); } void QGraphicsWidget_Resize(QGraphicsWidget* self, QSizeF* size) { self->resize(*size); } void QGraphicsWidget_Resize2(QGraphicsWidget* self, double w, double h) { self->resize(static_cast(w), static_cast(h)); } QSizeF* QGraphicsWidget_Size(const QGraphicsWidget* self) { return new QSizeF(self->size()); } void QGraphicsWidget_SetGeometry(QGraphicsWidget* self, QRectF* rect) { self->setGeometry(*rect); } void QGraphicsWidget_SetGeometry2(QGraphicsWidget* self, double x, double y, double w, double h) { self->setGeometry(static_cast(x), static_cast(y), static_cast(w), static_cast(h)); } QRectF* QGraphicsWidget_Rect(const QGraphicsWidget* self) { return new QRectF(self->rect()); } void QGraphicsWidget_SetContentsMargins(QGraphicsWidget* self, double left, double top, double right, double bottom) { self->setContentsMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom)); } void QGraphicsWidget_SetContentsMarginsWithMargins(QGraphicsWidget* self, QMarginsF* margins) { self->setContentsMargins(*margins); } void QGraphicsWidget_GetContentsMargins(const QGraphicsWidget* self, double* left, double* top, double* right, double* bottom) { self->getContentsMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom)); } void QGraphicsWidget_SetWindowFrameMargins(QGraphicsWidget* self, double left, double top, double right, double bottom) { self->setWindowFrameMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom)); } void QGraphicsWidget_SetWindowFrameMarginsWithMargins(QGraphicsWidget* self, QMarginsF* margins) { self->setWindowFrameMargins(*margins); } void QGraphicsWidget_GetWindowFrameMargins(const QGraphicsWidget* self, double* left, double* top, double* right, double* bottom) { self->getWindowFrameMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom)); } void QGraphicsWidget_UnsetWindowFrameMargins(QGraphicsWidget* self) { self->unsetWindowFrameMargins(); } QRectF* QGraphicsWidget_WindowFrameGeometry(const QGraphicsWidget* self) { return new QRectF(self->windowFrameGeometry()); } QRectF* QGraphicsWidget_WindowFrameRect(const QGraphicsWidget* self) { return new QRectF(self->windowFrameRect()); } int QGraphicsWidget_WindowFlags(const QGraphicsWidget* self) { Qt::WindowFlags _ret = self->windowFlags(); return static_cast(_ret); } int QGraphicsWidget_WindowType(const QGraphicsWidget* self) { Qt::WindowType _ret = self->windowType(); return static_cast(_ret); } void QGraphicsWidget_SetWindowFlags(QGraphicsWidget* self, int wFlags) { self->setWindowFlags(static_cast(wFlags)); } bool QGraphicsWidget_IsActiveWindow(const QGraphicsWidget* self) { return self->isActiveWindow(); } void QGraphicsWidget_SetWindowTitle(QGraphicsWidget* self, struct miqt_string* title) { QString title_QString = QString::fromUtf8(&title->data, title->len); self->setWindowTitle(title_QString); } struct miqt_string* QGraphicsWidget_WindowTitle(const QGraphicsWidget* self) { QString _ret = self->windowTitle(); // 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()); } int QGraphicsWidget_FocusPolicy(const QGraphicsWidget* self) { Qt::FocusPolicy _ret = self->focusPolicy(); return static_cast(_ret); } void QGraphicsWidget_SetFocusPolicy(QGraphicsWidget* self, int policy) { self->setFocusPolicy(static_cast(policy)); } void QGraphicsWidget_SetTabOrder(QGraphicsWidget* first, QGraphicsWidget* second) { QGraphicsWidget::setTabOrder(first, second); } QGraphicsWidget* QGraphicsWidget_FocusWidget(const QGraphicsWidget* self) { return self->focusWidget(); } int QGraphicsWidget_GrabShortcut(QGraphicsWidget* self, QKeySequence* sequence) { return self->grabShortcut(*sequence); } void QGraphicsWidget_ReleaseShortcut(QGraphicsWidget* self, int id) { self->releaseShortcut(static_cast(id)); } void QGraphicsWidget_SetShortcutEnabled(QGraphicsWidget* self, int id) { self->setShortcutEnabled(static_cast(id)); } void QGraphicsWidget_SetShortcutAutoRepeat(QGraphicsWidget* self, int id) { self->setShortcutAutoRepeat(static_cast(id)); } void QGraphicsWidget_AddAction(QGraphicsWidget* self, QAction* action) { self->addAction(action); } void QGraphicsWidget_AddActions(QGraphicsWidget* self, struct miqt_array* /* of QAction* */ actions) { QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { actions_QList.push_back(actions_arr[i]); } self->addActions(actions_QList); } void QGraphicsWidget_InsertActions(QGraphicsWidget* self, QAction* before, struct miqt_array* /* of QAction* */ actions) { QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { actions_QList.push_back(actions_arr[i]); } self->insertActions(before, actions_QList); } void QGraphicsWidget_InsertAction(QGraphicsWidget* self, QAction* before, QAction* action) { self->insertAction(before, action); } void QGraphicsWidget_RemoveAction(QGraphicsWidget* self, QAction* action) { self->removeAction(action); } struct miqt_array* QGraphicsWidget_Actions(const QGraphicsWidget* self) { QList _ret = self->actions(); // Convert QList<> from C++ memory to manually-managed C memory QAction** _arr = static_cast(malloc(sizeof(QAction*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } void QGraphicsWidget_SetAttribute(QGraphicsWidget* self, int attribute) { self->setAttribute(static_cast(attribute)); } bool QGraphicsWidget_TestAttribute(const QGraphicsWidget* self, int attribute) { return self->testAttribute(static_cast(attribute)); } int QGraphicsWidget_Type(const QGraphicsWidget* self) { return self->type(); } void QGraphicsWidget_Paint(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option) { self->paint(painter, option); } void QGraphicsWidget_PaintWindowFrame(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option) { self->paintWindowFrame(painter, option); } QRectF* QGraphicsWidget_BoundingRect(const QGraphicsWidget* self) { return new QRectF(self->boundingRect()); } QPainterPath* QGraphicsWidget_Shape(const QGraphicsWidget* self) { return new QPainterPath(self->shape()); } void QGraphicsWidget_GeometryChanged(QGraphicsWidget* self) { self->geometryChanged(); } void QGraphicsWidget_connect_GeometryChanged(QGraphicsWidget* self, intptr_t slot) { QGraphicsWidget::connect(self, static_cast(&QGraphicsWidget::geometryChanged), self, [=]() { miqt_exec_callback_QGraphicsWidget_GeometryChanged(slot); }); } void QGraphicsWidget_LayoutChanged(QGraphicsWidget* self) { self->layoutChanged(); } void QGraphicsWidget_connect_LayoutChanged(QGraphicsWidget* self, intptr_t slot) { QGraphicsWidget::connect(self, static_cast(&QGraphicsWidget::layoutChanged), self, [=]() { miqt_exec_callback_QGraphicsWidget_LayoutChanged(slot); }); } bool QGraphicsWidget_Close(QGraphicsWidget* self) { return self->close(); } struct miqt_string* QGraphicsWidget_Tr2(const char* s, const char* c) { QString _ret = QGraphicsWidget::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* QGraphicsWidget_Tr3(const char* s, const char* c, int n) { QString _ret = QGraphicsWidget::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* QGraphicsWidget_TrUtf82(const char* s, const char* c) { QString _ret = QGraphicsWidget::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* QGraphicsWidget_TrUtf83(const char* s, const char* c, int n) { QString _ret = QGraphicsWidget::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()); } int QGraphicsWidget_GrabShortcut2(QGraphicsWidget* self, QKeySequence* sequence, int context) { return self->grabShortcut(*sequence, static_cast(context)); } void QGraphicsWidget_SetShortcutEnabled2(QGraphicsWidget* self, int id, bool enabled) { self->setShortcutEnabled(static_cast(id), enabled); } void QGraphicsWidget_SetShortcutAutoRepeat2(QGraphicsWidget* self, int id, bool enabled) { self->setShortcutAutoRepeat(static_cast(id), enabled); } void QGraphicsWidget_SetAttribute2(QGraphicsWidget* self, int attribute, bool on) { self->setAttribute(static_cast(attribute), on); } void QGraphicsWidget_Paint3(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) { self->paint(painter, option, widget); } void QGraphicsWidget_PaintWindowFrame3(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) { self->paintWindowFrame(painter, option, widget); } void QGraphicsWidget_Delete(QGraphicsWidget* self) { delete self; }