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/qpushbutton.h:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>qpushbutton.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>qpushbutton.h</h1>
|
---|
33 |
|
---|
34 | <p>This is the verbatim text of the qpushbutton.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
35 | <hr>
|
---|
36 | <pre>
|
---|
37 | /****************************************************************************
|
---|
38 | ** $Id: qpushbutton-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
39 | **
|
---|
40 | ** Definition of QPushButton class
|
---|
41 | **
|
---|
42 | ** Created : 940221
|
---|
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 QPUSHBUTTON_H
|
---|
75 | #define QPUSHBUTTON_H
|
---|
76 |
|
---|
77 | #ifndef QT_H
|
---|
78 | #include "qbutton.h"
|
---|
79 | #include "qiconset.h"
|
---|
80 | #endif // QT_H
|
---|
81 |
|
---|
82 | #ifndef QT_NO_PUSHBUTTON
|
---|
83 | class QPushButtonPrivate;
|
---|
84 | class QPopupMenu;
|
---|
85 |
|
---|
86 | class Q_EXPORT QPushButton : public QButton
|
---|
87 | {
|
---|
88 | Q_OBJECT
|
---|
89 |
|
---|
90 | Q_PROPERTY( bool autoDefault READ autoDefault WRITE setAutoDefault )
|
---|
91 | Q_PROPERTY( bool default READ isDefault WRITE setDefault )
|
---|
92 | Q_PROPERTY( bool menuButton READ isMenuButton DESIGNABLE false )
|
---|
93 | Q_PROPERTY( QIconSet iconSet READ iconSet WRITE setIconSet )
|
---|
94 | Q_OVERRIDE( bool toggleButton WRITE setToggleButton )
|
---|
95 | Q_OVERRIDE( bool on WRITE setOn )
|
---|
96 | Q_PROPERTY( bool flat READ isFlat WRITE setFlat )
|
---|
97 | Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
|
---|
98 |
|
---|
99 | public:
|
---|
100 | QPushButton( QWidget *parent, const char* name=0 );
|
---|
101 | QPushButton( const QString &text, QWidget *parent, const char* name=0 );
|
---|
102 | #ifndef QT_NO_ICONSET
|
---|
103 | QPushButton( const QIconSet& icon, const QString &text, QWidget *parent, const char* name=0 );
|
---|
104 | #endif
|
---|
105 | ~QPushButton();
|
---|
106 |
|
---|
107 | QSize sizeHint() const;
|
---|
108 |
|
---|
109 | void move( int x, int y );
|
---|
110 | void move( const QPoint &p );
|
---|
111 | void resize( int w, int h );
|
---|
112 | void resize( const QSize & );
|
---|
113 | void setGeometry( int x, int y, int w, int h );
|
---|
114 |
|
---|
115 | void setGeometry( const QRect & );
|
---|
116 |
|
---|
117 | void setToggleButton( bool );
|
---|
118 |
|
---|
119 | bool autoDefault() const { return autoDefButton; }
|
---|
120 | virtual void setAutoDefault( bool autoDef );
|
---|
121 | bool isDefault() const { return defButton; }
|
---|
122 | virtual void setDefault( bool def );
|
---|
123 |
|
---|
124 | virtual void setIsMenuButton( bool enable ) { // obsolete functions
|
---|
125 | if ( (bool)hasMenuArrow == enable )
|
---|
126 | return;
|
---|
127 | hasMenuArrow = enable ? 1 : 0;
|
---|
128 | update();
|
---|
129 | updateGeometry();
|
---|
130 | }
|
---|
131 | bool isMenuButton() const { return hasMenuArrow; }
|
---|
132 |
|
---|
133 | #ifndef QT_NO_POPUPMENU
|
---|
134 | void setPopup( QPopupMenu* popup );
|
---|
135 | QPopupMenu* popup() const;
|
---|
136 | #endif
|
---|
137 | #ifndef QT_NO_ICONSET
|
---|
138 | void setIconSet( const QIconSet& );
|
---|
139 | QIconSet* iconSet() const;
|
---|
140 | #endif
|
---|
141 | void setFlat( bool );
|
---|
142 | bool isFlat() const;
|
---|
143 |
|
---|
144 | public slots:
|
---|
145 | virtual void setOn( bool );
|
---|
146 |
|
---|
147 | protected:
|
---|
148 | void drawButton( QPainter * );
|
---|
149 | void drawButtonLabel( QPainter * );
|
---|
150 | void focusInEvent( QFocusEvent * );
|
---|
151 | void focusOutEvent( QFocusEvent * );
|
---|
152 | void resizeEvent( QResizeEvent * );
|
---|
153 | void updateMask();
|
---|
154 | private slots:
|
---|
155 | #ifndef QT_NO_POPUPMENU
|
---|
156 | void popupPressed();
|
---|
157 | #endif
|
---|
158 | private:
|
---|
159 | void init();
|
---|
160 |
|
---|
161 | uint autoDefButton : 1;
|
---|
162 | uint defButton : 1;
|
---|
163 | uint flt : 1;
|
---|
164 | uint reserved : 1; // UNUSED
|
---|
165 | uint lastEnabled : 1; // UNUSED
|
---|
166 | uint hasMenuArrow : 1;
|
---|
167 |
|
---|
168 | QPushButtonPrivate* d;
|
---|
169 |
|
---|
170 | friend class QDialog;
|
---|
171 |
|
---|
172 | private: // Disabled copy constructor and operator=
|
---|
173 | #if defined(Q_DISABLE_COPY)
|
---|
174 | QPushButton( const QPushButton & );
|
---|
175 | QPushButton &operator=( const QPushButton & );
|
---|
176 | #endif
|
---|
177 | };
|
---|
178 |
|
---|
179 |
|
---|
180 | #endif // QT_NO_PUSHBUTTON
|
---|
181 |
|
---|
182 | #endif // QPUSHBUTTON_H
|
---|
183 | </pre>
|
---|
184 | <!-- eof -->
|
---|
185 | <p><address><hr><div align=center>
|
---|
186 | <table width=100% cellspacing=0 border=0><tr>
|
---|
187 | <td>Copyright © 2007
|
---|
188 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
189 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
190 | </table></div></address></body>
|
---|
191 | </html>
|
---|