MythTV master
v2genreList.h
Go to the documentation of this file.
1
2// 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
22class 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
void Copy(const V2GenreList *src)
Definition: v2genreList.h:43
Q_CLASSINFO("Version", "1.0")
SERVICE_PROPERTY_RO_REF(QVariantList, Genres)
V2Genre * AddNewGenre()
Definition: v2genreList.h:48
QVariantList GenreList
Definition: v2genreList.h:32
Q_DISABLE_COPY(V2GenreList)
Q_DECLARE_METATYPE(std::chrono::seconds)