Results 1 to 5 of 5

Thread: how to clear spinbox values

  1. #1
    Join Date
    Dec 2010
    Location
    Lithuania
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default how to clear spinbox values

    How to clear spin box value? I mean if current showing value is 5 but after clicking clear button it should go to 1. How to do this?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to clear spinbox values

    QSpinBox::setValue( 1 ) should do what you want.

  3. #3
    Join Date
    Dec 2010
    Location
    Lithuania
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to clear spinbox values

    nope. it doesn't. If it would I would not asked

  4. #4
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to clear spinbox values

    nope. it doesn't. If it would I would not asked
    hi,
    what u want? mention it clearly.
    Bala

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to clear spinbox values

    Quote Originally Posted by Shien View Post
    nope. it doesn't. If it would I would not asked
    So how are you connecting the clicked() signal from the clear button to the setValue() call on the spinbox? Do you even know if the connection is working? Have you used the debugger to see if clicking the clear button gets to the slot that resets the spinbox value?

    You should probably show us some code.

Similar Threads

  1. Getting the value from a spinbox
    By X-man in forum Newbie
    Replies: 14
    Last Post: 28th September 2007, 01:27
  2. spinbox
    By mickey in forum Newbie
    Replies: 5
    Last Post: 26th July 2006, 19:09
  3. spinbox
    By mickey in forum Newbie
    Replies: 2
    Last Post: 22nd May 2006, 08:35
  4. buttonGroup and spinBox
    By mickey in forum Newbie
    Replies: 9
    Last Post: 21st May 2006, 17:50
  5. Custom SpinBox
    By Luis Rodriguez in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2006, 18: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.