Hi
I don't really know if it will work for your plugin design (with your class being an interface), but I already extended a QGraphicsItem so it has signals/slots too, this way :
#ifndef _TSP_HANDLE_H_
#define _TSP_HANDLE_H_
#include <QObject>
#include <QGraphicsItem>
{
Q_OBJECT
public :
virtual int type(void) const { return Handle::Type; }
public :
Handle(TSPScene *scene,int id,int state) ;
virtual QRectF boundingRect
(void) const ;
signals :
void activated(int id,int s) ;
void deactivated(int id) ;
void updated
(int id,
const QPointF &cursorPos
) ;
} ;
#endif // _TSP_HANDLE_H_
#ifndef _TSP_HANDLE_H_
#define _TSP_HANDLE_H_
#include <QObject>
#include <QGraphicsItem>
class Handle : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public :
enum {Type = QGraphicsItem::UserType + 7};
virtual int type(void) const { return Handle::Type; }
public :
Handle(TSPScene *scene,int id,int state) ;
virtual QPainterPath shape(void) const ;
virtual QRectF boundingRect(void) const ;
virtual void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *) ;
signals :
void activated(int id,int s) ;
void deactivated(int id) ;
void updated(int id,const QPointF &cursorPos) ;
} ;
#endif // _TSP_HANDLE_H_
To copy to clipboard, switch view to plain text mode
this code has been compiled, linked and executed successfully on windows.
If you want to try, let me know if it worked
Bookmarks