PDA

View Full Version : QGraphicsView



hgedek
17th August 2007, 10:03
class ImenuPage:public QGraphicsView,public IBasePage
{
}
IBasePage is an abstract class and inherits from QWidget.


ImenuPage::ImenuPage(EditorPage *_editor,QWidget *parent)
:QGraphicsView(parent),IBasePage(_editor)
{
scene=new QGraphicsScene;
scene->setSceneRect(230, 100, 560, 320);
setScene(scene);
}

class IBasePage:public QWidget
{
}

When I didnt use IBasePage I can create a scene and show images.But If I use above codes there is nothing.Why?

marcel
17th August 2007, 10:16
I think this is because both your base classes have as base class QWidget.

Therefore you will get compilations errors about ambiguous members/functions( I think ).
If you really need two base classes, then I think you should use virtual inheritance.

Regards