Results 1 to 3 of 3

Thread: How to Set Range in qspinbox and add exception value?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to Set Range in qspinbox and add exception value?

    If you have a set of special values then a QComboBox like suggested by Ginsengelf could also be extended to have one value for "range" and which enables/shows the spinbox when selected.

    If you have one special value, you could use QSpinBox::setSpecialValueText().
    It displays a custom text instead of the numerical value for the spinbox' minimum.

    You could have possibly multiple special values at the beginning or the end by deriving from QSpinBox and overwrite textFromValue() such that the numbers are not displayed but a special text.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    npatil15 (17th April 2019)

Similar Threads

  1. range widget?
    By TorAn in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2016, 08:01
  2. QwtSlider with zero range
    By Induriel in forum Qwt
    Replies: 6
    Last Post: 29th October 2015, 18:44
  3. Out of range detection
    By zgulser in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2009, 09:32
  4. Index out of Range
    By santhoshv84 in forum Qt Programming
    Replies: 2
    Last Post: 19th August 2008, 15:33
  5. QLineEdit set min max range?
    By whitefurrows in forum Qt Programming
    Replies: 29
    Last Post: 10th June 2006, 23:51

Tags for this Thread

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.