MythTV master
v2countryList.h
Go to the documentation of this file.
1#ifndef V2COUNTRYLIST_H_
2#define V2COUNTRYLIST_H_
3
4#include <QVariantList>
5
7#include "v2country.h"
8
9class V2CountryList : public QObject
10{
11 Q_OBJECT
12 Q_CLASSINFO( "version", "1.0" );
13
14 Q_CLASSINFO( "Countries", "type=V2Country");
15
16 SERVICE_PROPERTY2( QVariantList, Countries );
17
18 public:
19
20 Q_INVOKABLE V2CountryList(QObject *parent = nullptr)
21 : QObject( parent )
22 {
23 }
24
25 void Copy( const V2CountryList *src )
26 {
27 CopyListContents< V2Country >( this, m_Countries, src->m_Countries );
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 V2Country( this );
36 m_Countries.append( QVariant::fromValue<QObject *>( pObject ));
37
38 return pObject;
39 }
40
41 private:
43};
44
46
47#endif
Q_DISABLE_COPY(V2CountryList)
SERVICE_PROPERTY2(QVariantList, Countries)
Q_CLASSINFO("Countries", "type=V2Country")
Q_INVOKABLE V2CountryList(QObject *parent=nullptr)
Definition: v2countryList.h:20
V2Country * AddNewCountry()
Definition: v2countryList.h:30
void Copy(const V2CountryList *src)
Definition: v2countryList.h:25
Q_CLASSINFO("version", "1.0")
Q_DECLARE_METATYPE(std::chrono::seconds)