>From: Maurizio M. Gavioli [mailto:[email protected]] 
>
>There seem to be problems with enum's in the current plug-in framework:
>according to documentation, to be accessible to QML, enum's should be
defined *within* a QObject derived class.
>https://qt-project.org/doc/qt-5/qtqml-cppintegration-data.html#enumeration-
types

Well, I read
https://qt-project.org/doc/qt-5/qtqml-cppintegration-data.html#enumeration-t
ypes:
To use a custom enumeration as a data type, its class must be registered and
the enumeration must also be declared with Q_ENUMS() to register it with
Qt's meta object system.
...
C++ signals and methods with enumeration-type parameters can be used from
QML provided that the enumeration and the signal or method are both declared
within the same class, or that the enumeration value is one of those
declared in the Qt Namespace.

"declared" != "defined" or am I wrong here? As far as I understand the
Q_ENUMS() Macro only declares it, see above.

So instead of using the Q_ENUMS() outside the class, for enums defined
outside a class,  we need to use the Q_ENUMS()  inside any class that uses
it?

https://qt-project.org/doc/qt-5/qobject.html#Q_ENUMS:
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. In addition,
the class defining the enum has to inherit QObject as well as declare the
enum using Q_ENUMS().

It doesn't talks about enums being defined outside all classes though
But maybe using e.g. Q_ENUMS(Ms::Element) inside of all classes using it
would work?

Bye, Jojo


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to