source: tspsg/src/3rdparty/qttoolbardialog-2.2_1-opensource/doc/html/qttoolbarmanager.html @ a713b103e8

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since a713b103e8 was 94cd045fad, checked in by Oleksii Serdiuk, 15 years ago

+ Started adding a toolbar customization with the ude of QtToolbarDialog? (http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qttoolbardialog/).

  • Property mode set to 100644
File size: 11.8 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html
3    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<!-- qttoolbardialog-2.2_1-opensource/src/qttoolbardialog.cpp -->
6<head>
7  <title>QtToolBarManager Class Reference</title>
8  <link href="classic.css" rel="stylesheet" type="text/css" />
9</head>
10<body>
11<table border="0" cellpadding="0" cellspacing="0" width="100%">
12<tr>
13<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
14<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
15</tr></table><h1 class="title">QtToolBarManager Class Reference</h1>
16<p>The QtToolBarManager class provides toolbar management for main windows. <a href="#details">More...</a></p>
17<pre> #include &lt;QtToolBarManager&gt;</pre><p>Inherits <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a>.</p>
18<ul>
19<li><a href="qttoolbarmanager-members.html">List of all members, including inherited members</a></li>
20</ul>
21<a name="public-functions"></a>
22<h3>Public Functions</h3>
23<ul>
24<li><div class="fn"></div><b><a href="qttoolbarmanager.html#QtToolBarManager">QtToolBarManager</a></b> ( QObject * <i>parent</i> = 0 )</li>
25<li><div class="fn"></div><b><a href="qttoolbarmanager.html#dtor.QtToolBarManager">~QtToolBarManager</a></b> ()</li>
26<li><div class="fn"></div>void <b><a href="qttoolbarmanager.html#addAction">addAction</a></b> ( QAction * <i>action</i>, const QString &amp; <i>category</i> )</li>
27<li><div class="fn"></div>void <b><a href="qttoolbarmanager.html#addToolBar">addToolBar</a></b> ( QToolBar * <i>toolBar</i>, const QString &amp; <i>category</i> )</li>
28<li><div class="fn"></div>QMainWindow * <b><a href="qttoolbarmanager.html#mainWindow">mainWindow</a></b> () const</li>
29<li><div class="fn"></div>void <b><a href="qttoolbarmanager.html#removeAction">removeAction</a></b> ( QAction * <i>action</i> )</li>
30<li><div class="fn"></div>void <b><a href="qttoolbarmanager.html#removeToolBar">removeToolBar</a></b> ( QToolBar * <i>toolBar</i> )</li>
31<li><div class="fn"></div>bool <b><a href="qttoolbarmanager.html#restoreState">restoreState</a></b> ( const QByteArray &amp; <i>state</i>, int <i>version</i> = 0 )</li>
32<li><div class="fn"></div>QByteArray <b><a href="qttoolbarmanager.html#saveState">saveState</a></b> ( int <i>version</i> = 0 ) const</li>
33<li><div class="fn"></div>void <b><a href="qttoolbarmanager.html#setMainWindow">setMainWindow</a></b> ( QMainWindow * <i>mainWindow</i> )</li>
34<li><div class="fn"></div>QList&lt;QToolBar *&gt; <b><a href="qttoolbarmanager.html#toolBars">toolBars</a></b> () const</li>
35</ul>
36<ul>
37<li><div class="fn"></div>29 public functions inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#public-functions">QObject</a></li>
38</ul>
39<h3>Additional Inherited Members</h3>
40<ul>
41<li><div class="fn"></div>1 property inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#properties">QObject</a></li>
42<li><div class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#public-slots">QObject</a></li>
43<li><div class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#signals">QObject</a></li>
44<li><div class="fn"></div>1 public type inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#public-variables">QObject</a></li>
45<li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#static-public-members">QObject</a></li>
46<li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#protected-functions">QObject</a></li>
47<li><div class="fn"></div>2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.5/qobject.html#protected-variables">QObject</a></li>
48</ul>
49<a name="details"></a>
50<hr />
51<h2>Detailed Description</h2>
52<p>The QtToolBarManager class provides toolbar management for main windows.</p>
53<p>The QtToolBarManager is typically used with a <a href="qttoolbardialog.html">QtToolBarDialog</a> which allows the user to customize the toolbars for a given main window. The <a href="qttoolbardialog.html">QtToolBarDialog</a> class's functionality is controlled by an instance of the QtToolBarManager class, and the main window is specified using the QtToolBarManager class's <a href="qttoolbarmanager.html#setMainWindow">setMainWindow</a>() function.</p>
54<p>The currently specified main window can be retrieved using the <a href="qttoolbarmanager.html#mainWindow">mainWindow</a>() function.</p>
55<p>The toolbar manager holds lists of the given main window's actions and toolbars, and can add actions and toolbars to these lists using the <a href="qttoolbarmanager.html#addAction">addAction</a>() and <a href="qttoolbarmanager.html#addToolBar">addToolBar</a>() functions respectively. The actions can in addition be categorized acccording to the user's preferences. The toolbar manager can also remove custom actions and toolbars using the <a href="qttoolbarmanager.html#removeAction">removeAction</a>() and <a href="qttoolbarmanager.html#removeToolBar">removeToolBar</a>() functions.</p>
56<p>Finally, the QtToolBarManager is able to save the customized state of its toolbars using the <a href="qttoolbarmanager.html#saveState">saveState</a>() function as well as restore the toolbars' saved state using <a href="qttoolbarmanager.html#restoreState">restoreState</a>() function.</p>
57<p>See also <a href="qttoolbardialog.html">QtToolBarDialog</a>.</p>
58<hr />
59<h2>Member Function Documentation</h2>
60<h3 class="fn"><a name="QtToolBarManager"></a>QtToolBarManager::QtToolBarManager ( <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
61<p>Creates a toolbar manager with the given <i>parent</i>.</p>
62<h3 class="fn"><a name="dtor.QtToolBarManager"></a>QtToolBarManager::~QtToolBarManager ()</h3>
63<p>Destroys the toolbar manager.</p>
64<h3 class="fn"><a name="addAction"></a>void QtToolBarManager::addAction ( <a href="http://qt.nokia.com/doc/4.5/qaction.html">QAction</a> * <i>action</i>, const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>category</i> )</h3>
65<p>Adds the given <i>action</i> to the given <i>category</i> in the manager's list of actions. If the <i>category</i> doesn't exist it is created. Only non separator actions can be added. If the action is already added to the list, the function doesn't do anything.</p>
66<p>See also <a href="qttoolbarmanager.html#removeAction">removeAction</a>().</p>
67<h3 class="fn"><a name="addToolBar"></a>void QtToolBarManager::addToolBar ( <a href="http://qt.nokia.com/doc/4.5/qtoolbar.html">QToolBar</a> * <i>toolBar</i>, const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>category</i> )</h3>
68<p>Adds the given <i>toolBar</i> to the manager's toolbar list.</p>
69<p>All the <i>toolBar</i>'s actions are automatically added to the given <i>category</i> in the manager's list of actions if they're not already there. The manager remembers which toolbar the actions belonged to, so, when the <i>toolBar</i> is removed, its actions will be removed as well.</p>
70<p>Custom toolbars are created with the main window returned by the <a href="qttoolbarmanager.html#mainWindow">mainWindow</a>() function, as its parent.</p>
71<p>See also <a href="qttoolbarmanager.html#removeToolBar">removeToolBar</a>().</p>
72<h3 class="fn"><a name="mainWindow"></a><a href="http://qt.nokia.com/doc/4.5/qmainwindow.html">QMainWindow</a> * QtToolBarManager::mainWindow () const</h3>
73<p>Returns the main window associated this toolbar manager.</p>
74<p>See also <a href="qttoolbarmanager.html#setMainWindow">setMainWindow</a>().</p>
75<h3 class="fn"><a name="removeAction"></a>void QtToolBarManager::removeAction ( <a href="http://qt.nokia.com/doc/4.5/qaction.html">QAction</a> * <i>action</i> )</h3>
76<p>Removes the specified <i>action</i> from the manager's list of actions. The action is also removed from all the registered toolbars. If the specified <i>action</i> is the only action in its category, that category is removed as well.</p>
77<p>See also <a href="qttoolbarmanager.html#addAction">addAction</a>().</p>
78<h3 class="fn"><a name="removeToolBar"></a>void QtToolBarManager::removeToolBar ( <a href="http://qt.nokia.com/doc/4.5/qtoolbar.html">QToolBar</a> * <i>toolBar</i> )</h3>
79<p>Removes the specified <i>toolBar</i> from the manager's list. All the actions that existed in the specified <i>toolBar</i> when it was added are removed as well.</p>
80<p>See also <a href="qttoolbarmanager.html#addToolBar">addToolBar</a>().</p>
81<h3 class="fn"><a name="restoreState"></a>bool QtToolBarManager::restoreState ( const <a href="http://qt.nokia.com/doc/4.5/qbytearray.html">QByteArray</a> &amp; <i>state</i>, int <i>version</i> = 0 )</h3>
82<p>Restores the saved state of the toolbar manager's toolbars. The <i>version</i> number is compared with the version number of the stored <i>state</i>.</p>
83<p>Returns true if the version numbers are matching and the toolbar manager's state is restored; otherwise the toolbar manager's state is left unchanged and the function returns false.</p>
84<p>Note that the state of the toolbar manager's toolbars should be restored before restoring the state of the main window's toolbars and dockwidgets using the <a href="http://qt.nokia.com/doc/4.5/qmainwindow.html#restoreState">QMainWindow::restoreState</a>() function. In that way the restoreState() function can create the custom toolbars before the <a href="http://qt.nokia.com/doc/4.5/qmainwindow.html#restoreState">QMainWindow::restoreState</a>() function restores the custom toolbars' positions.</p>
85<p>See also <a href="qttoolbarmanager.html#saveState">saveState</a>().</p>
86<h3 class="fn"><a name="saveState"></a><a href="http://qt.nokia.com/doc/4.5/qbytearray.html">QByteArray</a> QtToolBarManager::saveState ( int <i>version</i> = 0 ) const</h3>
87<p>Saves the state of the toolbar manager's toolbars. The <i>version</i> number is stored as part of the data.</p>
88<p>Identifies all the <a href="http://qt.nokia.com/doc/4.5/qtoolbar.html">QToolBar</a> and <a href="http://qt.nokia.com/doc/4.5/qaction.html">QAction</a> objects by their object name property. Ensure that this property is unique for each <a href="http://qt.nokia.com/doc/4.5/qtoolbar.html">QToolBar</a> and <a href="http://qt.nokia.com/doc/4.5/qaction.html">QAction</a> that you add using the <a href="qttoolbarmanager.html">QtToolBarManager</a>.</p>
89<p>Returns an identifier for the state which can be passed along with the version number to the <a href="qttoolbarmanager.html#restoreState">restoreState</a>() function to restore the saved state.</p>
90<p>See also <a href="qttoolbarmanager.html#restoreState">restoreState</a>().</p>
91<h3 class="fn"><a name="setMainWindow"></a>void QtToolBarManager::setMainWindow ( <a href="http://qt.nokia.com/doc/4.5/qmainwindow.html">QMainWindow</a> * <i>mainWindow</i> )</h3>
92<p>Sets the main window upon which the toolbar manager operates, to be the given <i>mainWindow</i>.</p>
93<p>See also <a href="qttoolbarmanager.html#mainWindow">mainWindow</a>().</p>
94<h3 class="fn"><a name="toolBars"></a><a href="http://qt.nokia.com/doc/4.5/qlist.html">QList</a>&lt;<a href="http://qt.nokia.com/doc/4.5/qtoolbar.html">QToolBar</a> *&gt; QtToolBarManager::toolBars () const</h3>
95<p>Returns the manager's toolbar list.</p>
96<p /><address><hr /><div align="center">
97<table width="100%" cellspacing="0" border="0"><tr class="address">
98<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
99<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
100<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
101</tr></table></div></address></body>
102</html>
Note: See TracBrowser for help on using the repository browser.