Results 1 to 5 of 5

Thread: Default visible text descriptor on widgets like QSpinBox and QComboBox

  1. #1
    Join Date
    May 2010
    Posts
    41
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Default visible text descriptor on widgets like QSpinBox and QComboBox

    Hi,

    I'm wondering if it's possible to have some kind of default text descriptor on widgets like the QSpinBox and QComboBox so that before you even use the control, that text is shown. As an example, if I have a QComboBox which allows you to select different countries, then the default text would show "Country", but it would not be an option once you collapse the combobox. Is this at all easily possible in Qt?

  2. #2
    Join Date
    May 2010
    Posts
    41
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Default visible text descriptor on widgets like QSpinBox and QComboBox

    Bump.......

  3. #3
    Join Date
    May 2010
    Posts
    41
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Default visible text descriptor on widgets like QSpinBox and QComboBox

    One more bump I guess...

  4. #4
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Default visible text descriptor on widgets like QSpinBox and QComboBox

    Bump

    I'm searching for this...

  5. #5
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Default visible text descriptor on widgets like QSpinBox and QComboBox

    Wow, that's an old timer

    As far as I know there's no such functionality out-of-a-box in qt.
    First item added to the combobox is displayed as currently selected item.

    You could create your own widget using QPushButton and QListWidget (as a popup).

    Edit:
    In fact for spin box you can do something like that:
    Qt Code:
    1. spinBox->setSpecialValueText( "Some Default Text" );
    To copy to clipboard, switch view to plain text mode 
    This text will be displayed when spinbox value is equal to minimum.
    Last edited by Spitfire; 27th April 2012 at 11:26.

Similar Threads

  1. Lowering the text in a QSpinBox
    By Stobie in forum Qt Programming
    Replies: 0
    Last Post: 14th February 2010, 20:57
  2. Horizontal QSpinBox or QComboBox???
    By sendyou in forum Qt Programming
    Replies: 4
    Last Post: 19th August 2008, 07:30
  3. Contents not Properly Visible in QComboBox
    By merry in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2007, 12:32
  4. Key shortcuts for not visible widgets
    By trskel in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2007, 10:02
  5. All widgets are visible in QStackedWidget
    By YuriyRusinov in forum Qt Programming
    Replies: 14
    Last Post: 22nd March 2007, 12:02

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.