MythTV  master
enumItem.h
Go to the documentation of this file.
1 // Program Name: enumItem.h
3 // Created : July 25, 2014
4 //
5 // Copyright (c) 2014 David Blain <dblain@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see LICENSE for details
8 //
10 
11 #ifndef ENUMS_H_
12 #define ENUMS_H_
13 
16 
17 namespace DTC
18 {
19 
20 class SERVICE_PUBLIC EnumItem : public QObject
21 {
22  Q_OBJECT
23  Q_CLASSINFO( "version", "1.02" );
24 
25  Q_PROPERTY( QString Key READ Key WRITE setKey )
26  Q_PROPERTY( int Value READ Value WRITE setValue )
27  Q_PROPERTY( QString Desc READ Desc WRITE setDesc )
28 
29  PROPERTYIMP_REF( QString , Key )
30  PROPERTYIMP ( int , Value )
31  PROPERTYIMP_REF( QString , Desc );
32 
33  public:
34 
35  static inline void InitializeCustomTypes();
36 
37  Q_INVOKABLE explicit EnumItem( QObject *parent = nullptr)
38  : QObject ( parent ),
39  m_Value ( 0 )
40  {
41  }
42 
43  void Copy( const EnumItem *src )
44  {
45  m_Key = src->m_Key ;
46  m_Value = src->m_Value;
47  m_Desc = src->m_Desc ;
48  }
49 
50  private:
51  Q_DISABLE_COPY(EnumItem);
52 };
53 
55 {
56  qRegisterMetaType< EnumItem* >();
57 }
58 
59 } // namespace
60 
61 #endif
DTC::EnumItem
Definition: enumItem.h:20
DTC::EnumItem::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: enumItem.h:54
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
datacontracthelper.h
serviceexp.h
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:123
DTC::EnumItem::Copy
void Copy(const EnumItem *src)
Definition: enumItem.h:43
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70