Possible Duplicate:
What leads to incomplete types? (QGraphicsItem: Source or target has incomplete type)
I started out with this question: What leads to incomplete types? (QGraphicsItem: Source or target has incomplete type)
As mentioned there, I got the following error (partly my own translation):
C664: Conversion of parameter 1 from 'Qt::CursorShape' to 'const QCursor &' not possible. Source or target has incomplete type.
While trying to figure out why the item might be incomplete, I stripped it down to a minimal test case that still shows the error. Weird thing is: it is absolutely minimal...
Header:
#include <QGraphicsPixmapItem>
class PhotoItem : public QGraphicsPixmapItem
{
public:
PhotoItem();
void someMethod();
protected:
};
Implementation:
#include "photoitem.h"
PhotoItem::PhotoItem() : QGraphicsPixmapItem()
{
QPixmap pxm(80, 80);
pxm.fill(Qt::cyan);
setPixmap( pxm );
}
void PhotoItem::someMethod()
{
setCursor(Qt::OpenHandCursor);
}
It does not compile, giving the error as above. However, setting the cursor in the main method with item->setCursor(Qt::OpenHandCursor);
works just fine. The error seems to be persistent across other QGraphicsItems (at least I tested QGraphicsRectItem).
I am utterly confused and don't really know, what to check next. Does the code above work on other machines/setups? What else could I test to get more information?
Thanks, Louise