MythTV master
v2titleInfoList.h
Go to the documentation of this file.
1
2// Program Name: titleInfoList.h
3// Created : June 14, 2013
4//
5// Copyright (c) 2013 Chris Pinkham <cpinkham@mythtv.org>
6//
7// Licensed under the GPL v2 or later, see COPYING for details
8//
10
11#ifndef V2TITLEINFOLIST_H_
12#define V2TITLEINFOLIST_H_
13
14#include <QVariantList>
15
17
18#include "v2titleInfo.h"
19
20class V2TitleInfoList : public QObject
21{
22 Q_OBJECT
23 Q_CLASSINFO( "Version", "1.0" );
24
25 Q_CLASSINFO( "TitleInfos", "type=V2TitleInfo");
26
27 SERVICE_PROPERTY2( QVariantList, TitleInfos );
28
29 public:
30
31 Q_INVOKABLE V2TitleInfoList(QObject *parent = nullptr)
32 : QObject( parent )
33 {
34 }
35
36 void Copy( const V2TitleInfoList *src )
37 {
38 CopyListContents< V2TitleInfo >( this, m_TitleInfos, src->m_TitleInfos );
39 }
40
42 {
43 // We must make sure the object added to the QVariantList has
44 // a parent of 'this'
45
46 auto *pObject = new V2TitleInfo( this );
47 m_TitleInfos.append( QVariant::fromValue<QObject *>( pObject ));
48
49 return pObject;
50 }
51
52 private:
54};
55
57
58#endif
V2TitleInfo * AddNewTitleInfo()
Q_INVOKABLE V2TitleInfoList(QObject *parent=nullptr)
SERVICE_PROPERTY2(QVariantList, TitleInfos)
Q_CLASSINFO("TitleInfos", "type=V2TitleInfo")
void Copy(const V2TitleInfoList *src)
Q_DISABLE_COPY(V2TitleInfoList)
Q_CLASSINFO("Version", "1.0")
Q_DECLARE_METATYPE(std::chrono::seconds)