C++ (Qt)class PPIDisplay : public QObject{ Q_OBJECTpublic slots: virtual void createTarget(int id, int type, qreal x, qreal y) = 0; virtual void destroyTarget(int id) = 0; virtual void moveTarget(int id, qreal x, qreal y) = 0; virtual void moveRay(qreal delta) = 0;};
C++ (Qt)class SceneView : public PPIDisplay, public QGraphicsView{ Q_OBJECTpublic: explicit SceneView(QWidget *parent = 0);};
Warning: Class SceneView inherits from two QObject subclasses PPIDisplay and QGraphicsView. This is not supported!
C++ (Qt)class PPIDisplay : public virtual QObject
C++ (Qt)class Animal {public: virtual void eat();}; class Mammal : public virtual Animal {public: virtual Color getHairColor();}; class WingedAnimal : public virtual Animal {public: virtual void flap();}; class Bat : public Mammal, public WingedAnimal {};
C++ (Qt)class SceneDisplay : public QGraphicsScene, public PPIDisplay{public: SceneDisplay();public slots: void createTarget(int id, int type, qreal x, qreal y) {} void destroyTarget(int id) {} void moveTarget(int id, qreal x, qreal y) {} void moveRay(qreal delta) {}};
C++ (Qt)class PPIDisplay : public QObject{ Q_OBJECT public: PPIDisplay(QObject *parent = 0) : QObject(parent) {} public slots: virtual void createTarget(int id, int type, qreal x, qreal y) = 0; virtual void destroyTarget(int id) = 0; virtual void moveTarget(int id, qreal x, qreal y) = 0; virtual void moveRay(qreal delta) = 0;};
C++ (Qt)class SceneDisplay : public PPIDisplay{ Q_OBJECT public: SceneDisplay(QObject *parent = 0) : PPIDisplay(parent) {} public slots: void createTarget(int id, int type, qreal x, qreal y); void destroyTarget(int id); void moveTarget(int id, qreal x, qreal y); void moveRay(qreal delta); private: QGraphicsScene *m_scene;};