PDA

View Full Version : qgraphicsitem_cast problem



dreamer
30th April 2008, 12:54
After compiling the code, i have this 3 error:

moc_pixmapitem.cpp:40: error: ‘staticMetaObject’ is not a member of ‘QGraphicsPixmapItem’

moc_pixmapitem.cpp:54: error: ‘qt_metacast’ is not a member of ‘QGraphicsPixmapItem’

moc_pixmapitem.cpp:59: error: ‘qt_metacall’ is not a member of ‘QGraphicsPixmapItem’

I have this error, when i inserted this line of code in my MainWIndow application:


QGraphicsItem* item;
if(item->type() == pixmapItem::Type)
qgraphicsitem_cast<pixmapItem *>(item);


I add to pixmapitem.h file:


public:
enum { Type = UserType + 2 };
int type() const{return Type;}


What's wrong???

dreamer
30th April 2008, 15:22
I had a public slot function in pixmapItem class.....so i put this function in a public section(without slot) and so resolve the problem............:D