PDA

View Full Version : Prob: Adding SpinBox to the GraphicsWidget



ashishsaryar
20th May 2008, 08:10
Hi ,

I reimplement my custom QGraphicsWidget and i add it in my custom scene.

I want to add spin box to this GraphicsWidget .


QSpinBox *m_pSpinBox = new QSpinBox(this);

If I pass parent as this widget its showing erro like this :


error C2664 : 'QSpinBox::QSpinBox(QWidget *)' : cannot convert parameter 1 from 'QCustomGraphicsWidget *const ' to 'QWidget *'


Please help me to add spin box to the GraphicsWidget .

Thanks .

jpn
20th May 2008, 09:00
As it say, "this" is not a QWidget. Why don't you use QGraphicsProxyWidget? From QGraphicsProxyWidget::setWidget() docs:

widget must be a top-level widget whose parent is 0.