Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Q_PROPERTY(QQmlListProperty<$type$> $list_name$ READ $list_name$ NOTIFY $list_name$Changed)
- public:
- QQmlListProperty<$type$> $list_name$()
- {
- return QQmlListProperty<$type$>(this,
- this,
- &$%{CurrentDocument:FileBaseName}$::append$list_name:c$,
- &$%{CurrentDocument:FileBaseName}$::$list_name$Count,
- &$%{CurrentDocument:FileBaseName}$::$list_name$ByIndex,
- &$%{CurrentDocument:FileBaseName}$::clear$list_name:c$);
- }
- void append$list_name:c$($type$ * item)
- {
- /* TODO: implement*/
- }
- int $list_name$Count() const
- {
- /* TODO: implement*/
- }
- $type$ * $list_name$ByIndex(int index) const
- {
- /* TODO: implement*/
- }
- void clear$list_name:c$()
- {
- /* TODO: implement*/
- }
- signals:
- void $list_name$Changed(QQmlListProperty<$type$> $list_name$);
- private:
- static void append$list_name:c$(QQmlListProperty<$type$> * list, $type$ * item)
- {
- reinterpret_cast<$%{CurrentDocument:FileBaseName}$*>(list->data)->append$list_name:c$(item);
- }
- static int $list_name$Count(QQmlListProperty<$type$> * list)
- {
- return reinterpret_cast<$%{CurrentDocument:FileBaseName}$*>(list->data)->$list_name$Count();
- }
- static $type$* $list_name$ByIndex(QQmlListProperty<$type$> * list, int index)
- {
- return reinterpret_cast<$%{CurrentDocument:FileBaseName}$*>(list->data)->$list_name$ByIndex(index);
- }
- static void clear$list_name:c$(QQmlListProperty<$type$> * list)
- {
- reinterpret_cast<$%{CurrentDocument:FileBaseName}$*>(list->data)->clear$list_name:c$();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement