[Qt-interest] Re : Enumerations: 'qt_metatype_id' is not a member of ...
BOUCARD Olivier
boucard_olivier at yahoo.fr
Mon Sep 26 14:30:42 CEST 2011
I am not sure you can declare a metatype as a pointer!
>________________________________
>De : Schimkowitsch Robert <Robert.Schimkowitsch at andritz.com>
>À : qt-interest at qt.nokia.com
>Envoyé le : Lundi 26 Septembre 2011 14h14
>Objet : [Qt-interest] Enumerations: 'qt_metatype_id' is not a member of ...
>
>
>Enumerations: 'qt_metatype_id' is not a member of ...
>I find myself unable to get rid of the following error message:
>qmetatype.h:169: error: 'qt_metatype_id' is not a member of 'QMetaTypeId<CCmn_UIUpdateTimer::EUiActivityMode>'
>My main.cpp looks like this:
>#include <QApplication>
>#include <QVariant>
>#include <QMetaEnum>
>#include <QMetaObject>
>#include <QDebug>
>#include "cmn_uiupdatetimer.h"
>int main(int argc, char *argv[])
>{
> QApplication a(argc, argv);
> CCmn_UIUpdateTimer::EUiActivityMode activityMode = CCmn_UIUpdateTimer::eUiOff;
> QVariant vActivityMode;
> vActivityMode.setValue(activityMode); // << ERROR LINE
> qDebug() << vActivityMode;
> return a.exec();
>}
>The header file "cmn_uiupdatetimer.h" has been stripped of all code, and looks like this:
>#include <QObject>
>#include <QMetaType>
>#include <QMetaEnum>
>class CCmn_UIUpdateTimer : public QObject
>{
> Q_OBJECT
> Q_ENUMS(EUiActivityMode)
>public:
> enum EUiActivityMode
> {
> eUiOff = 0,
> eUiActive = 1
> };
>};
>Q_DECLARE_METATYPE(CCmn_UIUpdateTimer*)
>I have declared the enum EUiActivityMode using Q_ENUMS. Why doesn't that work?
>Kind regards
>Robert Schimkowitsch
>
>________________________________
>
>This message and any attachments are solely for the
use of the intended recipients. They may contain privileged and/or confidential
information or other information protected from disclosure. If you are not an
intended recipient, you are hereby notified that you received this email in
error and that any review, dissemination, distribution or copying of this email
and any attachment is strictly prohibited. If you have received this email in
error, please contact the sender and delete the message and any attachment from
your system.
>
>ANDRITZ HYDRO GmbH
>Rechtsform/ Legal form: Gesellschaft mit beschrankter Haftung / Corporation
>Firmensitz/ Registered seat: Wien
>Firmenbuchgericht/ Court of registry: Handelsgericht Wien
>Firmenbuchnummer/ Company registration: FN 61833 g
>DVR: 0605077
>UID-Nr.: ATU14756806
>
>Thank You.
>________________________________
>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at qt.nokia.com
>http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110926/e5a82cd8/attachment.html
More information about the Qt-interest-old
mailing list