The QGraphicsItem is a abstrac class and can't be used directly, QGraphicsItem::paint ()is a pure virtual function, so you can't create a object of this class. QGraphics is used as a base class
because of this..
QList<QGraphicsItem> //don't compile. can't create a object of a abstract class
QList<QGraphicsItem *> // works because is posible create a pointer of a abstract class, polymorphism
QList<SubclassGraphicsItem> //works because the class is not abstract
QList<QGraphicsItem> //don't compile. can't create a object of a abstract class
QList<QGraphicsItem *> // works because is posible create a pointer of a abstract class, polymorphism
QList<SubclassGraphicsItem> //works because the class is not abstract
To copy to clipboard, switch view to plain text mode
Bookmarks