Results 1 to 2 of 2

Thread: QSpinBox with quint64 instead of int value - how can i get it?

  1. #1
    Join Date
    Nov 2008
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Question QSpinBox with quint64 instead of int value - how can i get it?

    Does anyone have something like this? I tried to reimplement QAbstractSpinBox but this code does nothing.

    Qt Code:
    1. #include <QWidget>
    2. #include <QAbstractSpinBox>
    3.  
    4. class LongSpinBox: public QAbstractSpinBox
    5. {
    6. Q_OBJECT
    7. public:
    8. LongSpinBox(QWidget* parent = 0);
    9. quint64 val;
    10. QString text() const;
    11. public slots:
    12. void stepUp();
    13. void stepDown();
    14. public:
    15. QAbstractSpinBox::StepEnabled stepEnabled();
    16. signals:
    17. void editingFinished();
    18. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "LongSpinBox.h"
    2. LongSpinBox::LongSpinBox( QWidget* parent /*= 0*/ )
    3. {
    4. val = 0;
    5. }
    6.  
    7. QString LongSpinBox::text() const
    8. {
    9. return "333";
    10. }
    11.  
    12. void LongSpinBox::stepUp()
    13. {
    14. ++val;
    15. }
    16.  
    17. void LongSpinBox::stepDown()
    18. {
    19. --val;
    20. }
    21.  
    22. QAbstractSpinBox::StepEnabled LongSpinBox::stepEnabled()
    23. {
    24. return ( StepUpEnabled) | (StepDownEnabled);
    25. }
    To copy to clipboard, switch view to plain text mode 

  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: QSpinBox with quint64 instead of int value - how can i get it?

    You didn't implement a method to return the quint64 value.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QSpinBox
    By ToddAtWSU in forum Qt Programming
    Replies: 10
    Last Post: 1st September 2012, 03:36
  2. QSpinBox Right-Click
    By mbrusati in forum Qt Programming
    Replies: 4
    Last Post: 30th January 2009, 19:11
  3. QSpinBox on_valueChanged
    By martinb0820 in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2008, 02:31
  4. QSpinbox
    By sonuani in forum Newbie
    Replies: 3
    Last Post: 21st March 2008, 10:36
  5. Reading the value of a QSpinBox
    By jochen_r in forum Newbie
    Replies: 4
    Last Post: 10th January 2006, 12:25

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.