Results 1 to 1 of 1

Thread: Add a QSpinBox in the ToolBar

  1. #1
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    39
    Thanks
    15
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Add a QSpinBox in the ToolBar

    Okay so how do I add a spinbox into the toolbar via the Qt Creator?

    I have other actions in there (open, close, save etc) which is fine because they are represented by an icon, but a spinbox wont stick in there as it were.

    Cheers
    Oz

    Okay so how do I add a spinbox into the toolbar via the Qt Creator?

    I have other actions in there (open, close, save etc) which is fine because they are represented by an icon, but a spinbox wont stick in there as it were.

    Cheers
    Oz


    Added after 1 40 minutes:


    Solved: Has to be done within code and not in the creator if its a widget (same applies to the statusbar I think. At least a post I saw that Wysota replied to said as much. Thanks Wysota)

    e.g. in the MainWindow constructor
    Qt Code:
    1. QSpinBox *spinBox = new QSpinBox(this);
    2. ui->toolBar->addWidget(spinBox);
    To copy to clipboard, switch view to plain text mode 

    Cheers
    Oz
    Last edited by OzQTNoob; 16th October 2012 at 06:58.

Similar Threads

  1. QSpinBox
    By ToddAtWSU in forum Qt Programming
    Replies: 10
    Last Post: 1st September 2012, 03:36
  2. QSpinbox
    By Markus_AC in forum Qt Programming
    Replies: 8
    Last Post: 20th October 2011, 11:26
  3. Replies: 5
    Last Post: 11th September 2010, 14:29
  4. QSpinbox
    By sonuani in forum Newbie
    Replies: 3
    Last Post: 21st March 2008, 10:36
  5. Reading the value of a QSpinBox
    By jochen_r in forum Newbie
    Replies: 4
    Last Post: 10th January 2006, 12:25

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
  •  
Qt is a trademark of The Qt Company.