Added support for creating a new QVariant given another and for assign operations
This commit is contained in:
parent
76894f3bc3
commit
3857a48d86
|
@ -146,6 +146,14 @@ void dos_qvariant_create_string(void** vptr, const char* value)
|
|||
*vptr = new QVariant(value);
|
||||
}
|
||||
|
||||
void dos_qvariant_create_qvariant(void** vptr, void* other)
|
||||
{
|
||||
auto newQVariant = new QVariant();
|
||||
auto otherQVariant = reinterpret_cast<QVariant*>(other);
|
||||
*newQVariant = *otherQVariant;
|
||||
*vptr = newQVariant;
|
||||
}
|
||||
|
||||
void dos_qvariant_create_qobject(void **vptr, void* value)
|
||||
{
|
||||
auto qobject = reinterpret_cast<QObject*>(value);
|
||||
|
@ -166,6 +174,13 @@ void dos_qvariant_delete(void *vptr)
|
|||
delete variant;
|
||||
}
|
||||
|
||||
void dos_qvariant_assign(void* vptr, void* other)
|
||||
{
|
||||
auto leftQVariant = reinterpret_cast<QVariant*>(vptr);
|
||||
auto rightQVariant = reinterpret_cast<QVariant*>(other);
|
||||
*leftQVariant = *rightQVariant;
|
||||
}
|
||||
|
||||
void dos_qvariant_toInt(void* vptr, int& value)
|
||||
{
|
||||
auto variant = reinterpret_cast<QVariant*>(vptr);
|
||||
|
|
|
@ -43,6 +43,7 @@ extern "C"
|
|||
void dos_qvariant_create_bool(void **vptr, bool value);
|
||||
void dos_qvariant_create_string(void **vptr, const char* value);
|
||||
void dos_qvariant_create_qobject(void **vptr, void* value);
|
||||
void dos_qvariant_create_qvariant(void **vptr, void* value);
|
||||
void dos_qvariant_toInt(void* vptr, int& value);
|
||||
void dos_qvariant_setInt(void* vptr, int value);
|
||||
void dos_qvariant_toBool(void* vptr, bool& value);
|
||||
|
@ -51,6 +52,7 @@ extern "C"
|
|||
void dos_qvariant_setString(void* vptr, const char* value);
|
||||
void dos_qvariant_isnull(void *vptr, bool& isNull);
|
||||
void dos_qvariant_delete(void *vptr);
|
||||
void dos_qvariant_assign(void* vptr, void* other);
|
||||
|
||||
// QObject
|
||||
void dos_qobject_create(void **vptr,
|
||||
|
|
Loading…
Reference in New Issue