MythTV  master
v2genreList.h
Go to the documentation of this file.
1 // Program Name: genreList.h
3 // Created : Mar. 08, 2017
4 //
5 // Copyright (c) 2017 Paul Harrison <pharrison@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2GENRELIST_H_
12 #define V2GENRELIST_H_
13 
14 #include <QString>
15 #include <QVariantList>
16 
18 
19 
20 #include "v2genre.h"
21 
22 class V2GenreList : public QObject
23 {
24  Q_OBJECT
25  Q_CLASSINFO( "Version", "1.0" );
26 
27  // Q_CLASSINFO Used to augment Metadata for properties.
28  // See mythhttpservice.h for details
29 
30  Q_CLASSINFO( "GenreList", "type=V2Genre");
31 
32  Q_PROPERTY( QVariantList GenreList READ Genres USER true )
33 
34  SERVICE_PROPERTY_RO_REF( QVariantList, Genres );
35 
36  public:
37 
38  Q_INVOKABLE V2GenreList(QObject *parent = nullptr)
39  : QObject ( parent )
40  {
41  }
42 
43  void Copy( const V2GenreList *src )
44  {
45  CopyListContents< V2Genre >( this, m_Genres, src->m_Genres );
46  }
47 
49  {
50  // We must make sure the object added to the QVariantList has
51  // a parent of 'this'
52 
53  auto *pObject = new V2Genre( this );
54  m_Genres.append( QVariant::fromValue<QObject *>( pObject ));
55 
56  return pObject;
57  }
58 
59  private:
61 };
62 
64 
65 #endif
v2genre.h
V2GenreList::Copy
void Copy(const V2GenreList *src)
Definition: v2genreList.h:43
V2GenreList::GenreList
QVariantList GenreList
Definition: v2genreList.h:32
V2GenreList::V2GenreList
Q_INVOKABLE V2GenreList(QObject *parent=nullptr)
Definition: v2genreList.h:38
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2GenreList::SERVICE_PROPERTY_RO_REF
SERVICE_PROPERTY_RO_REF(QVariantList, Genres)
V2Genre
Definition: v2genre.h:21
mythhttpservice.h
V2GenreList
Definition: v2genreList.h:22
V2GenreList::AddNewGenre
V2Genre * AddNewGenre()
Definition: v2genreList.h:48
V2GenreList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2GenreList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2GenreList)