Results 1 to 2 of 2

Thread: Prob: Adding SpinBox to the GraphicsWidget

  1. #1
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Prob: Adding SpinBox to the GraphicsWidget

    Hi ,

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

    I want to add spin box to this GraphicsWidget .

    Qt Code:
    1. QSpinBox *m_pSpinBox = new QSpinBox(this);
    To copy to clipboard, switch view to plain text mode 

    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 .
    Last edited by jpn; 20th May 2008 at 08:53. Reason: missing tags
    Ashish Kumar Saryar

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Prob: Adding SpinBox to the GraphicsWidget

    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.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.