ugluk
22nd January 2013, 11:12
Is it possible? All my attempts have failed, specifically:
class BSFontLoader
: public QObject
{
Q_OBJECT
Q_ENUMS(Status)
Q_PROPERTY(QVariantList sources READ sources WRITE setSources)
Q_CLASSINFO("DefaultProperty", "sources")
...
}
Doing:
FontLoader {
"example.ttf"
"bla.ttf"
}
Does not work.
Added after 19 minutes:
I see:
This marks property as the class's default property. property must be either an object property, or a list property.
But a QVariantList is neither.
class BSFontLoader
: public QObject
{
Q_OBJECT
Q_ENUMS(Status)
Q_PROPERTY(QVariantList sources READ sources WRITE setSources)
Q_CLASSINFO("DefaultProperty", "sources")
...
}
Doing:
FontLoader {
"example.ttf"
"bla.ttf"
}
Does not work.
Added after 19 minutes:
I see:
This marks property as the class's default property. property must be either an object property, or a list property.
But a QVariantList is neither.