Q3ToolBarSeparator Class Reference

Inheritance diagram for Q3ToolBarSeparator:

Inheritance graph
[legend]
Collaboration diagram for Q3ToolBarSeparator:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 90 of file q3toolbar.cpp.

Public Slots

void setOrientation (Qt::Orientation)

Public Member Functions

 Q3ToolBarSeparator (Qt::Orientation, Q3ToolBar *parent, const char *name=0)
QSize sizeHint () const
Qt::Orientation orientation () const

Protected Member Functions

void changeEvent (QEvent *)
void paintEvent (QPaintEvent *)

Private Attributes

Qt::Orientation orient


Constructor & Destructor Documentation

Q3ToolBarSeparator::Q3ToolBarSeparator ( Qt::Orientation  ,
Q3ToolBar parent,
const char *  name = 0 
)

Definition at line 154 of file q3toolbar.cpp.

References QObject::connect(), QSizePolicy::Minimum, QObject::parent(), setOrientation(), QWidget::setSizePolicy(), SIGNAL, and SLOT.

00156     : QWidget(parent, name)
00157 {
00158     connect(parent, SIGNAL(orientationChanged(Qt::Orientation)),
00159              this, SLOT(setOrientation(Qt::Orientation)));
00160     setOrientation(o);
00161     setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
00162 }

Here is the call graph for this function:


Member Function Documentation

QSize Q3ToolBarSeparator::sizeHint (  )  const [virtual]

Reimplemented from QWidget.

Definition at line 190 of file q3toolbar.cpp.

References getStyleOption(), Qt::Horizontal, orient, QStyle::pixelMetric(), QStyle::PM_ToolBarSeparatorExtent, and QWidget::style().

00191 {
00192     QStyleOption opt = getStyleOption(this);
00193     int extent = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, &opt, this);
00194     if (orient == Qt::Horizontal)
00195         return QSize(extent, 0);
00196     else
00197         return QSize(0, extent);
00198 }

Here is the call graph for this function:

Qt::Orientation Q3ToolBarSeparator::orientation (  )  const [inline]

Definition at line 97 of file q3toolbar.cpp.

References orient.

Referenced by getStyleOption().

00097 { return orient; }

void Q3ToolBarSeparator::setOrientation ( Qt::Orientation   )  [slot]

Definition at line 166 of file q3toolbar.cpp.

References orient.

Referenced by changeEvent(), and Q3ToolBarSeparator().

00167 {
00168     orient = o;
00169 }

void Q3ToolBarSeparator::changeEvent ( QEvent ev  )  [protected, virtual]

This event handler can be reimplemented to handle state changes.

The state being changed in this event can be retrieved through event event.

Change events include: QEvent::ToolBarChange, QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange, QEvent::StyleChange, QEvent::PaletteChange, QEvent::WindowTitleChange, QEvent::IconTextChange, QEcvent::ModifiedChange, QEvent::MouseTrackingChange, QEvent::ParentChange, QEvent::WindowStateChange, QEvent::LanguageChange, QEvent::LocaleChange, QEvent::LayoutDirectionChange.

Reimplemented from QWidget.

Definition at line 171 of file q3toolbar.cpp.

References QWidget::changeEvent(), orient, setOrientation(), QEvent::StyleChange, and QEvent::type().

00172 {
00173     if(ev->type() == QEvent::StyleChange)
00174         setOrientation(orient);
00175     QWidget::changeEvent(ev);
00176 }

Here is the call graph for this function:

void Q3ToolBarSeparator::paintEvent ( QPaintEvent  )  [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 200 of file q3toolbar.cpp.

References QStyle::drawPrimitive(), getStyleOption(), p, QStyle::PE_Q3DockWindowSeparator, and QWidget::style().

00201 {
00202     QPainter p(this);
00203     QStyleOption opt = getStyleOption(this);
00204     style()->drawPrimitive(QStyle::PE_Q3DockWindowSeparator, &opt, &p, this);
00205 }

Here is the call graph for this function:


Member Data Documentation

Qt::Orientation Q3ToolBarSeparator::orient [private]

Definition at line 105 of file q3toolbar.cpp.

Referenced by changeEvent(), orientation(), setOrientation(), and sizeHint().


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