All of the interesting technological, artistic or just plain fun subjects I'd investigate if I had an infinite number of lifetimes. In other words, a dumping ground...

Wednesday 19 August 2009

Qt Designer and subclassing QGraphicsView

From http://doc.trolltech.com/qq/qq20-jambi.html


The display is implemented by subclassing the QGraphicsView class. When using Qt Designer to create our user interface, this custom widget is unavailable to us. But it is still possible to include the widget in the user interface definition by "promoting" one of Qt's regular widgets as a placeholder for it on the form we create in Qt Designer.

So, when designing the user interface, we put a QGraphicsView widget onto the form, Then we open a context menu over it and click Promote to Custom Widget. In the dialog that opens, we specify the name of our subclass: QtanoidView in this case.

No comments:

tim's shared items

Add to Google Reader or Homepage