View Full Version : Changing QFrame to QGraphicsView in Draggable icons example

9th October 2009, 15:27
In the Draggable Icons example, the DragWidget class inherits the QFrame class. I changed the code so that the DragWidget class now inherits the QGraphicsView class. Now the program does not work. The background color is not set to gray. I cannot drag the icons around anymore either.

The QGraphicsView class inherits QAbstractScrollArea which inherits QFrame. So what has changed that doesn't allow the icons to be dragged?

12th October 2009, 21:17
Anyone know?

12th October 2009, 22:42
hmm did you read documentation about QGraphicsView? It is a bit more complicated than QFrame. Are you changing icons into QGraphicsPixmapItems? Did you setup the scene t your needs? I assume that the background is now white and I think it is the color it should be now so nothing weird...