[Qt-interest] widget promotion
Andreas Pakulat
apaku at gmx.de
Sat Dec 27 14:17:04 CET 2008
On 27.12.08 14:05:44, ami guru wrote:
> I have customized class with QGaphicsView as a base class .
>
> In the designer i have a main window and dragged a QGraphicsView
> widget and placed that in the form to use that as the placeholder.
>
> Then i promoted that to my customized one.
>
> The customized class that i have has a constructor.
>
> What should be the defualt parameter in the constructor
>
> ********************************************************'
> class H3DNodeView : public QGraphicsView
> {
> H3DNodeView(QWidget *parent = 0);
> };
>
> ****************************************************************'
>
> In that case i have error
>
> H3DNodeView.cpp: In constructor 'H3DNodeView::H3DNodeView(QWidget*)':
> H3DNodeView.cpp:5: error: type 'QWidget' is not a direct base of
> 'H3DNodeView'
Your constructor implementation is wrong, apparently you're using
H3DNodeView::H3DNodeView( QWidget* parent )
: QWidget(parent)
But it should be QGraphicsView in the second line.
Andreas
--
You will soon forget this.
More information about the Qt-interest-old
mailing list