Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
|
The QToolBar class provides a tool bar. More...
#include <qtoolbar.h>
Inherits QWidget.
Inherited by QPEToolBar.
The QToolBar class provides a tool bar.
A toolbar is a panel that contains a set of controls, usually represented by small icons. Its purpose is to provide quick access to frequently used commands or options. Within a main window, the user can drag toolbars freely around and hide them with a click on the toolbar handle.
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.
You may use any kind of widget within a toolbar, with QToolButton and QComboBox being the two most common ones.
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 main window can be resized to a smaller size than a toolbar would need to show all items. If this happens QToolbar shows a little arrow button at the right or bottom end. When clicking on that button, a popup menu is opened which shows all items of the toolbar which are outside the visible area of the mainwindow.
Usually, a toolbar gets just the space it needs. However, with setHorizontalStretchable()/setVerticalStretchable() or setStretchableWidget() you can advise the main window to expand the toolbar to fill all available width in the specified orientation.
The tool bar arranges its buttons either horizontally or vertically (see setOrientation() for details). Generally, QMainWindow will set the orientation correctly for you. The toolbar emits a signal orientationChanged() each time the orientation changes, in case some child widgets need adjustments.
To remove all items from a toolbar, you can use the clear() method.
See also QToolButton, QMainWindow, Parts of Isys on Visual Design, and GUI Design Handbook: Tool Bar..
This is the constructor to use if you want to create torn-off toolbars, or toolbars in the status bar.
A stretchable toolbar fills all available width in a toolbar dock. A non-stretchable toolbar usually gets just the space it needs.
See also setHorizontalStretchable(), setVerticalStretchable(), and isVerticalStretchable().
A stretchable toolbar fills all available height in a toolbar dock. A non-stretchable toolbar usually gets just the space it needs.
See also setHorizontalStretchable(), setVerticalStretchable(), and isHorizontalStretchable().
See also setLabel().
Returns the current orientation of the toolbar.
This signal is emitted when the toolbar changed its orientation to newOrientation.
Reimplemented from QWidget.
A stretchable toolbar fills the available width in a toolbar dock. A non-stretchable toolbar usually gets just the space it needs.
The default is FALSE.
See also QMainWindow::setRightJustification(), isHorizontalStretchable(), setVerticalStretchable(), and isVerticalStretchable().
See also label().
Emits the orientationChanged() signal.
See also orientation().
If you call setStretchableWidget() and the toolbar is not stretchable yet, setStretchable( ) is called.
See also QMainWindow::setRightJustification(), setVerticalStretchable(), and setHorizontalStretchable().
A stretchable toolbar fills the available height in a toolbar dock. A non-stretchable toolbar usually gets just the space it needs.
The default is FALSE.
See also QMainWindow::setRightJustification(), isVerticalStretchable(), setHorizontalStretchable(), and isHorizontalStretchable().
This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved.
| Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|