Вопрос, почему такой код
#include <QObject>
#include <QGraphicsItemGroup>
class QCassete : public QGraphicsItemGroup
{
Q_OBJECT
protected:
QSizeF fsize;
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
public:
QCassete(QGraphicsItem * parent = 0);
};
Выдает ошибку компиляции:
debug/moc_qcassete.cpp:41: error: 'staticMetaObject' is not a member of 'QGraphicsItemGroup'
c:/Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qobject.h: In member function 'virtual const QMetaObject* QCassete::metaObject() const':
c:/Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qobject.h:296: error: 'QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > QObject::d_ptr' is protected
debug/moc_qcassete.cpp:51: error: within this context
c:/Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qobject.h:296: error: object missing in reference to 'QObject::d_ptr'
debug/moc_qcassete.cpp:51: error: from this location
c:/Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qobject.h:296: error: 'QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > QObject::d_ptr' is protected
debug/moc_qcassete.cpp:51: error: within this context
c:/Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qobject.h:296: error: object missing in reference to 'QObject::d_ptr'
debug/moc_qcassete.cpp:51: error: from this location
debug/moc_qcassete.cpp: In member function 'virtual void* QCassete::qt_metacast(const char*)':
debug/moc_qcassete.cpp:59: error: 'qt_metacast' is not a member of 'QGraphicsItemGroup'
debug/moc_qcassete.cpp: In member function 'virtual int QCassete::qt_metacall(QMetaObject::Call, int, void**)':
debug/moc_qcassete.cpp:64: error: 'qt_metacall' is not a member of 'QGraphicsItemGroup'
mingw32-make[1]: *** [debug/moc_qcassete.o] Error 1
mingw32-make: *** [debug] Error 2
Процесс "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" завершился с кодом %2.