13 #ifndef __PLUGIN_API_EXCERPT_H__ 14 #define __PLUGIN_API_EXCERPT_H__ 69 template <
class Wrapper,
class T>
72 Wrapper* w = t ?
new Wrapper(t) :
nullptr;
74 QQmlEngine::setObjectOwnership(w, QQmlEngine::JavaScriptOwnership);
90 template <
typename T,
class Container>
94 : QQmlListProperty<T>(obj, &container, &count, &at) {};
96 static int count(QQmlListProperty<T>* l) {
return int(static_cast<Container*>(l->data)->size()); }
97 static T*
at(QQmlListProperty<T>* l,
int i) {
return excerptWrap<T>(
static_cast<Container*
>(l->data)->
at(i)); }
101 template<
typename T,
class Container>
Wrapper * excerptWrap(T *t)
Definition: excerpt.h:70
static T * at(QQmlListProperty< T > *l, int i)
Definition: excerpt.h:97
QString title() const
Definition: excerpt.h:64
Excerpt(Ms::Excerpt *_e=nullptr)
Definition: excerpt.h:49
Definition: aeolus.cpp:26
QmlExcerptsListAccess< T, Container > wrapExcerptsContainerProperty(QObject *obj, Container &c)
Definition: excerpt.h:102
Ms::Excerpt *const e
Definition: excerpt.h:44
static int count(QQmlListProperty< T > *l)
Definition: excerpt.h:96
QmlExcerptsListAccess(QObject *obj, Container &container)
Definition: excerpt.h:93
QString title()
Definition: excerpt.h:56
virtual ~Excerpt()
Definition: excerpt.h:53
Excerpt & operator=(const Excerpt &)=delete
Q_INVOKABLE bool is(Ms::PluginAPI::Excerpt *other)
Checks whether two variables represent the same object.
Definition: excerpt.h:60