DOtherSide  0.7.1
C language library for creating bindings for the Qt QML language
Functions
QObject

Functions related to the QObject class. More...

Functions

DOS_API DosQMetaObjectdos_qobject_qmetaobject (void)
 Return QMetaObject associated to the QObject class. More...
 
DOS_API DosQObjectdos_qobject_create (void *dObjectPointer, DosQMetaObject *metaObject, DObjectCallback dObjectCallback)
 Create a new QObject. More...
 
DOS_API void dos_qobject_signal_emit (DosQObject *vptr, const char *name, int parametersCount, void **parameters)
 Emit a signal definited in a QObject. More...
 
DOS_API char * dos_qobject_objectName (const DosQObject *vptr)
 Return the DosQObject objectName. More...
 
DOS_API void dos_qobject_setObjectName (DosQObject *vptr, const char *name)
 Calls the QObject::setObjectName() function. More...
 
DOS_API void dos_qobject_delete (DosQObject *vptr)
 Free the memory allocated for the QObject. More...
 
DOS_API void dos_qobject_deleteLater (DosQObject *vptr)
 Free the memory allocated for the QObject in the next event loop cycle. More...
 
DOS_API DosQVariantdos_qobject_property (DosQObject *vptr, const char *propertyName)
 Read Value of a property by its name. More...
 
DOS_API bool dos_qobject_setProperty (DosQObject *vptr, const char *propertyName, DosQVariant *value)
 Write Value to a property by its name. More...
 
DOS_API char * dos_slot_macro (const char *str)
 Return the equivalent of SLOT(str) macro invokation. More...
 
DOS_API char * dos_signal_macro (const char *str)
 Return the equivalent of SIGNAL(str) macro invokation. More...
 
DOS_API void dos_qobject_connect_static (DosQObject *sender, const char *signal, DosQObject *receiver, const char *slot, DosQtConnectionType connection_type)
 Connect an object signal to another object signal or slot. More...
 
DOS_API void dos_qobject_disconnect_static (DosQObject *sender, const char *signal, DosQObject *receiver, const char *slot)
 Disconnect an object slot or signal from an object signal. More...
 

Detailed Description

Functions related to the QObject class.

Function Documentation

◆ dos_qobject_connect_static()

DOS_API void dos_qobject_connect_static ( DosQObject sender,
const char *  signal,
DosQObject receiver,
const char *  slot,
DosQtConnectionType  connection_type 
)

Connect an object signal to another object signal or slot.

Note
Use the dos_signal_macro o dos_slot_macro for property format the string arguments

◆ dos_qobject_create()

DOS_API DosQObject* dos_qobject_create ( void *  dObjectPointer,
DosQMetaObject metaObject,
DObjectCallback  dObjectCallback 
)

Create a new QObject.

Parameters
dObjectPointerThe pointer of the QObject in the binded language
metaObjectThe QMetaObject associated to the given QObject
dObjectCallbackThe callback called from QML whenever a slot or property should be in read, write or invoked
Returns
A new QObject
Note
The returned QObject should be freed by calling dos_qobject_delete()
The dObjectPointer is usefull for forwarding a property read/slot to the correct object in the binded language in the callback

◆ dos_qobject_delete()

DOS_API void dos_qobject_delete ( DosQObject vptr)

Free the memory allocated for the QObject.

Parameters
vptrThe QObject

◆ dos_qobject_deleteLater()

DOS_API void dos_qobject_deleteLater ( DosQObject vptr)

Free the memory allocated for the QObject in the next event loop cycle.

Parameters
vptrThe QObject

◆ dos_qobject_disconnect_static()

DOS_API void dos_qobject_disconnect_static ( DosQObject sender,
const char *  signal,
DosQObject receiver,
const char *  slot 
)

Disconnect an object slot or signal from an object signal.

Note
Use the dos_signal_macro o dos_slot_macro for property format the string arguments

◆ dos_qobject_objectName()

DOS_API char* dos_qobject_objectName ( const DosQObject vptr)

Return the DosQObject objectName.

Parameters
vptrThe DosQObject pointer
Returns
A string in UTF8 format
Note
The returned string should be freed using the dos_chararray_delete() function

◆ dos_qobject_property()

DOS_API DosQVariant* dos_qobject_property ( DosQObject vptr,
const char *  propertyName 
)

Read Value of a property by its name.

Parameters
vptrThe QObject
propertyNamethe Name of the property to be read
Returns
Value of the given property
Note
returns an empty QVariant if the propertyName does not exist

◆ dos_qobject_qmetaobject()

DOS_API DosQMetaObject* dos_qobject_qmetaobject ( void  )

Return QMetaObject associated to the QObject class.

Returns
The QMetaObject of the QObject class
Note
The returned QObject should be freed using dos_qmetaobject_delete().

◆ dos_qobject_setObjectName()

DOS_API void dos_qobject_setObjectName ( DosQObject vptr,
const char *  name 
)

Calls the QObject::setObjectName() function.

Parameters
vptrThe QObject
nameA pointer to an UTF-8 string
Note
The name string is owned by the caller thus it will not be deleted

◆ dos_qobject_setProperty()

DOS_API bool dos_qobject_setProperty ( DosQObject vptr,
const char *  propertyName,
DosQVariant value 
)

Write Value to a property by its name.

Parameters
vptrThe QObject
propertyNameThe Name of the property to be written
valueThe value to be written
Returns
Result as bool

◆ dos_qobject_signal_emit()

DOS_API void dos_qobject_signal_emit ( DosQObject vptr,
const char *  name,
int  parametersCount,
void **  parameters 
)

Emit a signal definited in a QObject.

Parameters
vptrThe QObject
nameThe signal name
parametersCountThe number of parameters in the parameters array
parametersAn array of DosQVariant with the values of signal arguments

◆ dos_signal_macro()

DOS_API char* dos_signal_macro ( const char *  str)

Return the equivalent of SIGNAL(str) macro invokation.

Note
The returned string should be freed by calling the dos_chararray_delete() function

◆ dos_slot_macro()

DOS_API char* dos_slot_macro ( const char *  str)

Return the equivalent of SLOT(str) macro invokation.

Note
The returned string should be free with dos_chararray_delete