Q3WidgetStackPrivate::Invisible Class Reference

Inheritance diagram for Q3WidgetStackPrivate::Invisible:

Inheritance graph
[legend]
Collaboration diagram for Q3WidgetStackPrivate::Invisible:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 34 of file q3widgetstack.cpp.

Public Member Functions

 Invisible (Q3WidgetStack *parent)
const char * className () const

Protected Member Functions

void paintEvent (QPaintEvent *)


Constructor & Destructor Documentation

Q3WidgetStackPrivate::Invisible::Invisible ( Q3WidgetStack parent  )  [inline]

Definition at line 37 of file q3widgetstack.cpp.

00037                                        : QWidget(parent, "qt_invisible_widgetstack")
00038       {
00039                 setBackgroundMode(NoBackground);
00040       }


Member Function Documentation

const char* Q3WidgetStackPrivate::Invisible::className (  )  const [inline]

Definition at line 41 of file q3widgetstack.cpp.

00042       {
00043           return "Q3WidgetStackPrivate::Invisible";
00044       }

void Q3WidgetStackPrivate::Invisible::paintEvent ( QPaintEvent  )  [inline, protected, virtual]

This event handler can be reimplemented in a subclass to receive paint events which are passed in the event parameter.

A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.

Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QTableView do this, for example.

Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region (see QRegion::united()). repaint() does not permit this optimization, so we suggest using update() whenever possible.

When the paint event occurs, the update region has normally been erased, so that you're painting on the widget's background.

The background can be set using setBackgroundRole() and setPalette().

From Qt 4.0, QWidget automatically double-buffers its painting, so there's no need to write double-buffering code in paintEvent() to avoid flicker.

Note: Under X11 it is possible to toggle the global double buffering by calling qt_x11_set_global_double_buffer(). Example usage:

See also:
event(), repaint(), update(), QPainter, QPixmap, QPaintEvent, {Analog Clock Example}

Reimplemented from QWidget.

Definition at line 46 of file q3widgetstack.cpp.

References QWidget::QPainter, and QWidget::rect().

00047             {
00048                 QPainter(this).eraseRect(rect());
00049             }

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 16:38:06 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1