libyui-qt
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 <shundhammer@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 
48  YQIntField( YWidget * parent,
49  const std::string & label,
50  int minValue,
51  int maxValue,
52  int initialValue );
53 
57  virtual ~YQIntField();
58 
65  virtual int value();
66 
67 protected:
68 
76  virtual void setValueInternal( int val );
77 
78 public:
79 
85  virtual void setLabel( const std::string & label );
86 
92  virtual void setEnabled( bool enabled );
93 
99  virtual int preferredWidth();
100 
106  virtual int preferredHeight();
107 
113  virtual void setSize( int newWidth, int newHeight );
114 
120  virtual bool setKeyboardFocus();
121 
122 
123 signals:
124 
128  void valueChanged( int newValue );
129 
130 
131 protected slots:
132 
137  void valueChangedSlot( int newValue );
138 
139 
140 protected:
141 
142  YQWidgetCaption * _caption;
143  QSpinBox * _qt_spinBox;
144 };
145 
146 
147 #endif // YQIntField_h
virtual bool setKeyboardFocus()
Definition: YQIntField.cc:151
virtual void setValueInternal(int val)
Definition: YQIntField.cc:96
Definition: YQIntField.h:39
virtual int value()
Definition: YQIntField.cc:89
virtual void setEnabled(bool enabled)
Definition: YQIntField.cc:121
void valueChanged(int newValue)
void valueChangedSlot(int newValue)
Definition: YQIntField.cc:104
virtual ~YQIntField()
Definition: YQIntField.cc:82
Definition: YQWidgetCaption.h:38
virtual void setLabel(const std::string &label)
Definition: YQIntField.cc:113
virtual int preferredHeight()
Definition: YQIntField.cc:137
YQIntField(YWidget *parent, const std::string &label, int minValue, int maxValue, int initialValue)
Definition: YQIntField.cc:43
virtual int preferredWidth()
Definition: YQIntField.cc:130
virtual void setSize(int newWidth, int newHeight)
Definition: YQIntField.cc:144