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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta name="robots" content="noindex,noarchive">
<title>Qt Toolkit - QToolBar Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 15%; text-indent: -15%; }
a:link { text-decoration: none; }
--></style>
</head><body bgcolor="#ffffff">
<a href=index.html><img width=122 height=65 src=qtlogo.jpg alt="Qt logo" align=left border=0></a>
<center><img src=dochead.gif width=472 height=27></center>
<br clear=all>
<h1 align=center>QToolBar Class Reference</h1><br clear="all">
<p>
The QToolBar class provides a simple tool bar.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qtoolbar-h.html">qtoolbar.h</a>></code>
<p>
Inherits <a href="qwidget.html">QWidget</a>.
<p><a href="qtoolbar-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><span class="fn"><a href="qtoolbar.html#a0"><strong>QToolBar</strong></a>(constchar*label, QMainWindow*, QMainWindow::ToolBarDock=QMainWindow::Top, boolnewLine=FALSE, constchar*name=0)</span>
<li><span class="fn"><a href="qtoolbar.html#a1"><strong>QToolBar</strong></a>(constchar*label, QMainWindow*, QWidget*, boolnewLine=FALSE, constchar*name=0, WFlagsf=0)</span>
<li><span class="fn"><a href="qtoolbar.html#a2"><strong>QToolBar</strong></a>(QMainWindow*parent=0, constchar*name=0)</span>
<li><span class="fn"><a href="qtoolbar.html#a3"><strong>~QToolBar</strong></a>()</span>
<li><span class="fn">void<a href="qtoolbar.html#a4"><strong>addSeparator</strong></a>()</span>
<li><span class="fn">virtualvoid<a href="qtoolbar.html#a5"><strong>setOrientation</strong></a>(Orientation)</span>
<li><span class="fn">Orientation<a href="qtoolbar.html#a6"><strong>orientation</strong></a>()const</span>
<li><span class="fn">virtualvoid<a href="qtoolbar.html#a7"><strong>show</strong></a>()</span>
<li><span class="fn">QMainWindow*<a href="qtoolbar.html#a8"><strong>mainWindow</strong></a>()</span>
<li><span class="fn">void<a href="qtoolbar.html#a9"><strong>setStretchableWidget</strong></a>(QWidget*)</span>
<li><span class="fn">virtualbool<a href="qtoolbar.html#b0"><strong>event</strong></a>(QEvent*e)</span>
</ul>
<h2>Protected Members</h2>
<ul>
<li><span class="fn">virtualvoid<a href="qtoolbar.html#b1"><strong>paintEvent</strong></a>(QPaintEvent*)</span>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QToolBar class provides a simple tool bar.
<p>
To use QToolBar, you simply create a QToolBar as child of a
<a href="qmainwindow.html">QMainWindow</a>, create a number of <a href="qtoolbutton.html">QToolButton</a> widgets (or other
widgets) in left to right (or top to bottom) order, call
<a href="qtoolbar.html#a4">addSeparator</a>() when you want a separator, and that's all.
<p>The <a href="application-application-cpp.html#QToolBar">application/application.cpp</a> example does precisely this.
<p>Each QToolBar lives in a <a href="qmainwindow.html">dock</a> 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.
<p>The tool bar is able to arrange its buttons horizontally or
vertically (see <a href="qtoolbar.html#a5">setOrientation</a>() 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.
<p>See also: <a href="qtoolbutton.html">QToolButton</a>, <a href="qmainwindow.html">QMainWindow</a>, <a href="http://www.iarchitect.com/visual.htm">Parts of Isys on Visual Design,</a>, <a href="http://www.microsoft.com/win32dev/uiguide/uigui192.htm">Microsoft Style Guide,</a>, <a href="http://www.microsoft.com/win32dev/uiguide/uigui196.htm">some common buttons (NB: read the license),</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Tool Bar.</a>
<p>Examples:
<a href="application-application-cpp.html#QToolBar">application/application.cpp</a>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="a2"></a>QToolBar::QToolBar(<a href="qmainwindow.html">QMainWindow</a>*parent=0, constchar*name=0)</h3>
<p>Constructs an empty tool bar in the top dock of its parent,
without any label and without requiring a newline. This is mostly
useless.
<h3 class="fn"><a name="a1"></a>QToolBar::QToolBar(constchar*label, <a href="qmainwindow.html">QMainWindow</a>*mainWindow, <a href="qwidget.html">QWidget</a>*parent, boolnewLine=FALSE, constchar*name=0, WFlagsf=0)</h3>
<p>Constructs an empty horizontal tool bar which is a parent of <em>parent</em> and managed by <em>mainWindow.</em> The <em>label</em> and <em>newLine</em>
are passed straight to <a href="qmainwindow.html#a9">QMainWindow::addToolBar</a>(). <em>name</em> is the
object name and <em>f</em> is the widget flags.
<p>This is the constructor to use if you want to create torn-off
toolbars, or toolbars in the status bar.
<h3 class="fn"><a name="a0"></a>QToolBar::QToolBar(constchar*label, <a href="qmainwindow.html">QMainWindow</a>*parent, <a href="qmainwindow.html">QMainWindow::ToolBarDock</a>dock=QMainWindow::Top, boolnewLine=FALSE, constchar*name=0)</h3>
<p>Constructs an empty tool bar which is a chilf od <em>parent</em> and
managed by <em>parent,</em> initially in <em>dock,</em> labelled <em>and</em> starting
a new line in the dock if <em>newLine</em> is TRUE. <em>name</em> is the object
name, as usual.
<h3 class="fn"><a name="a3"></a>QToolBar::~QToolBar()</h3>
<p>Destroys the object and frees any allocated resources.
<h3 class="fn">void<a name="a4"></a>QToolBar::addSeparator()</h3>
<p>Adds a separator in here. Cool, man.
<h3 class="fn">bool<a name="b0"></a>QToolBar::event(<a href="qevent.html">QEvent</a>*e) <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#a2">QObject.</a>
<h3 class="fn"><a href="qmainwindow.html">QMainWindow</a>*<a name="a8"></a>QToolBar::mainWindow()</h3>
<p>Returns a pointer to the <a href="qmainwindow.html">QMainWindow</a> which controls this tool bar.
<h3 class="fn">QToolBar::Orientation<a name="a6"></a>QToolBar::orientation()const</h3>
<p>Returns the current orientation of the toolbar.
<h3 class="fn">void<a name="b1"></a>QToolBar::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Paint the handle. The Motif style is rather close to Netscape
and even closer to KDE.
<p>Reimplemented from <a href="qwidget.html#o4">QWidget.</a>
<h3 class="fn">void<a name="a5"></a>QToolBar::setOrientation(OrientationnewOrientation) <code>[virtual]</code></h3>
<p>Sets this toolbar to organize its content vertically if <em>newOrientation</em> is <code>Vertical</code> and horizontally if <em>newOrientation</em>
is <code>Horizontal.</code>
<h3 class="fn">void<a name="a9"></a>QToolBar::setStretchableWidget(<a href="qwidget.html">QWidget</a>*w)</h3>
<p>Sets <em>w</em> to be expanded if this toolbar is requested to stretch
(because <a href="qmainwindow.html">QMainWindow</a> right-justifies the dock it's in).
<h3 class="fn">void<a name="a7"></a>QToolBar::show() <code>[virtual]</code></h3>
<p>Reimplemented to set up geometry management.
<p>Reimplemented from <a href="qwidget.html#k2">QWidget.</a>
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.troll.no">www.troll.no</a>):<br>
<form method=post action="http://www.troll.no/search.cgi">
<input type=hidden name="version" value="1.44"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-99
<a href="troll.html">Troll Tech</a>, all rights reserved.
<p>
It was generated from the following files:
<ul>
<li>qtoolbar.h: 1998/08/19
<li>qtoolbar.cpp: 1998/08/12
</ul>
<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 1999 Troll Tech<td><a href="trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 1.45</div>
</table></div></address></body></html>
|