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