libyui-qt
YQSlider.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: YQSlider.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQSlider_h
27 #define YQSlider_h
28 
29 #include <QFrame>
30 #include <yui/YSlider.h>
31 
32 class YQWidgetCaption;
33 class QSlider;
34 class QSpinBox;
35 
36 class YQSlider : public QFrame, public YSlider
37 {
38  Q_OBJECT
39 
40 public:
41 
47  YQSlider( YWidget * parent,
48  const std::string & label,
49  int minValue,
50  int maxValue,
51  int initialValue,
52  bool reverseLayout = false );
53 
57  virtual ~YQSlider();
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 
118  virtual bool setKeyboardFocus();
119 
120 
121 public slots:
126  void valueChangedSlot( int newValue );
127 
128 signals:
129 
133  void valueChanged( int newValue );
134 
135 
136 protected:
137 
138  YQWidgetCaption * _caption;
139  QSlider * _qt_slider;
140  QSpinBox * _qt_spinBox;
141  QFrame * _hbox;
142 };
143 
144 
145 #endif // YQSlider_h
Definition: YQSlider.h:36
virtual ~YQSlider()
Definition: YQSlider.cc:122
virtual void setSize(int newWidth, int newHeight)
Definition: YQSlider.cc:183
void valueChangedSlot(int newValue)
Definition: YQSlider.cc:146
virtual int preferredWidth()
Definition: YQSlider.cc:166
virtual int preferredHeight()
Definition: YQSlider.cc:176
YQSlider(YWidget *parent, const std::string &label, int minValue, int maxValue, int initialValue, bool reverseLayout=false)
Definition: YQSlider.cc:43
virtual int value()
Definition: YQSlider.cc:129
void valueChanged(int newValue)
virtual bool setKeyboardFocus()
Definition: YQSlider.cc:198
virtual void setLabel(const std::string &label)
Definition: YQSlider.cc:190
virtual void setValueInternal(int val)
Definition: YQSlider.cc:136
Definition: YQWidgetCaption.h:38
virtual void setEnabled(bool enabled)
Definition: YQSlider.cc:156