Hello,
I have a question regarding design of multi subclasses item on the scene. I know that's not Qt question but C++ but because of the context I posted it in Qt section, if that's wrong section please move this thread.

What I want to do is to have base class with all common code for the item like this:

Qt Code:
  1. class Base : public virtual QGraphicsItem
  2. {
  3. // common code for all items on the scene
  4. };
To copy to clipboard, switch view to plain text mode 
Next I want some object that are i.e. QGraphicsPixmapItem, QGrapthicsTextItem etc, i.e..
Qt Code:
  1. class ItemA : public Base, public QGraphicsPixmapItem
  2. {
  3. QRectF boundingRect() const {
  4. return QGraphicsPixmapItem::boundingRect();
  5. }
  6.  
  7. void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
  8.  
  9. painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
  10. QGraphicsPixmapItem::paint( painter, option, widget);
  11. }
  12.  
  13. // Only pixmap related code
  14. };
To copy to clipboard, switch view to plain text mode 
Now I want to control all these objects so I store pointers to objects like:
Qt Code:
  1. QList <Base*> itemList;
To copy to clipboard, switch view to plain text mode 
The problem is ambiguity of QGraphicsItem (in Base) due to the fact that i.e. QGraphicsPixmapItem (and all Qt item classes) are declared as:
Qt Code:
  1. class Q_WIDGETS_EXPORT QGraphicsPixmapItem : public QGraphicsItem
To copy to clipboard, switch view to plain text mode 

My question is how would I go about designing classes that do subclass from i.e. QGraphicsPixmapItem