mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 19:14:06 +02:00
Check if a NULL pointer should be converted into a QVariant
This commit is contained in:
@@ -36,8 +36,13 @@ QVariantMap
|
|||||||
qobject2qvariant( const QObject* object )
|
qobject2qvariant( const QObject* object )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||||
const QMetaObject* metaObject = object->metaObject();
|
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
|
if ( object == NULL )
|
||||||
|
{
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QMetaObject* metaObject = object->metaObject();
|
||||||
for ( int i = 0; i < metaObject->propertyCount(); ++i )
|
for ( int i = 0; i < metaObject->propertyCount(); ++i )
|
||||||
{
|
{
|
||||||
QMetaProperty metaproperty = metaObject->property( i );
|
QMetaProperty metaproperty = metaObject->property( i );
|
||||||
|
Reference in New Issue
Block a user