MythTV  master
channelGroupList.h
Go to the documentation of this file.
1 #ifndef CHANNELGROUPLIST_H_
2 #define CHANNELGROUPLIST_H_
3 
4 #include <QVariantList>
5 #include <QString>
6 #include <QDateTime>
7 
10 
11 #include "channelGroup.h"
12 
13 namespace DTC
14 {
15 
16 class SERVICE_PUBLIC ChannelGroupList : public QObject
17 {
18  Q_OBJECT
19  Q_CLASSINFO( "version", "1.0" );
20 
21  // Q_CLASSINFO Used to augment Metadata for properties.
22  // See datacontracthelper.h for details
23 
24  Q_CLASSINFO( "ChannelGroups", "type=DTC::ChannelGroup");
25 
26  Q_PROPERTY( QVariantList ChannelGroups READ ChannelGroups )
27 
28  PROPERTYIMP_RO_REF( QVariantList, ChannelGroups );
29 
30  public:
31 
32  static inline void InitializeCustomTypes();
33 
34  Q_INVOKABLE ChannelGroupList(QObject *parent = nullptr)
35  : QObject( parent )
36  {
37  }
38 
39  void Copy( const ChannelGroupList *src )
40  {
41  CopyListContents< ChannelGroup >( this, m_ChannelGroups, src->m_ChannelGroups );
42  }
43 
45  {
46  // We must make sure the object added to the QVariantList has
47  // a parent of 'this'
48 
49  auto *pObject = new ChannelGroup( this );
50  m_ChannelGroups.append( QVariant::fromValue<QObject *>( pObject ));
51 
52  return pObject;
53  }
54 
55  private:
56  Q_DISABLE_COPY(ChannelGroupList);
57 };
58 
60 {
61  qRegisterMetaType< ChannelGroupList* >();
62 
64 }
65 
66 } // namespace DTC
67 
68 #endif
DTC::ChannelGroup::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: channelGroup.h:60
DTC::ChannelGroupList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: channelGroupList.h:59
DTC::ChannelGroupList
Definition: channelGroupList.h:16
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
PROPERTYIMP_RO_REF
#define PROPERTYIMP_RO_REF(type, name)
Definition: datacontracthelper.h:114
datacontracthelper.h
serviceexp.h
DTC::ChannelGroupList::AddNewChannelGroup
ChannelGroup * AddNewChannelGroup()
Definition: channelGroupList.h:44
DTC::ChannelGroup
Definition: channelGroup.h:23
channelGroup.h
DTC
Definition: datacontracthelper.h:123
DTC::ChannelGroupList::ChannelGroupList
Q_INVOKABLE ChannelGroupList(QObject *parent=nullptr)
Definition: channelGroupList.h:34
DTC::ChannelGroupList::Copy
void Copy(const ChannelGroupList *src)
Definition: channelGroupList.h:39