[3e4acc]: libgui / InvertableSpinBox.h Maximize Restore History

Download this file

InvertableSpinBox.h    75 lines (54 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/***************************************************************************
InvertableSpinBox.h - a spinbox with invertable spin buttons
-------------------
begin : Sun Jan 12 2003
copyright : (C) 2003 by Thomas Eschenbacher
email : Thomas.Eschenbacher@gmx.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "config.h"
#include <kdemacros.h>
#include <QSpinBox>
#ifndef _INVERTABLE_SPIN_BOX_H_
#define _INVERTABLE_SPIN_BOX_H_
class QWidget;
class KDE_EXPORT InvertableSpinBox: public QSpinBox
{
Q_OBJECT
public:
/** Constructor */
InvertableSpinBox(QWidget *parent);
/** Destructor */
virtual ~InvertableSpinBox()
{
}
/** enable/disable inverse mode */
virtual void setInverse(bool inverse);
/** returns the current inversion state */
virtual bool inverse() const { return m_inverse; }
public slots:
/**
* calls QSpinBox::stepUp() in normal mode and
* QSpinBox::stepDown() in inverse mode
*/
virtual void stepUp();
/**
* calls QSpinBox::stepDown() in normal mode and
* QSpinBox::stepUp() in inverse mode
*/
virtual void stepDown();
protected slots:
/** checks for range in inverse mode */
void checkValueChange(int value);
private:
/** if true, spin buttons work in inverse mode */
bool m_inverse;
};
#endif /* _INVERTABLE_SPIN_BOX_H_ */