Results 1 to 6 of 6

Thread: spinbox

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default spinbox

    I have a spinBox linked to a SLOT; sometimes I used to change its value with keybord and not with arrow; is it possible call SLOT also when I change its value by hand (with keyboard)? thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: spinbox

    should work with connecting signal valueChanged() to the slot you want, this will call that slot every time the value is change, with out regarding how it was changed.

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: spinbox

    valueChanged(int) I suppose. But maybe we aren't understand; actually for change value spinbox I can:
    1. use mouse
    2.point with mouse over number shown by spinbox then type a number AND PRESS RETURN. I'm loooking to avoid this return...can I do it?
    Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: spinbox

    I'm loooking to avoid this return...can I do it
    Only if the values are one digit values.
    For this you will have to subclass QSpinBox and override keyPressEvent().

  5. The following user says thank you to high_flyer for this useful post:

    mickey (26th July 2006)

  6. #5
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: spinbox

    they're two...
    Regards

  7. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: spinbox

    actually now that I think of it, you could make it also with more then one digit numbers, but then the user will always need to fill as many digits as the maximal number has, so for smaller number you can do for example:
    01,02 etc...

Similar Threads

  1. spinbox
    By mickey in forum Newbie
    Replies: 2
    Last Post: 22nd May 2006, 08:35
  2. buttonGroup and spinBox
    By mickey in forum Newbie
    Replies: 9
    Last Post: 21st May 2006, 17:50
  3. problem with spinbox control ?
    By vinod in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2006, 19:58
  4. Custom SpinBox
    By Luis Rodriguez in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2006, 18:25
  5. a simple question: spinbox
    By mickey in forum Newbie
    Replies: 3
    Last Post: 27th February 2006, 15:37

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.