libyui-qt
2.46.1
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
YQIntField.h
1
/*
2
Copyright (C) 2000-2012 Novell, Inc
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: YQIntField.h
20
21
Author: Stefan Hundhammer <sh@suse.de>
22
23
/-*/
24
25
26
#ifndef YQIntField_h
27
#define YQIntField_h
28
29
#include <qlabel.h>
30
#include <QFrame>
31
32
#include <yui/YIntField.h>
33
34
35
class
YQWidgetCaption
;
36
class
QSpinBox;
37
38
39
class
YQIntField
:
public
QFrame,
public
YIntField
40
{
41
Q_OBJECT
42
43
public
:
44
45
/**
46
* Constructor.
47
**/
48
YQIntField
( YWidget * parent,
49
const
std::string & label,
50
int
minValue,
51
int
maxValue,
52
int
initialValue );
53
54
/**
55
* Destructor.
56
**/
57
virtual
~YQIntField
();
58
59
/**
60
* Get the current value (the number entered by the user or set from the
61
* outside) of this IntField.
62
*
63
* Implemented from YIntField.
64
**/
65
virtual
int
value
();
66
67
protected
:
68
69
/**
70
* Set the current value (the number entered by the user or set from the
71
* outside) of this IntField. 'val' is guaranteed to be between minValue
72
* and maxValue; no further checks are required.
73
*
74
* Implemented from YIntField.
75
**/
76
virtual
void
setValueInternal
(
int
val );
77
78
public
:
79
80
/**
81
* Set the label (the caption above the input field).
82
*
83
* Reimplemented from YIntField.
84
**/
85
virtual
void
setLabel
(
const
std::string & label );
86
87
/**
88
* Sets the widget's enabled state.
89
*
90
* Inherited from YWidget.
91
**/
92
virtual
void
setEnabled
(
bool
enabled );
93
94
/**
95
* Preferred width of the widget.
96
*
97
* Reimplemented from YWidget.
98
**/
99
virtual
int
preferredWidth
();
100
101
/**
102
* Preferred height of the widget.
103
*
104
* Reimplemented from YWidget.
105
**/
106
virtual
int
preferredHeight
();
107
108
/**
109
* Set the new size of the widget.
110
*
111
* Reimplemented from YWidget.
112
**/
113
virtual
void
setSize
(
int
newWidth,
int
newHeight );
114
115
/**
116
* Accept the keyboard focus.
117
*
118
* Reimplemented from YWidget.
119
**/
120
virtual
bool
setKeyboardFocus
();
121
122
123
signals:
124
125
/**
126
* Emitted when the value changes (regardless of the notify flag).
127
**/
128
void
valueChanged
(
int
newValue );
129
130
131
protected
slots:
132
133
/**
134
* Slot for "value changed". This will send a ValueChanged event if
135
* 'notify' is set.
136
**/
137
void
valueChangedSlot
(
int
newValue );
138
139
140
protected
:
141
142
YQWidgetCaption
* _caption;
143
QSpinBox * _qt_spinBox;
144
};
145
146
147
#endif // YQIntField_h
src
YQIntField.h
Generated by
1.8.3.1