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