MagicSmoke  $VERSION$
centbox.h
Go to the documentation of this file.
1 //
2 // C++ Interface: centbox
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008-2011
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_CENTBOX_H
14 #define MAGICSMOKE_CENTBOX_H
15 
16 #include <QAbstractSpinBox>
17 #include <QDialog>
18 #include <QRegExpValidator>
19 
20 #include "commonexport.h"
21 
22 class MAGICSMOKE_COMMON_EXPORT MCentSpinBox:public QAbstractSpinBox
23 {
24  Q_OBJECT
25  public:
26  MCentSpinBox(QWidget*parent=0,int value=0,int maxValue=2147483647);
27 
28  virtual int value()const;
29  virtual void setValue(int);
30 
31  virtual void setRange(int,int);
32 
33  virtual int minimumValue()const;
34  virtual int maximumValue()const;
35 
36  void stepBy(int);
37  protected:
38  virtual QValidator::State validate(QString &input, int &pos) const;
39  virtual StepEnabled stepEnabled () const;
40  signals:
41  void valueChanged(int);
42  private slots:
43  void fixup();
44  private:
45  int mval,mmax,mmin;
46  QRegExpValidator mvalid;
47 };
48 
50 {
51  Q_OBJECT
52  public:
53  MCentDialog(QWidget*parent=0,QString title=QString(),QString label=QString(),int value=0,int maxValue=2147483647);
54 
55  virtual int value()const;
56 
57  static int getCents(QWidget*parent=0,QString title=QString(),QString label=QString(),int value=0,int maxValue=2147483647,bool *ok=0);
58  private:
59  MCentSpinBox*box;
60 };
61 
62 #endif
#define MAGICSMOKE_COMMON_EXPORT
Definition: commonexport.h:7
Definition: centbox.h:49
Definition: centbox.h:22