Qenum. If you don't want to add your enum to a class with Q_OBJECT or Q_GADGET, then the other way to do it is to put your enum inside a Q_NAMESPACE. Qenum

 
 If you don't want to add your enum to a class with Q_OBJECT or Q_GADGET, then the other way to do it is to put your enum inside a Q_NAMESPACEQenum  Kotlin™ is protected under the Kotlin Foundation and licensed under the

In short, Qt can not support multiple header files that each have the Q_NAMESPACE macro. So, my code actually looks something like this: enum class Foo { Bar1, Bar2 } Q_ENUMS (Foo) Q_DECLARE_METATYPE (Foo). enum to int is unambiguous cast (assuming C++ 03 where enum is basically an int ), will be performed implicitly no problem. y is a list; x is a handle to a:; Variable¶. The decorator is used to register an Enum to the meta-object system, which is available via QObject. We would like to show you a description here but the site won’t allow us. int to enum is potentially errorneous as it's a narrowing cast, not every int value is a valid enum value. When the third party SDK adds or adjusts the order of enumeration, we need to re-adjust these definitions. Q_ENUMS (Class::EnumName doesn't create a new enumerator, and useless. 1 day ago · Good afternoon. The environment variable. If you don't want to add your enum to a class with Q_OBJECT or Q_GADGET, then the other way to do it is to put your enum inside a Q_NAMESPACE. Anonymous classes. 0 <5. The enumerator’s keys (names of each enumerated item) are returned by key(); use keyCount() to find the number of keys. QFlags is used to store combinations of Enum, which provides type checking safety. How to properly compare Q_ENUM and QStringList I have a small example . Follow. Data Type Conversion Between QML and C++. #. In both cases the enum doesn't get recognised by QML. Btw. [since 5. Download this exampleA PySide6/QML application consists, at least, of two different files - a file with the QML description of the user interface, and a python file that loads the QML file. there’s also non-flag enums, which have the same type and enum name. To start viewing messages, select the forum that you want to visit from the selection below. To use the type T in queued signal and slot connections, qRegisterMetaType () must be called before the first connection is established. Instantly publish your crates and install them. I just found multiple examples showing the usage of Q_ENUM and Q_ENUMS and looking into the definition of Q_ENUM showed me that it includes Q_ENUMS and other definitions. enumValue } That would result in enumValue is MyEnumElement instead of enumValue is 0 which is the case now. Then you can use a global header where you define them, like: namespace Tags { const char *Name1 = "Some string" ; const char *Name2 = "Some other string" ; }; If you need to stringify enum names, you can use QMetaEnum like this: class Enums { Q_GADGET enum A { Message1, Message2 } Q_ENUM (A); QString aToString(const A. The problem needs to be somewhere in MOC which ignores the. The string represention is case sensitive. Example¶ Enumeration (or enum) is a user defined data type in C. Just to mention it, if the underlying type of the enum happens to be fixed, from C++17 on, it is possible to simply write. Q_ENUMS (EnumBillingEvents). The enum value names need to be capitalized: enum Enum_Test { ETestA, ETestB }; Q_ENUM (Enum_Test) Then you can use it in QML as: QtObject { property int myEnumVal: MyClass. Reload to refresh your session. a rounded line end. C enums. Your code should look like this: Q_ENUM (StateEnum) //note the missing 'S' here Q_PROPERTY (StateEnum state READ state NOTIFY stateChanged) Share. . Play media files in playlists (such as compressed audio or video files). Record audio and compress it. To register a QObject -derived class as an instantiable QML object type, add QML_ELEMENT or QML_NAMED_ELEMENT (<name>) to the class declaration. h file :The enumeration type is a representation of a C++ enum type. 1. ; enums passed to. Types are automatically registered for: #define Q_ENUM(x) Q_ENUMS(x) Q_ENUM_IMPL(x) 117: #define Q_FLAG(x) Q_FLAGS(x) Q_ENUM_IMPL(x) 118: #define Q_ENUM_NS_IMPL(ENUM) \ 119: inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return &staticMetaObject; } \ 120: inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; } 121 The QFlags<Enum> class is a template class, where Enum is an enum type. h #ifndef ENUMCLASSES_H #define ENUMCLASSES_H #include <QObject> namespace mynamespace { enum class Fruit : int { Apple, Banana, Orange }; Q_ENUM (Fruit) } #endif // ENUMCLASSES_H. Sorted by: 3. For qmake, add CONFIG += qmltypes, a QML_IMPORT_NAME, and a QML_IMPORT_MAJOR_VERSION to your project file. (Z(:^ 1 Reply Last reply Reply Quote 1. h" #include. If we also want the strict type safety, the follow code can implement somthing like enum. I have enums declared within this class, which I have registered with qml via the Q_ENUM macro. Usage. The first uses the enumeration and the second defines the enumeration. The default value is 1. Contributing to Kotlin Releases Press Kit Security Blog Issue Tracker Careers. For example: import QtQuick 2. See the Custom Type Example for code that demonstrates this. There is no meta-object for the global namespace. Shared types #[qenum] - Support for Q_ENUM and Q_ENUM_NS Qt allows exposing enums to Qt's meta-object system, and thereby QML, with a set of macros: Q_ENUM is used to expose an enum that is a member of a QObject; Q_ENUM_NS is used to expose an enum that is in a namespace to the meta-object system. [override virtual] void QProcess:: close Reimplements: QIODevice::close(). Then I would like to communicate between C++ and QML using signals. Connect with our community. QBitmap is only a convenience class that inherits QPixmap, ensuring a depth of 1. The enum is defined by using the enum keyword. Saved searches Use saved searches to filter your results more quicklyFirst Way. In short, everything is "by-the-book" but for some reason I continue getting undefined for each and every enum in QML. Editor for a list of QObjects is a table where rows are objects and columns are properties. To start viewing messages, select the forum that you want to visit from the selection below. Follow. card", 1, 0, "Card");This is true to the documentation of Q_ENUM actually (emphasis mine): This macro registers an enum type with the meta-object system. Extend an enumeration. but i have one more thing to solve : i can reach the enum from my QML code : Connections { target. There are two parts to networking within QEMU: the virtual network device that is provided to the guest (e. For example: import QtQuick 2. To include the definitions of the module’s classes, use the following directive:When declaring in the same class one enumeration, the corresponding Q_ENUM's, and a Q_INVOKABLE function with the enumeration in parameter, the function can be called from qml. bool QMetaEnum:: isFlag const. If a relative path is given then it will be interpreted as relative to the working directory of the application. 1 Answer Sorted by: 1 In order for Qt (Designer) to see an enum, PyQt has to add it to the meta-object of the custom class. Your TI-89 graphing calculator (along with the TI-89 Titanium, TI-92 Plus, and Voyage 200) help you graph and so much more. QVariant does not have constructor taking a template value. The enum in C is also known as the enumerated type. pyside6_option_python_enum before PySide6 is imported. 1. Note down the BUSID value of the USB device you want. The type and its values must start with a capital letter but otherwise follow rules for naming a variable (e. Working with enum constants. rs","contentType":"file. Please do not confuse that with the Qt QFlags concept. /configure --target-list=<list of machines here> make. 4. 3, replace the Shiboken enums with Python variants, which harmonize the builtin enums with the already existing QEnum “macro” shown in the QEnum/QFlag section. This macro registers an enum type with the meta-object system. However there is no sample of how to do the registration call per se. In addition, we have to use Q_ENUM macro with the name of the enum that we have introduced: enum Day { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, }; Q_ENUM (Day) The following steps are similar to ones we had in our previous articles. The decorator is used to register an Enum to the meta-object system, which is available via QObject. staticMetaObject. –1 Answer. the query parameters are: skip: with a value of 0; limit: with a value of 10; As they are part of the URL, they are "naturally" strings. Implementing interfaces in enum classes. All derivatives of QAbstractScrollArea , including QTextEdit , and QAbstractItemView (all item view classes), support scrollable backgrounds using background. In C programming, an enumeration type (also called enum) is a data type that consists of integral constants. So using qRegisterMetaType () you will just trade Q_ENUM () for Q_DECLARE_METATYPE (). AlignRight using an int type propertyintenumValue:textItem. Within an enumeration, the values can be compared by identity, and the enumeration itself can be. Jedi Engineer. If this is your first visit, be sure to check out the FAQ by clicking the link above. An other way, using a QMap : Declare and fill a QMap<QString, QSomeObject::SomeEnum> with the enum values you want in your combo box, then fill your QComboBox with a QStringList of the QMap's keys. This class decorator is equivalent to the Q_ENUM macro from Qt. The following information is primarily meant for developers of Qt applications, to help with extending the level of automated testing of Qt applications. Modified 4 years, 9 months ago. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. This tutorial is very similar to the Qt Chat Tutorial one but it focuses on explaining how to integrate a SQL database into a PySide6 application using QML for its UI. You also need to make adjustments in the build system. When data values are exchanged between QML and C++, they are converted by the QML engine to have the correct data types as appropriate for use in QML or C++. See also setChildProcessModifier() and unixProcessParameters(). Proper way to add enum class to meta-object Qt 5. @MCQ, necroing the necro'd necro: The syntax presented in the question is not wrong in C. Signals and slots are used for communication between objects. Enumerators can be created in two types:-It can be declared during declaring enumerated types, just add the name of. Suggests using Q_ENUM instead of Q_ENUMS. I have changed for you. Create a new QQmlApplicationEngine and loads the QML file at the given filePath, which must be a local file path. When used as flags, enumerators can be combined using the OR operator. We strongly advise against using it in new code. To define an enumeration type, use the enum keyword and specify the names of enum members: C#. When used as flags, enumerators can be combined using the OR operator. sqlDialog. The central feature in this model is a very powerful mechanism for seamless object communication called signals and slots. 0 Item { // refer to Text. To use the type T in queued signal and slot connections, qRegisterMetaType () must be called before the first connection is established. The upgrade path from PyQt5 to PyQt6 is fairly straightforward, with one main gotcha. But now I have a lot of enums created in this way. The enumeration type must be registered with the Meta-Object System using the Q_ENUM() macro. Compound query clauses wrap other leaf or compound queries and are used to combine multiple queries in a logical fashion (such as the bool or dis_max query), or to alter their behaviour (such as the constant_score query). Each member takes the enumeration's data type. There are around 30 enums in the namespace. 可见,使用Q_ENUM注册过的枚举类型,可以不加修饰直接被qDebug()打印出来,另外通过静态函数QMetaEnum::fromType()可以获得一个QMetaEnum 对象,以此作为中介,能够轻松完成枚举量和字符串之间的相互转化。这一点恐怕是引入Q_ENUM机制最直. dependencies: retrofit: '>=4. /1991 G. Forum Rules. QMetaType:: ~QMetaType Destructs this object. @return next set flag found. 12 (p. A small new feature that was added to Qt 5. @param flag enum value to start search from. The Qt Meta-Object System in Qt is responsible for the signals and slots inter-object communication mechanism, runtime type information, and the Qt property system. Usage # Generator #. In the meantime, I don't know what the best course of action is - we could patch out the warning from our. Here is a simple example of a Hello World. 0. NET is a structure that maps a set of values (fields) to a basic type (the default is int). 4 Answers. enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum. I have tried to import the Q_ENUM macro from PySide2. Only one enum can be put in the macro. valueToKey ( int (m_state) ) this worked, now i can create a QString with my state name and get it from QML . If the QMetaObject this enum is part of was generated with Qt 6. g. Viewed 2k times 1 I read several advices how to get an actual QString from a Q_ENUM value. class StyleClass : public QObject { Q_OBJECT // Let the MOC know about this QObject QML_ELEMENT //. In order to use it with custom types from Qt Meta System QVariant::seValue must be used. QMetaType. class Helper : public QObject { Q_OBJECT Q_ENUMS (Requester). The Property System. I have no problem with registering and using C++ enums in QML code. FirstValue instead (and to do this, you'll need to register MyClass with qmlRegisterType () and then import the registered module). This is useful for QML applications which may refer to the emitted values by name. Qt provides a sophisticated property system similar to the ones supplied by some compiler vendors. My implementation works by replacing the original class with a. g. Note. Improve this. A common enum that is seen in QML is the Status enum which is present in the. When used as flags, enumerators can be combined using the OR operator. Because enumeration members must be constants, Python doesn’t allow you. 番外:なぜenumは==で比較できるのか?. Using Q_ENUMS I can now "register" with Qt an enum declared inside a class that inherists from QObject. Returns the meta type of the enum. 0") Like other meta-data, class information is accessible at run-time through the meta-object; see QMetaObject::classInfo () for details. as you can see in my first code the Q_ENUM is there from the beginnig thank you :) QMetaEnum ::fromType< ClassName ::CurrentState> (). Al nosotros asignar el tipo enum a un campo, este, no podrá almacenar otro valor que no se encuentre dentro de la lista. QMetaEnum. Network Basics. You can specify Byte, Integer, Long, SByte, Short, UInteger, ULong, or UShort. Opaque enum declaration for an unscoped enumeration must specify the name and the underlying type. Your code is therefore not prone to errors due to modifications to the enum. const 是 constant 的缩写,本意是不变的,不易改变的意思。在 C++ 中是用来修饰内置类型变量,自定义对象,成员函数,返回值,函数参数。 C++ const 允许指定一个语义约束,编译器会强制实施这个约束,允许程序员告诉编译器某值是保持不变的。如果在编程中确实有某个值保持不变,就应该明确使用. This now makes it possible for Message values to be stored in QVariant objects and retrieved later. enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum. Add the generator to your dev dependencies. In order to access this enum in QML, you need to register it first: qmlRegisterType (UserState, "yourlibname", 1, 0, "UserState") And then import it in your QML: import yourlibname 1. Google has many special features to help you find exactly what you're looking for. For some applications, just renaming the imports from PyQt5 to PyQt6 will be enough to convert your application to work with the new library. We’ll now start the virtual machine for the first time, telling QEMU to use a CD-ROM player, and put the image we just downloaded onto it. You switched accounts on another tab or window. Maintenance Tool is included in each Qt installation. Because C++ forbids unions from including types that have non-default constructors or destructors, most interesting Qt classes cannot be used in unions. An other way, using a QMap : Declare and fill a QMap<QString, QSomeObject::SomeEnum> with the enum values you want in your combo box, then fill your QComboBox with a QStringList of the QMap's keys. What is the difference between Q_ENUM and Q_ENUMS. This is a valid statement for both python and QML: UserState. #. See Qt documentation which contains sample code. Q_ENUMS is processed by MOC, so it needs to be in a class that is QObject derived and has a Q_OBJECT marker. 好处是简单,缺点是类型是 int ,并且仍然是变量。. It is not possible to refer to the enumeration type in QML itself; instead, the int or var types can be used when referring to enumeration values from QML code. . The decorator is used to register an Enum to the meta-object system, which is available via. . 4 was featuring tech preview). cpp // 1. using enums in functions. The string represention is case. bool QMetaEnum:: isFlag () const Returns true if this enumerator is used as a flag; otherwise returns false. If i make it inherit QObject g++ complains: src/. First Way. The following example uses the ENUM statement in different ways to define enumerators. Qt Q_ENUM / QMetaEnum vs better-enums. Everything works great and I can convert the enum strings to the actual enum values. #include <iostream> class Color { public: static Color RED() {. Quick Enum. Closes all communication with the process and kills it. i. Q2 provides the industry's most comprehensive and adaptable digital banking platform and innovative solutions designed to help banks and credit unions compete to win in an always-connected world. Enumerations can be template parameters in exactly the same way that ints can. Go to my next postNew Features. It must be placed after the enum declaration in a class that has the Q_OBJECT or the Q_GADGET macro. Python qenum_key - 57 examples found. QtCore. 0. How to use enum in Qt? Ask Question Asked 9 years, 11 months ago Modified 2 years, 4 months ago Viewed 46k times 4 I have a QObject class Message. I've defined them all in the same way: namespace AppEnumsNs { Q_NAMESPACE typedef enum. When you declare a new Q_PROPERTY in ClassA you should use full form of the enum ClassB::EnumName. Fedora is an open source Linux distribution, and its primary license is GPLv2. if an enum is a member of a class, it's implicitly static. [static] bool QMetaType:: compare (const void *lhs, const void *rhs, int typeId, int *result) Compares the objects at lhs and rhs. h #include <QObject> enum class Enum1 {A, B}; Q_ENUM_NS (Enum1) If the main goal is to use the enum as a property, it is sufficient to just use Q_DECLARE_METATYPE after the globally-declared enumeration. Last updated:. Detailed Description¶. The solution I have now is the following, however inelegant: class MyClass : public QQuickItem { Q_OBJECT Q_PROPERTY (MyEnum enumValue READ. One way to use enumeration types in the data contract model is to apply the DataContractAttribute attribute to the type. Day. 1 Answer. You can define one with the enum keyword. Returns true if this enumerator is used as a flag; otherwise returns false. One of the many nice features of the enumitem package is that labels of enumerated items and the format of cross-references to these items can be set in a very straightforward way. However, QML doesn't seem to recognise the enum value (which is always. How to Style. The optional named argument name defines the signal name. As said in int qRegisterMetaType () documentation: To use the type T in QVariant, using Q_DECLARE_METATYPE () is sufficient. Since you have Image and Path in your enum, the valid values to pass to keyToValue () are "Image" (returns 0), and "Path" (return 1), other values will returns -1. Parameters 1 Specifies that enumerations occupy 1 byte of storage, are of type signed char if the range of enumeration values falls within the limits of signed char, and unsigned char otherwise. 5 or greater then use Q_ENUM instead as Q_ENUMS are deprecated. In addition, the class defining the enum has to inherit QObject as well as declare the enum using Q_ENUMS (). Here is the command line to do this: sudo qemu-system-x86_64 -boot d -cdrom /path/debian. qml file easily readable by replacing hard coded numbers, (2) force errors when interpreting *. The type and its values must start with a capital letter but otherwise follow rules for naming a variable (e. 编译 Qt 源码时,编译选项 QT_NAMESPACE 将决定编译出来的 Qt 是否带命名空间 QT_NAMESPACE. The QMetaEnum class provides meta-data about an enumerator. 查看 Qt 源码就可以明白这对宏的含义:. It declares strategy as having an anonymous enumerated type, and assigns one of the declared values of that type to it. 用Q_ENUM声明的枚举,会自动注册到Qt元类型系统,可以使用静态函数QMetaEnum::fromType()来获取QMetaEnum。4. Sorted by: 17. The use of enum in C makes the program easy to understand and maintain. For example: import QtQuick 2. Without QVariant, this would be a problem for QObject::property () and for database work, etc. searching forward. This requires the exchanged data to be of a type that is recognizable by the engine. Now we have two strongly typed enums which are accessible from both C++ and QML in one go! As with all classes and types that is exposed to QML, they need to be registered as well: // main. Enums are not working out for me. See full list on woboq. ). Accessing an enum stored in a QVariant. enums passed to qDebug will prin…QEnum/QFlag. The inconvenience with this approach is that there's no type checking at all; any enum value can. The Q_DECLARE_METATYPE() macro also makes it possible for these values to be used as arguments to signals, but only in direct signal-slot connections. 8. 使用枚举类. If you own a Mac (x86 or ARM) and want to have a full Linux desktop for development or testing, you'll find that having a responsive desktop is a nice thing. An enumeration can be initialized from an integer without a cast, using list. Enum is a collection of named integer constant means it’s each element is assigned by integer value. Once Qt is installed, you can use Maintenance Tool under <install_dir> to add components and to update or remove installed components. @JKSH said in Undefined reference to staticMetaObject: you can force moc to run by running qmake. 10, enumerations are directly supported in QML. With your typedef it creates nothing and the typedef works like in standard C++ without Qt-specific runtime behavior, so it can't be used in QML. static public readonly MyEnum eighth = new MyEnum (8, "ate a pizza"); static public readonly MyEnum ninth = new MyEnum (9, "nine is the captain of the bunch"); // You must avoid parameterless constructor as it will break everything! string _desc; // Example of a user-set constructor: just a value and custom arg. Stack Overflow Public questions & answers; Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Talent Build your employer brand ; Advertising Reach developers & technologists worldwide; Labs The future of collective knowledge sharing; About the companyHey, I want to have enum in my c++ class and use it in qml but the value of enum elements are undefined. If a field is empty, keep it in the result. Description Disk image file formats . 1. enum Season { Spring, Summer, Autumn, Winter } By default, the associated constant values of enum members. 0 Item { // refer to Text. The following pages provide more information about Qt’s core features: The Meta-Object System. Hm, well look at my comment, I've edited it shortly after writing it. 可以使用QMetaEnum::fromType ()获取. ONLINE. Set to MediaPlayer::Infinite to loop the current media file forever. Enum): MULTI_SELECT = "multi" SINGLE_SELECT = "single" @staticmethod def from_str. This property holds whether the media contains video. For example: import QtQuick 2. bool QMetaEnum:: isScoped () const QEnum/QFlag. Also, to use type T with the QObject::property () API, qRegisterMetaType () must be. It is not possible to refer to the enumeration type in QML itself; instead, the int or var types can be used when referring to enumeration values from QML code. The following code snippet shows how a script function can be defined and then invoked from C++ using QJSValue::call ():QObjects receive events by having their QObject::event () function called. By using it, we can access our enumerator. ⚠️ All of this only makes sense. . as you can see in my first code the Q_ENUM is there from the beginnig thank you :) QMetaEnum ::fromType< ClassName ::CurrentState> (). new can never be used with an enum, even within the enum type itself. For converting a enum to string I can write this: QMetaEnum::fromType<Class::Enum> (). Open a new Terminal instance as Administrator and type the following command to list all the USB devices connected to Windows. NOV = 11 DEC = 12. Definition of quannum in the Definitions. I created an enum in a class: class ClassA { Q_OBJECT public : enum Enum_Test { eTestA, eTestB }. If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. 14. These enums are automatically declared as a QMetaTypes (no need to add them in Q_DECLARE_METATYPEanymore). The following code doesn't work. Become a contributor and enhance the site with your work. To ease cross platform development Qt will by default remap Command to the ControlModifier , to align with other platforms. What does quannum mean? Information and translations of quannum in the most comprehensive. Message ID: patch-v2-08. Hi, I have been searching but. ; Only one enum can be put in the macro. the use of typedef it is to safe you from writing each time enum tag1 to define variable. Query clauses behave differently depending on whether they are used in query context or filter context. The enumerator must be in a QObject derived class to be registered. However, I only have a value of the TAX enumeration. My header file: #ifndef CENUM_TEST_H #define CENUM_TEST_H #include class C_TEST : public QObject { Q_OBJECT Q_PROPERTY(int MODE MEMBER m_. In new code, you should prefer the use of the Q_ENUM () macro, which makes the type available also to the meta type system. h> class ClassB : public QObject { Q_OBJECT QML_ELEMENT. Note that for enum types, you no not even need to call qRegisterMetaType () in these cases. raspi2b. Follow. It can be either a pull-down menu in a menu bar or a standalone context menu. qcow2. First I read a configuration entry from an . Each member must have a value, which needs to be constant. This includes the preferred formats raw and qcow2 as well as formats that are supported for compatibility. Definition of quanum in the Definitions. This patches removes bdi_start_writeback(), renames __wb_start_writeback() to wb_start_writeback() and makes laptop_mode_timer_fn() use. . The way pixels are described in these frames can vary greatly, and some pixel formats offer greater compression opportunities at the expense of ease of. The following code creates two identical rectangles. . Java Enum is a data type which contains fixed set of constants. Re: Q_ENUMS on C-style global enums. Registering an enumeration type makes the enumerator names available for use in calls to QObject::setProperty(). First post . QEnum/QFlag¶ This class decorator is equivalent to the Q_ENUM macro from Qt. Common examples include compass directions (values of NORTH, SOUTH, EAST, and WEST) and the days of the week. Don’t worry, it’s not you — it’s us. So every time I need to create one more class, copy already implemented, change class name, change strings in registration method and add necessary enums. value. It is not possible. QFlags is used throughout Qt for storing combinations of enum values. It is not possible to refer to the enumeration type in QML itself; instead, the int or var types can be used when referring to enumeration values from QML code.