I could be missing something dreadfully obvious here, but....
I have a plugin that creates a QGraphicsScene object and is attached to the QGraphicsView created in the main application. Through the plugin (from the context of the QGraphicsScene object), I want to create a QRadioButton that is attached to the underlying QGraphicsView.
QList<QGraphicsView *>& Views = views();
if(Views.size() == 0)
{
//safety code
}
//We can assume that the Scene (this) is connected to one and only one view.
QRadioButton* pButton = new QRadioButton("Text", Views[0]);
This does not compile on VS 2005 (Qt 4.2.1), the compiler complaining that QGraphicsView* and QWidget* are unrelated pointers. g++ on Mac whines similarily.
According to the docs, the inheritance tree looks like:
QGraphicsView <- QAbstractScrollArea <- QFrame <- QWidget
According to my understanding of C++ this is an acceptable conversion.
Is there something I'm missing, is the documentation correct or what?
Ross
Bookmarks