The QToolBar class provides a simple tool bar. More...
#include <qtoolbar.h>
Inherits QWidget.
To use QToolBar, you simply create a QToolBar as child of a QMainWindow, create a number of QToolButton widgets (or other widgets) in left to right (or top to bottom) order, call addSeparator() when you want a separator, and that's all.
The application/application.cpp example does precisely this.
Each QToolBar lives in a dock in a QMainWindow, and can optionally start a new line in its dock. Tool bars that start a new line are always positioned at the left end or top of the tool bar dock; others are placed next to the previous tool bar and word-wrapped as necessary.
The tool bar is able to arrange its buttons horizontally or vertically (see setOrientation() for details) and draws the appropriate frames around the tool button in Windows and Motif style. Generally, QMainWindow will set the orientation correctly for you.
See also: QToolButton, QMainWindow, Parts of Isys on Visual Design,, Microsoft Style Guide,, some common buttons (NB: read the license), and GUI Design Handbook: Tool Bar.
Examples: application/application.cpp
Constructs an empty tool bar in the top dock of its parent, without any label and without requiring a newline. This is mostly useless.
Constructs an empty horizontal tool bar which is a parent of parent and managed by mainWindow. The label and newLine are passed straight to QMainWindow::addToolBar(). name is the object name and f is the widget flags.
This is the constructor to use if you want to create torn-off toolbars, or toolbars in the status bar.
Constructs an empty tool bar which is a chilf od parent and managed by parent, initially in dock, labelled and starting a new line in the dock if newLine is TRUE. name is the object name, as usual.
Destroys the object and frees any allocated resources.
Adds a separator in here. Cool, man.
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QObject.
Returns a pointer to the QMainWindow which controls this tool bar.
Returns the current orientation of the toolbar.
[virtual protected]
Paint the handle. The Motif style is rather close to Netscape and even closer to KDE.
Reimplemented from QWidget.
[virtual]
Sets this toolbar to organize its content vertically if newOrientation is Vertical
and horizontally if newOrientation
is Horizontal.
Sets w to be expanded if this toolbar is requested to stretch (because QMainWindow right-justifies the dock it's in).
[virtual]
Reimplemented to set up geometry management.
Reimplemented from QWidget.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright İ 1998 Troll Tech | Trademarks | Qt version 1.42
|