MythTV  master
v2videoSourceList.h
Go to the documentation of this file.
1 #ifndef V2VIDEOSOURCELIST_H_
2 #define V2VIDEOSOURCELIST_H_
3 
4 #include <QVariantList>
5 #include <QDateTime>
6 
8 
9 #include "v2videoSource.h"
10 
11 
12 class V2VideoSourceList : public QObject
13 {
14  Q_OBJECT
15  Q_CLASSINFO( "Version", "1.0" );
16 
17  Q_CLASSINFO( "VideoSources", "type=V2VideoSource");
18  Q_CLASSINFO( "AsOf" , "transient=true" );
19 
20 
21  SERVICE_PROPERTY2( QDateTime , AsOf )
22  SERVICE_PROPERTY2( QString , Version )
23  SERVICE_PROPERTY2( QString , ProtoVer )
24  SERVICE_PROPERTY2( QVariantList, VideoSources )
25 
26  public:
27 
28  Q_INVOKABLE V2VideoSourceList(QObject *parent = nullptr)
29  : QObject( parent )
30  {
31  }
32 
33  void Copy( const V2VideoSourceList *src )
34  {
35  m_AsOf = src->m_AsOf ;
36  m_Version = src->m_Version ;
37  m_ProtoVer = src->m_ProtoVer ;
38 
39  CopyListContents< V2VideoSource >( this, m_VideoSources, src->m_VideoSources );
40  }
41 
43  {
44  // We must make sure the object added to the QVariantList has
45  // a parent of 'this'
46 
47  auto *pObject = new V2VideoSource( this );
48  m_VideoSources.append( QVariant::fromValue<QObject *>( pObject ));
49 
50  return pObject;
51  }
52 
53  private:
55 };
56 
58 
59 #endif
V2VideoSourceList::AddNewVideoSource
V2VideoSource * AddNewVideoSource()
Definition: v2videoSourceList.h:42
V2VideoSourceList
Definition: v2videoSourceList.h:12
V2VideoSourceList::Copy
void Copy(const V2VideoSourceList *src)
Definition: v2videoSourceList.h:33
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2VideoSourceList::V2VideoSourceList
Q_INVOKABLE V2VideoSourceList(QObject *parent=nullptr)
Definition: v2videoSourceList.h:28
v2videoSource.h
SERVICE_PROPERTY2
#define SERVICE_PROPERTY2(Type, Name)
Definition: mythhttpservice.h:72
mythhttpservice.h
V2VideoSourceList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2VideoSourceList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2VideoSourceList)
V2VideoSource
Definition: v2videoSource.h:10