[Qt-interest] Re : Enumerations: 'qt_metatype_id' is not a memberof ...
Schimkowitsch Robert
Robert.Schimkowitsch at andritz.com
Mon Sep 26 14:38:29 CEST 2011
The Q_DECLARE_METATYPE works as it is. I have used that kind of code may times. Also, look in Examples, they often use it that way.
Q_ENUMS is the problem.
In fact, I have modified the "Affine" Demo (which declares a Q_ENUM) and found out that attempting to assign that enum to a Variant using setValue fails with the same error message.
Kind regards
Robert Schimkowitsch
________________________________
From: qt-interest-bounces+robert.schimkowitsch=andritz.com at qt.nokia.com [mailto:qt-interest-bounces+robert.schimkowitsch=andritz.com at qt.nokia.com] On Behalf Of BOUCARD Olivier
Sent: Monday, September 26, 2011 2:31 PM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Re : Enumerations: 'qt_metatype_id' is not a memberof ...
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 ...
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
#####################################################################################
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.
Thank You.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
#####################################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110926/5af29a35/attachment.html
More information about the Qt-interest-old
mailing list