MythTV  master
v2cutList.h
Go to the documentation of this file.
1 // Program Name: cutList.h
3 // Created : Mar. 09, 2014
4 //
5 // Copyright (c) 2014 team MythTV
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2CUTLIST_H_
12 #define V2CUTLIST_H_
13 
14 #include <QString>
15 #include <QVariantList>
16 
18 
19 #include "v2cutting.h"
20 
21 class V2CutList : public QObject
22 {
23  Q_OBJECT
24  Q_CLASSINFO( "Version", "1.0" );
25  Q_CLASSINFO( "Cuttings", "type=V2Cutting");
26 
27  SERVICE_PROPERTY2( QVariantList, Cuttings );
28 
29  public:
30 
31  static inline void InitializeCustomTypes();
32 
33  Q_INVOKABLE V2CutList(QObject *parent = nullptr)
34  : QObject ( parent )
35  {
36  }
37 
38  void Copy( const V2CutList *src )
39  {
40  CopyListContents< V2Cutting >( this, m_Cuttings, src->m_Cuttings );
41  }
42 
44  {
45  // We must make sure the object added to the QVariantList has
46  // a parent of 'this'
47 
48  auto *pObject = new V2Cutting( this );
49  m_Cuttings.append( QVariant::fromValue<QObject *>( pObject ));
50 
51  return pObject;
52  }
53 
54  private:
56 };
57 
59 
60 #endif
V2CutList::V2CutList
Q_INVOKABLE V2CutList(QObject *parent=nullptr)
Definition: v2cutList.h:33
V2CutList::AddNewCutting
V2Cutting * AddNewCutting()
Definition: v2cutList.h:43
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(std::chrono::seconds)
V2CutList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2CutList
Definition: v2cutList.h:21
V2CutList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2CutList)
V2CutList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, Cuttings)
mythhttpservice.h
V2CutList::Copy
void Copy(const V2CutList *src)
Definition: v2cutList.h:38
v2cutting.h
V2Cutting
Definition: v2cutting.h:19
V2CutList::InitializeCustomTypes
static void InitializeCustomTypes()