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/qscrollview.h:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>qscrollview.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>qscrollview.h</h1>
|
---|
33 |
|
---|
34 | <p>This is the verbatim text of the qscrollview.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
35 | <hr>
|
---|
36 | <pre>
|
---|
37 | /****************************************************************************
|
---|
38 | ** $Id: qscrollview-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
39 | **
|
---|
40 | ** Definition of QScrollView class
|
---|
41 | **
|
---|
42 | ** Created : 970523
|
---|
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 | #ifndef QSCROLLVIEW_H
|
---|
74 | #define QSCROLLVIEW_H
|
---|
75 |
|
---|
76 | #ifndef QT_H
|
---|
77 | #include "qframe.h"
|
---|
78 | #include "qscrollbar.h"
|
---|
79 | #endif // QT_H
|
---|
80 |
|
---|
81 | #ifndef QT_NO_SCROLLVIEW
|
---|
82 |
|
---|
83 | class QScrollViewData;
|
---|
84 |
|
---|
85 | class Q_EXPORT QScrollView : public QFrame
|
---|
86 | {
|
---|
87 | Q_OBJECT
|
---|
88 | Q_ENUMS( ResizePolicy ScrollBarMode )
|
---|
89 | Q_PROPERTY( ResizePolicy resizePolicy READ resizePolicy WRITE setResizePolicy )
|
---|
90 | Q_PROPERTY( ScrollBarMode vScrollBarMode READ vScrollBarMode WRITE setVScrollBarMode )
|
---|
91 | Q_PROPERTY( ScrollBarMode hScrollBarMode READ hScrollBarMode WRITE setHScrollBarMode )
|
---|
92 | Q_PROPERTY( int visibleWidth READ visibleWidth )
|
---|
93 | Q_PROPERTY( int visibleHeight READ visibleHeight )
|
---|
94 | Q_PROPERTY( int contentsWidth READ contentsWidth )
|
---|
95 | Q_PROPERTY( int contentsHeight READ contentsHeight )
|
---|
96 | Q_PROPERTY( int contentsX READ contentsX )
|
---|
97 | Q_PROPERTY( int contentsY READ contentsY )
|
---|
98 | #ifndef QT_NO_DRAGANDDROP
|
---|
99 | Q_PROPERTY( bool dragAutoScroll READ dragAutoScroll WRITE setDragAutoScroll )
|
---|
100 | #endif
|
---|
101 |
|
---|
102 | public:
|
---|
103 | QScrollView(QWidget* parent=0, const char* name=0, WFlags f=0);
|
---|
104 | ~QScrollView();
|
---|
105 |
|
---|
106 | enum ResizePolicy { Default, Manual, AutoOne, AutoOneFit };
|
---|
107 | virtual void setResizePolicy( ResizePolicy );
|
---|
108 | ResizePolicy resizePolicy() const;
|
---|
109 |
|
---|
110 | void styleChange( QStyle & );
|
---|
111 | void removeChild(QWidget* child);
|
---|
112 | virtual void addChild( QWidget* child, int x=0, int y=0 );
|
---|
113 | virtual void moveChild( QWidget* child, int x, int y );
|
---|
114 | int childX(QWidget* child);
|
---|
115 | int childY(QWidget* child);
|
---|
116 | bool childIsVisible(QWidget* child) { return child->isVisible(); } // obsolete functions
|
---|
117 | void showChild(QWidget* child, bool yes=TRUE) {
|
---|
118 | if ( yes )
|
---|
119 | child->show();
|
---|
120 | else
|
---|
121 | child->hide();
|
---|
122 | }
|
---|
123 |
|
---|
124 | enum ScrollBarMode { Auto, AlwaysOff, AlwaysOn };
|
---|
125 |
|
---|
126 | ScrollBarMode vScrollBarMode() const;
|
---|
127 | virtual void setVScrollBarMode( ScrollBarMode );
|
---|
128 |
|
---|
129 | ScrollBarMode hScrollBarMode() const;
|
---|
130 | virtual void setHScrollBarMode( ScrollBarMode );
|
---|
131 |
|
---|
132 | QWidget* cornerWidget() const;
|
---|
133 | virtual void setCornerWidget(QWidget*);
|
---|
134 |
|
---|
135 | // ### 4.0: Consider providing a factory function for scrollbars
|
---|
136 | // (e.g. make the two following functions virtual)
|
---|
137 | QScrollBar* horizontalScrollBar() const;
|
---|
138 | QScrollBar* verticalScrollBar() const;
|
---|
139 | QWidget* viewport() const;
|
---|
140 | QWidget* clipper() const;
|
---|
141 |
|
---|
142 | int visibleWidth() const;
|
---|
143 | int visibleHeight() const;
|
---|
144 |
|
---|
145 | int contentsWidth() const;
|
---|
146 | int contentsHeight() const;
|
---|
147 | int contentsX() const;
|
---|
148 | int contentsY() const;
|
---|
149 |
|
---|
150 | void resize( int w, int h );
|
---|
151 | void resize( const QSize& );
|
---|
152 | void show();
|
---|
153 |
|
---|
154 | void updateContents( int x, int y, int w, int h );
|
---|
155 | void updateContents( const QRect& r );
|
---|
156 | void updateContents();
|
---|
157 | void repaintContents( int x, int y, int w, int h, bool erase=TRUE );
|
---|
158 | void repaintContents( const QRect& r, bool erase=TRUE );
|
---|
159 | void repaintContents( bool erase=TRUE );
|
---|
160 | void contentsToViewport( int x, int y, int& vx, int& vy ) const;
|
---|
161 | void viewportToContents( int vx, int vy, int& x, int& y ) const;
|
---|
162 | QPoint contentsToViewport( const QPoint& ) const;
|
---|
163 | QPoint viewportToContents( const QPoint& ) const;
|
---|
164 | void enableClipper( bool y );
|
---|
165 |
|
---|
166 | void setStaticBackground( bool y );
|
---|
167 | bool hasStaticBackground() const;
|
---|
168 |
|
---|
169 | QSize viewportSize( int, int ) const;
|
---|
170 | QSize sizeHint() const;
|
---|
171 | QSize minimumSizeHint() const;
|
---|
172 |
|
---|
173 | void removeChild(QObject* child);
|
---|
174 |
|
---|
175 | bool isHorizontalSliderPressed();
|
---|
176 | bool isVerticalSliderPressed();
|
---|
177 |
|
---|
178 | #ifndef QT_NO_DRAGANDDROP
|
---|
179 | virtual void setDragAutoScroll( bool b );
|
---|
180 | bool dragAutoScroll() const;
|
---|
181 | #endif
|
---|
182 |
|
---|
183 | signals:
|
---|
184 | void contentsMoving(int x, int y);
|
---|
185 | void horizontalSliderPressed();
|
---|
186 | void horizontalSliderReleased();
|
---|
187 | void verticalSliderPressed();
|
---|
188 | void verticalSliderReleased();
|
---|
189 |
|
---|
190 | public slots:
|
---|
191 | virtual void resizeContents( int w, int h );
|
---|
192 | void scrollBy( int dx, int dy );
|
---|
193 | virtual void setContentsPos( int x, int y );
|
---|
194 | void ensureVisible(int x, int y);
|
---|
195 | void ensureVisible(int x, int y, int xmargin, int ymargin);
|
---|
196 | void center(int x, int y);
|
---|
197 | void center(int x, int y, float xmargin, float ymargin);
|
---|
198 |
|
---|
199 | void updateScrollBars(); // ### virtual in 4.0
|
---|
200 | void setEnabled( bool enable );
|
---|
201 |
|
---|
202 | protected:
|
---|
203 | virtual void drawContents(QPainter*, int cx, int cy, int cw, int ch);
|
---|
204 | virtual void drawContentsOffset(QPainter*, int ox, int oy,
|
---|
205 | int cx, int cy, int cw, int ch);
|
---|
206 |
|
---|
207 |
|
---|
208 | virtual void contentsMousePressEvent( QMouseEvent* );
|
---|
209 | virtual void contentsMouseReleaseEvent( QMouseEvent* );
|
---|
210 | virtual void contentsMouseDoubleClickEvent( QMouseEvent* );
|
---|
211 | virtual void contentsMouseMoveEvent( QMouseEvent* );
|
---|
212 | #ifndef QT_NO_DRAGANDDROP
|
---|
213 | virtual void contentsDragEnterEvent( QDragEnterEvent * );
|
---|
214 | virtual void contentsDragMoveEvent( QDragMoveEvent * );
|
---|
215 | virtual void contentsDragLeaveEvent( QDragLeaveEvent * );
|
---|
216 | virtual void contentsDropEvent( QDropEvent * );
|
---|
217 | #endif
|
---|
218 | #ifndef QT_NO_WHEELEVENT
|
---|
219 | virtual void contentsWheelEvent( QWheelEvent * );
|
---|
220 | #endif
|
---|
221 | virtual void contentsContextMenuEvent( QContextMenuEvent * );
|
---|
222 |
|
---|
223 |
|
---|
224 | virtual void viewportPaintEvent( QPaintEvent* );
|
---|
225 | virtual void viewportResizeEvent( QResizeEvent* );
|
---|
226 | virtual void viewportMousePressEvent( QMouseEvent* );
|
---|
227 | virtual void viewportMouseReleaseEvent( QMouseEvent* );
|
---|
228 | virtual void viewportMouseDoubleClickEvent( QMouseEvent* );
|
---|
229 | virtual void viewportMouseMoveEvent( QMouseEvent* );
|
---|
230 | #ifndef QT_NO_DRAGANDDROP
|
---|
231 | virtual void viewportDragEnterEvent( QDragEnterEvent * );
|
---|
232 | virtual void viewportDragMoveEvent( QDragMoveEvent * );
|
---|
233 | virtual void viewportDragLeaveEvent( QDragLeaveEvent * );
|
---|
234 | virtual void viewportDropEvent( QDropEvent * );
|
---|
235 | #endif
|
---|
236 | #ifndef QT_NO_WHEELEVENT
|
---|
237 | virtual void viewportWheelEvent( QWheelEvent * );
|
---|
238 | #endif
|
---|
239 | virtual void viewportContextMenuEvent( QContextMenuEvent * );
|
---|
240 |
|
---|
241 | void frameChanged();
|
---|
242 |
|
---|
243 | virtual void setMargins(int left, int top, int right, int bottom);
|
---|
244 | int leftMargin() const;
|
---|
245 | int topMargin() const;
|
---|
246 | int rightMargin() const;
|
---|
247 | int bottomMargin() const;
|
---|
248 |
|
---|
249 | bool focusNextPrevChild( bool next );
|
---|
250 |
|
---|
251 | virtual void setHBarGeometry(QScrollBar& hbar, int x, int y, int w, int h);
|
---|
252 | virtual void setVBarGeometry(QScrollBar& vbar, int x, int y, int w, int h);
|
---|
253 |
|
---|
254 | void resizeEvent(QResizeEvent*);
|
---|
255 | void mousePressEvent( QMouseEvent * );
|
---|
256 | void mouseReleaseEvent( QMouseEvent * );
|
---|
257 | void mouseDoubleClickEvent( QMouseEvent * );
|
---|
258 | void mouseMoveEvent( QMouseEvent * );
|
---|
259 | #ifndef QT_NO_WHEELEVENT
|
---|
260 | void wheelEvent( QWheelEvent * );
|
---|
261 | #endif
|
---|
262 | void contextMenuEvent( QContextMenuEvent * );
|
---|
263 | bool eventFilter( QObject *, QEvent *e );
|
---|
264 |
|
---|
265 | void setCachedSizeHint( const QSize &sh ) const;
|
---|
266 | QSize cachedSizeHint() const;
|
---|
267 | void fontChange( const QFont & );
|
---|
268 |
|
---|
269 | private:
|
---|
270 | void drawContents( QPainter* );
|
---|
271 | void moveContents(int x, int y);
|
---|
272 |
|
---|
273 | QScrollViewData* d;
|
---|
274 |
|
---|
275 | private slots:
|
---|
276 | void hslide(int);
|
---|
277 | void vslide(int);
|
---|
278 | void hbarIsPressed();
|
---|
279 | void hbarIsReleased();
|
---|
280 | void vbarIsPressed();
|
---|
281 | void vbarIsReleased();
|
---|
282 | #ifndef QT_NO_DRAGANDDROP
|
---|
283 | void doDragAutoScroll();
|
---|
284 | void startDragAutoScroll();
|
---|
285 | void stopDragAutoScroll();
|
---|
286 | #endif
|
---|
287 |
|
---|
288 | private: // Disabled copy constructor and operator=
|
---|
289 | #if defined(Q_DISABLE_COPY)
|
---|
290 | QScrollView( const QScrollView & );
|
---|
291 | QScrollView &operator=( const QScrollView & );
|
---|
292 | #endif
|
---|
293 | void changeFrameRect(const QRect&);
|
---|
294 |
|
---|
295 | public:
|
---|
296 | void disableSizeHintCaching();
|
---|
297 |
|
---|
298 | };
|
---|
299 |
|
---|
300 | #endif // QT_NO_SCROLLVIEW
|
---|
301 |
|
---|
302 | #endif // QSCROLLVIEW_H
|
---|
303 | </pre>
|
---|
304 | <!-- eof -->
|
---|
305 | <p><address><hr><div align=center>
|
---|
306 | <table width=100% cellspacing=0 border=0><tr>
|
---|
307 | <td>Copyright © 2007
|
---|
308 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
309 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
310 | </table></div></address></body>
|
---|
311 | </html>
|
---|