MythTV master
v2cutList.h
Go to the documentation of this file.
1
2// 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
21class 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
static void InitializeCustomTypes()
Q_CLASSINFO("Version", "1.0")
void Copy(const V2CutList *src)
Definition: v2cutList.h:38
V2Cutting * AddNewCutting()
Definition: v2cutList.h:43
Q_DISABLE_COPY(V2CutList)
Q_CLASSINFO("Cuttings", "type=V2Cutting")
SERVICE_PROPERTY2(QVariantList, Cuttings)
Q_INVOKABLE V2CutList(QObject *parent=nullptr)
Definition: v2cutList.h:33
Q_DECLARE_METATYPE(std::chrono::seconds)