File: qwidget-h.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (927 lines) | stat: -rw-r--r-- 33,087 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
Qt Toolkit - qwidget.h include file
</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>qwidget.h</h1><br clear="all">
This is the verbatim text of the qwidget.h include file.  It is
provided only for illustration; the copyright
remains with Trolltech.
<hr>
<pre>
/****************************************************************************
** &#36;Id&#58; qt/src/kernel/qwidget.h   2.3.2   edited 2001-10-20 $
**
** Definition of QWidget class
**
** Created : 931029
**
** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#ifndef QWIDGET_H
#define QWIDGET_H

#ifndef QT_H
#include "qwindowdefs.h"
#include "qobject.h"
#include "qpaintdevice.h"
#include "qpalette.h"
#include "qcursor.h"
#include "qfont.h"
#include "qfontmetrics.h"
#include "qfontinfo.h"
#include "qstyle.h"
#include "qsizepolicy.h"
#endif // QT_H

class <a href="qlayout.html">QLayout</a>;
struct QWExtra;
struct QTLWExtra;
class <a href="qfocusdata.html">QFocusData</a>;
class <a href="qstyle.html">QStyle</a>;
class QWSRegionManager;

class Q_EXPORT <a href="qwidget.html">QWidget</a> : public <a href="qobject.html">QObject</a>, public <a href="qpaintdevice.html">QPaintDevice</a>
{
    Q_OBJECT
    Q_ENUMS( BackgroundMode PropagationMode FocusPolicy BackgroundOrigin )
    Q_PROPERTY( bool isTopLevel READ isTopLevel )
    Q_PROPERTY( bool isModal READ isModal )
    Q_PROPERTY( bool isPopup READ isPopup )
    Q_PROPERTY( bool isDesktop READ isDesktop )
    Q_PROPERTY( bool enabled READ isEnabled WRITE setEnabled )
    Q_PROPERTY( QRect geometry READ geometry WRITE setGeometry )
    Q_PROPERTY( QRect frameGeometry READ frameGeometry )
    Q_PROPERTY( int x READ x )
    Q_PROPERTY( int y READ y )
    Q_PROPERTY( QPoint pos READ pos )
    Q_PROPERTY( QSize frameSize READ frameSize )
    Q_PROPERTY( QSize size READ size WRITE resize DESIGNABLE false )
    Q_PROPERTY( int width READ width )
    Q_PROPERTY( int height READ height )
    Q_PROPERTY( QRect rect READ rect )
    Q_PROPERTY( QRect childrenRect READ childrenRect )
    Q_PROPERTY( QRegion childrenRegion READ childrenRegion )
    Q_PROPERTY( QSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy )
    Q_PROPERTY( QSize minimumSize READ minimumSize WRITE setMinimumSize )
    Q_PROPERTY( QSize maximumSize READ maximumSize WRITE setMaximumSize )
    Q_PROPERTY( int minimumWidth READ minimumWidth WRITE setMinimumWidth STORED false )
    Q_PROPERTY( int minimumHeight READ minimumHeight WRITE setMinimumHeight STORED false )
    Q_PROPERTY( int maximumWidth READ maximumWidth WRITE setMaximumWidth STORED false )
    Q_PROPERTY( int maximumHeight READ maximumHeight WRITE setMaximumHeight STORED false )
    Q_PROPERTY( QSize sizeIncrement READ sizeIncrement WRITE setSizeIncrement )
    Q_PROPERTY( QSize baseSize READ baseSize WRITE setBaseSize )
    Q_PROPERTY( BackgroundMode backgroundMode READ backgroundMode WRITE setBackgroundMode DESIGNABLE false )
    Q_PROPERTY( QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE false )
    Q_PROPERTY( QColor foregroundColor READ foregroundColor )
    Q_PROPERTY( QPixmap backgroundPixmap READ backgroundPixmap WRITE setBackgroundPixmap DESIGNABLE false )
    Q_PROPERTY( QColorGroup colorGroup READ colorGroup )
    Q_PROPERTY( QPalette palette READ palette WRITE setPalette RESET unsetPalette )
    Q_PROPERTY( bool ownPalette READ ownPalette )
    Q_PROPERTY( QFont font READ font WRITE setFont RESET unsetFont )
    Q_PROPERTY( bool ownFont READ ownFont )
#ifndef QT_NO_CURSOR
    Q_PROPERTY( QCursor cursor READ cursor WRITE setCursor RESET unsetCursor )
    Q_PROPERTY( bool ownCursor READ ownCursor )
#endif
    Q_PROPERTY( QString caption READ caption WRITE setCaption )
    Q_PROPERTY( QPixmap icon READ icon WRITE setIcon )
    Q_PROPERTY( QString iconText READ iconText WRITE setIconText )
    Q_PROPERTY( bool mouseTracking READ hasMouseTracking WRITE setMouseTracking )
    Q_PROPERTY( bool isActiveWindow READ isActiveWindow )
    Q_PROPERTY( bool focusEnabled READ isFocusEnabled )
    Q_PROPERTY( FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy )
    Q_PROPERTY( bool focus READ hasFocus )
    Q_PROPERTY( bool updatesEnabled READ isUpdatesEnabled WRITE setUpdatesEnabled DESIGNABLE false )
    Q_PROPERTY( bool visible READ isVisible )
    Q_PROPERTY( QRect visibleRect READ visibleRect )
    Q_PROPERTY( bool hidden READ isHidden )
    Q_PROPERTY( bool minimized READ isMinimized )
    Q_PROPERTY( QSize sizeHint READ sizeHint )
    Q_PROPERTY( QSize minimumSizeHint READ minimumSizeHint )
    Q_PROPERTY( QRect microFocusHint READ microFocusHint )
    Q_PROPERTY( bool acceptDrops READ acceptDrops WRITE setAcceptDrops )
    Q_PROPERTY( bool autoMask READ autoMask WRITE setAutoMask )
    Q_PROPERTY( BackgroundOrigin backgroundOrigin READ backgroundOrigin WRITE setBackgroundOrigin )
    Q_PROPERTY( bool customWhatsThis READ customWhatsThis )

public:
    QWidget( QWidget *parent=0, const char *name=0, WFlags f=0 );
    ~QWidget();

    WId          winId() const;
    void         setName( const char *name );
#ifndef QT_NO_STYLE
    // GUI style setting

    QStyle     &amp;style() const;
    void        setStyle( QStyle * );
#endif
    // Widget types and states

    bool         isTopLevel()   const;
    bool         isModal()      const;
    bool         isPopup()      const;
    bool         isDesktop()    const;

    bool         isEnabled()    const;
    bool         isEnabledTo(QWidget*) const;
    bool         isEnabledToTLW() const;

public slots:
    virtual void setEnabled( bool );
    void setDisabled( bool );

    // Widget coordinates

public:
    QRect        frameGeometry() const;
    const QRect &amp;geometry()     const;
    int          x()            const;
    int          y()            const;
    QPoint       pos()          const;
    QSize        frameSize()    const;
    QSize        size()         const;
    int          width()        const;
    int          height()       const;
    QRect        rect()         const;
    QRect        childrenRect() const;
    QRegion      childrenRegion() const;

    QSize        minimumSize()   const;
    QSize        maximumSize()   const;
    int          minimumWidth()  const;
    int          minimumHeight() const;
    int          maximumWidth()  const;
    int          maximumHeight() const;
    void         setMinimumSize( const QSize &amp; );
    virtual void setMinimumSize( int minw, int minh );
    void         setMaximumSize( const QSize &amp; );
    virtual void setMaximumSize( int maxw, int maxh );
    void         setMinimumWidth( int minw );
    void         setMinimumHeight( int minh );
    void         setMaximumWidth( int maxw );
    void         setMaximumHeight( int maxh );

    QSize        sizeIncrement() const;
    void         setSizeIncrement( const QSize &amp; );
    virtual void setSizeIncrement( int w, int h );
    QSize        baseSize() const;
    void         setBaseSize( const QSize &amp; );
    void         setBaseSize( int basew, int baseh );

    void        setFixedSize( const QSize &amp; );
    void        setFixedSize( int w, int h );
    void        setFixedWidth( int w );
    void        setFixedHeight( int h );

    // Widget coordinate mapping

    QPoint       mapToGlobal( const QPoint &amp; )   const;
    QPoint       mapFromGlobal( const QPoint &amp; ) const;
    QPoint       mapToParent( const QPoint &amp; )   const;
    QPoint       mapFromParent( const QPoint &amp; ) const;
    QPoint       mapTo( QWidget *, const QPoint &amp; ) const;
    QPoint       mapFrom( QWidget *, const QPoint &amp; ) const;

    QWidget     *topLevelWidget()   const;

    // Widget attribute functions

    enum BackgroundMode { FixedColor, FixedPixmap, NoBackground,
                          PaletteForeground, PaletteButton, PaletteLight,
                          PaletteMidlight, PaletteDark, PaletteMid,
                          PaletteText, PaletteBrightText, PaletteBase,
                          PaletteBackground, PaletteShadow, PaletteHighlight,
                          PaletteHighlightedText, PaletteButtonText,
                          X11ParentRelative };

    BackgroundMode      backgroundMode() const;
    virtual void        setBackgroundMode( BackgroundMode );

    const QColor &amp;      backgroundColor() const;
    const QColor &amp;      foregroundColor() const;
    virtual void        setBackgroundColor( const QColor &amp; );

    const QPixmap *     backgroundPixmap() const;
    virtual void        setBackgroundPixmap( const QPixmap &amp; );

#ifndef QT_NO_PALETTE
    const QColorGroup &amp; colorGroup() const;
    const QPalette &amp;    palette()    const;
    bool                ownPalette() const;
    virtual void        setPalette( const QPalette &amp; );
    void                unsetPalette();
#endif
    QFont               font() const;
    bool                ownFont() const;
    virtual void        setFont( const QFont &amp; );
    void                unsetFont();
    QFontMetrics        fontMetrics() const;
    QFontInfo           fontInfo() const;

    enum PropagationMode { NoChildren, AllChildren,
                           SameFont, SamePalette = SameFont };

    PropagationMode     fontPropagation() const; // obsolete, remove 3.0
    virtual void        setFontPropagation( PropagationMode ); // obsolete, remove 3.0

    PropagationMode     palettePropagation() const; // obsolete, remove 3.0
    virtual void        setPalettePropagation( PropagationMode ); // obsolete, remove 3.0
#ifndef QT_NO_CURSOR
    const QCursor      &amp;cursor() const;
    bool                ownCursor() const;
    virtual void        setCursor( const QCursor &amp; );
    virtual void        unsetCursor();
#endif
    QString             caption() const;
    const QPixmap      *icon() const;
    QString             iconText() const;
    bool                hasMouseTracking() const;

    virtual void        setMask( const QBitmap &amp; );
    virtual void        setMask( const QRegion &amp; );
    void                clearMask();

public slots:
    virtual void        setCaption( const QString &amp;);
    virtual void        setIcon( const QPixmap &amp; );
    virtual void        setIconText( const QString &amp;);
    virtual void        setMouseTracking( bool enable );

    // Keyboard input focus functions

    virtual void        setFocus();
    void                clearFocus();

public:
    enum FocusPolicy {
        NoFocus = 0,
        TabFocus = 0x1,
        ClickFocus = 0x2,
        StrongFocus = 0x3,
        WheelFocus = 0x7
    };

    bool                isActiveWindow() const;
    virtual void        setActiveWindow();
    bool                isFocusEnabled() const;

    FocusPolicy         focusPolicy() const;
    virtual void        setFocusPolicy( FocusPolicy );
    bool                hasFocus() const;
    static void         setTabOrder( QWidget *, QWidget * );
    virtual void        setFocusProxy( QWidget * );
    QWidget *           focusProxy() const;

    // Grab functions

    void                grabMouse();
#ifndef QT_NO_CURSOR
    void                grabMouse( const QCursor &amp; );
#endif
    void                releaseMouse();
    void                grabKeyboard();
    void                releaseKeyboard();
    static QWidget *    mouseGrabber();
    static QWidget *    keyboardGrabber();

    // Update/refresh functions

    bool                isUpdatesEnabled() const;

#if 0 //def _WS_QWS_
    void                repaintUnclipped( const QRegion &amp;, bool erase = TRUE );
#endif
public slots:
    virtual void        setUpdatesEnabled( bool enable );
    void                update();
    void                update( int x, int y, int w, int h );
    void                update( const QRect&amp; );
    void                repaint();
    void                repaint( bool erase );
    void                repaint( int x, int y, int w, int h, bool erase=TRUE );
    void                repaint( const QRect &amp;, bool erase=TRUE );
    void                repaint( const QRegion &amp;, bool erase=TRUE );

    // Widget management functions

    virtual void        show();
    virtual void        hide();
#ifndef QT_NO_COMPAT
    void                iconify()       { showMinimized(); }
#endif
    virtual void        showMinimized();
    virtual void        showMaximized();
    void                showFullScreen(); // virtual 3.0
    virtual void        showNormal();
    virtual void        polish();
    void                constPolish() const;
    bool                close();

    void                raise();
    void                lower();
    void                stackUnder( QWidget* );
    virtual void        move( int x, int y );
    void                move( const QPoint &amp; );
    virtual void        resize( int w, int h );
    void                resize( const QSize &amp; );
    virtual void        setGeometry( int x, int y, int w, int h );
    virtual void        setGeometry( const QRect &amp; );

public:
    virtual bool        close( bool alsoDelete );
    bool                isVisible()     const;
    bool                isVisibleTo(QWidget*) const;
    bool                isVisibleToTLW() const; // obsolete
    QRect               visibleRect() const;
    bool                isHidden() const;
    bool                isMinimized() const;
    bool                isMaximized() const;

    virtual QSize       sizeHint() const;
    virtual QSize       minimumSizeHint() const;
    virtual QSizePolicy sizePolicy() const;
    void                setSizePolicy( QSizePolicy );
    virtual int heightForWidth(int) const;

    virtual void        adjustSize();
#ifndef QT_NO_LAYOUT
    QLayout *           layout() const { return lay_out; }
#endif
    void                updateGeometry();
    virtual void        reparent( QWidget *parent, WFlags, const QPoint &amp;,
                                  bool showIt=FALSE );
    void                reparent( QWidget *parent, const QPoint &amp;,
                                  bool showIt=FALSE );
#ifndef QT_NO_COMPAT
    void                recreate( QWidget *parent, WFlags f, const QPoint &amp; p,
                                  bool showIt=FALSE )
    { reparent(parent,f,p,showIt); }
#endif

    void                erase();
    void                erase( int x, int y, int w, int h );
    void                erase( const QRect &amp; );
    void                erase( const QRegion &amp; );
    void                scroll( int dx, int dy );
    void                scroll( int dx, int dy, const QRect&amp; );

    void                drawText( int x, int y, const QString &amp;);
    void                drawText( const QPoint &amp;, const QString &amp;);

    // Misc. functions

    QWidget *           focusWidget() const;
    QRect               microFocusHint() const;

    // drag and drop

    bool                acceptDrops() const;
    virtual void        setAcceptDrops( bool on );

    // transparency and pseudo transparency

    virtual void        setAutoMask(bool);
    bool                autoMask() const;

    enum BackgroundOrigin { WidgetOrigin, ParentOrigin };

    void setBackgroundOrigin( BackgroundOrigin );
    BackgroundOrigin backgroundOrigin() const;


    // whats this help
    virtual bool customWhatsThis() const;

    QWidget *           parentWidget() const;
    bool                testWState( uint n ) const;
    bool                testWFlags( WFlags f ) const;
    static QWidget *    find( WId );
    static QWidgetMapper *wmapper();

#if defined(_WS_QWS_)
    virtual QGfx * graphicsContext(bool clip_children=TRUE) const;
#endif

protected:
    // Event handlers
    bool         event( QEvent * );
    virtual void mousePressEvent( QMouseEvent * );
    virtual void mouseReleaseEvent( QMouseEvent * );
    virtual void mouseDoubleClickEvent( QMouseEvent * );
    virtual void mouseMoveEvent( QMouseEvent * );
    virtual void wheelEvent( QWheelEvent * );
    virtual void keyPressEvent( QKeyEvent * );
    virtual void keyReleaseEvent( QKeyEvent * );
    virtual void focusInEvent( QFocusEvent * );
    virtual void focusOutEvent( QFocusEvent * );
    virtual void enterEvent( QEvent * );
    virtual void leaveEvent( QEvent * );
    virtual void paintEvent( QPaintEvent * );
    virtual void moveEvent( QMoveEvent * );
    virtual void resizeEvent( QResizeEvent * );
    virtual void closeEvent( QCloseEvent * );

#ifndef QT_NO_DRAGANDDROP
    virtual void dragEnterEvent( QDragEnterEvent * );
    virtual void dragMoveEvent( QDragMoveEvent * );
    virtual void dragLeaveEvent( QDragLeaveEvent * );
    virtual void dropEvent( QDropEvent * );
#endif

    virtual void showEvent( QShowEvent * );
    virtual void hideEvent( QHideEvent * );
    virtual void customEvent( QCustomEvent * );

#if defined(_WS_MAC_)
    virtual bool macEvent( MSG * );             // Macintosh event
    QWidget * mytop;                            // This widget's top-level widg
    int back_type;                              // Type of background
    QPixmap * bg_pix;
    virtual void fixport();
    virtual void propagateUpdates(int x,int y,int x2,int y2);
#elif defined(_WS_WIN_)
    virtual bool winEvent( MSG * );             // Windows event
#elif defined(_WS_X11_)
    virtual bool x11Event( XEvent * );          // X11 event
#elif defined(_WS_QWS_)
    virtual bool qwsEvent( QWSEvent * );
    virtual unsigned char * scanLine(int) const;
    virtual int bytesPerLine() const;
#endif

    virtual void updateMask();

    // Misc. protected functions

protected:
#ifndef QT_NO_STYLE
    virtual void styleChange( QStyle&amp; );
#endif
    virtual void enabledChange( bool );
    virtual void backgroundColorChange( const QColor &amp; );
    virtual void backgroundPixmapChange( const QPixmap &amp; );
#ifndef QT_NO_PALETTE
    virtual void paletteChange( const QPalette &amp; );
#endif
    virtual void fontChange( const QFont &amp; );

    int          metric( int )  const;

    virtual void create( WId = 0, bool initializeWindow = TRUE,
                         bool destroyOldWindow = TRUE );
    virtual void destroy( bool destroyWindow = TRUE,
                          bool destroySubWindows = TRUE );
    uint         getWState() const;
    virtual void setWState( uint );
    void         clearWState( uint n );
    WFlags       getWFlags() const;
    virtual void setWFlags( WFlags );
    void         clearWFlags( WFlags n );

    virtual void setFRect( const QRect &amp; );
    virtual void setCRect( const QRect &amp; );

    virtual bool focusNextPrevChild( bool next );

    QWExtra     *extraData();
    QTLWExtra   *topData();
    QFocusData  *focusData();

    virtual void setKeyCompression(bool);
    virtual void setMicroFocusHint(int x, int y, int w, int h, bool text=TRUE);

private slots:
    void         focusProxyDestroyed();

private:
    void         setFontSys();
#ifndef QT_NO_LAYOUT
    void         setLayout( QLayout *l );
#endif
    void         setWinId( WId );
    void         showWindow();
    void         hideWindow();
    void         sendShowEventsToChildren( bool spontaneous );
    void         sendHideEventsToChildren( bool spontaneous );
    void         createTLExtra();
    void         createExtra();
    void         deleteExtra();
    void         createSysExtra();
    void         deleteSysExtra();
    void         createTLSysExtra();
    void         deleteTLSysExtra();
    void         deactivateWidgetCleanup();
    void         internalSetGeometry( int, int, int, int, bool );
    void         reparentFocusWidgets( QWidget * );
    QFocusData  *focusData( bool create );
    void         setBackgroundFromMode();
    void         setBackgroundColorDirect( const QColor &amp; );
    void         setBackgroundPixmapDirect( const QPixmap &amp; );
    void         setBackgroundModeDirect( BackgroundMode );
    void         setBackgroundEmpty();
#if defined(_WS_X11_)
    void         setBackgroundX11Relative();
    void         checkChildrenDnd();
#endif

    WId          winid;
    uint         widget_state;
    uint         widget_flags;
    uint         propagate_font : 2; // obsolete
    uint         propagate_palette : 2; // obsolete
    uint         focus_policy : 4;
    uint         own_font :1;
    uint         own_palette :1;
    uint         sizehint_forced :1;
    uint         is_closing :1;
    uint         in_show : 1;
    uint         in_show_maximized : 1;
    QPoint       fpos;
    QRect        crect;
    QColor       bg_col;
#ifndef QT_NO_PALETTE
    QPalette     pal;
#endif
    QFont        fnt;
#ifndef QT_NO_LAYOUT
    QLayout     *lay_out;
#endif
    QWExtra     *extra;
#if defined(_WS_QWS_)
    QRegion      req_region;                    // Requested region
    mutable QRegion      paintable_region;      // Paintable region
    mutable bool         paintable_region_dirty;// needs to be recalculated
    mutable QRegion      alloc_region;          // Allocated region
    mutable bool         alloc_region_dirty;    // needs to be recalculated
    mutable int          overlapping_children;  // Handle overlapping children

    int          alloc_region_index;
    int          alloc_region_revision;

    void updateOverlappingChildren() const;
    void setChildrenAllocatedDirty();
    bool isAllocatedRegionDirty() const;
    QRegion requestedRegion() const;
    QRegion allocatedRegion() const;
    QRegion paintableRegion() const;

    // used to accumulate dirty region when children moved/resized.
    QRegion dirtyChildren;
    bool isSettingGeometry;
    friend class QWSManager;
#endif

    static void  createMapper();
    static void  destroyMapper();
    static QWidgetList   *wList();
    static QWidgetList   *tlwList();
    static QWidgetMapper *mapper;
    friend class QApplication;
    friend class QBaseApplication;
    friend class QPainter;
    friend class QFontMetrics;
    friend class QFontInfo;
    friend class QETWidget;
#if 1 //was #ifdef TOTAL_LOSER_COMPILER but they all seem to be
    friend class QLayout;
#else
    friend void QLayout::setWidgetLayout( QWidget *, QLayout * );
#endif
private:        // Disabled copy constructor and operator=
#if defined(Q_DISABLE_COPY)
    QWidget( const QWidget &amp; );
    QWidget &amp;operator=( const QWidget &amp; );
#endif

public: // obsolete functions to dissappear or to become inline in 3.0
#ifndef QT_NO_PALETTE
    void setPalette( const QPalette &amp;, bool iReallyMeanIt );
#endif
    void setFont( const QFont &amp;, bool iReallyMeanIt );
};


inline bool QWidget::testWState( uint f ) const
{ return (widget_state &amp; f) != 0; }

inline bool QWidget::testWFlags( WFlags f ) const
{ return (widget_flags &amp; f) != 0; }


inline WId QWidget::winId() const
{ return winid; }

inline bool QWidget::isTopLevel() const
{ return testWFlags(WType_TopLevel); }

inline bool QWidget::isModal() const
{ return testWFlags(WType_Modal); }

inline bool QWidget::isPopup() const
{ return testWFlags(WType_Popup); }

inline bool QWidget::isDesktop() const
{ return testWFlags(WType_Desktop); }

inline bool QWidget::isEnabled() const
{ return !testWState(WState_Disabled); }

inline const QRect &amp;QWidget::geometry() const
{ return crect; }

inline int QWidget::x() const
{ return fpos.x(); }

inline int QWidget::y() const
{ return fpos.y(); }

inline QPoint QWidget::pos() const
{ return fpos; }

inline QSize QWidget::size() const
{ return crect.size(); }

inline int QWidget::width() const
{ return crect.width(); }

inline int QWidget::height() const
{ return crect.height(); }

inline QRect QWidget::rect() const
{ return QRect(0,0,crect.width(),crect.height()); }

inline int QWidget::minimumWidth() const
{ return minimumSize().width(); }

inline int QWidget::minimumHeight() const
{ return minimumSize().height(); }

inline int QWidget::maximumWidth() const
{ return maximumSize().width(); }

inline int QWidget::maximumHeight() const
{ return maximumSize().height(); }

inline void QWidget::setMinimumSize( const QSize &amp;s )
{ setMinimumSize(s.width(),s.height()); }

inline void QWidget::setMaximumSize( const QSize &amp;s )
{ setMaximumSize(s.width(),s.height()); }

inline void QWidget::setSizeIncrement( const QSize &amp;s )
{ setSizeIncrement(s.width(),s.height()); }

inline void QWidget::setBaseSize( const QSize &amp;s )
{ setBaseSize(s.width(),s.height()); }

inline const QColor &amp;QWidget::backgroundColor() const
{ return bg_col; }

#ifndef QT_NO_PALETTE
inline const QPalette &amp;QWidget::palette() const
{ return pal; }
#endif

inline QFont QWidget::font() const
{ return fnt; }

inline QFontMetrics QWidget::fontMetrics() const
{ return QFontMetrics(font()); }

inline QFontInfo QWidget::fontInfo() const
{ return QFontInfo(font()); }

inline bool QWidget::hasMouseTracking() const
{ return testWState(WState_MouseTracking); }

inline bool  QWidget::isFocusEnabled() const
{ return (FocusPolicy)focus_policy != NoFocus; }

inline QWidget::FocusPolicy QWidget::focusPolicy() const
{ return (FocusPolicy)focus_policy; }

inline bool QWidget::isUpdatesEnabled() const
{ return !testWState(WState_BlockUpdates); }

inline void QWidget::update( const QRect &amp;r )
{ update( r.x(), r.y(), r.width(), r.height() ); }

inline void QWidget::repaint()
{ repaint( 0, 0, crect.width(), crect.height(), TRUE ); }

inline void QWidget::repaint( bool erase )
{ repaint( 0, 0, crect.width(), crect.height(), erase ); }

inline void QWidget::repaint( const QRect &amp;r, bool erase )
{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); }

inline void QWidget::erase()
{ erase( 0, 0, crect.width(), crect.height() ); }

inline void QWidget::erase( const QRect &amp;r )
{ erase( r.x(), r.y(), r.width(), r.height() ); }

inline bool QWidget::close()
{ return close( FALSE ); }

inline bool QWidget::isVisible() const
{ return testWState(WState_Visible); }

inline bool QWidget::isHidden() const
{ return testWState(WState_ForceHide); }

inline void QWidget::move( const QPoint &amp;p )
{ move( p.x(), p.y() ); }

inline void QWidget::resize( const QSize &amp;s )
{ resize( s.width(), s.height()); }

inline void QWidget::setGeometry( const QRect &amp;r )
{ setGeometry( r.left(), r.top(), r.width(), r.height() ); }

inline void QWidget::drawText( const QPoint &amp;p, const QString &amp;s )
{ drawText( p.x(), p.y(), s ); }

inline QWidget *QWidget::parentWidget() const
{ return (QWidget *)QObject::parent(); }

inline QWidgetMapper *QWidget::wmapper()
{ return mapper; }

inline uint QWidget::getWState() const
{ return widget_state; }

inline void QWidget::setWState( uint f )
{ widget_state |= f; }

inline void QWidget::clearWState( uint f )
{ widget_state &amp;= ~f; }

inline Qt::WFlags QWidget::getWFlags() const
{ return widget_flags; }

inline void QWidget::setWFlags( WFlags f )
{ widget_flags |= f; }

inline void QWidget::clearWFlags( WFlags f )
{ widget_flags &amp;= ~f; }

inline void QWidget::constPolish() const
{
    if ( !testWState(WState_Polished) ) {
        QWidget* that = (QWidget*) this;
        that-&gt;polish();
        that-&gt;setWState(WState_Polished); // be on the safe side...
    }
}
#ifndef QT_NO_CURSOR
inline bool QWidget::ownCursor() const
{
    return testWState( WState_OwnCursor );
}
#endif
inline bool QWidget::ownFont() const
{
    return own_font;
}
#ifndef QT_NO_PALETTE
inline bool QWidget::ownPalette() const
{
    return own_palette;
}
#endif

// Extra QWidget data
//  - to minimize memory usage for members that are seldom used.
//  - top-level widgets have extra extra data to reduce cost further

class <a href="qfocusdata.html">QFocusData</a>;
class QWSManager;
#if defined(_WS_WIN_)
class QOleDropTarget;
#endif

struct QTLWExtra {
    QString  caption;                           // widget caption
    QString  iconText;                          // widget icon text
    QPixmap *icon;                              // widget icon
    QFocusData *focusData;                      // focus data (for TLW)
    QSize    fsize;                             // rect of frame
    short    incw, inch;                        // size increments
    uint     iconic: 1;                         // iconified [cur. win32 only]
    uint     fullscreen : 1;                    // full-screen mode
    uint     showMode: 2;                       // 0 normal, 1 minimized, 2 maximized, 3 reset
    short    basew, baseh;                      // base sizes
#if defined(_WS_X11_)
    WId      parentWinId;                       // parent window Id (valid after reparenting)
    uint     embedded : 1;                      // window is embedded in another Qt application
    uint     reserved: 2;                       // reserved
    uint     dnd : 1;                           // DND properties installed
    uint     uspos : 1;                         // User defined position
    uint     ussize : 1;                        // User defined size
    void    *xic;                               // XIM Input Context
#endif
#if defined(_WS_QWS_) &amp;&amp; !defined ( QT_NO_QWS_MANAGER )
    QRegion decor_allocated_region;             // decoration allocated region
    QWSManager *qwsManager;
#endif
#if defined(_WS_WIN_)
    HICON    winIcon;                           // internal Windows icon
#endif
    QRect    normalGeometry;                    // used by showMin/maximized/FullScreen
};


#define QWIDGETSIZE_MAX 32767

// dear user: you can see this struct, but it is internal. do not touch.

struct QWExtra {
    Q_INT16  minw, minh;                        // minimum size
    Q_INT16  maxw, maxh;                        // maximum size
    QPixmap *bg_pix;                            // background pixmap
    QWidget *focus_proxy;
#ifndef QT_NO_CURSOR
    QCursor *curs;
#endif
    QTLWExtra *topextra;                        // only useful for TLWs
#if defined(_WS_WIN_)
    QOleDropTarget *dropTarget;                 // drop target
#endif
#if defined(_WS_X11_)
    WId      xDndProxy;                         // XDND forwarding to embedded windows
#endif
#if defined(_WS_QWS_)
    QRegion mask;                               // widget mask
#endif
    char     bg_mode;                           // background mode
#ifndef QT_NO_STYLE
    QStyle* style;
#endif
    QRect micro_focus_hint;                     // micro focus hint
    QSizePolicy size_policy;
    void * posted_events;                       // in qapplication
#if defined(_WS_X11_)
    uint children_use_dnd : 1;                  // one or more children have DND enabled
#endif
};


#endif // QWIDGET_H

</pre>
<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>