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 
8 #include "serviceexp.h"
9 #include "datacontracthelper.h"
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 DESIGNABLE true )
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  ChannelGroup *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
void Copy(const ChannelGroupList *src)
static void InitializeCustomTypes()
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
ChannelGroup * AddNewChannelGroup()
#define PROPERTYIMP_RO_REF(type, name)
static void InitializeCustomTypes()
Definition: channelGroup.h:60
Q_INVOKABLE ChannelGroupList(QObject *parent=nullptr)