MythTV master
v2languageList.h
Go to the documentation of this file.
1#ifndef V2LANGUAGELIST_H_
2#define V2LANGUAGELIST_H_
3
4#include <QVariantList>
5
7#include "v2language.h"
8
9class V2LanguageList : public QObject
10{
11 Q_OBJECT
12 Q_CLASSINFO( "version", "1.0" );
13
14 Q_CLASSINFO( "Languages", "type=V2Language");
15
16 SERVICE_PROPERTY2( QVariantList, Languages );
17
18 public:
19
20 Q_INVOKABLE V2LanguageList(QObject *parent = nullptr)
21 : QObject( parent )
22 {
23 }
24
25 void Copy( const V2LanguageList *src )
26 {
27 CopyListContents< V2Language >( this, m_Languages, src->m_Languages );
28 }
29
31 {
32 // We must make sure the object added to the QVariantList has
33 // a parent of 'this'
34
35 auto *pObject = new V2Language( this );
36 m_Languages.append( QVariant::fromValue<QObject *>( pObject ));
37
38 return pObject;
39 }
40
41 private:
43};
44
46
47#endif
Q_INVOKABLE V2LanguageList(QObject *parent=nullptr)
Q_DISABLE_COPY(V2LanguageList)
Q_CLASSINFO("version", "1.0")
Q_CLASSINFO("Languages", "type=V2Language")
V2Language * AddNewLanguage()
SERVICE_PROPERTY2(QVariantList, Languages)
void Copy(const V2LanguageList *src)
Q_DECLARE_METATYPE(std::chrono::seconds)