MythTV  master
v2markupList.h
Go to the documentation of this file.
1 // Program Name: markupList.h
3 // Created : Apr. 4, 2021
4 //
5 // Copyright (c) 2021 team MythTV
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2MARKUPLIST_H_
12 #define V2MARKUPLIST_H_
13 
14 #include <QString>
15 #include <QVariantList>
16 
18 
19 #include "v2markup.h"
20 
21 class V2MarkupList : public QObject
22 {
23  Q_OBJECT
24  Q_CLASSINFO( "Version", "1.0" );
25 
26  Q_CLASSINFO( "Mark", "type=V2Markup");
27  Q_CLASSINFO( "Seek", "type=V2Markup");
28 
29  SERVICE_PROPERTY2( QVariantList, Mark );
30  SERVICE_PROPERTY2( QVariantList, Seek );
31 
32  public:
33 
34  Q_INVOKABLE V2MarkupList(QObject *parent = nullptr)
35  : QObject ( parent )
36  {
37  }
38 
39  void Copy( const V2MarkupList *src )
40  {
41  CopyListContents< V2Markup >( this, m_Mark, src->m_Mark );
42  CopyListContents< V2Markup >( this, m_Seek, src->m_Seek );
43  }
44 
46  {
47  // We must make sure the object added to the QVariantList has
48  // a parent of 'this'
49 
50  auto *pObject = new V2Markup( this );
51  m_Mark.append( QVariant::fromValue<QObject *>( pObject ));
52 
53  return pObject;
54  }
55 
57  {
58  // We must make sure the object added to the QVariantList has
59  // a parent of 'this'
60 
61  auto *pObject = new V2Markup( this );
62  m_Seek.append( QVariant::fromValue<QObject *>( pObject ));
63 
64  return pObject;
65  }
66 
67  private:
69 };
70 
72 
73 #endif
v2markup.h
V2MarkupList::AddNewSeek
V2Markup * AddNewSeek()
Definition: v2markupList.h:56
V2MarkupList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2MarkupList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2MarkupList)
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(std::chrono::seconds)
V2MarkupList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, Mark)
mythhttpservice.h
V2MarkupList::AddNewMarkup
V2Markup * AddNewMarkup()
Definition: v2markupList.h:45
V2Markup
Definition: v2markup.h:21
V2MarkupList::Copy
void Copy(const V2MarkupList *src)
Definition: v2markupList.h:39
V2MarkupList
Definition: v2markupList.h:21
V2MarkupList::V2MarkupList
Q_INVOKABLE V2MarkupList(QObject *parent=nullptr)
Definition: v2markupList.h:34