Results 1 to 11 of 11

Thread: catch signal stepDown from doubleSpinBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: catch signal stepDown from doubleSpinBox

    Is it only the stepDown slot? The stepUp/Down slots are public in QDoubleSpinBox, and you are redeclaring them as private. Maybe that's causing your problem.

  2. #2
    Join Date
    Feb 2008
    Posts
    157
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: catch signal stepDown from doubleSpinBox

    Quote Originally Posted by rexi View Post
    Is it only the stepDown slot? The stepUp/Down slots are public in QDoubleSpinBox, and you are redeclaring them as private. Maybe that's causing your problem.
    makeing the slots public changes nothing. The functions are still not called at button up or down.

    EDIT:
    If I use the correct virtual function it works:
    Qt Code:
    1. // overwritten virtual function of QAbstractSpinBox
    2. void QScienceSpinBox::stepBy(int steps)
    3. {
    4. if (steps < 0)
    5. stepDown();
    6. else
    7. stepUp();
    8. }
    9.  
    10. void QScienceSpinBox::stepDown()
    11. {
    12. QSBDEBUG() << "stepDown()";
    13. setValue(value()/10.0);
    14. }
    15.  
    16. void QScienceSpinBox::stepUp()
    17. {
    18. QSBDEBUG() << "stepUp()";
    19. setValue(value()*10.0);
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by pospiech; 3rd January 2009 at 14:55.

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.