Possible duplicate:What leads to incomplete types? (QGraphicsItem: source or target is of an incomplete type)
I started with this question: What leads to incomplete types? (QGraphicsItem: source or target is of an incomplete type)
As already mentioned, I got the following error (partially my own translation):
C664: Converting parameter 1 from 'Qt :: CursorShape' to 'const QCursor &' is not possible. The source or target is of an incomplete type.
When trying to figure out why the item may be incomplete, I split it into a minimal test case that still shows an error. Strange: this is absolutely minimal ...
Title:
#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); }
, , . item->setCursor(Qt::OpenHandCursor); . , -, QGraphicsItems ( , QGraphicsRectItem).
item->setCursor(Qt::OpenHandCursor);
, . /? , ?
,
cpp :
#include <QCursor>
, - , forward, QCursor ( , ... er, "forward declares"?). Qt::OpenHandCursor , , QCursor. cpp , , .
Qt::OpenHandCursor
, , , , <QtGui> - , QCursor , .
<QtGui>
QGraphicsItems:: setCursor QCursor, Qt:: OpenHandCursor, , .. , QCursor.
setCursor(QCursor(Qt::OpenHandCursor));
, .
, "", .