From 179c4c9c30f358af6a9c4cfb218cc55dd8fce693 Mon Sep 17 00:00:00 2001 From: st0pli <oyleme@gmail.com> Date: Mon, 30 Dec 2024 00:56:54 +0800 Subject: [PATCH] Add QVariant__Color support Add QVariant__Color support --- qt6/gen_qvariant.cpp | 5 +++++ qt6/gen_qvariant.go | 8 ++++++++ qt6/gen_qvariant.h | 3 +++ 3 files changed, 16 insertions(+) diff --git a/qt6/gen_qvariant.cpp b/qt6/gen_qvariant.cpp index c805302e..b3ea2cce 100644 --- a/qt6/gen_qvariant.cpp +++ b/qt6/gen_qvariant.cpp @@ -33,6 +33,7 @@ #include <QUuid> #include <QVariant> #include <QVariantConstPointer> +#include <QColor> #include <qvariant.h> #include "gen_qvariant.h" @@ -233,6 +234,10 @@ QVariant* QVariant_new42(QMetaType* typeVal, const void* copyVal) { return new QVariant(*typeVal, copyVal); } +QVariant* QVariant_new4099(QColor* color) { + return new QVariant(*color); +} + void QVariant_OperatorAssign(QVariant* self, QVariant* other) { self->operator=(*other); } diff --git a/qt6/gen_qvariant.go b/qt6/gen_qvariant.go index 6bec3e92..59a156b8 100644 --- a/qt6/gen_qvariant.go +++ b/qt6/gen_qvariant.go @@ -504,6 +504,14 @@ func NewQVariant42(typeVal QMetaType, copyVal unsafe.Pointer) *QVariant { return ret } +// NewQVariant4099 constructs a new QVariant object. +func NewQVariant4099(color *QColor) *QVariant { + + ret := newQVariant(C.QVariant_new4099(color.cPointer())) + ret.isSubclass = true + return ret +} + func (this *QVariant) OperatorAssign(other *QVariant) { C.QVariant_OperatorAssign(this.h, other.cPointer()) } diff --git a/qt6/gen_qvariant.h b/qt6/gen_qvariant.h index 78678823..7d93a3f2 100644 --- a/qt6/gen_qvariant.h +++ b/qt6/gen_qvariant.h @@ -44,6 +44,7 @@ class QUrl; class QUuid; class QVariant; class QVariantConstPointer; +class QColor; #else typedef struct QBitArray QBitArray; typedef struct QChar QChar; @@ -74,6 +75,7 @@ typedef struct QUrl QUrl; typedef struct QUuid QUuid; typedef struct QVariant QVariant; typedef struct QVariantConstPointer QVariantConstPointer; +typedef struct QColor QColor; #endif QVariant* QVariant_new(); @@ -118,6 +120,7 @@ QVariant* QVariant_new39(QModelIndex* modelIndex); QVariant* QVariant_new40(QPersistentModelIndex* modelIndex); QVariant* QVariant_new41(int typeVal); QVariant* QVariant_new42(QMetaType* typeVal, const void* copyVal); +QVariant* QVariant_new4099(QColor* color); void QVariant_OperatorAssign(QVariant* self, QVariant* other); void QVariant_Swap(QVariant* self, QVariant* other); int QVariant_UserType(const QVariant* self);