1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qslider.h:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>qslider.h Include File</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qslider.h</h1>
|
---|
33 |
|
---|
34 | <p>This is the verbatim text of the qslider.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
35 | <hr>
|
---|
36 | <pre>
|
---|
37 | /****************************************************************************
|
---|
38 | ** $Id: qslider-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
39 | **
|
---|
40 | ** Definition of QSlider class
|
---|
41 | **
|
---|
42 | ** Created : 961019
|
---|
43 | **
|
---|
44 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
45 | **
|
---|
46 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
47 | **
|
---|
48 | ** This file may be distributed under the terms of the Q Public License
|
---|
49 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
50 | ** LICENSE.QPL included in the packaging of this file.
|
---|
51 | **
|
---|
52 | ** This file may be distributed and/or modified under the terms of the
|
---|
53 | ** GNU General Public License version 2 as published by the Free Software
|
---|
54 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
55 | ** packaging of this file.
|
---|
56 | **
|
---|
57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
58 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
59 | ** Agreement provided with the Software.
|
---|
60 | **
|
---|
61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
63 | **
|
---|
64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
65 | ** information about Qt Commercial License Agreements.
|
---|
66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
68 | **
|
---|
69 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
70 | ** not clear to you.
|
---|
71 | **
|
---|
72 | **********************************************************************/
|
---|
73 |
|
---|
74 | #ifndef QSLIDER_H
|
---|
75 | #define QSLIDER_H
|
---|
76 |
|
---|
77 | #ifndef QT_H
|
---|
78 | #include "qwidget.h"
|
---|
79 | #include "qrangecontrol.h"
|
---|
80 | #endif // QT_H
|
---|
81 |
|
---|
82 | #ifndef QT_NO_SLIDER
|
---|
83 |
|
---|
84 | struct QSliderPrivate;
|
---|
85 |
|
---|
86 | class QTimer;
|
---|
87 |
|
---|
88 | class Q_EXPORT QSlider : public QWidget, public QRangeControl
|
---|
89 | {
|
---|
90 | Q_OBJECT
|
---|
91 | Q_ENUMS( TickSetting )
|
---|
92 | Q_PROPERTY( int minValue READ minValue WRITE setMinValue )
|
---|
93 | Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue )
|
---|
94 | Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep )
|
---|
95 | Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep )
|
---|
96 | Q_PROPERTY( int value READ value WRITE setValue )
|
---|
97 | Q_PROPERTY( bool tracking READ tracking WRITE setTracking )
|
---|
98 | Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
|
---|
99 | Q_PROPERTY( TickSetting tickmarks READ tickmarks WRITE setTickmarks )
|
---|
100 | Q_PROPERTY( int tickInterval READ tickInterval WRITE setTickInterval )
|
---|
101 |
|
---|
102 | public:
|
---|
103 | enum TickSetting { NoMarks = 0, Above = 1, Left = Above,
|
---|
104 | Below = 2, Right = Below, Both = 3 };
|
---|
105 |
|
---|
106 | QSlider( QWidget *parent, const char* name = 0 );
|
---|
107 | QSlider( Orientation, QWidget *parent, const char* name = 0 );
|
---|
108 | QSlider( int minValue, int maxValue, int pageStep, int value, Orientation,
|
---|
109 | QWidget *parent, const char* name = 0 );
|
---|
110 | ~QSlider();
|
---|
111 |
|
---|
112 | virtual void setOrientation( Orientation );
|
---|
113 | Orientation orientation() const;
|
---|
114 | virtual void setTracking( bool enable );
|
---|
115 | bool tracking() const;
|
---|
116 | virtual void setPalette( const QPalette & );
|
---|
117 |
|
---|
118 | int sliderStart() const;
|
---|
119 | QRect sliderRect() const;
|
---|
120 | QSize sizeHint() const;
|
---|
121 | void setSizePolicy( QSizePolicy sp );
|
---|
122 | void setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw = FALSE );
|
---|
123 |
|
---|
124 | QSizePolicy sizePolicy() const;
|
---|
125 | QSize minimumSizeHint() const;
|
---|
126 |
|
---|
127 | virtual void setTickmarks( TickSetting );
|
---|
128 | TickSetting tickmarks() const { return ticks; }
|
---|
129 |
|
---|
130 | virtual void setTickInterval( int );
|
---|
131 | int tickInterval() const { return tickInt; }
|
---|
132 |
|
---|
133 | int minValue() const;
|
---|
134 | int maxValue() const;
|
---|
135 | void setMinValue( int );
|
---|
136 | void setMaxValue( int );
|
---|
137 | int lineStep() const;
|
---|
138 | int pageStep() const;
|
---|
139 | void setLineStep( int );
|
---|
140 | void setPageStep( int );
|
---|
141 | int value() const;
|
---|
142 |
|
---|
143 | public slots:
|
---|
144 | virtual void setValue( int );
|
---|
145 | void addStep();
|
---|
146 | void subtractStep();
|
---|
147 | void addLine();
|
---|
148 | void subtractLine();
|
---|
149 |
|
---|
150 | signals:
|
---|
151 | void valueChanged( int value );
|
---|
152 | void sliderPressed();
|
---|
153 | void sliderMoved( int value );
|
---|
154 | void sliderReleased();
|
---|
155 |
|
---|
156 | protected:
|
---|
157 | void resizeEvent( QResizeEvent * );
|
---|
158 | void paintEvent( QPaintEvent * );
|
---|
159 |
|
---|
160 | void keyPressEvent( QKeyEvent * );
|
---|
161 | void mousePressEvent( QMouseEvent * );
|
---|
162 | void mouseReleaseEvent( QMouseEvent * );
|
---|
163 | void mouseMoveEvent( QMouseEvent * );
|
---|
164 | #ifndef QT_NO_WHEELEVENT
|
---|
165 | void wheelEvent( QWheelEvent * );
|
---|
166 | #endif
|
---|
167 | void focusInEvent( QFocusEvent *e );
|
---|
168 | void focusOutEvent( QFocusEvent *e );
|
---|
169 |
|
---|
170 | void styleChange( QStyle& );
|
---|
171 |
|
---|
172 | void valueChange();
|
---|
173 | void rangeChange();
|
---|
174 |
|
---|
175 | private slots:
|
---|
176 | void repeatTimeout();
|
---|
177 |
|
---|
178 | private:
|
---|
179 | enum State { Idle, Dragging, TimingUp, TimingDown };
|
---|
180 |
|
---|
181 | void init();
|
---|
182 | int positionFromValue( int ) const;
|
---|
183 | int valueFromPosition( int ) const;
|
---|
184 | void moveSlider( int );
|
---|
185 | void reallyMoveSlider( int );
|
---|
186 | void resetState();
|
---|
187 | int available() const;
|
---|
188 | int goodPart( const QPoint& ) const;
|
---|
189 | void initTicks();
|
---|
190 |
|
---|
191 | QSliderPrivate *d;
|
---|
192 | QTimer *timer;
|
---|
193 | QCOORD sliderPos;
|
---|
194 | int sliderVal;
|
---|
195 | QCOORD clickOffset;
|
---|
196 | State state;
|
---|
197 | bool track;
|
---|
198 | QCOORD tickOffset;
|
---|
199 | TickSetting ticks;
|
---|
200 | int tickInt;
|
---|
201 | Orientation orient;
|
---|
202 |
|
---|
203 | private: // Disabled copy constructor and operator=
|
---|
204 | #if defined(Q_DISABLE_COPY)
|
---|
205 | QSlider( const QSlider & );
|
---|
206 | QSlider &operator=( const QSlider & );
|
---|
207 | #endif
|
---|
208 | };
|
---|
209 |
|
---|
210 | inline bool QSlider::tracking() const
|
---|
211 | {
|
---|
212 | return track;
|
---|
213 | }
|
---|
214 |
|
---|
215 | inline QSlider::Orientation QSlider::orientation() const
|
---|
216 | {
|
---|
217 | return orient;
|
---|
218 | }
|
---|
219 |
|
---|
220 | inline int QSlider::sliderStart() const
|
---|
221 | {
|
---|
222 | return sliderPos;
|
---|
223 | }
|
---|
224 |
|
---|
225 | inline void QSlider::setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw )
|
---|
226 | {
|
---|
227 | QWidget::setSizePolicy( hor, ver, hfw );
|
---|
228 | }
|
---|
229 |
|
---|
230 | #endif // QT_NO_SLIDER
|
---|
231 |
|
---|
232 | #endif // QSLIDER_H
|
---|
233 | </pre>
|
---|
234 | <!-- eof -->
|
---|
235 | <p><address><hr><div align=center>
|
---|
236 | <table width=100% cellspacing=0 border=0><tr>
|
---|
237 | <td>Copyright © 2007
|
---|
238 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
239 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
240 | </table></div></address></body>
|
---|
241 | </html>
|
---|