Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1f9eb832ba1e4b88d9a5c2b384813bb4 > files > 3973

kdelibs3-apidocs-3.5.10-31.fc15.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">

<head>
  <title>kdeui: ktoolbar.cpp Source File (kdeui)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org"  r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org"  r (n 0 s 0 v 0 l 0))' />

  <meta name="trademark" content="KDE e.V." />
  <meta name="description" content="K Desktop Environment Homepage, KDE.org" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />

  <link rel="shortcut icon" href="../../favicon.ico" />

<link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" />



</head>

<body>

<div id="nav_header_top" align="right">
  <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a>

  <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a>
  <span class="doNotDisplay">::</span>

  <div id="nav_header_title" align="left">KDE API Reference</div>


</div>

<div id="nav_header_bottom" align="right">
  <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span>
  <div id="nav_header_bottom_right" style="text-align: left;">
/ <a href="../..">API Reference</a>
 / <a href=".">kdeui</a>
  </div>
</div>


<table id="main" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
      <td valign="top" class="menuheader" height="0"></td>

  <td id="contentcolumn" valign="top" rowspan="2" >
    <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;">
    <a name="content"></a>


<!-- Generated by Doxygen 1.7.4 -->
<div class="header">
  <div class="headertitle">
<div class="title">ktoolbar.cpp</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* This file is part of the KDE libraries</span>
<a name="l00002"></a>00002 <span class="comment">    Copyright</span>
<a name="l00003"></a>00003 <span class="comment">    (C) 2000 Reginald Stadlbauer (reggie@kde.org)</span>
<a name="l00004"></a>00004 <span class="comment">    (C) 1997, 1998 Stephan Kulow (coolo@kde.org)</span>
<a name="l00005"></a>00005 <span class="comment">    (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)</span>
<a name="l00006"></a>00006 <span class="comment">    (C) 1997, 1998 Sven Radej (radej@kde.org)</span>
<a name="l00007"></a>00007 <span class="comment">    (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)</span>
<a name="l00008"></a>00008 <span class="comment">    (C) 1999 Chris Schlaeger (cs@kde.org)</span>
<a name="l00009"></a>00009 <span class="comment">    (C) 1999 Kurt Granroth (granroth@kde.org)</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00012"></a>00012 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00013"></a>00013 <span class="comment">    License version 2 as published by the Free Software Foundation.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00016"></a>00016 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00017"></a>00017 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00018"></a>00018 <span class="comment">    Library General Public License for more details.</span>
<a name="l00019"></a>00019 <span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">    You should have received a copy of the GNU Library General Public License</span>
<a name="l00021"></a>00021 <span class="comment">    along with this library; see the file COPYING.LIB.  If not, write to</span>
<a name="l00022"></a>00022 <span class="comment">    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span>
<a name="l00023"></a>00023 <span class="comment">    Boston, MA 02110-1301, USA.</span>
<a name="l00024"></a>00024 <span class="comment">*/</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;config.h&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifdef KDE_USE_FINAL</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#undef Always</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#include &lt;qdockwindow.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#endif</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;qpainter.h&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;qtooltip.h&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;qdrawutil.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;qstring.h&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;qrect.h&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;qobjectlist.h&gt;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;qtimer.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;qstyle.h&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;qlayout.h&gt;</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include &lt;ktoolbar.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;kmainwindow.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;klineedit.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;kseparator.h&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/klocale_8h.html">klocale.h</a>&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;kapplication.h&gt;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;kaction.h&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;kstdaction.h&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;kglobal.h&gt;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &lt;kconfig.h&gt;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;kiconloader.h&gt;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include &lt;kcombobox.h&gt;</span>
<a name="l00057"></a>00057 <span class="preprocessor">#include &lt;kpopupmenu.h&gt;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#include &lt;kanimwidget.h&gt;</span>
<a name="l00059"></a>00059 <span class="preprocessor">#include &lt;kedittoolbar.h&gt;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &lt;kipc.h&gt;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &lt;kwin.h&gt;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &lt;kdebug.h&gt;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &lt;ktoolbarbutton.h&gt;</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="keyword">enum</span> {
<a name="l00066"></a>00066     CONTEXT_TOP = 0,
<a name="l00067"></a>00067     CONTEXT_LEFT = 1,
<a name="l00068"></a>00068     CONTEXT_RIGHT = 2,
<a name="l00069"></a>00069     CONTEXT_BOTTOM = 3,
<a name="l00070"></a>00070     CONTEXT_FLOAT = 4,
<a name="l00071"></a>00071     CONTEXT_FLAT = 5,
<a name="l00072"></a>00072     CONTEXT_ICONS = 6,
<a name="l00073"></a>00073     CONTEXT_TEXT = 7,
<a name="l00074"></a>00074     CONTEXT_TEXTRIGHT = 8,
<a name="l00075"></a>00075     CONTEXT_TEXTUNDER = 9,
<a name="l00076"></a>00076     CONTEXT_ICONSIZES = 50 <span class="comment">// starting point for the icon size list, put everything else before</span>
<a name="l00077"></a>00077 };
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keyword">class </span>KToolBarPrivate
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <span class="keyword">public</span>:
<a name="l00082"></a>00082     KToolBarPrivate() {
<a name="l00083"></a>00083         m_iconSize     = 0;
<a name="l00084"></a>00084         m_iconText     = KToolBar::IconOnly;
<a name="l00085"></a>00085         m_highlight    = <span class="keyword">true</span>;
<a name="l00086"></a>00086         m_transparent  = <span class="keyword">true</span>;
<a name="l00087"></a>00087         m_honorStyle   = <span class="keyword">false</span>;
<a name="l00088"></a>00088 
<a name="l00089"></a>00089         m_enableContext  = <span class="keyword">true</span>;
<a name="l00090"></a>00090 
<a name="l00091"></a>00091         m_xmlguiClient   = 0;
<a name="l00092"></a>00092 
<a name="l00093"></a>00093         oldPos = Qt::DockUnmanaged;
<a name="l00094"></a>00094 
<a name="l00095"></a>00095         modified = m_isHorizontal = positioned = <span class="keyword">false</span>;
<a name="l00096"></a>00096 
<a name="l00097"></a>00097         IconSizeDefault = 0;
<a name="l00098"></a>00098         IconTextDefault = <span class="stringliteral">&quot;IconOnly&quot;</span>;
<a name="l00099"></a>00099 
<a name="l00100"></a>00100         NewLineDefault = <span class="keyword">false</span>;
<a name="l00101"></a>00101         OffsetDefault = 0;
<a name="l00102"></a>00102         PositionDefault = <span class="stringliteral">&quot;Top&quot;</span>;
<a name="l00103"></a>00103     HiddenDefault = <span class="keyword">false</span>;
<a name="l00104"></a>00104         idleButtons.setAutoDelete(<span class="keyword">true</span>);
<a name="l00105"></a>00105     }
<a name="l00106"></a>00106 
<a name="l00107"></a>00107     <span class="keywordtype">int</span> m_iconSize;
<a name="l00108"></a>00108     KToolBar::IconText m_iconText;
<a name="l00109"></a>00109     <span class="keywordtype">bool</span> m_highlight : 1;
<a name="l00110"></a>00110     <span class="keywordtype">bool</span> m_transparent : 1;
<a name="l00111"></a>00111     <span class="keywordtype">bool</span> m_honorStyle : 1;
<a name="l00112"></a>00112     <span class="keywordtype">bool</span> m_isHorizontal : 1;
<a name="l00113"></a>00113     <span class="keywordtype">bool</span> m_enableContext : 1;
<a name="l00114"></a>00114     <span class="keywordtype">bool</span> modified : 1;
<a name="l00115"></a>00115     <span class="keywordtype">bool</span> positioned : 1;
<a name="l00116"></a>00116 
<a name="l00117"></a>00117     <a class="codeRef" href="qwidget.html">QWidget</a> *m_parent;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     QMainWindow::ToolBarDock oldPos;
<a name="l00120"></a>00120 
<a name="l00121"></a>00121     <a class="code" href="classKXMLGUIClient.html" title="A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...">KXMLGUIClient</a> *m_xmlguiClient;
<a name="l00122"></a>00122 
<a name="l00123"></a>00123     <span class="keyword">struct </span>ToolBarInfo
<a name="l00124"></a>00124     {
<a name="l00125"></a>00125         ToolBarInfo() : index( -1 ), offset( -1 ), newline( false ), dock( <a class="codeRef" href="qt.html">Qt</a>::DockTop ) {}
<a name="l00126"></a>00126         ToolBarInfo( Qt::Dock d, <span class="keywordtype">int</span> i, <span class="keywordtype">bool</span> n, <span class="keywordtype">int</span> o ) : index( i ), offset( o ), newline( n ), dock( d ) {}
<a name="l00127"></a>00127         <span class="keywordtype">int</span> index, offset;
<a name="l00128"></a>00128         <span class="keywordtype">bool</span> newline;
<a name="l00129"></a>00129         Qt::Dock dock;
<a name="l00130"></a>00130     };
<a name="l00131"></a>00131 
<a name="l00132"></a>00132     ToolBarInfo toolBarInfo;
<a name="l00133"></a>00133     <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;</a> iconSizes;
<a name="l00134"></a>00134     <a class="codeRef" href="qtimer.html">QTimer</a> repaintTimer;
<a name="l00135"></a>00135 
<a name="l00136"></a>00136   <span class="comment">// Default Values.</span>
<a name="l00137"></a>00137   <span class="keywordtype">bool</span> HiddenDefault;
<a name="l00138"></a>00138   <span class="keywordtype">int</span> IconSizeDefault;
<a name="l00139"></a>00139   <a class="codeRef" href="qstring.html">QString</a> IconTextDefault;
<a name="l00140"></a>00140   <span class="keywordtype">bool</span> NewLineDefault;
<a name="l00141"></a>00141   <span class="keywordtype">int</span> OffsetDefault;
<a name="l00142"></a>00142   <a class="codeRef" href="qstring.html">QString</a> PositionDefault;
<a name="l00143"></a>00143 
<a name="l00144"></a>00144    <a class="codeRef" href="qptrlist.html">QPtrList&lt;QWidget&gt;</a> idleButtons;
<a name="l00145"></a>00145 };
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 KToolBarSeparator::KToolBarSeparator(Orientation o , <span class="keywordtype">bool</span> l, <a class="codeRef" href="qtoolbar.html">QToolBar</a> *parent,
<a name="l00148"></a>00148                                      <span class="keyword">const</span> <span class="keywordtype">char</span>* name )
<a name="l00149"></a>00149     :<a class="codeRef" href="qframe.html">QFrame</a>( parent, name ), line( l )
<a name="l00150"></a>00150 {
<a name="l00151"></a>00151     connect( parent, SIGNAL(orientationChanged(Orientation)),
<a name="l00152"></a>00152              <span class="keyword">this</span>, SLOT(<a class="codeRef" href="qdialog.html#setOrientation">setOrientation</a>(Orientation)) );
<a name="l00153"></a>00153     <a class="codeRef" href="qdialog.html#setOrientation">setOrientation</a>( o );
<a name="l00154"></a>00154     setBackgroundMode( parent-&gt;backgroundMode() );
<a name="l00155"></a>00155     setBackgroundOrigin( ParentOrigin );
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="keywordtype">void</span> KToolBarSeparator::setOrientation( Orientation o )
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160     orient = o;
<a name="l00161"></a>00161     setFrameStyle( NoFrame );
<a name="l00162"></a>00162 }
<a name="l00163"></a>00163 
<a name="l00164"></a>00164 <span class="keywordtype">void</span> KToolBarSeparator::drawContents( <a class="codeRef" href="qpainter.html">QPainter</a>* p )
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166     <span class="keywordflow">if</span> ( line ) {
<a name="l00167"></a>00167         QStyle::SFlags flags = QStyle::Style_Default;
<a name="l00168"></a>00168 
<a name="l00169"></a>00169         <span class="keywordflow">if</span> ( orientation() == Horizontal )
<a name="l00170"></a>00170             flags = flags | QStyle::Style_Horizontal;
<a name="l00171"></a>00171 
<a name="l00172"></a>00172         style().drawPrimitive(QStyle::PE_DockWindowSeparator, p,
<a name="l00173"></a>00173                               contentsRect(), colorGroup(), flags);
<a name="l00174"></a>00174     } <span class="keywordflow">else</span> {
<a name="l00175"></a>00175         <a class="codeRef" href="qframe.html#drawContents">QFrame::drawContents</a>(p);
<a name="l00176"></a>00176     }
<a name="l00177"></a>00177 }
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 <span class="keywordtype">void</span> KToolBarSeparator::styleChange( <a class="codeRef" href="qstyle.html">QStyle</a>&amp; )
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181     setOrientation( orient );
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 <a class="codeRef" href="qsize.html">QSize</a> KToolBarSeparator::sizeHint()<span class="keyword"> const</span>
<a name="l00185"></a>00185 <span class="keyword"></span>{
<a name="l00186"></a>00186     <span class="keywordtype">int</span> dim = style().pixelMetric( QStyle::PM_DockWindowSeparatorExtent, <span class="keyword">this</span> );
<a name="l00187"></a>00187     <span class="keywordflow">return</span> orientation() == Vertical ? <a class="codeRef" href="qsize.html">QSize</a>( 0, dim ) : QSize( dim, 0 );
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 
<a name="l00190"></a>00190 <a class="codeRef" href="qsizepolicy.html">QSizePolicy</a> KToolBarSeparator::sizePolicy()<span class="keyword"> const</span>
<a name="l00191"></a>00191 <span class="keyword"></span>{
<a name="l00192"></a>00192     <span class="keywordflow">return</span> <a class="codeRef" href="qsizepolicy.html">QSizePolicy</a>( QSizePolicy::Minimum, QSizePolicy::Minimum );
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194 
<a name="l00195"></a><a class="code" href="classKToolBar.html#aff70c7fc809846073c34ac6b934b4cf2">00195</a> <a class="code" href="classKToolBar.html#aff70c7fc809846073c34ac6b934b4cf2" title="Normal constructor.">KToolBar::KToolBar</a>( <a class="codeRef" href="qwidget.html">QWidget</a> *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> honorStyle, <span class="keywordtype">bool</span> readConfig )
<a name="l00196"></a>00196     : <a class="codeRef" href="qtoolbar.html">QToolBar</a>( <a class="codeRef" href="qstring.html">QString</a>::fromLatin1( name ),
<a name="l00197"></a>00197       dynamic_cast&lt;<a class="codeRef" href="qmainwindow.html">QMainWindow</a>*&gt;(parent),
<a name="l00198"></a>00198       parent, false,
<a name="l00199"></a>00199       name ? name : <span class="stringliteral">&quot;mainToolBar&quot;</span>)
<a name="l00200"></a>00200 {
<a name="l00201"></a>00201     init( readConfig, honorStyle );
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203 
<a name="l00204"></a><a class="code" href="classKToolBar.html#ac1cdcee1bc79ab48ad8e71b902f37b8f">00204</a> <a class="code" href="classKToolBar.html#aff70c7fc809846073c34ac6b934b4cf2" title="Normal constructor.">KToolBar::KToolBar</a>( <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *parentWindow, QMainWindow::ToolBarDock dock, <span class="keywordtype">bool</span> newLine, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> honorStyle, <span class="keywordtype">bool</span> readConfig )
<a name="l00205"></a>00205     : <a class="codeRef" href="qtoolbar.html">QToolBar</a>( <a class="codeRef" href="qstring.html">QString</a>::fromLatin1( name ),
<a name="l00206"></a>00206       parentWindow, dock, newLine,
<a name="l00207"></a>00207       name ? name : <span class="stringliteral">&quot;mainToolBar&quot;</span>)
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     init( readConfig, honorStyle );
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 
<a name="l00212"></a><a class="code" href="classKToolBar.html#a08f927f577024e2466f53e80da502755">00212</a> <a class="code" href="classKToolBar.html#aff70c7fc809846073c34ac6b934b4cf2" title="Normal constructor.">KToolBar::KToolBar</a>( <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *parentWindow, <a class="codeRef" href="qwidget.html">QWidget</a> *dock, <span class="keywordtype">bool</span> newLine, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> honorStyle, <span class="keywordtype">bool</span> readConfig )
<a name="l00213"></a>00213     : <a class="codeRef" href="qtoolbar.html">QToolBar</a>( <a class="codeRef" href="qstring.html">QString</a>::fromLatin1( name ),
<a name="l00214"></a>00214       parentWindow, dock, newLine,
<a name="l00215"></a>00215       name ? name : <span class="stringliteral">&quot;mainToolBar&quot;</span>)
<a name="l00216"></a>00216 {
<a name="l00217"></a>00217     init( readConfig, honorStyle );
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219 
<a name="l00220"></a><a class="code" href="classKToolBar.html#a52a92b6904844a6c4ec165e7fb52bcc1">00220</a> <a class="code" href="classKToolBar.html#a52a92b6904844a6c4ec165e7fb52bcc1" title="Destructor.">KToolBar::~KToolBar</a>()
<a name="l00221"></a>00221 {
<a name="l00222"></a>00222     emit <a class="code" href="classKToolBar.html#a8d049eecb6685f390e834fab959f5e22" title="This signal is emitted when the toolbar is getting deleted, and before ~KToolbar finishes (so it&#39;s st...">toolbarDestroyed</a>();
<a name="l00223"></a>00223     <span class="keyword">delete</span> d;
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 
<a name="l00226"></a>00226 <span class="keywordtype">void</span> KToolBar::init( <span class="keywordtype">bool</span> readConfig, <span class="keywordtype">bool</span> honorStyle )
<a name="l00227"></a>00227 {
<a name="l00228"></a>00228     d = <span class="keyword">new</span> KToolBarPrivate;
<a name="l00229"></a>00229     <a class="code" href="classKToolBar.html#af8f4554e0a3f770f1b7f1d6d1382d944" title="Set toolbar to full parent size (default).">setFullSize</a>( <span class="keyword">true</span> );
<a name="l00230"></a>00230     d-&gt;m_honorStyle = honorStyle;
<a name="l00231"></a>00231     context = 0;
<a name="l00232"></a>00232     layoutTimer = <span class="keyword">new</span> <a class="codeRef" href="qtimer.html">QTimer</a>( <span class="keyword">this</span> );
<a name="l00233"></a>00233     connect( layoutTimer, SIGNAL( timeout() ),
<a name="l00234"></a>00234              <span class="keyword">this</span>, SLOT( rebuildLayout() ) );
<a name="l00235"></a>00235     connect( &amp;(d-&gt;repaintTimer), SIGNAL( timeout() ),
<a name="l00236"></a>00236              <span class="keyword">this</span>, SLOT( slotRepaint() ) );
<a name="l00237"></a>00237 
<a name="l00238"></a>00238     <span class="keywordflow">if</span> ( kapp ) { <span class="comment">// may be null when started inside designer</span>
<a name="l00239"></a>00239         connect(kapp, SIGNAL(toolbarAppearanceChanged(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SLOT(slotAppearanceChanged()));
<a name="l00240"></a>00240         <span class="comment">// request notification of changes in icon style</span>
<a name="l00241"></a>00241         kapp-&gt;addKipcEventMask(KIPC::IconChanged);
<a name="l00242"></a>00242         connect(kapp, SIGNAL(iconChanged(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SLOT(slotIconChanged(<span class="keywordtype">int</span>)));
<a name="l00243"></a>00243     }
<a name="l00244"></a>00244 
<a name="l00245"></a>00245     <span class="comment">// finally, read in our configurable settings</span>
<a name="l00246"></a>00246     <span class="keywordflow">if</span> ( readConfig )
<a name="l00247"></a>00247         slotReadConfig();
<a name="l00248"></a>00248 
<a name="l00249"></a>00249     <span class="keywordflow">if</span> ( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l00250"></a>00250         connect( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>(), SIGNAL( toolBarPositionChanged( <a class="codeRef" href="qtoolbar.html">QToolBar</a> * ) ),
<a name="l00251"></a>00251                  <span class="keyword">this</span>, SLOT( toolBarPosChanged( <a class="codeRef" href="qtoolbar.html">QToolBar</a> * ) ) );
<a name="l00252"></a>00252 
<a name="l00253"></a>00253     <span class="comment">// Hack to make sure we recalculate our size when we dock.</span>
<a name="l00254"></a>00254     connect( <span class="keyword">this</span>, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) );
<a name="l00255"></a>00255 }
<a name="l00256"></a>00256 
<a name="l00257"></a><a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969">00257</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; icon, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> enabled,
<a name="l00258"></a>00258                             <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> index, <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> *_instance )
<a name="l00259"></a>00259 {
<a name="l00260"></a>00260     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( icon, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text, _instance );
<a name="l00261"></a>00261 
<a name="l00262"></a>00262     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00263"></a>00263     button-&gt;setEnabled( enabled );
<a name="l00264"></a>00264     doConnections( button );
<a name="l00265"></a>00265     <span class="keywordflow">return</span> index;
<a name="l00266"></a>00266 }
<a name="l00267"></a>00267 
<a name="l00268"></a>00268 
<a name="l00269"></a><a class="code" href="classKToolBar.html#ab5ae4abd32bd9b28b746858d75f0d062">00269</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; icon, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *signal,
<a name="l00270"></a>00270                             <span class="keyword">const</span> <a class="codeRef" href="qobject.html">QObject</a> *receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> *slot,
<a name="l00271"></a>00271                             <span class="keywordtype">bool</span> enabled, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> index, <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> *_instance )
<a name="l00272"></a>00272 {
<a name="l00273"></a>00273     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( icon, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text, _instance);
<a name="l00274"></a>00274     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00275"></a>00275     button-&gt;setEnabled( enabled );
<a name="l00276"></a>00276     connect( button, signal, receiver, slot );
<a name="l00277"></a>00277     doConnections( button );
<a name="l00278"></a>00278     <span class="keywordflow">return</span> index;
<a name="l00279"></a>00279 }
<a name="l00280"></a>00280 
<a name="l00281"></a>00281 
<a name="l00282"></a><a class="code" href="classKToolBar.html#ae8ddad5c697f82a2a2c90ca244362c14">00282</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qpixmap.html">QPixmap</a>&amp; pixmap, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> enabled,
<a name="l00283"></a>00283                             <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> index )
<a name="l00284"></a>00284 {
<a name="l00285"></a>00285     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( pixmap, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text);
<a name="l00286"></a>00286     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00287"></a>00287     button-&gt;setEnabled( enabled );
<a name="l00288"></a>00288     doConnections( button );
<a name="l00289"></a>00289     <span class="keywordflow">return</span> index;
<a name="l00290"></a>00290 }
<a name="l00291"></a>00291 
<a name="l00292"></a>00292 
<a name="l00293"></a><a class="code" href="classKToolBar.html#a7983650038f4078af1c926877da5602b">00293</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qpixmap.html">QPixmap</a>&amp; pixmap, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *signal,
<a name="l00294"></a>00294                             <span class="keyword">const</span> <a class="codeRef" href="qobject.html">QObject</a> *receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> *slot,
<a name="l00295"></a>00295                             <span class="keywordtype">bool</span> enabled, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text,
<a name="l00296"></a>00296                             <span class="keywordtype">int</span> index )
<a name="l00297"></a>00297 {
<a name="l00298"></a>00298     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( pixmap, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text);
<a name="l00299"></a>00299     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00300"></a>00300     button-&gt;setEnabled( enabled );
<a name="l00301"></a>00301     connect( button, signal, receiver, slot );
<a name="l00302"></a>00302     doConnections( button );
<a name="l00303"></a>00303     <span class="keywordflow">return</span> index;
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 
<a name="l00306"></a>00306 
<a name="l00307"></a><a class="code" href="classKToolBar.html#a836b4d94b4b3bc3009fea56189471c1f">00307</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; icon, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <a class="codeRef" href="qpopupmenu.html">QPopupMenu</a> *popup,
<a name="l00308"></a>00308                             <span class="keywordtype">bool</span> enabled, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;text, <span class="keywordtype">int</span> index )
<a name="l00309"></a>00309 {
<a name="l00310"></a>00310     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( icon, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text );
<a name="l00311"></a>00311     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00312"></a>00312     button-&gt;setEnabled( enabled );
<a name="l00313"></a>00313     button-&gt;<a class="code" href="classKToolBarButton.html#a8ff1dfa4d8473d8ed22b17f59779766a" title="Give this button a popup menu.">setPopup</a>( popup );
<a name="l00314"></a>00314     doConnections( button );
<a name="l00315"></a>00315     <span class="keywordflow">return</span> index;
<a name="l00316"></a>00316 }
<a name="l00317"></a>00317 
<a name="l00318"></a>00318 
<a name="l00319"></a><a class="code" href="classKToolBar.html#ac704084ea75df3dfe249701f330848b2">00319</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a72e18642288ea976523a43b7ef057969" title="Insert a button (a KToolBarButton) with a pixmap.">KToolBar::insertButton</a>(<span class="keyword">const</span> <a class="codeRef" href="qpixmap.html">QPixmap</a>&amp; pixmap, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <a class="codeRef" href="qpopupmenu.html">QPopupMenu</a> *popup,
<a name="l00320"></a>00320                             <span class="keywordtype">bool</span> enabled, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;text, <span class="keywordtype">int</span> index )
<a name="l00321"></a>00321 {
<a name="l00322"></a>00322     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button = <span class="keyword">new</span> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a>( pixmap, <span class="keywordtype">id</span>, <span class="keyword">this</span>, 0, text );
<a name="l00323"></a>00323     insertWidgetInternal( button, index, <span class="keywordtype">id</span> );
<a name="l00324"></a>00324     button-&gt;setEnabled( enabled );
<a name="l00325"></a>00325     button-&gt;<a class="code" href="classKToolBarButton.html#a8ff1dfa4d8473d8ed22b17f59779766a" title="Give this button a popup menu.">setPopup</a>( popup );
<a name="l00326"></a>00326     doConnections( button );
<a name="l00327"></a>00327     <span class="keywordflow">return</span> index;
<a name="l00328"></a>00328 }
<a name="l00329"></a>00329 
<a name="l00330"></a>00330 
<a name="l00331"></a><a class="code" href="classKToolBar.html#a7b7e329709faaf871606767bfca7dbb7">00331</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a7b7e329709faaf871606767bfca7dbb7" title="Inserts a KLineEdit.">KToolBar::insertLined</a> (<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> <span class="keywordtype">id</span>,
<a name="l00332"></a>00332                             <span class="keyword">const</span> <span class="keywordtype">char</span> *signal,
<a name="l00333"></a>00333                             <span class="keyword">const</span> <a class="codeRef" href="qobject.html">QObject</a> *receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> *slot,
<a name="l00334"></a>00334                             <span class="keywordtype">bool</span> enabled ,
<a name="l00335"></a>00335                             <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; toolTipText,
<a name="l00336"></a>00336                             <span class="keywordtype">int</span> size, <span class="keywordtype">int</span> index )
<a name="l00337"></a>00337 {
<a name="l00338"></a>00338     <a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> *lined = <span class="keyword">new</span> <a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> ( <span class="keyword">this</span>, 0 );
<a name="l00339"></a>00339     <span class="keywordflow">if</span> ( !toolTipText.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l00340"></a>00340         <a class="codeRef" href="qtooltip.html#add">QToolTip::add</a>( lined, toolTipText );
<a name="l00341"></a>00341     <span class="keywordflow">if</span> ( size &gt; 0 )
<a name="l00342"></a>00342         lined-&gt;setMinimumWidth( size );
<a name="l00343"></a>00343     insertWidgetInternal( lined, index, <span class="keywordtype">id</span> );
<a name="l00344"></a>00344     connect( lined, signal, receiver, slot );
<a name="l00345"></a>00345     lined-&gt;<a class="code" href="classKLineEdit.html#a48675b4c9e2138b7fe345ffccb9f5b66" title="Re-implemented to enable text squeezing.">setText</a>(text);
<a name="l00346"></a>00346     lined-&gt;setEnabled( enabled );
<a name="l00347"></a>00347     <span class="keywordflow">return</span> index;
<a name="l00348"></a>00348 }
<a name="l00349"></a>00349 
<a name="l00350"></a><a class="code" href="classKToolBar.html#a93fc0604762a0f120cda78996474f38d">00350</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a93fc0604762a0f120cda78996474f38d" title="Inserts a KComboBox with list.">KToolBar::insertCombo</a> (<span class="keyword">const</span> <a class="codeRef" href="qstringlist.html">QStringList</a> &amp;list, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> writable,
<a name="l00351"></a>00351                             <span class="keyword">const</span> <span class="keywordtype">char</span> *signal, <span class="keyword">const</span> <a class="codeRef" href="qobject.html">QObject</a> *receiver,
<a name="l00352"></a>00352                             <span class="keyword">const</span> <span class="keywordtype">char</span> *slot, <span class="keywordtype">bool</span> enabled,
<a name="l00353"></a>00353                             <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; tooltiptext,
<a name="l00354"></a>00354                             <span class="keywordtype">int</span> size, <span class="keywordtype">int</span> index,
<a name="l00355"></a>00355                             QComboBox::Policy policy )
<a name="l00356"></a>00356 {
<a name="l00357"></a>00357     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> *combo = <span class="keyword">new</span> <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> ( writable, <span class="keyword">this</span> );
<a name="l00358"></a>00358 
<a name="l00359"></a>00359     insertWidgetInternal( combo, index, <span class="keywordtype">id</span> );
<a name="l00360"></a>00360     combo-&gt;<a class="codeRef" href="qcombobox.html#insertStringList">insertStringList</a> (list);
<a name="l00361"></a>00361     combo-&gt;<a class="codeRef" href="qcombobox.html#setInsertionPolicy">setInsertionPolicy</a>(policy);
<a name="l00362"></a>00362     combo-&gt;setEnabled( enabled );
<a name="l00363"></a>00363     <span class="keywordflow">if</span> ( size &gt; 0 )
<a name="l00364"></a>00364         combo-&gt;setMinimumWidth( size );
<a name="l00365"></a>00365     <span class="keywordflow">if</span> (!tooltiptext.<a class="codeRef" href="qstring.html#isNull">isNull</a>())
<a name="l00366"></a>00366         <a class="codeRef" href="qtooltip.html#add">QToolTip::add</a>( combo, tooltiptext );
<a name="l00367"></a>00367 
<a name="l00368"></a>00368     <span class="keywordflow">if</span> ( signal &amp;&amp; receiver &amp;&amp; slot )
<a name="l00369"></a>00369         connect ( combo, signal, receiver, slot );
<a name="l00370"></a>00370     <span class="keywordflow">return</span> index;
<a name="l00371"></a>00371 }
<a name="l00372"></a>00372 
<a name="l00373"></a>00373 
<a name="l00374"></a><a class="code" href="classKToolBar.html#a99a4df846b6d220846f6dd2e9957f0d8">00374</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a93fc0604762a0f120cda78996474f38d" title="Inserts a KComboBox with list.">KToolBar::insertCombo</a> (<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> writable,
<a name="l00375"></a>00375                             <span class="keyword">const</span> <span class="keywordtype">char</span> *signal, <a class="codeRef" href="qobject.html">QObject</a> *receiver,
<a name="l00376"></a>00376                             <span class="keyword">const</span> <span class="keywordtype">char</span> *slot, <span class="keywordtype">bool</span> enabled,
<a name="l00377"></a>00377                             <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; tooltiptext,
<a name="l00378"></a>00378                             <span class="keywordtype">int</span> size, <span class="keywordtype">int</span> index,
<a name="l00379"></a>00379                             QComboBox::Policy policy )
<a name="l00380"></a>00380 {
<a name="l00381"></a>00381     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> *combo = <span class="keyword">new</span> <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> ( writable, <span class="keyword">this</span> );
<a name="l00382"></a>00382     insertWidgetInternal( combo, index, <span class="keywordtype">id</span> );
<a name="l00383"></a>00383     combo-&gt;<a class="codeRef" href="qcombobox.html#insertItem">insertItem</a> (text);
<a name="l00384"></a>00384     combo-&gt;<a class="codeRef" href="qcombobox.html#setInsertionPolicy">setInsertionPolicy</a>(policy);
<a name="l00385"></a>00385     combo-&gt;setEnabled( enabled );
<a name="l00386"></a>00386     <span class="keywordflow">if</span> ( size &gt; 0 )
<a name="l00387"></a>00387         combo-&gt;setMinimumWidth( size );
<a name="l00388"></a>00388     <span class="keywordflow">if</span> (!tooltiptext.<a class="codeRef" href="qstring.html#isNull">isNull</a>())
<a name="l00389"></a>00389         <a class="codeRef" href="qtooltip.html#add">QToolTip::add</a>( combo, tooltiptext );
<a name="l00390"></a>00390     connect (combo, signal, receiver, slot);
<a name="l00391"></a>00391     <span class="keywordflow">return</span> index;
<a name="l00392"></a>00392 }
<a name="l00393"></a>00393 
<a name="l00394"></a><a class="code" href="classKToolBar.html#ad19797e5223acac465644d6bec08ac5a">00394</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#ad19797e5223acac465644d6bec08ac5a" title="Inserts a separator into the toolbar with the given id.">KToolBar::insertSeparator</a>(<span class="keywordtype">int</span> index, <span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00395"></a>00395 {
<a name="l00396"></a>00396     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <span class="keyword">new</span> KToolBarSeparator( orientation(), <span class="keyword">false</span>, <span class="keyword">this</span>, <span class="stringliteral">&quot;tool bar separator&quot;</span> );
<a name="l00397"></a>00397     insertWidgetInternal( w, index, <span class="keywordtype">id</span> );
<a name="l00398"></a>00398     <span class="keywordflow">return</span> index;
<a name="l00399"></a>00399 }
<a name="l00400"></a>00400 
<a name="l00401"></a><a class="code" href="classKToolBar.html#a215a940ea172d2ad6c2be085db76338b">00401</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a215a940ea172d2ad6c2be085db76338b" title="Inserts a line separator into the toolbar with the given id.">KToolBar::insertLineSeparator</a>(<span class="keywordtype">int</span> index, <span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00402"></a>00402 {
<a name="l00403"></a>00403     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <span class="keyword">new</span> KToolBarSeparator( orientation(), <span class="keyword">true</span>, <span class="keyword">this</span>, <span class="stringliteral">&quot;tool bar separator&quot;</span> );
<a name="l00404"></a>00404     insertWidgetInternal( w, index, <span class="keywordtype">id</span> );
<a name="l00405"></a>00405     <span class="keywordflow">return</span> index;
<a name="l00406"></a>00406 }
<a name="l00407"></a>00407 
<a name="l00408"></a>00408 
<a name="l00409"></a><a class="code" href="classKToolBar.html#ad66bcc5dff10558a3a1d7cf2acfbae79">00409</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#ad66bcc5dff10558a3a1d7cf2acfbae79" title="Inserts a user-defined widget.">KToolBar::insertWidget</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> <span class="comment">/*width*/</span>, <a class="codeRef" href="qwidget.html">QWidget</a> *widget, <span class="keywordtype">int</span> index)
<a name="l00410"></a>00410 {
<a name="l00411"></a>00411     removeWidgetInternal( widget ); <span class="comment">// in case we already have it ?</span>
<a name="l00412"></a>00412     insertWidgetInternal( widget, index, <span class="keywordtype">id</span> );
<a name="l00413"></a>00413     <span class="keywordflow">return</span> index;
<a name="l00414"></a>00414 }
<a name="l00415"></a>00415 
<a name="l00416"></a><a class="code" href="classKToolBar.html#a766b9b1e9b7403c0adca268493e5513d">00416</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a766b9b1e9b7403c0adca268493e5513d" title="Inserts an animated widget.">KToolBar::insertAnimatedWidget</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <a class="codeRef" href="qobject.html">QObject</a> *receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> *slot,
<a name="l00417"></a>00417                                     <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; icons, <span class="keywordtype">int</span> index )
<a name="l00418"></a>00418 {
<a name="l00419"></a>00419     <a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *anim = <span class="keyword">new</span> <a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a>( icons, d-&gt;m_iconSize, <span class="keyword">this</span> );
<a name="l00420"></a>00420     insertWidgetInternal( anim, index, <span class="keywordtype">id</span> );
<a name="l00421"></a>00421 
<a name="l00422"></a>00422     <span class="keywordflow">if</span> ( receiver )
<a name="l00423"></a>00423         connect( anim, SIGNAL(<a class="code" href="classKToolBar.html#a69b4c60b0f0d2f528a3925ec02f322ec" title="Emitted when button id is clicked.">clicked</a>()), receiver, slot);
<a name="l00424"></a>00424 
<a name="l00425"></a>00425     <span class="keywordflow">return</span> index;
<a name="l00426"></a>00426 }
<a name="l00427"></a>00427 
<a name="l00428"></a><a class="code" href="classKToolBar.html#aa0f75d84233df38b05673b2fcaa935c3">00428</a> <a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *<a class="code" href="classKToolBar.html#aa0f75d84233df38b05673b2fcaa935c3" title="This will return a pointer to the animated widget with the given id, if it exists.">KToolBar::animatedWidget</a>( <span class="keywordtype">int</span> <span class="keywordtype">id</span> )
<a name="l00429"></a>00429 {
<a name="l00430"></a>00430     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00431"></a>00431     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00432"></a>00432         <span class="keywordflow">return</span> 0;
<a name="l00433"></a>00433     <a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *aw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *<span class="keyword">&gt;</span>(*it);
<a name="l00434"></a>00434     <span class="keywordflow">if</span> ( aw )
<a name="l00435"></a>00435         <span class="keywordflow">return</span> aw;
<a name="l00436"></a>00436     <a class="codeRef" href="qobjectlist.html">QObjectList</a> *l = queryList( <span class="stringliteral">&quot;KAnimWidget&quot;</span> );
<a name="l00437"></a>00437     <span class="keywordflow">if</span> ( !l || !l-&gt;first() ) {
<a name="l00438"></a>00438         <span class="keyword">delete</span> l;
<a name="l00439"></a>00439         <span class="keywordflow">return</span> 0;
<a name="l00440"></a>00440     }
<a name="l00441"></a>00441 
<a name="l00442"></a>00442     <span class="keywordflow">for</span> ( <a class="codeRef" href="qobject.html">QObject</a> *o = l-&gt;first(); o; o = l-&gt;next() ) {
<a name="l00443"></a>00443         <a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *aw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKAnimWidget.html" title="Standard &quot;About KDE&quot; dialog box.">KAnimWidget</a> *<span class="keyword">&gt;</span>(o);
<a name="l00444"></a>00444         <span class="keywordflow">if</span> ( aw )
<a name="l00445"></a>00445         {
<a name="l00446"></a>00446             <span class="keyword">delete</span> l;
<a name="l00447"></a>00447             <span class="keywordflow">return</span> aw;
<a name="l00448"></a>00448         }
<a name="l00449"></a>00449     }
<a name="l00450"></a>00450 
<a name="l00451"></a>00451     <span class="keyword">delete</span> l;
<a name="l00452"></a>00452     <span class="keywordflow">return</span> 0;
<a name="l00453"></a>00453 }
<a name="l00454"></a>00454 
<a name="l00455"></a>00455 
<a name="l00456"></a><a class="code" href="classKToolBar.html#ac44c90fe1d7c3e5002679bcff441a11c">00456</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ac44c90fe1d7c3e5002679bcff441a11c" title="Adds connections to items.">KToolBar::addConnection</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *signal,
<a name="l00457"></a>00457                                <span class="keyword">const</span> <a class="codeRef" href="qobject.html">QObject</a> *receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> *slot)
<a name="l00458"></a>00458 {
<a name="l00459"></a>00459     <a class="codeRef" href="qwidget.html">QWidget</a>* w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>( <span class="keywordtype">id</span> );
<a name="l00460"></a>00460     <span class="keywordflow">if</span> ( w )
<a name="l00461"></a>00461         connect( w, signal, receiver, slot );
<a name="l00462"></a>00462 }
<a name="l00463"></a>00463 
<a name="l00464"></a><a class="code" href="classKToolBar.html#a0282fa8e12fa74abe3e210d681779fa5">00464</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a0282fa8e12fa74abe3e210d681779fa5" title="Enables/disables item.">KToolBar::setItemEnabled</a>( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> enabled )
<a name="l00465"></a>00465 {
<a name="l00466"></a>00466     <a class="codeRef" href="qwidget.html">QWidget</a>* w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>( <span class="keywordtype">id</span> );
<a name="l00467"></a>00467     <span class="keywordflow">if</span> ( w )
<a name="l00468"></a>00468         w-&gt;<a class="codeRef" href="qwidget.html#setEnabled">setEnabled</a>( enabled );
<a name="l00469"></a>00469 }
<a name="l00470"></a>00470 
<a name="l00471"></a>00471 
<a name="l00472"></a><a class="code" href="classKToolBar.html#ae209793afee1dbdb4749b25ed75b0e51">00472</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ae209793afee1dbdb4749b25ed75b0e51" title="Sets button pixmap.">KToolBar::setButtonPixmap</a>( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qpixmap.html">QPixmap</a>&amp; _pixmap )
<a name="l00473"></a>00473 {
<a name="l00474"></a>00474     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00475"></a>00475     <span class="keywordflow">if</span> ( button )
<a name="l00476"></a>00476         button-&gt;<a class="code" href="classKToolBarButton.html#a1f50667c226ef1eab58a72d31c7e9b45">setPixmap</a>( _pixmap );
<a name="l00477"></a>00477 }
<a name="l00478"></a>00478 
<a name="l00479"></a>00479 
<a name="l00480"></a><a class="code" href="classKToolBar.html#a7863f50f1bf8e9f88f1bb8071dcc9025">00480</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a7863f50f1bf8e9f88f1bb8071dcc9025" title="Sets the icon for a button.">KToolBar::setButtonIcon</a>( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; _icon )
<a name="l00481"></a>00481 {
<a name="l00482"></a>00482     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00483"></a>00483     <span class="keywordflow">if</span> ( button )
<a name="l00484"></a>00484         button-&gt;<a class="code" href="classKToolBarButton.html#abf2b554c8c530c81da7f78031f5d5360" title="Set the icon for this button.">setIcon</a>( _icon );
<a name="l00485"></a>00485 }
<a name="l00486"></a>00486 
<a name="l00487"></a><a class="code" href="classKToolBar.html#afa960bf2982d1dd85c3fb46fee054efc">00487</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#afa960bf2982d1dd85c3fb46fee054efc" title="Sets a button icon from a QIconSet.">KToolBar::setButtonIconSet</a>( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qiconset.html">QIconSet</a>&amp; iconset )
<a name="l00488"></a>00488 {
<a name="l00489"></a>00489     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00490"></a>00490     <span class="keywordflow">if</span> ( button )
<a name="l00491"></a>00491         button-&gt;<a class="code" href="classKToolBarButton.html#a1be8f4cf1a34bec99674ee7b2cbc9e42" title="Set the pixmaps for this toolbar button from a QIconSet.">setIconSet</a>( iconset );
<a name="l00492"></a>00492 }
<a name="l00493"></a>00493 
<a name="l00494"></a>00494 
<a name="l00495"></a><a class="code" href="classKToolBar.html#a2cbeba5b5b86747b00d9927b0ce6785a">00495</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a2cbeba5b5b86747b00d9927b0ce6785a" title="Sets a delayed popup for a button.">KToolBar::setDelayedPopup</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span> , <a class="codeRef" href="qpopupmenu.html">QPopupMenu</a> *_popup, <span class="keywordtype">bool</span> toggle )
<a name="l00496"></a>00496 {
<a name="l00497"></a>00497     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00498"></a>00498     <span class="keywordflow">if</span> ( button )
<a name="l00499"></a>00499         button-&gt;<a class="code" href="classKToolBarButton.html#aa16fac31f921658c03eb19508bed8ecb" title="Gives this button a delayed popup menu.">setDelayedPopup</a>( _popup, toggle );
<a name="l00500"></a>00500 }
<a name="l00501"></a>00501 
<a name="l00502"></a>00502 
<a name="l00503"></a><a class="code" href="classKToolBar.html#a2986829d080eebd4e1a5474a52b00bcd">00503</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a2986829d080eebd4e1a5474a52b00bcd" title="Turns a button into an autorepeat button.">KToolBar::setAutoRepeat</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> flag)
<a name="l00504"></a>00504 {
<a name="l00505"></a>00505     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00506"></a>00506     <span class="keywordflow">if</span> ( button )
<a name="l00507"></a>00507         button-&gt;setAutoRepeat( flag );
<a name="l00508"></a>00508 }
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 
<a name="l00511"></a><a class="code" href="classKToolBar.html#a2ee4fda059a1a0e1822842c093b2e59b">00511</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a2ee4fda059a1a0e1822842c093b2e59b" title="Turns button into a toggle button if flag is true.">KToolBar::setToggle</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> flag )
<a name="l00512"></a>00512 {
<a name="l00513"></a>00513     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00514"></a>00514     <span class="keywordflow">if</span> ( button )
<a name="l00515"></a>00515         button-&gt;<a class="code" href="classKToolBarButton.html#a4d775ab87569c71caf48537864c9046e" title="Turn this button into a toggle button or disable the toggle aspects of it.">setToggle</a>( flag );
<a name="l00516"></a>00516 }
<a name="l00517"></a>00517 
<a name="l00518"></a>00518 
<a name="l00519"></a><a class="code" href="classKToolBar.html#ad699ca5ba2a7bcf03a336df924128167">00519</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ad699ca5ba2a7bcf03a336df924128167" title="Toggles a togglebutton.">KToolBar::toggleButton</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00520"></a>00520 {
<a name="l00521"></a>00521     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00522"></a>00522     <span class="keywordflow">if</span> ( button )
<a name="l00523"></a>00523         button-&gt;<a class="code" href="classKToolBarButton.html#ae24d8b59606a8758863f0fe9ec690b54" title="Toggle this button.">toggle</a>();
<a name="l00524"></a>00524 }
<a name="l00525"></a>00525 
<a name="l00526"></a>00526 
<a name="l00527"></a><a class="code" href="classKToolBar.html#a62c2a7d02d936b28f32838431ca5b4ce">00527</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a62c2a7d02d936b28f32838431ca5b4ce" title="Sets a toggle button state.">KToolBar::setButton</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> flag)
<a name="l00528"></a>00528 {
<a name="l00529"></a>00529     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00530"></a>00530     <span class="keywordflow">if</span> ( button )
<a name="l00531"></a>00531         button-&gt;<a class="code" href="classKToolBarButton.html#a497d4d6de1b98a3250c5e35cc455059d" title="Turn this button on or off.">on</a>( flag );
<a name="l00532"></a>00532 }
<a name="l00533"></a>00533 
<a name="l00534"></a>00534 
<a name="l00535"></a><a class="code" href="classKToolBar.html#a8ba492518d37652384f11a30a81efe64">00535</a> <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#a8ba492518d37652384f11a30a81efe64" title="Returns true if button is on and is a toggle button.">KToolBar::isButtonOn</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)<span class="keyword"> const</span>
<a name="l00536"></a>00536 <span class="keyword"></span>{
<a name="l00537"></a>00537     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <span class="keyword">const_cast&lt;</span><a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a>*<span class="keyword">&gt;</span>( this )-&gt;<a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00538"></a>00538     <span class="keywordflow">return</span> button ? button-&gt;isOn() : <span class="keyword">false</span>;
<a name="l00539"></a>00539 }
<a name="l00540"></a>00540 
<a name="l00541"></a>00541 
<a name="l00542"></a><a class="code" href="classKToolBar.html#aea382e3162c0e056ce158110acda5194">00542</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#aea382e3162c0e056ce158110acda5194" title="Sets the text of a line editor.">KToolBar::setLinedText</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text)
<a name="l00543"></a>00543 {
<a name="l00544"></a>00544     <a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> * lineEdit = <a class="code" href="classKToolBar.html#a0ecdf3b0838c3cf762b48179a8aa2a38" title="Returns a pointer to KToolBarLined with id.">getLined</a>( <span class="keywordtype">id</span> );
<a name="l00545"></a>00545     <span class="keywordflow">if</span> ( lineEdit )
<a name="l00546"></a>00546         lineEdit-&gt;<a class="code" href="classKLineEdit.html#a48675b4c9e2138b7fe345ffccb9f5b66" title="Re-implemented to enable text squeezing.">setText</a>( text );
<a name="l00547"></a>00547 }
<a name="l00548"></a>00548 
<a name="l00549"></a>00549 
<a name="l00550"></a><a class="code" href="classKToolBar.html#a987d04f2156f1a4261a529b4f7c95e54">00550</a> <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a987d04f2156f1a4261a529b4f7c95e54" title="Returns the line editor text.">KToolBar::getLinedText</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)<span class="keyword"> const</span>
<a name="l00551"></a>00551 <span class="keyword"></span>{
<a name="l00552"></a>00552     <a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> * lineEdit = <span class="keyword">const_cast&lt;</span><a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a>*<span class="keyword">&gt;</span>( this )-&gt;<a class="code" href="classKToolBar.html#a0ecdf3b0838c3cf762b48179a8aa2a38" title="Returns a pointer to KToolBarLined with id.">getLined</a>( <span class="keywordtype">id</span> );
<a name="l00553"></a>00553     <span class="keywordflow">return</span> lineEdit ? lineEdit-&gt;<a class="codeRef" href="qlineedit.html#text">text</a>() : QString::null;
<a name="l00554"></a>00554 }
<a name="l00555"></a>00555 
<a name="l00556"></a>00556 
<a name="l00557"></a><a class="code" href="classKToolBar.html#a234fba30ee7ed80cfd8004d6c3ffe3e3">00557</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a234fba30ee7ed80cfd8004d6c3ffe3e3" title="Inserts text in combobox id at position index.">KToolBar::insertComboItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> index)
<a name="l00558"></a>00558 {
<a name="l00559"></a>00559     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00560"></a>00560     <span class="keywordflow">if</span> (comboBox)
<a name="l00561"></a>00561         comboBox-&gt;<a class="codeRef" href="qcombobox.html#insertItem">insertItem</a>( text, index );
<a name="l00562"></a>00562 }
<a name="l00563"></a>00563 
<a name="l00564"></a><a class="code" href="classKToolBar.html#a6d4b5c42083c74203c95af9ded34e735">00564</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a6d4b5c42083c74203c95af9ded34e735" title="Inserts list in combobox id at position index.">KToolBar::insertComboList</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qstringlist.html">QStringList</a> &amp;list, <span class="keywordtype">int</span> index)
<a name="l00565"></a>00565 {
<a name="l00566"></a>00566     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00567"></a>00567     <span class="keywordflow">if</span> (comboBox)
<a name="l00568"></a>00568         comboBox-&gt;<a class="codeRef" href="qcombobox.html#insertStringList">insertStringList</a>( list, index );
<a name="l00569"></a>00569 }
<a name="l00570"></a>00570 
<a name="l00571"></a>00571 
<a name="l00572"></a><a class="code" href="classKToolBar.html#a0872fda38201fb11e53847f6d63d60b7">00572</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a0872fda38201fb11e53847f6d63d60b7" title="Removes item index from combobox id.">KToolBar::removeComboItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> index)
<a name="l00573"></a>00573 {
<a name="l00574"></a>00574     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00575"></a>00575     <span class="keywordflow">if</span> (comboBox)
<a name="l00576"></a>00576         comboBox-&gt;<a class="codeRef" href="qcombobox.html#removeItem">removeItem</a>( index );
<a name="l00577"></a>00577 }
<a name="l00578"></a>00578 
<a name="l00579"></a>00579 
<a name="l00580"></a><a class="code" href="classKToolBar.html#a2ba70be9d7d4020bff7c9760f04fd08b">00580</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a2ba70be9d7d4020bff7c9760f04fd08b" title="Sets item index to be current item in combobox id.">KToolBar::setCurrentComboItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> index)
<a name="l00581"></a>00581 {
<a name="l00582"></a>00582     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00583"></a>00583     <span class="keywordflow">if</span> (comboBox)
<a name="l00584"></a>00584         comboBox-&gt;<a class="code" href="classKComboBox.html#a633c4dc51b0ea801e2efbb505e0e341d" title="Selects the first item that matches item.">setCurrentItem</a>( index );
<a name="l00585"></a>00585 }
<a name="l00586"></a>00586 
<a name="l00587"></a>00587 
<a name="l00588"></a><a class="code" href="classKToolBar.html#a836dccde8fb845c1898d9ca16adacc4b">00588</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a836dccde8fb845c1898d9ca16adacc4b" title="Changes item index in combobox id to text.">KToolBar::changeComboItem</a>  (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; text, <span class="keywordtype">int</span> index)
<a name="l00589"></a>00589 {
<a name="l00590"></a>00590     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00591"></a>00591     <span class="keywordflow">if</span> (comboBox)
<a name="l00592"></a>00592         comboBox-&gt;<a class="codeRef" href="qcombobox.html#changeItem">changeItem</a>( text, index );
<a name="l00593"></a>00593 }
<a name="l00594"></a>00594 
<a name="l00595"></a>00595 
<a name="l00596"></a><a class="code" href="classKToolBar.html#a9f648cb7623cfe97e6263f098cbfa699">00596</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9f648cb7623cfe97e6263f098cbfa699" title="Clears the combobox id.">KToolBar::clearCombo</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00597"></a>00597 {
<a name="l00598"></a>00598     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00599"></a>00599     <span class="keywordflow">if</span> (comboBox)
<a name="l00600"></a>00600         comboBox-&gt;<a class="codeRef" href="qcombobox.html#clear">clear</a>();
<a name="l00601"></a>00601 }
<a name="l00602"></a>00602 
<a name="l00603"></a>00603 
<a name="l00604"></a><a class="code" href="classKToolBar.html#a17a7799274dec1d45e17669bc5aba4cf">00604</a> <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a17a7799274dec1d45e17669bc5aba4cf" title="Returns text of item index from combobox id.">KToolBar::getComboItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> index)<span class="keyword"> const</span>
<a name="l00605"></a>00605 <span class="keyword"></span>{
<a name="l00606"></a>00606     <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * comboBox = <span class="keyword">const_cast&lt;</span><a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a>*<span class="keyword">&gt;</span>( this )-&gt;<a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">getCombo</a>( <span class="keywordtype">id</span> );
<a name="l00607"></a>00607     <span class="keywordflow">return</span> comboBox ? comboBox-&gt;<a class="codeRef" href="qcombobox.html#text">text</a>( index ) : QString::null;
<a name="l00608"></a>00608 }
<a name="l00609"></a>00609 
<a name="l00610"></a>00610 
<a name="l00611"></a><a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff">00611</a> <a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> * <a class="code" href="classKToolBar.html#a2a70c8200f8295e26721f605f82e79ff" title="Returns a pointer to the combobox with id.">KToolBar::getCombo</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00612"></a>00612 {
<a name="l00613"></a>00613     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00614"></a>00614     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00615"></a>00615         <span class="keywordflow">return</span> 0;
<a name="l00616"></a>00616     <span class="keywordflow">return</span> <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKComboBox.html" title="An enhanced combo box.">KComboBox</a> *<span class="keyword">&gt;</span>( *it );
<a name="l00617"></a>00617 }
<a name="l00618"></a>00618 
<a name="l00619"></a>00619 
<a name="l00620"></a><a class="code" href="classKToolBar.html#a0ecdf3b0838c3cf762b48179a8aa2a38">00620</a> <a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> * <a class="code" href="classKToolBar.html#a0ecdf3b0838c3cf762b48179a8aa2a38" title="Returns a pointer to KToolBarLined with id.">KToolBar::getLined</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00621"></a>00621 {
<a name="l00622"></a>00622     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00623"></a>00623     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00624"></a>00624         <span class="keywordflow">return</span> 0;
<a name="l00625"></a>00625     <span class="keywordflow">return</span> <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKLineEdit.html" title="An enhanced QLineEdit widget for inputting text.">KLineEdit</a> *<span class="keyword">&gt;</span>( *it );
<a name="l00626"></a>00626 }
<a name="l00627"></a>00627 
<a name="l00628"></a>00628 
<a name="l00629"></a><a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413">00629</a> <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">KToolBar::getButton</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00630"></a>00630 {
<a name="l00631"></a>00631     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00632"></a>00632     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00633"></a>00633         <span class="keywordflow">return</span> 0;
<a name="l00634"></a>00634     <span class="keywordflow">return</span> <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *<span class="keyword">&gt;</span>( *it );
<a name="l00635"></a>00635 }
<a name="l00636"></a>00636 
<a name="l00637"></a>00637 
<a name="l00638"></a><a class="code" href="classKToolBar.html#a9892c2613d0c006b899e75ad98aee8e7">00638</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9892c2613d0c006b899e75ad98aee8e7" title="Align item to the right.">KToolBar::alignItemRight</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> right )
<a name="l00639"></a>00639 {
<a name="l00640"></a>00640     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00641"></a>00641     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00642"></a>00642         <span class="keywordflow">return</span>;
<a name="l00643"></a>00643     <span class="keywordflow">if</span> ( rightAligned &amp;&amp; !right &amp;&amp; (*it) == rightAligned )
<a name="l00644"></a>00644         rightAligned = 0;
<a name="l00645"></a>00645     <span class="keywordflow">if</span> ( (*it) &amp;&amp; right )
<a name="l00646"></a>00646         rightAligned = (*it);
<a name="l00647"></a>00647 }
<a name="l00648"></a>00648 
<a name="l00649"></a>00649 
<a name="l00650"></a><a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942">00650</a> <a class="codeRef" href="qwidget.html">QWidget</a> *<a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">KToolBar::getWidget</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00651"></a>00651 {
<a name="l00652"></a>00652     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00653"></a>00653     <span class="keywordflow">return</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() ) ? 0 : (*it);
<a name="l00654"></a>00654 }
<a name="l00655"></a>00655 
<a name="l00656"></a>00656 
<a name="l00657"></a><a class="code" href="classKToolBar.html#a8f16628f17e5ba9112db8dad8c38182b">00657</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a8f16628f17e5ba9112db8dad8c38182b" title="Set item autosized.">KToolBar::setItemAutoSized</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> yes )
<a name="l00658"></a>00658 {
<a name="l00659"></a>00659     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>(<span class="keywordtype">id</span>);
<a name="l00660"></a>00660     <span class="keywordflow">if</span> ( w &amp;&amp; yes )
<a name="l00661"></a>00661         setStretchableWidget( w );
<a name="l00662"></a>00662 }
<a name="l00663"></a>00663 
<a name="l00664"></a>00664 
<a name="l00665"></a><a class="code" href="classKToolBar.html#a7602a5fd82cc3ae426e9b780ff548865">00665</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a7602a5fd82cc3ae426e9b780ff548865" title="Remove all items.">KToolBar::clear</a> ()
<a name="l00666"></a>00666 {
<a name="l00667"></a>00667     <span class="comment">/* Delete any idle buttons, so QToolBar doesn&#39;t delete them itself, making a mess */</span>
<a name="l00668"></a>00668     <span class="keywordflow">for</span>(<a class="codeRef" href="qwidget.html">QWidget</a> *w=d-&gt;idleButtons.first(); w; w=d-&gt;idleButtons.next())
<a name="l00669"></a>00669        w-&gt;blockSignals(<span class="keyword">false</span>);    
<a name="l00670"></a>00670     d-&gt;idleButtons.clear();
<a name="l00671"></a>00671      
<a name="l00672"></a>00672     <a class="code" href="classKToolBar.html#a7602a5fd82cc3ae426e9b780ff548865" title="Remove all items.">QToolBar::clear</a>();
<a name="l00673"></a>00673     widget2id.<a class="codeRef" href="qmap.html#clear">clear</a>();
<a name="l00674"></a>00674     id2widget.<a class="codeRef" href="qmap.html#clear">clear</a>();
<a name="l00675"></a>00675 }
<a name="l00676"></a>00676 
<a name="l00677"></a>00677 
<a name="l00678"></a><a class="code" href="classKToolBar.html#acae86c81488fc0c7b99150b68822a5ab">00678</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#acae86c81488fc0c7b99150b68822a5ab" title="Remove item id.">KToolBar::removeItem</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00679"></a>00679 {
<a name="l00680"></a>00680     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00681"></a>00681     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00682"></a>00682     {
<a name="l00683"></a>00683         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(220) &lt;&lt; name() &lt;&lt; <span class="stringliteral">&quot; KToolBar::removeItem item &quot;</span> &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; not found&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00684"></a>00684         <span class="keywordflow">return</span>;
<a name="l00685"></a>00685     }
<a name="l00686"></a>00686     <a class="codeRef" href="qwidget.html">QWidget</a> * w = (*it);
<a name="l00687"></a>00687     id2widget.<a class="codeRef" href="qmap.html#remove">remove</a>( <span class="keywordtype">id</span> );
<a name="l00688"></a>00688     widget2id.<a class="codeRef" href="qmap.html#remove">remove</a>( w );
<a name="l00689"></a>00689     widgets.<a class="codeRef" href="qptrlist.html#removeRef">removeRef</a>( w );
<a name="l00690"></a>00690     <span class="keyword">delete</span> w;
<a name="l00691"></a>00691 }
<a name="l00692"></a>00692 
<a name="l00693"></a>00693 
<a name="l00694"></a><a class="code" href="classKToolBar.html#ae4892bc680e3f6c01510d21f178bbc5d">00694</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ae4892bc680e3f6c01510d21f178bbc5d" title="Remove item id.">KToolBar::removeItemDelayed</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00695"></a>00695 {
<a name="l00696"></a>00696     <a class="codeRef" href="qmap.html#Iterator">Id2WidgetMap::Iterator</a> it = id2widget.<a class="codeRef" href="qmap.html#find">find</a>( <span class="keywordtype">id</span> );
<a name="l00697"></a>00697     <span class="keywordflow">if</span> ( it == id2widget.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l00698"></a>00698     {
<a name="l00699"></a>00699         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(220) &lt;&lt; name() &lt;&lt; <span class="stringliteral">&quot; KToolBar::removeItem item &quot;</span> &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; not found&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00700"></a>00700         <span class="keywordflow">return</span>;
<a name="l00701"></a>00701     }
<a name="l00702"></a>00702     <a class="codeRef" href="qwidget.html">QWidget</a> * w = (*it);
<a name="l00703"></a>00703     id2widget.<a class="codeRef" href="qmap.html#remove">remove</a>( <span class="keywordtype">id</span> );
<a name="l00704"></a>00704     widget2id.<a class="codeRef" href="qmap.html#remove">remove</a>( w );
<a name="l00705"></a>00705     widgets.<a class="codeRef" href="qptrlist.html#removeRef">removeRef</a>( w );
<a name="l00706"></a>00706 
<a name="l00707"></a>00707     w-&gt;blockSignals(<span class="keyword">true</span>);
<a name="l00708"></a>00708     d-&gt;idleButtons.append(w);
<a name="l00709"></a>00709     layoutTimer-&gt;<a class="codeRef" href="qtimer.html#start">start</a>( 50, <span class="keyword">true</span> );
<a name="l00710"></a>00710 }
<a name="l00711"></a>00711 
<a name="l00712"></a>00712 
<a name="l00713"></a><a class="code" href="classKToolBar.html#a6676e0cc8546cd15fb1b683843e84f3d">00713</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a6676e0cc8546cd15fb1b683843e84f3d" title="Hide item id.">KToolBar::hideItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00714"></a>00714 {
<a name="l00715"></a>00715     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>(<span class="keywordtype">id</span>);
<a name="l00716"></a>00716     <span class="keywordflow">if</span> ( w )
<a name="l00717"></a>00717         w-&gt;<a class="codeRef" href="qwidget.html#hide">hide</a>();
<a name="l00718"></a>00718 }
<a name="l00719"></a>00719 
<a name="l00720"></a>00720 
<a name="l00721"></a><a class="code" href="classKToolBar.html#a9415e330e1c54df0b0b48227e0a41f18">00721</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9415e330e1c54df0b0b48227e0a41f18" title="Show item id.">KToolBar::showItem</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00722"></a>00722 {
<a name="l00723"></a>00723     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>(<span class="keywordtype">id</span>);
<a name="l00724"></a>00724     <span class="keywordflow">if</span> ( w )
<a name="l00725"></a>00725         w-&gt;<a class="codeRef" href="qwidget.html#show">show</a>();
<a name="l00726"></a>00726 }
<a name="l00727"></a>00727 
<a name="l00728"></a>00728 
<a name="l00729"></a><a class="code" href="classKToolBar.html#a94a31837341bbb174f419ebd9a50f7f7">00729</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a94a31837341bbb174f419ebd9a50f7f7" title="Returns the index of the item id.">KToolBar::itemIndex</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00730"></a>00730 {
<a name="l00731"></a>00731     <a class="codeRef" href="qwidget.html">QWidget</a> *w = <a class="code" href="classKToolBar.html#aa31a29a17533a9ac3527a4b56e5b6942" title="Returns a pointer to the widget corresponding to id.">getWidget</a>(<span class="keywordtype">id</span>);
<a name="l00732"></a>00732     <span class="keywordflow">return</span> w ? widgets.<a class="codeRef" href="qptrlist.html#findRef">findRef</a>(w) : -1;
<a name="l00733"></a>00733 }
<a name="l00734"></a>00734 
<a name="l00735"></a><a class="code" href="classKToolBar.html#ac5d2ffec524b5e068559be7a9bfc5c84">00735</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#ac5d2ffec524b5e068559be7a9bfc5c84" title="Returns the id of the item at the given index.">KToolBar::idAt</a> (<span class="keywordtype">int</span> index)
<a name="l00736"></a>00736 {
<a name="l00737"></a>00737     <a class="codeRef" href="qwidget.html">QWidget</a> *w = widgets.<a class="codeRef" href="qptrlist.html#at">at</a>(index);
<a name="l00738"></a>00738     <span class="keywordflow">return</span> widget2id[w];
<a name="l00739"></a>00739 }
<a name="l00740"></a>00740 
<a name="l00741"></a><a class="code" href="classKToolBar.html#af8f4554e0a3f770f1b7f1d6d1382d944">00741</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#af8f4554e0a3f770f1b7f1d6d1382d944" title="Set toolbar to full parent size (default).">KToolBar::setFullSize</a>(<span class="keywordtype">bool</span> flag )
<a name="l00742"></a>00742 {
<a name="l00743"></a>00743     setHorizontalStretchable( flag );
<a name="l00744"></a>00744     setVerticalStretchable( flag );
<a name="l00745"></a>00745 }
<a name="l00746"></a>00746 
<a name="l00747"></a>00747 
<a name="l00748"></a>00748 <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#af5ade4ab889e1764512e6a09cd90b49a" title="Returns the full-size mode enabled flag.">KToolBar::fullSize</a>()<span class="keyword"> const</span>
<a name="l00749"></a>00749 <span class="keyword"></span>{
<a name="l00750"></a>00750     <span class="keywordflow">return</span> isHorizontalStretchable() || isVerticalStretchable();
<a name="l00751"></a>00751 }
<a name="l00752"></a>00752 
<a name="l00753"></a>00753 
<a name="l00754"></a><a class="code" href="classKToolBar.html#a130c75a8cde6dbeb683efed6888d2e52">00754</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a130c75a8cde6dbeb683efed6888d2e52" title="Enable or disable moving of toolbar.">KToolBar::enableMoving</a>(<span class="keywordtype">bool</span> flag )
<a name="l00755"></a>00755 {
<a name="l00756"></a>00756     setMovingEnabled(flag);
<a name="l00757"></a>00757 }
<a name="l00758"></a>00758 
<a name="l00759"></a>00759 
<a name="l00760"></a><a class="code" href="classKToolBar.html#adbe60f3fa4ef666643d25674ba4bf4ee">00760</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#adbe60f3fa4ef666643d25674ba4bf4ee" title="Set position of toolbar.">KToolBar::setBarPos</a> (<a class="code" href="classKToolBar.html#a6ffe1dc843dce9174cac6a083665b429" title="Possible bar positions.">BarPosition</a> bpos)
<a name="l00761"></a>00761 {
<a name="l00762"></a>00762     <span class="keywordflow">if</span> ( !<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l00763"></a>00763         <span class="keywordflow">return</span>;
<a name="l00764"></a>00764     <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;moveDockWindow( <span class="keyword">this</span>, (Dock)bpos );
<a name="l00765"></a>00765     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; setBarPos dockWindowIndex=&quot; &lt;&lt; dockWindowIndex() &lt;&lt; endl;</span>
<a name="l00766"></a>00766 }
<a name="l00767"></a>00767 
<a name="l00768"></a>00768 
<a name="l00769"></a>00769 <a class="code" href="classKToolBar.html#a6ffe1dc843dce9174cac6a083665b429" title="Possible bar positions.">KToolBar::BarPosition</a> <a class="code" href="classKToolBar.html#a6223973b27d1192b533d13f521161b92" title="Returns the toolbar position.">KToolBar::barPos</a>()<span class="keyword"> const</span>
<a name="l00770"></a>00770 <span class="keyword"></span>{
<a name="l00771"></a>00771     <span class="keywordflow">if</span> ( !this-&gt;<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l00772"></a>00772         <span class="keywordflow">return</span> place() == QDockWindow::InDock ? KToolBar::Top : KToolBar::Floating;
<a name="l00773"></a>00773     Dock dock;
<a name="l00774"></a>00774     <span class="keywordtype">int</span> dm1, dm2;
<a name="l00775"></a>00775     <span class="keywordtype">bool</span> dm3;
<a name="l00776"></a>00776     this-&gt;<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;getLocation( (<a class="codeRef" href="qtoolbar.html">QToolBar</a>*)<span class="keyword">this</span>, dock, dm1, dm3, dm2 );
<a name="l00777"></a>00777     <span class="keywordflow">if</span> ( dock == DockUnmanaged ) {
<a name="l00778"></a>00778         <span class="keywordflow">return</span> (<a class="code" href="classKToolBar.html#a6ffe1dc843dce9174cac6a083665b429" title="Possible bar positions.">KToolBar::BarPosition</a>)DockTop;
<a name="l00779"></a>00779     }
<a name="l00780"></a>00780     <span class="keywordflow">return</span> (<a class="code" href="classKToolBar.html#a6ffe1dc843dce9174cac6a083665b429" title="Possible bar positions.">BarPosition</a>)dock;
<a name="l00781"></a>00781 }
<a name="l00782"></a>00782 
<a name="l00783"></a>00783 
<a name="l00784"></a><a class="code" href="classKToolBar.html#a2e103e95391e29e59dda335ead6cee48">00784</a> <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#a2e103e95391e29e59dda335ead6cee48" title="Show, hide, or toggle toolbar.">KToolBar::enable</a>(<a class="code" href="classKToolBar.html#a56263520372b8f05ff975a5c7be9c2bb" title="The state of the status bar.">BarStatus</a> stat)
<a name="l00785"></a>00785 {
<a name="l00786"></a>00786     <span class="keywordtype">bool</span> mystat = isVisible();
<a name="l00787"></a>00787 
<a name="l00788"></a>00788     <span class="keywordflow">if</span> ( (stat == Toggle &amp;&amp; mystat) || stat == Hide )
<a name="l00789"></a>00789         hide();
<a name="l00790"></a>00790     <span class="keywordflow">else</span>
<a name="l00791"></a>00791         show();
<a name="l00792"></a>00792 
<a name="l00793"></a>00793     <span class="keywordflow">return</span> isVisible() == mystat;
<a name="l00794"></a>00794 }
<a name="l00795"></a>00795 
<a name="l00796"></a>00796 
<a name="l00797"></a><a class="code" href="classKToolBar.html#a9a54277ad886694d5bb14df0091dbb09">00797</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9a54277ad886694d5bb14df0091dbb09" title="Use setMaximumHeight() instead.">KToolBar::setMaxHeight</a> ( <span class="keywordtype">int</span> h )
<a name="l00798"></a>00798 {
<a name="l00799"></a>00799     setMaximumHeight( h );
<a name="l00800"></a>00800 }
<a name="l00801"></a>00801 
<a name="l00802"></a><a class="code" href="classKToolBar.html#aad8cde91453888f6773c1b790f3c4f34">00802</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#aad8cde91453888f6773c1b790f3c4f34" title="Returns the value set with setMaxHeight().">KToolBar::maxHeight</a>()
<a name="l00803"></a>00803 {
<a name="l00804"></a>00804     <span class="keywordflow">return</span> maximumHeight();
<a name="l00805"></a>00805 }
<a name="l00806"></a>00806 
<a name="l00807"></a>00807 
<a name="l00808"></a><a class="code" href="classKToolBar.html#a79b36a32d1fc05d05c82998f0599b372">00808</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a79b36a32d1fc05d05c82998f0599b372" title="Use setMaximumWidth() instead.">KToolBar::setMaxWidth</a> (<span class="keywordtype">int</span> dw)
<a name="l00809"></a>00809 {
<a name="l00810"></a>00810     setMaximumWidth( dw );
<a name="l00811"></a>00811 }
<a name="l00812"></a>00812 
<a name="l00813"></a>00813 
<a name="l00814"></a><a class="code" href="classKToolBar.html#a8adf4ac64ec3e8c863898d04d0b4c511">00814</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a8adf4ac64ec3e8c863898d04d0b4c511" title="Returns the value set with setMaxWidth().">KToolBar::maxWidth</a>()
<a name="l00815"></a>00815 {
<a name="l00816"></a>00816     <span class="keywordflow">return</span> maximumWidth();
<a name="l00817"></a>00817 }
<a name="l00818"></a>00818 
<a name="l00819"></a>00819 
<a name="l00820"></a><a class="code" href="classKToolBar.html#a1236de1e85820d0889d7dbe4fafc6bd1">00820</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a1236de1e85820d0889d7dbe4fafc6bd1" title="Set title for toolbar when it floats.">KToolBar::setTitle</a> (<span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; _title)
<a name="l00821"></a>00821 {
<a name="l00822"></a>00822     <a class="codeRef" href="qtoolbar.html#setLabel">setLabel</a>( _title );
<a name="l00823"></a>00823 }
<a name="l00824"></a>00824 
<a name="l00825"></a>00825 
<a name="l00826"></a><a class="code" href="classKToolBar.html#a9f3507945a6f2f84799d340703325fbf">00826</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9f3507945a6f2f84799d340703325fbf" title="Use setMovingEnabled(bool) instead.">KToolBar::enableFloating</a> (<span class="keywordtype">bool</span> )
<a name="l00827"></a>00827 {
<a name="l00828"></a>00828 }
<a name="l00829"></a>00829 
<a name="l00830"></a>00830 
<a name="l00831"></a><a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1">00831</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">KToolBar::setIconText</a>(IconText it)
<a name="l00832"></a>00832 {
<a name="l00833"></a>00833     <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( it, <span class="keyword">true</span> );
<a name="l00834"></a>00834 }
<a name="l00835"></a>00835 
<a name="l00836"></a>00836 
<a name="l00837"></a><a class="code" href="classKToolBar.html#a864105ec799de68ceacaf5b8e8c2d98e">00837</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">KToolBar::setIconText</a>(IconText icontext, <span class="keywordtype">bool</span> update)
<a name="l00838"></a>00838 {
<a name="l00839"></a>00839     <span class="keywordtype">bool</span> doUpdate=<span class="keyword">false</span>;
<a name="l00840"></a>00840 
<a name="l00841"></a>00841     <span class="keywordflow">if</span> (icontext != d-&gt;m_iconText) {
<a name="l00842"></a>00842         d-&gt;m_iconText = icontext;
<a name="l00843"></a>00843         doUpdate=<span class="keyword">true</span>;
<a name="l00844"></a>00844         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;  icontext has changed, doUpdate=true&quot; &lt;&lt; endl;</span>
<a name="l00845"></a>00845     }
<a name="l00846"></a>00846     <span class="keywordflow">else</span> {
<a name="l00847"></a>00847         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;  icontext hasn&#39;t changed, doUpdate=false&quot; &lt;&lt; endl;</span>
<a name="l00848"></a>00848     }
<a name="l00849"></a>00849 
<a name="l00850"></a>00850     <span class="keywordflow">if</span> (!update)
<a name="l00851"></a>00851         <span class="keywordflow">return</span>;
<a name="l00852"></a>00852 
<a name="l00853"></a>00853     <span class="keywordflow">if</span> (doUpdate)
<a name="l00854"></a>00854         doModeChange(); <span class="comment">// tell buttons what happened</span>
<a name="l00855"></a>00855 
<a name="l00856"></a>00856     <span class="comment">// ugly hack to force a QMainWindow::triggerLayout( true )</span>
<a name="l00857"></a>00857     <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *mw = <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>();
<a name="l00858"></a>00858     <span class="keywordflow">if</span> ( mw ) {
<a name="l00859"></a>00859         mw-&gt;setUpdatesEnabled( <span class="keyword">false</span> );
<a name="l00860"></a>00860         mw-&gt;<a class="codeRef" href="qmainwindow.html#setToolBarsMovable">setToolBarsMovable</a>( !mw-&gt;<a class="codeRef" href="qmainwindow.html#toolBarsMovable">toolBarsMovable</a>() );
<a name="l00861"></a>00861         mw-&gt;<a class="codeRef" href="qmainwindow.html#setToolBarsMovable">setToolBarsMovable</a>( !mw-&gt;<a class="codeRef" href="qmainwindow.html#toolBarsMovable">toolBarsMovable</a>() );
<a name="l00862"></a>00862         mw-&gt;setUpdatesEnabled( <span class="keyword">true</span> );
<a name="l00863"></a>00863     }
<a name="l00864"></a>00864 }
<a name="l00865"></a>00865 
<a name="l00866"></a>00866 
<a name="l00867"></a>00867 KToolBar::IconText <a class="code" href="classKToolBar.html#a490ab97a6311fe2969b698fb3fbd976b" title="Returns the current text style for buttons.">KToolBar::iconText</a>()<span class="keyword"> const</span>
<a name="l00868"></a>00868 <span class="keyword"></span>{
<a name="l00869"></a>00869     <span class="keywordflow">return</span> d-&gt;m_iconText;
<a name="l00870"></a>00870 }
<a name="l00871"></a>00871 
<a name="l00872"></a>00872 
<a name="l00873"></a><a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e">00873</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">KToolBar::setIconSize</a>(<span class="keywordtype">int</span> size)
<a name="l00874"></a>00874 {
<a name="l00875"></a>00875     <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">setIconSize</a>( size, <span class="keyword">true</span> );
<a name="l00876"></a>00876 }
<a name="l00877"></a>00877 
<a name="l00878"></a><a class="code" href="classKToolBar.html#a97c603e59ece00a21dfe7df89962da01">00878</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">KToolBar::setIconSize</a>(<span class="keywordtype">int</span> size, <span class="keywordtype">bool</span> update)
<a name="l00879"></a>00879 {
<a name="l00880"></a>00880     <span class="keywordtype">bool</span> doUpdate=<span class="keyword">false</span>;
<a name="l00881"></a>00881 
<a name="l00882"></a>00882     <span class="keywordflow">if</span> ( size != d-&gt;m_iconSize ) {
<a name="l00883"></a>00883             d-&gt;m_iconSize = size;
<a name="l00884"></a>00884             doUpdate=<span class="keyword">true</span>;
<a name="l00885"></a>00885     }
<a name="l00886"></a>00886 
<a name="l00887"></a>00887     <span class="keywordflow">if</span> (!update)
<a name="l00888"></a>00888         <span class="keywordflow">return</span>;
<a name="l00889"></a>00889 
<a name="l00890"></a>00890     <span class="keywordflow">if</span> (doUpdate)
<a name="l00891"></a>00891         doModeChange(); <span class="comment">// tell buttons what happened</span>
<a name="l00892"></a>00892 
<a name="l00893"></a>00893     <span class="comment">// ugly hack to force a QMainWindow::triggerLayout( true )</span>
<a name="l00894"></a>00894     <span class="keywordflow">if</span> ( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() ) {
<a name="l00895"></a>00895         <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *mw = <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>();
<a name="l00896"></a>00896         mw-&gt;setUpdatesEnabled( <span class="keyword">false</span> );
<a name="l00897"></a>00897         mw-&gt;<a class="codeRef" href="qmainwindow.html#setToolBarsMovable">setToolBarsMovable</a>( !mw-&gt;<a class="codeRef" href="qmainwindow.html#toolBarsMovable">toolBarsMovable</a>() );
<a name="l00898"></a>00898         mw-&gt;<a class="codeRef" href="qmainwindow.html#setToolBarsMovable">setToolBarsMovable</a>( !mw-&gt;<a class="codeRef" href="qmainwindow.html#toolBarsMovable">toolBarsMovable</a>() );
<a name="l00899"></a>00899         mw-&gt;setUpdatesEnabled( <span class="keyword">true</span> );
<a name="l00900"></a>00900     }
<a name="l00901"></a>00901 }
<a name="l00902"></a>00902 
<a name="l00903"></a>00903 
<a name="l00904"></a>00904 <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a8863644b550afdc19af4654bafdcb378" title="Returns the current icon size for buttons.">KToolBar::iconSize</a>()<span class="keyword"> const</span>
<a name="l00905"></a>00905 <span class="keyword"></span>{
<a name="l00906"></a>00906     <span class="keywordflow">if</span> ( !d-&gt;m_iconSize ) <span class="comment">// default value?</span>
<a name="l00907"></a>00907         <span class="keywordflow">return</span> <a class="code" href="classKToolBar.html#a56381a2905305e79f146701eda990d65" title="Returns the default size for this type of toolbar.">iconSizeDefault</a>();
<a name="l00908"></a>00908 
<a name="l00909"></a>00909     <span class="keywordflow">return</span> d-&gt;m_iconSize;
<a name="l00910"></a>00910 }
<a name="l00911"></a>00911 
<a name="l00912"></a><a class="code" href="classKToolBar.html#a56381a2905305e79f146701eda990d65">00912</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a56381a2905305e79f146701eda990d65" title="Returns the default size for this type of toolbar.">KToolBar::iconSizeDefault</a>()<span class="keyword"> const</span>
<a name="l00913"></a>00913 <span class="keyword"></span>{
<a name="l00914"></a>00914     <span class="keywordflow">if</span> (!::qstrcmp(<a class="codeRef" href="qobject.html#name">QObject::name</a>(), <span class="stringliteral">&quot;mainToolBar&quot;</span>))
<a name="l00915"></a>00915         <span class="keywordflow">return</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#afd3675a46a4985161c31b3cc0ee2a606">KGlobal::iconLoader</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconLoader.html#aac50718d068ed2efc3761ef621f88d7c">currentSize</a>(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82aa93d89e9cb5f184569d0e78f13982a06">KIcon::MainToolbar</a>);
<a name="l00916"></a>00916 
<a name="l00917"></a>00917     <span class="keywordflow">return</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#afd3675a46a4985161c31b3cc0ee2a606">KGlobal::iconLoader</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconLoader.html#aac50718d068ed2efc3761ef621f88d7c">currentSize</a>(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82a085b2f483cdfd6158de55aba647318e4">KIcon::Toolbar</a>);
<a name="l00918"></a>00918 }
<a name="l00919"></a>00919 
<a name="l00920"></a><a class="code" href="classKToolBar.html#aba1897a073bf0082db38f6024e8fe572">00920</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#aba1897a073bf0082db38f6024e8fe572" title="This allows you to enable or disable the context menu.">KToolBar::setEnableContextMenu</a>(<span class="keywordtype">bool</span> enable )
<a name="l00921"></a>00921 {
<a name="l00922"></a>00922     d-&gt;m_enableContext = <a class="code" href="classKToolBar.html#a2e103e95391e29e59dda335ead6cee48" title="Show, hide, or toggle toolbar.">enable</a>;
<a name="l00923"></a>00923 }
<a name="l00924"></a>00924 
<a name="l00925"></a>00925 
<a name="l00926"></a><a class="code" href="classKToolBar.html#a5f5e8ef644103f08f9ec81085feb183d">00926</a> <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#a5f5e8ef644103f08f9ec81085feb183d" title="Returns the context menu enabled flag.">KToolBar::contextMenuEnabled</a>()<span class="keyword"> const</span>
<a name="l00927"></a>00927 <span class="keyword"></span>{
<a name="l00928"></a>00928     <span class="keywordflow">return</span> d-&gt;m_enableContext;
<a name="l00929"></a>00929 }
<a name="l00930"></a>00930 
<a name="l00931"></a>00931 
<a name="l00932"></a><a class="code" href="classKToolBar.html#ab1ee4b7086fbd843e2fe5ba86ba33c07">00932</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ab1ee4b7086fbd843e2fe5ba86ba33c07" title="This will inform a toolbar button to ignore certain style changes.">KToolBar::setItemNoStyle</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> no_style )
<a name="l00933"></a>00933 {
<a name="l00934"></a>00934     <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> * button = <a class="code" href="classKToolBar.html#a90fd62b99961c80154b48feaa1a28413" title="Returns a pointer to KToolBarButton.">getButton</a>( <span class="keywordtype">id</span> );
<a name="l00935"></a>00935     <span class="keywordflow">if</span> (button)
<a name="l00936"></a>00936         button-&gt;<a class="code" href="classKToolBarButton.html#a04ed1182509a63307fc77e35eae27b0a" title="Toolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc.">setNoStyle</a>( no_style );
<a name="l00937"></a>00937 }
<a name="l00938"></a>00938 
<a name="l00939"></a>00939 
<a name="l00940"></a>00940 <span class="keywordtype">void</span> KToolBar::setFlat (<span class="keywordtype">bool</span> flag)
<a name="l00941"></a>00941 {
<a name="l00942"></a>00942     <span class="keywordflow">if</span> ( !<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l00943"></a>00943         <span class="keywordflow">return</span>;
<a name="l00944"></a>00944     <span class="keywordflow">if</span> ( flag )
<a name="l00945"></a>00945         <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;moveDockWindow( <span class="keyword">this</span>, DockMinimized );
<a name="l00946"></a>00946     <span class="keywordflow">else</span>
<a name="l00947"></a>00947         <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;moveDockWindow( <span class="keyword">this</span>, DockTop );
<a name="l00948"></a>00948     <span class="comment">// And remember to save the new look later</span>
<a name="l00949"></a>00949     <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l00950"></a>00950     <span class="keywordflow">if</span> ( kmw )
<a name="l00951"></a>00951         kmw-&gt;<a class="code" href="classKMainWindow.html#a5f60cfc96af7dc428ced559abb62c660" title="Apply a state change.">setSettingsDirty</a>();
<a name="l00952"></a>00952 }
<a name="l00953"></a>00953 
<a name="l00954"></a>00954 
<a name="l00955"></a><a class="code" href="classKToolBar.html#ac7aa35097301273dbbd184e7d6ac6967">00955</a> <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#ac7aa35097301273dbbd184e7d6ac6967" title="Returns the total number of items in the toolbar.">KToolBar::count</a>()<span class="keyword"> const</span>
<a name="l00956"></a>00956 <span class="keyword"></span>{
<a name="l00957"></a>00957     <span class="keywordflow">return</span> id2widget.<a class="codeRef" href="qmap.html#count">count</a>();
<a name="l00958"></a>00958 }
<a name="l00959"></a>00959 
<a name="l00960"></a>00960 
<a name="l00961"></a><a class="code" href="classKToolBar.html#a6fc9ad28ecce08ecf6af0950ee15f402">00961</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a6fc9ad28ecce08ecf6af0950ee15f402" title="Instruct the toolbar to save it&#39;s current state to either the app config file or to the XML-GUI resou...">KToolBar::saveState</a>()
<a name="l00962"></a>00962 {
<a name="l00963"></a>00963     <span class="comment">// first, try to save to the xml file</span>
<a name="l00964"></a>00964     <span class="keywordflow">if</span> ( d-&gt;m_xmlguiClient &amp;&amp; !d-&gt;m_xmlguiClient-&gt;xmlFile().isEmpty() ) {
<a name="l00965"></a>00965         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; saveState: saving to &quot; &lt;&lt; d-&gt;m_xmlguiClient-&gt;xmlFile() &lt;&lt; endl;</span>
<a name="l00966"></a>00966         <a class="codeRef" href="qstring.html">QString</a> barname(!::qstrcmp(name(), <span class="stringliteral">&quot;unnamed&quot;</span>) ? <span class="stringliteral">&quot;mainToolBar&quot;</span> : name());
<a name="l00967"></a>00967         <span class="comment">// try to find our toolbar</span>
<a name="l00968"></a>00968         d-&gt;modified = <span class="keyword">false</span>;
<a name="l00969"></a>00969         <span class="comment">// go down one level to get to the right tags</span>
<a name="l00970"></a>00970         <a class="codeRef" href="qdomelement.html">QDomElement</a> current;
<a name="l00971"></a>00971         <span class="keywordflow">for</span>( <a class="codeRef" href="qdomnode.html">QDomNode</a> n = d-&gt;m_xmlguiClient-&gt;domDocument().documentElement().firstChild();
<a name="l00972"></a>00972              !n.isNull(); n = n.nextSibling()) {
<a name="l00973"></a>00973             current = n.toElement();
<a name="l00974"></a>00974 
<a name="l00975"></a>00975             <span class="keywordflow">if</span> ( current.<a class="codeRef" href="qdomelement.html#tagName">tagName</a>().lower() != <span class="stringliteral">&quot;toolbar&quot;</span> )
<a name="l00976"></a>00976                 <span class="keywordflow">continue</span>;
<a name="l00977"></a>00977 
<a name="l00978"></a>00978             <a class="codeRef" href="qstring.html">QString</a> curname(current.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;name&quot;</span> ));
<a name="l00979"></a>00979 
<a name="l00980"></a>00980             <span class="keywordflow">if</span> ( curname == barname ) {
<a name="l00981"></a>00981                 <a class="code" href="classKToolBar.html#a6fc9ad28ecce08ecf6af0950ee15f402" title="Instruct the toolbar to save it&#39;s current state to either the app config file or to the XML-GUI resou...">saveState</a>( current );
<a name="l00982"></a>00982                 <span class="keywordflow">break</span>;
<a name="l00983"></a>00983             }
<a name="l00984"></a>00984         }
<a name="l00985"></a>00985         <span class="comment">// if we didn&#39;t make changes, then just return</span>
<a name="l00986"></a>00986         <span class="keywordflow">if</span> ( !d-&gt;modified )
<a name="l00987"></a>00987             <span class="keywordflow">return</span>;
<a name="l00988"></a>00988 
<a name="l00989"></a>00989         <span class="comment">// now we load in the (non-merged) local file</span>
<a name="l00990"></a>00990         <a class="codeRef" href="qstring.html">QString</a> local_xml(KXMLGUIFactory::readConfigFile(d-&gt;m_xmlguiClient-&gt;xmlFile(), <span class="keyword">true</span>, d-&gt;m_xmlguiClient-&gt;instance()));
<a name="l00991"></a>00991         <a class="codeRef" href="qdomdocument.html">QDomDocument</a> local;
<a name="l00992"></a>00992         local.<a class="codeRef" href="qdomdocument.html#setContent">setContent</a>(local_xml);
<a name="l00993"></a>00993 
<a name="l00994"></a>00994         <span class="comment">// make sure we don&#39;t append if this toolbar already exists locally</span>
<a name="l00995"></a>00995         <span class="keywordtype">bool</span> just_append = <span class="keyword">true</span>;
<a name="l00996"></a>00996 
<a name="l00997"></a>00997         <span class="keywordflow">for</span>( <a class="codeRef" href="qdomnode.html">QDomNode</a> n = local.<a class="codeRef" href="qdomdocument.html#documentElement">documentElement</a>().firstChild();
<a name="l00998"></a>00998              !n.isNull(); n = n.nextSibling()) {
<a name="l00999"></a>00999             <a class="codeRef" href="qdomelement.html">QDomElement</a> elem = n.toElement();
<a name="l01000"></a>01000 
<a name="l01001"></a>01001             <span class="keywordflow">if</span> ( elem.<a class="codeRef" href="qdomelement.html#tagName">tagName</a>().lower() != <span class="stringliteral">&quot;toolbar&quot;</span> )
<a name="l01002"></a>01002                 <span class="keywordflow">continue</span>;
<a name="l01003"></a>01003 
<a name="l01004"></a>01004             <a class="codeRef" href="qstring.html">QString</a> curname(elem.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;name&quot;</span> ));
<a name="l01005"></a>01005 
<a name="l01006"></a>01006             <span class="keywordflow">if</span> ( curname == barname ) {
<a name="l01007"></a>01007                 just_append = <span class="keyword">false</span>;
<a name="l01008"></a>01008                 local.<a class="codeRef" href="qdomdocument.html#documentElement">documentElement</a>().replaceChild( current, elem );
<a name="l01009"></a>01009                 <span class="keywordflow">break</span>;
<a name="l01010"></a>01010             }
<a name="l01011"></a>01011         }
<a name="l01012"></a>01012 
<a name="l01013"></a>01013         <span class="keywordflow">if</span> (just_append)
<a name="l01014"></a>01014             local.<a class="codeRef" href="qdomdocument.html#documentElement">documentElement</a>().appendChild( current );
<a name="l01015"></a>01015 
<a name="l01016"></a>01016         KXMLGUIFactory::saveConfigFile(local, d-&gt;m_xmlguiClient-&gt;localXMLFile(), d-&gt;m_xmlguiClient-&gt;instance() );
<a name="l01017"></a>01017 
<a name="l01018"></a>01018         <span class="keywordflow">return</span>;
<a name="l01019"></a>01019     }
<a name="l01020"></a>01020 
<a name="l01021"></a>01021     <span class="comment">// if that didn&#39;t work, we save to the config file</span>
<a name="l01022"></a>01022     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *config = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>();
<a name="l01023"></a>01023     <a class="code" href="classKToolBar.html#ae3cebd28554be5c6504622b682b76564" title="Save the toolbar settings to group configGroup in config.">saveSettings</a>(config, QString::null);
<a name="l01024"></a>01024     config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a062a2f1d6156f8c1677ea24e5c658cc1">sync</a>();
<a name="l01025"></a>01025 }
<a name="l01026"></a>01026 
<a name="l01027"></a>01027 <a class="codeRef" href="qstring.html">QString</a> KToolBar::settingsGroup()<span class="keyword"> const</span>
<a name="l01028"></a>01028 <span class="keyword"></span>{
<a name="l01029"></a>01029     <a class="codeRef" href="qstring.html">QString</a> configGroup;
<a name="l01030"></a>01030     <span class="keywordflow">if</span> (!::qstrcmp(name(), <span class="stringliteral">&quot;unnamed&quot;</span>) || !::qstrcmp(name(), <span class="stringliteral">&quot;mainToolBar&quot;</span>))
<a name="l01031"></a>01031         configGroup = <span class="stringliteral">&quot;Toolbar style&quot;</span>;
<a name="l01032"></a>01032     <span class="keywordflow">else</span>
<a name="l01033"></a>01033         configGroup = <a class="codeRef" href="qstring.html">QString</a>(name()) + <span class="stringliteral">&quot; Toolbar style&quot;</span>;
<a name="l01034"></a>01034     <span class="keywordflow">if</span> ( this-&gt;<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l01035"></a>01035     {
<a name="l01036"></a>01036         configGroup.<a class="codeRef" href="qstring.html#prepend">prepend</a>(<span class="stringliteral">&quot; &quot;</span>);
<a name="l01037"></a>01037         configGroup.<a class="codeRef" href="qstring.html#prepend">prepend</a>( this-&gt;<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;name() );
<a name="l01038"></a>01038     }
<a name="l01039"></a>01039     <span class="keywordflow">return</span> configGroup;
<a name="l01040"></a>01040 }
<a name="l01041"></a>01041 
<a name="l01042"></a><a class="code" href="classKToolBar.html#ae3cebd28554be5c6504622b682b76564">01042</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ae3cebd28554be5c6504622b682b76564" title="Save the toolbar settings to group configGroup in config.">KToolBar::saveSettings</a>(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *config, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;_configGroup)
<a name="l01043"></a>01043 {
<a name="l01044"></a>01044     <a class="codeRef" href="qstring.html">QString</a> configGroup = _configGroup;
<a name="l01045"></a>01045     <span class="keywordflow">if</span> (configGroup.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>())
<a name="l01046"></a>01046         configGroup = settingsGroup();
<a name="l01047"></a>01047     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; saveSettings() group=&quot; &lt;&lt; _configGroup &lt;&lt; &quot; -&gt; &quot; &lt;&lt; configGroup &lt;&lt; endl;</span>
<a name="l01048"></a>01048 
<a name="l01049"></a>01049     <a class="codeRef" href="qstring.html">QString</a> position, icontext;
<a name="l01050"></a>01050     <span class="keywordtype">int</span> index;
<a name="l01051"></a>01051     getAttributes( position, icontext, index );
<a name="l01052"></a>01052 
<a name="l01053"></a>01053     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;                position=&quot; &lt;&lt; position &lt;&lt; &quot; index=&quot; &lt;&lt; index &lt;&lt; &quot; offset=&quot; &lt;&lt; offset() &lt;&lt; &quot; newLine=&quot; &lt;&lt; newLine() &lt;&lt; endl;</span>
<a name="l01054"></a>01054 
<a name="l01055"></a>01055     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> saver(config, configGroup);
<a name="l01056"></a>01056 
<a name="l01057"></a>01057     <span class="keywordflow">if</span>(!config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;Position&quot;</span>) &amp;&amp; position == d-&gt;PositionDefault )
<a name="l01058"></a>01058       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;Position&quot;</span>);
<a name="l01059"></a>01059     <span class="keywordflow">else</span>
<a name="l01060"></a>01060       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;Position&quot;</span>, position);
<a name="l01061"></a>01061 
<a name="l01062"></a>01062     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;                icontext=&quot; &lt;&lt; icontext &lt;&lt; &quot; hasDefault:&quot; &lt;&lt; config-&gt;hasDefault( &quot;IconText&quot; ) &lt;&lt; &quot; d-&gt;IconTextDefault=&quot; &lt;&lt; d-&gt;IconTextDefault &lt;&lt; endl;</span>
<a name="l01063"></a>01063 
<a name="l01064"></a>01064     <span class="keywordflow">if</span>(d-&gt;m_honorStyle &amp;&amp; icontext == d-&gt;IconTextDefault &amp;&amp; !config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;IconText&quot;</span>) )
<a name="l01065"></a>01065     {
<a name="l01066"></a>01066       <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;                reverting icontext to default&quot; &lt;&lt; endl;</span>
<a name="l01067"></a>01067       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;IconText&quot;</span>);
<a name="l01068"></a>01068     }
<a name="l01069"></a>01069     <span class="keywordflow">else</span>
<a name="l01070"></a>01070     {
<a name="l01071"></a>01071       <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;                writing icontext &quot; &lt;&lt; icontext &lt;&lt; endl;</span>
<a name="l01072"></a>01072       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;IconText&quot;</span>, icontext);
<a name="l01073"></a>01073     }
<a name="l01074"></a>01074 
<a name="l01075"></a>01075     <span class="keywordflow">if</span>(!config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;IconSize&quot;</span>) &amp;&amp; <a class="code" href="classKToolBar.html#a8863644b550afdc19af4654bafdcb378" title="Returns the current icon size for buttons.">iconSize</a>() == <a class="code" href="classKToolBar.html#a56381a2905305e79f146701eda990d65" title="Returns the default size for this type of toolbar.">iconSizeDefault</a>() )
<a name="l01076"></a>01076       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;IconSize&quot;</span>);
<a name="l01077"></a>01077     <span class="keywordflow">else</span>
<a name="l01078"></a>01078       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;IconSize&quot;</span>, <a class="code" href="classKToolBar.html#a8863644b550afdc19af4654bafdcb378" title="Returns the current icon size for buttons.">iconSize</a>());
<a name="l01079"></a>01079 
<a name="l01080"></a>01080     <span class="keywordflow">if</span>(!config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;Hidden&quot;</span>) &amp;&amp; isHidden() == d-&gt;HiddenDefault )
<a name="l01081"></a>01081       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;Hidden&quot;</span>);
<a name="l01082"></a>01082     <span class="keywordflow">else</span>
<a name="l01083"></a>01083       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;Hidden&quot;</span>, isHidden());
<a name="l01084"></a>01084 
<a name="l01085"></a>01085     <span class="comment">// Note that index, unlike the other settings, depends on the other toolbars</span>
<a name="l01086"></a>01086     <span class="comment">// So on the first run with a clean local config file, even the usual</span>
<a name="l01087"></a>01087     <span class="comment">// hasDefault/==IndexDefault test would save the toolbar indexes</span>
<a name="l01088"></a>01088     <span class="comment">// (IndexDefault was 0, whereas index is the real index in the GUI)</span>
<a name="l01089"></a>01089     <span class="comment">//</span>
<a name="l01090"></a>01090     <span class="comment">// Saving the whole set of indexes is necessary though. When moving only</span>
<a name="l01091"></a>01091     <span class="comment">// one toolbar, if we only saved the changed indexes, the toolbars wouldn&#39;t</span>
<a name="l01092"></a>01092     <span class="comment">// reappear at the same position the next time.</span>
<a name="l01093"></a>01093     <span class="comment">// The whole set of indexes has to be saved.</span>
<a name="l01094"></a>01094     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot;                writing index &quot; &lt;&lt; index &lt;&lt; endl;</span>
<a name="l01095"></a>01095     <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l01096"></a>01096     <span class="comment">// don&#39;t save if there&#39;s only one toolbar</span>
<a name="l01097"></a>01097 
<a name="l01098"></a>01098     <span class="comment">// Don&#39;t use kmw-&gt;toolBarIterator() because you might</span>
<a name="l01099"></a>01099     <span class="comment">// mess up someone else&#39;s iterator.  Make the list on your own</span>
<a name="l01100"></a>01100     <a class="codeRef" href="qptrlist.html">QPtrList&lt;KToolBar&gt;</a> toolbarList;
<a name="l01101"></a>01101     <a class="codeRef" href="qptrlist.html">QPtrList&lt;QToolBar&gt;</a> lst;
<a name="l01102"></a>01102     <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = (<span class="keywordtype">int</span>)QMainWindow::DockUnmanaged; i &lt;= (int)DockMinimized; ++i ) {
<a name="l01103"></a>01103         lst = kmw-&gt;<a class="codeRef" href="qmainwindow.html#toolBars">toolBars</a>( (ToolBarDock)i );
<a name="l01104"></a>01104         <span class="keywordflow">for</span> ( <a class="codeRef" href="qtoolbar.html">QToolBar</a> *tb = lst.<a class="codeRef" href="qptrlist.html#first">first</a>(); tb; tb = lst.<a class="codeRef" href="qptrlist.html#next">next</a>() ) {
<a name="l01105"></a>01105             <span class="keywordflow">if</span> ( !tb-&gt;inherits( <span class="stringliteral">&quot;KToolBar&quot;</span> ) )
<a name="l01106"></a>01106                 <span class="keywordflow">continue</span>;
<a name="l01107"></a>01107             toolbarList.<a class="codeRef" href="qptrlist.html#append">append</a>( (<a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a>*)tb );
<a name="l01108"></a>01108         }
<a name="l01109"></a>01109     }
<a name="l01110"></a>01110     <a class="codeRef" href="qptrlistiterator.html">QPtrListIterator&lt;KToolBar&gt;</a> toolbarIterator( toolbarList );
<a name="l01111"></a>01111     <span class="keywordflow">if</span> ( !kmw || toolbarIterator.<a class="codeRef" href="qptrlistiterator.html#count">count</a>() &gt; 1 )
<a name="l01112"></a>01112         config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;Index&quot;</span>, index);
<a name="l01113"></a>01113     <span class="keywordflow">else</span>
<a name="l01114"></a>01114         config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;Index&quot;</span>);
<a name="l01115"></a>01115 
<a name="l01116"></a>01116     <span class="keywordflow">if</span>(!config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;Offset&quot;</span>) &amp;&amp; offset() == d-&gt;OffsetDefault )
<a name="l01117"></a>01117       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;Offset&quot;</span>);
<a name="l01118"></a>01118     <span class="keywordflow">else</span>
<a name="l01119"></a>01119       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;Offset&quot;</span>, offset());
<a name="l01120"></a>01120 
<a name="l01121"></a>01121     <span class="keywordflow">if</span>(!config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a8b4772ff38e67586be3548109f95c000">hasDefault</a>(<span class="stringliteral">&quot;NewLine&quot;</span>) &amp;&amp; newLine() == d-&gt;NewLineDefault )
<a name="l01122"></a>01122       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ae8690c8bd3a636efc768a0ae3e436374">revertToDefault</a>(<span class="stringliteral">&quot;NewLine&quot;</span>);
<a name="l01123"></a>01123     <span class="keywordflow">else</span>
<a name="l01124"></a>01124       config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#abdc1b550f51b069f2c67036572ae4d27">writeEntry</a>(<span class="stringliteral">&quot;NewLine&quot;</span>, newLine());
<a name="l01125"></a>01125 }
<a name="l01126"></a>01126 
<a name="l01127"></a>01127 
<a name="l01128"></a>01128 <span class="keywordtype">void</span> KToolBar::setXMLGUIClient( <a class="code" href="classKXMLGUIClient.html" title="A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...">KXMLGUIClient</a> *client )
<a name="l01129"></a>01129 {
<a name="l01130"></a>01130     d-&gt;m_xmlguiClient = client;
<a name="l01131"></a>01131 }
<a name="l01132"></a>01132 
<a name="l01133"></a><a class="code" href="classKToolBar.html#a3ed35ae2836a155ead5eb6780bb3510f">01133</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a3ed35ae2836a155ead5eb6780bb3510f" title="Assign a (translated) text to this toolbar.">KToolBar::setText</a>( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; txt )
<a name="l01134"></a>01134 {
<a name="l01135"></a>01135     <a class="codeRef" href="qtoolbar.html#setLabel">setLabel</a>( txt + <span class="stringliteral">&quot; (&quot;</span> + kapp-&gt;caption() + <span class="stringliteral">&quot;) &quot;</span> );
<a name="l01136"></a>01136 }
<a name="l01137"></a>01137 
<a name="l01138"></a>01138 
<a name="l01139"></a>01139 <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a450c58379184615d6694ca8ed7fc0ac0" title="Returns the toolbar&#39;s text.">KToolBar::text</a>()<span class="keyword"> const</span>
<a name="l01140"></a>01140 <span class="keyword"></span>{
<a name="l01141"></a>01141     <span class="keywordflow">return</span> <a class="codeRef" href="qtoolbar.html#label">label</a>();
<a name="l01142"></a>01142 }
<a name="l01143"></a>01143 
<a name="l01144"></a>01144 
<a name="l01145"></a>01145 <span class="keywordtype">void</span> KToolBar::doConnections( <a class="code" href="classKToolBarButton.html" title="A toolbar button.">KToolBarButton</a> *button )
<a name="l01146"></a>01146 {
<a name="l01147"></a>01147     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#a69b4c60b0f0d2f528a3925ec02f322ec" title="Emitted when button id is clicked.">clicked</a>(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#a69b4c60b0f0d2f528a3925ec02f322ec" title="Emitted when button id is clicked.">clicked</a>( <span class="keywordtype">int</span> ) ) );
<a name="l01148"></a>01148     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#a202e4e2f8ad753ba0c90fb7237b3a440" title="Emitted when button id is double-clicked.">doubleClicked</a>(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#a202e4e2f8ad753ba0c90fb7237b3a440" title="Emitted when button id is double-clicked.">doubleClicked</a>( <span class="keywordtype">int</span> ) ) );
<a name="l01149"></a>01149     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#a5de5d791ff5b6b90ea3062a37af45be8" title="Emits when button id is released.">released</a>(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#a5de5d791ff5b6b90ea3062a37af45be8" title="Emits when button id is released.">released</a>( <span class="keywordtype">int</span> ) ) );
<a name="l01150"></a>01150     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#a9dc54dd28bb0269643755124837e7ec6" title="Emitted when button id is pressed.">pressed</a>(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#a9dc54dd28bb0269643755124837e7ec6" title="Emitted when button id is pressed.">pressed</a>( <span class="keywordtype">int</span> ) ) );
<a name="l01151"></a>01151     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#addfb6896c4fd6a79220ed64340087237" title="Emitted when a toggle button changes state.">toggled</a>(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#addfb6896c4fd6a79220ed64340087237" title="Emitted when a toggle button changes state.">toggled</a>( <span class="keywordtype">int</span> ) ) );
<a name="l01152"></a>01152     connect(button, SIGNAL(<a class="code" href="classKToolBar.html#ae067dea989a4f1a1c32c03fed05ee4c5" title="This signal is emitted when item id gets highlighted/unhighlighted (i.e when mouse enters/exits)...">highlighted</a>(<span class="keywordtype">int</span>, <span class="keywordtype">bool</span>)), <span class="keyword">this</span>, SIGNAL( <a class="code" href="classKToolBar.html#ae067dea989a4f1a1c32c03fed05ee4c5" title="This signal is emitted when item id gets highlighted/unhighlighted (i.e when mouse enters/exits)...">highlighted</a>( <span class="keywordtype">int</span>, <span class="keywordtype">bool</span> ) ) );
<a name="l01153"></a>01153 }
<a name="l01154"></a>01154 
<a name="l01155"></a>01155 <span class="keywordtype">void</span> KToolBar::mousePressEvent ( <a class="codeRef" href="qmouseevent.html">QMouseEvent</a> *m )
<a name="l01156"></a>01156 {
<a name="l01157"></a>01157     <span class="keywordflow">if</span> ( !<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l01158"></a>01158         <span class="keywordflow">return</span>;
<a name="l01159"></a>01159     <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *mw = <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>();
<a name="l01160"></a>01160     <span class="keywordflow">if</span> ( mw-&gt;<a class="codeRef" href="qmainwindow.html#toolBarsMovable">toolBarsMovable</a>() &amp;&amp; d-&gt;m_enableContext ) {
<a name="l01161"></a>01161         <span class="keywordflow">if</span> ( m-&gt;<a class="codeRef" href="qmouseevent.html#button">button</a>() == RightButton ) {
<a name="l01162"></a>01162         <a class="codeRef" href="qguardedptr.html">QGuardedPtr&lt;KToolBar&gt;</a> guard( <span class="keyword">this</span> );
<a name="l01163"></a>01163             <span class="keywordtype">int</span> i = contextMenu()-&gt;<a class="codeRef" href="qpopupmenu.html#exec">exec</a>( m-&gt;<a class="codeRef" href="qmouseevent.html#globalPos">globalPos</a>(), 0 );
<a name="l01164"></a>01164         <span class="comment">// &quot;Configure Toolbars&quot; recreates toolbars, so we might not exist anymore.</span>
<a name="l01165"></a>01165         <span class="keywordflow">if</span> ( guard )
<a name="l01166"></a>01166                 slotContextAboutToHide();
<a name="l01167"></a>01167             <span class="keywordflow">switch</span> ( i ) {
<a name="l01168"></a>01168             <span class="keywordflow">case</span> -1:
<a name="l01169"></a>01169                 <span class="keywordflow">return</span>; <span class="comment">// popup canceled</span>
<a name="l01170"></a>01170             <span class="keywordflow">case</span> CONTEXT_LEFT:
<a name="l01171"></a>01171                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockLeft );
<a name="l01172"></a>01172                 <span class="keywordflow">break</span>;
<a name="l01173"></a>01173             <span class="keywordflow">case</span> CONTEXT_RIGHT:
<a name="l01174"></a>01174                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockRight );
<a name="l01175"></a>01175                 <span class="keywordflow">break</span>;
<a name="l01176"></a>01176             <span class="keywordflow">case</span> CONTEXT_TOP:
<a name="l01177"></a>01177                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockTop );
<a name="l01178"></a>01178                 <span class="keywordflow">break</span>;
<a name="l01179"></a>01179             <span class="keywordflow">case</span> CONTEXT_BOTTOM:
<a name="l01180"></a>01180                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockBottom );
<a name="l01181"></a>01181                 <span class="keywordflow">break</span>;
<a name="l01182"></a>01182             <span class="keywordflow">case</span> CONTEXT_FLOAT:
<a name="l01183"></a>01183                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockTornOff );
<a name="l01184"></a>01184                 <span class="keywordflow">break</span>;
<a name="l01185"></a>01185             <span class="keywordflow">case</span> CONTEXT_FLAT:
<a name="l01186"></a>01186                 mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, DockMinimized );
<a name="l01187"></a>01187                 <span class="keywordflow">break</span>;
<a name="l01188"></a>01188             <span class="keywordflow">case</span> CONTEXT_ICONS:
<a name="l01189"></a>01189                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( IconOnly );
<a name="l01190"></a>01190                 <span class="keywordflow">break</span>;
<a name="l01191"></a>01191             <span class="keywordflow">case</span> CONTEXT_TEXTRIGHT:
<a name="l01192"></a>01192                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( IconTextRight );
<a name="l01193"></a>01193                 <span class="keywordflow">break</span>;
<a name="l01194"></a>01194             <span class="keywordflow">case</span> CONTEXT_TEXT:
<a name="l01195"></a>01195                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( TextOnly );
<a name="l01196"></a>01196                 <span class="keywordflow">break</span>;
<a name="l01197"></a>01197             <span class="keywordflow">case</span> CONTEXT_TEXTUNDER:
<a name="l01198"></a>01198                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( IconTextBottom );
<a name="l01199"></a>01199                 <span class="keywordflow">break</span>;
<a name="l01200"></a>01200             <span class="keywordflow">default</span>:
<a name="l01201"></a>01201                 <span class="keywordflow">if</span> ( i &gt;= CONTEXT_ICONSIZES )
<a name="l01202"></a>01202                     <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">setIconSize</a>( i - CONTEXT_ICONSIZES );
<a name="l01203"></a>01203                 <span class="keywordflow">else</span>
<a name="l01204"></a>01204                     <span class="keywordflow">return</span>; <span class="comment">// assume this was an action handled elsewhere, no need for setSettingsDirty()</span>
<a name="l01205"></a>01205             }
<a name="l01206"></a>01206             <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(mw);
<a name="l01207"></a>01207             <span class="keywordflow">if</span> ( kmw )
<a name="l01208"></a>01208                 kmw-&gt;<a class="code" href="classKMainWindow.html#a5f60cfc96af7dc428ced559abb62c660" title="Apply a state change.">setSettingsDirty</a>();
<a name="l01209"></a>01209         }
<a name="l01210"></a>01210     }
<a name="l01211"></a>01211 }
<a name="l01212"></a>01212 
<a name="l01213"></a>01213 <span class="keywordtype">void</span> KToolBar::doModeChange()
<a name="l01214"></a>01214 {
<a name="l01215"></a>01215     <span class="keywordflow">for</span>(<a class="codeRef" href="qwidget.html">QWidget</a> *w=d-&gt;idleButtons.first(); w; w=d-&gt;idleButtons.next())
<a name="l01216"></a>01216        w-&gt;blockSignals(<span class="keyword">false</span>);
<a name="l01217"></a>01217     d-&gt;idleButtons.clear();
<a name="l01218"></a>01218 
<a name="l01219"></a>01219     emit <a class="code" href="classKToolBar.html#ad8b5e4f47f791675fb131014af7c8a90" title="This signal is emitted when toolbar detects changing of following parameters: highlighting, button-size, button-mode.">modechange</a>();
<a name="l01220"></a>01220 }
<a name="l01221"></a>01221 
<a name="l01222"></a>01222 <span class="keywordtype">void</span> KToolBar::rebuildLayout()
<a name="l01223"></a>01223 {
<a name="l01224"></a>01224     <span class="keywordflow">for</span>(<a class="codeRef" href="qwidget.html">QWidget</a> *w=d-&gt;idleButtons.first(); w; w=d-&gt;idleButtons.next())
<a name="l01225"></a>01225        w-&gt;blockSignals(<span class="keyword">false</span>);
<a name="l01226"></a>01226     d-&gt;idleButtons.clear();
<a name="l01227"></a>01227 
<a name="l01228"></a>01228     layoutTimer-&gt;<a class="codeRef" href="qtimer.html#stop">stop</a>();
<a name="l01229"></a>01229     <a class="codeRef" href="qapplication.html#sendPostedEvents-2">QApplication::sendPostedEvents</a>( <span class="keyword">this</span>, QEvent::ChildInserted );
<a name="l01230"></a>01230     <a class="codeRef" href="qboxlayout.html">QBoxLayout</a> *l = boxLayout();
<a name="l01231"></a>01231 
<a name="l01232"></a>01232     <span class="comment">// clear the old layout</span>
<a name="l01233"></a>01233     <a class="codeRef" href="qlayoutiterator.html">QLayoutIterator</a> it = l-&gt;iterator();
<a name="l01234"></a>01234     <span class="keywordflow">while</span> ( it.<a class="codeRef" href="qlayoutiterator.html#current">current</a>() )
<a name="l01235"></a>01235         it.<a class="codeRef" href="qlayoutiterator.html#deleteCurrent">deleteCurrent</a>();
<a name="l01236"></a>01236 
<a name="l01237"></a>01237     <span class="keywordflow">for</span> ( <a class="codeRef" href="qwidget.html">QWidget</a> *w = widgets.<a class="codeRef" href="qptrlist.html#first">first</a>(); w; w = widgets.<a class="codeRef" href="qptrlist.html#next">next</a>() ) {
<a name="l01238"></a>01238         <span class="keywordflow">if</span> ( w == rightAligned )
<a name="l01239"></a>01239             <span class="keywordflow">continue</span>;
<a name="l01240"></a>01240         KToolBarSeparator *ktbs = <span class="keyword">dynamic_cast&lt;</span>KToolBarSeparator *<span class="keyword">&gt;</span>(w);
<a name="l01241"></a>01241         <span class="keywordflow">if</span> ( ktbs &amp;&amp; !ktbs-&gt;showLine() ) {
<a name="l01242"></a>01242             l-&gt;<a class="codeRef" href="qboxlayout.html#addSpacing">addSpacing</a>( orientation() == Vertical ? w-&gt;sizeHint().height() : w-&gt;sizeHint().width() );
<a name="l01243"></a>01243             w-&gt;hide();
<a name="l01244"></a>01244             <span class="keywordflow">continue</span>;
<a name="l01245"></a>01245         }
<a name="l01246"></a>01246         <span class="keywordflow">if</span> ( dynamic_cast&lt;QPopupMenu *&gt;(w) ) <span class="comment">// w is a QPopupMenu?</span>
<a name="l01247"></a>01247             <span class="keywordflow">continue</span>;
<a name="l01248"></a>01248         l-&gt;<a class="codeRef" href="qboxlayout.html#addWidget">addWidget</a>( w );
<a name="l01249"></a>01249         w-&gt;show();
<a name="l01250"></a>01250         <span class="keywordflow">if</span> ((orientation() == Horizontal) &amp;&amp; dynamic_cast&lt;QLineEdit *&gt;(w)) <span class="comment">// w is QLineEdit ?</span>
<a name="l01251"></a>01251             l-&gt;<a class="codeRef" href="qboxlayout.html#addSpacing">addSpacing</a>(2); <span class="comment">// A little bit extra spacing behind it.</span>
<a name="l01252"></a>01252     }
<a name="l01253"></a>01253     <span class="keywordflow">if</span> ( rightAligned ) {
<a name="l01254"></a>01254         l-&gt;<a class="codeRef" href="qboxlayout.html#addStretch">addStretch</a>();
<a name="l01255"></a>01255         l-&gt;<a class="codeRef" href="qboxlayout.html#addWidget">addWidget</a>( rightAligned );
<a name="l01256"></a>01256         rightAligned-&gt;show();
<a name="l01257"></a>01257     }
<a name="l01258"></a>01258 
<a name="l01259"></a>01259     <span class="keywordflow">if</span> ( <a class="code" href="classKToolBar.html#af5ade4ab889e1764512e6a09cd90b49a" title="Returns the full-size mode enabled flag.">fullSize</a>() ) {
<a name="l01260"></a>01260         <span class="keywordflow">if</span> ( !rightAligned )
<a name="l01261"></a>01261             l-&gt;<a class="codeRef" href="qboxlayout.html#addStretch">addStretch</a>();
<a name="l01262"></a>01262         <span class="keywordflow">if</span> ( stretchableWidget )
<a name="l01263"></a>01263             l-&gt;<a class="codeRef" href="qboxlayout.html#setStretchFactor">setStretchFactor</a>( stretchableWidget, 10 );
<a name="l01264"></a>01264     }
<a name="l01265"></a>01265     l-&gt;<a class="codeRef" href="qboxlayout.html#invalidate">invalidate</a>();
<a name="l01266"></a>01266     <a class="codeRef" href="qapplication.html#postEvent">QApplication::postEvent</a>( <span class="keyword">this</span>, <span class="keyword">new</span> <a class="codeRef" href="qevent.html">QEvent</a>( QEvent::LayoutHint ) );
<a name="l01267"></a>01267 }
<a name="l01268"></a>01268 
<a name="l01269"></a>01269 <span class="keywordtype">void</span> KToolBar::childEvent( <a class="codeRef" href="qchildevent.html">QChildEvent</a> *e )
<a name="l01270"></a>01270 {
<a name="l01271"></a>01271     <span class="keywordflow">if</span> ( e-&gt;<a class="codeRef" href="qchildevent.html#child">child</a>()-&gt;isWidgetType() ) {
<a name="l01272"></a>01272         <a class="codeRef" href="qwidget.html">QWidget</a> * w = <span class="keyword">dynamic_cast&lt;</span><a class="codeRef" href="qwidget.html">QWidget</a> *<span class="keyword">&gt;</span>(e-&gt;<a class="codeRef" href="qchildevent.html#child">child</a>());
<a name="l01273"></a>01273         <span class="keywordflow">if</span> (!w || !(::qstrcmp( <span class="stringliteral">&quot;qt_dockwidget_internal&quot;</span>, w-&gt;name())))
<a name="l01274"></a>01274         {
<a name="l01275"></a>01275            QToolBar::childEvent( e );
<a name="l01276"></a>01276            <span class="keywordflow">return</span>;
<a name="l01277"></a>01277         }
<a name="l01278"></a>01278         <span class="keywordflow">if</span> ( e-&gt;type() == QEvent::ChildInserted ) {
<a name="l01279"></a>01279             <span class="keywordflow">if</span> ( !dynamic_cast&lt;QPopupMenu *&gt;(w)) { <span class="comment">// e-&gt;child() is not a QPopupMenu</span>
<a name="l01280"></a>01280                 <span class="comment">// prevent items that have been explicitly inserted by insert*() from</span>
<a name="l01281"></a>01281                 <span class="comment">// being inserted again</span>
<a name="l01282"></a>01282                 <span class="keywordflow">if</span> ( !widget2id.<a class="codeRef" href="qmap.html#contains">contains</a>( w ) )
<a name="l01283"></a>01283                 {
<a name="l01284"></a>01284                     <span class="keywordtype">int</span> dummy = -1;
<a name="l01285"></a>01285                     insertWidgetInternal( w, dummy, -1 );
<a name="l01286"></a>01286                 }
<a name="l01287"></a>01287             }
<a name="l01288"></a>01288         } <span class="keywordflow">else</span> {
<a name="l01289"></a>01289             removeWidgetInternal( w );
<a name="l01290"></a>01290         }
<a name="l01291"></a>01291         <span class="keywordflow">if</span> ( isVisibleTo( 0 ) )
<a name="l01292"></a>01292         {
<a name="l01293"></a>01293             layoutTimer-&gt;<a class="codeRef" href="qtimer.html#start">start</a>( 50, <span class="keyword">true</span> );
<a name="l01294"></a>01294             <a class="codeRef" href="qboxlayout.html">QBoxLayout</a> *l = boxLayout();
<a name="l01295"></a>01295 
<a name="l01296"></a>01296             <span class="comment">// clear the old layout so that we don&#39;t get unnecassery layout</span>
<a name="l01297"></a>01297             <span class="comment">// changes till we have rebuild the thing</span>
<a name="l01298"></a>01298             <a class="codeRef" href="qlayoutiterator.html">QLayoutIterator</a> it = l-&gt;iterator();
<a name="l01299"></a>01299             <span class="keywordflow">while</span> ( it.<a class="codeRef" href="qlayoutiterator.html#current">current</a>() )
<a name="l01300"></a>01300                it.<a class="codeRef" href="qlayoutiterator.html#deleteCurrent">deleteCurrent</a>();
<a name="l01301"></a>01301         }
<a name="l01302"></a>01302     }
<a name="l01303"></a>01303     QToolBar::childEvent( e );
<a name="l01304"></a>01304 }
<a name="l01305"></a>01305 
<a name="l01306"></a>01306 <span class="keywordtype">void</span> KToolBar::insertWidgetInternal( <a class="codeRef" href="qwidget.html">QWidget</a> *w, <span class="keywordtype">int</span> &amp;index, <span class="keywordtype">int</span> <span class="keywordtype">id</span> )
<a name="l01307"></a>01307 {
<a name="l01308"></a>01308     <span class="comment">// we can&#39;t have it in widgets, or something is really wrong</span>
<a name="l01309"></a>01309     <span class="comment">//widgets.removeRef( w );</span>
<a name="l01310"></a>01310 
<a name="l01311"></a>01311     connect( w, SIGNAL( destroyed() ),
<a name="l01312"></a>01312              <span class="keyword">this</span>, SLOT( widgetDestroyed() ) );
<a name="l01313"></a>01313     <span class="keywordflow">if</span> ( index == -1 || index &gt; (<span class="keywordtype">int</span>)widgets.<a class="codeRef" href="qptrlist.html#count">count</a>() ) {
<a name="l01314"></a>01314         index = (int)widgets.<a class="codeRef" href="qptrlist.html#count">count</a>();
<a name="l01315"></a>01315         widgets.<a class="codeRef" href="qptrlist.html#append">append</a>( w );
<a name="l01316"></a>01316     }
<a name="l01317"></a>01317     <span class="keywordflow">else</span>
<a name="l01318"></a>01318         widgets.<a class="codeRef" href="qptrlist.html#insert">insert</a>( index, w );
<a name="l01319"></a>01319     <span class="keywordflow">if</span> ( <span class="keywordtype">id</span> == -1 )
<a name="l01320"></a>01320         <span class="keywordtype">id</span> = id2widget.<a class="codeRef" href="qmap.html#count">count</a>();
<a name="l01321"></a>01321     id2widget.<a class="codeRef" href="qmap.html#insert">insert</a>( <span class="keywordtype">id</span>, w );
<a name="l01322"></a>01322     widget2id.<a class="codeRef" href="qmap.html#insert">insert</a>( w, <span class="keywordtype">id</span> );
<a name="l01323"></a>01323 }
<a name="l01324"></a>01324 
<a name="l01325"></a>01325 <span class="keywordtype">void</span> KToolBar::showEvent( <a class="codeRef" href="qshowevent.html">QShowEvent</a> *e )
<a name="l01326"></a>01326 {
<a name="l01327"></a>01327     QToolBar::showEvent( e );
<a name="l01328"></a>01328     rebuildLayout();
<a name="l01329"></a>01329 }
<a name="l01330"></a>01330 
<a name="l01331"></a>01331 <span class="keywordtype">void</span> KToolBar::setStretchableWidget( <a class="codeRef" href="qwidget.html">QWidget</a> *w )
<a name="l01332"></a>01332 {
<a name="l01333"></a>01333     <a class="codeRef" href="qtoolbar.html#setStretchableWidget">QToolBar::setStretchableWidget</a>( w );
<a name="l01334"></a>01334     stretchableWidget = w;
<a name="l01335"></a>01335 }
<a name="l01336"></a>01336 
<a name="l01337"></a>01337 <a class="codeRef" href="qsizepolicy.html">QSizePolicy</a> KToolBar::sizePolicy()<span class="keyword"> const</span>
<a name="l01338"></a>01338 <span class="keyword"></span>{
<a name="l01339"></a>01339     <span class="keywordflow">if</span> ( orientation() == Horizontal )
<a name="l01340"></a>01340         <span class="keywordflow">return</span> <a class="codeRef" href="qsizepolicy.html">QSizePolicy</a>( QSizePolicy::Expanding, QSizePolicy::Fixed );
<a name="l01341"></a>01341     <span class="keywordflow">else</span>
<a name="l01342"></a>01342         <span class="keywordflow">return</span> <a class="codeRef" href="qsizepolicy.html">QSizePolicy</a>( QSizePolicy::Fixed, QSizePolicy::Expanding );
<a name="l01343"></a>01343 }
<a name="l01344"></a>01344 
<a name="l01345"></a>01345 <a class="codeRef" href="qsize.html">QSize</a> KToolBar::sizeHint()<span class="keyword"> const</span>
<a name="l01346"></a>01346 <span class="keyword"></span>{
<a name="l01347"></a>01347     <a class="codeRef" href="qsize.html">QSize</a> minSize(0,0);
<a name="l01348"></a>01348     <a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a> *ncThis = <span class="keyword">const_cast&lt;</span><a class="code" href="classKToolBar.html" title="Floatable toolbar with auto resize.">KToolBar</a> *<span class="keyword">&gt;</span>(<span class="keyword">this</span>);
<a name="l01349"></a>01349 
<a name="l01350"></a>01350     ncThis-&gt;polish();
<a name="l01351"></a>01351 
<a name="l01352"></a>01352     <span class="keywordtype">int</span> margin = <span class="keyword">static_cast&lt;</span><a class="codeRef" href="qwidget.html">QWidget</a>*<span class="keyword">&gt;</span>(ncThis)-&gt;layout()-&gt;margin() + frameWidth();
<a name="l01353"></a>01353     <span class="keywordflow">switch</span>( <a class="code" href="classKToolBar.html#a6223973b27d1192b533d13f521161b92" title="Returns the toolbar position.">barPos</a>() )
<a name="l01354"></a>01354     {
<a name="l01355"></a>01355      <span class="keywordflow">case</span> KToolBar::Top:
<a name="l01356"></a>01356      <span class="keywordflow">case</span> KToolBar::Bottom:
<a name="l01357"></a>01357        <span class="keywordflow">for</span> ( <a class="codeRef" href="qwidget.html">QWidget</a> *w = ncThis-&gt;widgets.<a class="codeRef" href="qptrlist.html#first">first</a>(); w; w = ncThis-&gt;widgets.<a class="codeRef" href="qptrlist.html#next">next</a>() )
<a name="l01358"></a>01358        {
<a name="l01359"></a>01359           <a class="codeRef" href="qsize.html">QSize</a> sh = w-&gt;<a class="codeRef" href="qwidget.html#sizeHint">sizeHint</a>();
<a name="l01360"></a>01360           <span class="keywordflow">if</span> ( w-&gt;<a class="codeRef" href="qwidget.html#sizePolicy">sizePolicy</a>().horData() == QSizePolicy::Ignored )
<a name="l01361"></a>01361              sh.<a class="codeRef" href="qsize.html#setWidth">setWidth</a>( 1 );
<a name="l01362"></a>01362           <span class="keywordflow">if</span> ( w-&gt;<a class="codeRef" href="qwidget.html#sizePolicy">sizePolicy</a>().verData() == QSizePolicy::Ignored )
<a name="l01363"></a>01363              sh.<a class="codeRef" href="qsize.html#setHeight">setHeight</a>( 1 );
<a name="l01364"></a>01364           sh = sh.<a class="codeRef" href="qsize.html#boundedTo">boundedTo</a>( w-&gt;<a class="codeRef" href="qwidget.html#maximumSize">maximumSize</a>() )
<a name="l01365"></a>01365                  .expandedTo( w-&gt;<a class="codeRef" href="qwidget.html#minimumSize">minimumSize</a>() ).expandedTo( <a class="codeRef" href="qsize.html">QSize</a>(1, 1) );
<a name="l01366"></a>01366 
<a name="l01367"></a>01367           minSize = minSize.expandedTo(<a class="codeRef" href="qsize.html">QSize</a>(0, sh.<a class="codeRef" href="qsize.html#height">height</a>()));
<a name="l01368"></a>01368           minSize += <a class="codeRef" href="qsize.html">QSize</a>(sh.<a class="codeRef" href="qsize.html#width">width</a>()+1, 0);
<a name="l01369"></a>01369           <span class="keywordflow">if</span> (dynamic_cast&lt;QLineEdit *&gt;(w)) <span class="comment">// w is a QLineEdit ?</span>
<a name="l01370"></a>01370              minSize += <a class="codeRef" href="qsize.html">QSize</a>(2, 0); <span class="comment">// A little bit extra spacing behind it.</span>
<a name="l01371"></a>01371        }
<a name="l01372"></a>01372 
<a name="l01373"></a>01373        minSize += <a class="codeRef" href="qsize.html">QSize</a>(<a class="codeRef" href="qapplication.html#style">QApplication::style</a>().pixelMetric( QStyle::PM_DockWindowHandleExtent ), 0);
<a name="l01374"></a>01374        minSize += <a class="codeRef" href="qsize.html">QSize</a>(margin*2, margin*2);
<a name="l01375"></a>01375        <span class="keywordflow">break</span>;
<a name="l01376"></a>01376 
<a name="l01377"></a>01377      <span class="keywordflow">case</span> KToolBar::Left:
<a name="l01378"></a>01378      <span class="keywordflow">case</span> KToolBar::Right:
<a name="l01379"></a>01379        <span class="keywordflow">for</span> ( <a class="codeRef" href="qwidget.html">QWidget</a> *w = ncThis-&gt;widgets.<a class="codeRef" href="qptrlist.html#first">first</a>(); w; w = ncThis-&gt;widgets.<a class="codeRef" href="qptrlist.html#next">next</a>() )
<a name="l01380"></a>01380        {
<a name="l01381"></a>01381           <a class="codeRef" href="qsize.html">QSize</a> sh = w-&gt;<a class="codeRef" href="qwidget.html#sizeHint">sizeHint</a>();
<a name="l01382"></a>01382           <span class="keywordflow">if</span> ( w-&gt;<a class="codeRef" href="qwidget.html#sizePolicy">sizePolicy</a>().horData() == QSizePolicy::Ignored )
<a name="l01383"></a>01383              sh.<a class="codeRef" href="qsize.html#setWidth">setWidth</a>( 1 );
<a name="l01384"></a>01384           <span class="keywordflow">if</span> ( w-&gt;<a class="codeRef" href="qwidget.html#sizePolicy">sizePolicy</a>().verData() == QSizePolicy::Ignored )
<a name="l01385"></a>01385              sh.<a class="codeRef" href="qsize.html#setHeight">setHeight</a>( 1 );
<a name="l01386"></a>01386           sh = sh.<a class="codeRef" href="qsize.html#boundedTo">boundedTo</a>( w-&gt;<a class="codeRef" href="qwidget.html#maximumSize">maximumSize</a>() )
<a name="l01387"></a>01387                  .expandedTo( w-&gt;<a class="codeRef" href="qwidget.html#minimumSize">minimumSize</a>() ).expandedTo( <a class="codeRef" href="qsize.html">QSize</a>(1, 1) );
<a name="l01388"></a>01388 
<a name="l01389"></a>01389           minSize = minSize.expandedTo(<a class="codeRef" href="qsize.html">QSize</a>(sh.<a class="codeRef" href="qsize.html#width">width</a>(), 0));
<a name="l01390"></a>01390           minSize += <a class="codeRef" href="qsize.html">QSize</a>(0, sh.<a class="codeRef" href="qsize.html#height">height</a>()+1);
<a name="l01391"></a>01391        }
<a name="l01392"></a>01392        minSize += <a class="codeRef" href="qsize.html">QSize</a>(0, <a class="codeRef" href="qapplication.html#style">QApplication::style</a>().pixelMetric( QStyle::PM_DockWindowHandleExtent ));
<a name="l01393"></a>01393        minSize += <a class="codeRef" href="qsize.html">QSize</a>(margin*2, margin*2);
<a name="l01394"></a>01394        <span class="keywordflow">break</span>;
<a name="l01395"></a>01395 
<a name="l01396"></a>01396      <span class="keywordflow">default</span>:
<a name="l01397"></a>01397        minSize = QToolBar::sizeHint();
<a name="l01398"></a>01398        <span class="keywordflow">break</span>;
<a name="l01399"></a>01399     }
<a name="l01400"></a>01400     <span class="keywordflow">return</span> minSize;
<a name="l01401"></a>01401 }
<a name="l01402"></a>01402 
<a name="l01403"></a>01403 <a class="codeRef" href="qsize.html">QSize</a> KToolBar::minimumSize()<span class="keyword"> const</span>
<a name="l01404"></a>01404 <span class="keyword"></span>{
<a name="l01405"></a>01405     <span class="keywordflow">return</span> minimumSizeHint();
<a name="l01406"></a>01406 }
<a name="l01407"></a>01407 
<a name="l01408"></a>01408 <a class="codeRef" href="qsize.html">QSize</a> KToolBar::minimumSizeHint()<span class="keyword"> const</span>
<a name="l01409"></a>01409 <span class="keyword"></span>{
<a name="l01410"></a>01410     <span class="keywordflow">return</span> sizeHint();
<a name="l01411"></a>01411 }
<a name="l01412"></a>01412 
<a name="l01413"></a>01413 <span class="keywordtype">bool</span> KToolBar::highlight()<span class="keyword"> const</span>
<a name="l01414"></a>01414 <span class="keyword"></span>{
<a name="l01415"></a>01415     <span class="keywordflow">return</span> d-&gt;m_highlight;
<a name="l01416"></a>01416 }
<a name="l01417"></a>01417 
<a name="l01418"></a>01418 <span class="keywordtype">void</span> KToolBar::hide()
<a name="l01419"></a>01419 {
<a name="l01420"></a>01420     QToolBar::hide();
<a name="l01421"></a>01421 }
<a name="l01422"></a>01422 
<a name="l01423"></a>01423 <span class="keywordtype">void</span> KToolBar::show()
<a name="l01424"></a>01424 {
<a name="l01425"></a>01425     QToolBar::show();
<a name="l01426"></a>01426 }
<a name="l01427"></a>01427 
<a name="l01428"></a>01428 <span class="keywordtype">void</span> KToolBar::resizeEvent( <a class="codeRef" href="qresizeevent.html">QResizeEvent</a> *e )
<a name="l01429"></a>01429 {
<a name="l01430"></a>01430     <span class="keywordtype">bool</span> b = isUpdatesEnabled();
<a name="l01431"></a>01431     setUpdatesEnabled( <span class="keyword">false</span> );
<a name="l01432"></a>01432     QToolBar::resizeEvent( e );
<a name="l01433"></a>01433     <span class="keywordflow">if</span> (b)
<a name="l01434"></a>01434     {
<a name="l01435"></a>01435       <span class="keywordflow">if</span> (layoutTimer-&gt;<a class="codeRef" href="qtimer.html#isActive">isActive</a>())
<a name="l01436"></a>01436       {
<a name="l01437"></a>01437          <span class="comment">// Wait with repainting till layout is complete.</span>
<a name="l01438"></a>01438          d-&gt;repaintTimer.start( 100, <span class="keyword">true</span> );
<a name="l01439"></a>01439       }
<a name="l01440"></a>01440       <span class="keywordflow">else</span>
<a name="l01441"></a>01441       {
<a name="l01442"></a>01442          <span class="comment">// Repaint now</span>
<a name="l01443"></a>01443          slotRepaint();
<a name="l01444"></a>01444       }
<a name="l01445"></a>01445     }
<a name="l01446"></a>01446 }
<a name="l01447"></a>01447 
<a name="l01448"></a>01448 <span class="keywordtype">void</span> KToolBar::slotIconChanged(<span class="keywordtype">int</span> group)
<a name="l01449"></a>01449 {
<a name="l01450"></a>01450     <span class="keywordflow">if</span> ((group != <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82a085b2f483cdfd6158de55aba647318e4">KIcon::Toolbar</a>) &amp;&amp; (group != <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82aa93d89e9cb5f184569d0e78f13982a06">KIcon::MainToolbar</a>))
<a name="l01451"></a>01451         <span class="keywordflow">return</span>;
<a name="l01452"></a>01452     <span class="keywordflow">if</span> ((group == <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82aa93d89e9cb5f184569d0e78f13982a06">KIcon::MainToolbar</a>) != !::qstrcmp(name(), <span class="stringliteral">&quot;mainToolBar&quot;</span>))
<a name="l01453"></a>01453         <span class="keywordflow">return</span>;
<a name="l01454"></a>01454 
<a name="l01455"></a>01455     doModeChange();
<a name="l01456"></a>01456 
<a name="l01457"></a>01457     <span class="keywordflow">if</span> (isVisible())
<a name="l01458"></a>01458         updateGeometry();
<a name="l01459"></a>01459 }
<a name="l01460"></a>01460 
<a name="l01461"></a>01461 <span class="keywordtype">void</span> KToolBar::slotReadConfig()
<a name="l01462"></a>01462 {
<a name="l01463"></a>01463     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; slotReadConfig&quot; &lt;&lt; endl;</span>
<a name="l01464"></a>01464     <span class="comment">// Read appearance settings (hmm, we used to do both here,</span>
<a name="l01465"></a>01465     <span class="comment">// but a well behaved application will call applyMainWindowSettings</span>
<a name="l01466"></a>01466     <span class="comment">// anyway, right ?)</span>
<a name="l01467"></a>01467     applyAppearanceSettings(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>(), QString::null );
<a name="l01468"></a>01468 }
<a name="l01469"></a>01469 
<a name="l01470"></a>01470 <span class="keywordtype">void</span> KToolBar::slotAppearanceChanged()
<a name="l01471"></a>01471 {
<a name="l01472"></a>01472     <span class="comment">// Read appearance settings from global file.</span>
<a name="l01473"></a>01473     applyAppearanceSettings(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>(), QString::null, <span class="keyword">true</span> <span class="comment">/* lose local settings */</span> );
<a name="l01474"></a>01474 
<a name="l01475"></a>01475     <span class="comment">// And remember to save the new look later</span>
<a name="l01476"></a>01476     <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l01477"></a>01477     <span class="keywordflow">if</span> ( kmw )
<a name="l01478"></a>01478         kmw-&gt;<a class="code" href="classKMainWindow.html#a5f60cfc96af7dc428ced559abb62c660" title="Apply a state change.">setSettingsDirty</a>();
<a name="l01479"></a>01479 }
<a name="l01480"></a>01480 
<a name="l01481"></a>01481 <span class="comment">//static</span>
<a name="l01482"></a><a class="code" href="classKToolBar.html#aa0e3e3c3ef50ef084b44c2f826440b4b">01482</a> <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#aa0e3e3c3ef50ef084b44c2f826440b4b" title="Returns the global setting for &quot;Highlight buttons under mouse&quot;.">KToolBar::highlightSetting</a>()
<a name="l01483"></a>01483 {
<a name="l01484"></a>01484     <a class="codeRef" href="qstring.html">QString</a> grpToolbar(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;Toolbar style&quot;</span>));
<a name="l01485"></a>01485     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> saver(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>(), grpToolbar);
<a name="l01486"></a>01486     <span class="keywordflow">return</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;Highlighting&quot;</span>),<span class="keyword">true</span>);
<a name="l01487"></a>01487 }
<a name="l01488"></a>01488 
<a name="l01489"></a>01489 <span class="comment">//static</span>
<a name="l01490"></a><a class="code" href="classKToolBar.html#aea8b6b5d5980bf5de2be30e79f7bc94e">01490</a> <span class="keywordtype">bool</span> <a class="code" href="classKToolBar.html#aea8b6b5d5980bf5de2be30e79f7bc94e" title="Returns the global setting for &quot;Toolbars transparent when moving&quot;.">KToolBar::transparentSetting</a>()
<a name="l01491"></a>01491 {
<a name="l01492"></a>01492     <a class="codeRef" href="qstring.html">QString</a> grpToolbar(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;Toolbar style&quot;</span>));
<a name="l01493"></a>01493     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> saver(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>(), grpToolbar);
<a name="l01494"></a>01494     <span class="keywordflow">return</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;TransparentMoving&quot;</span>),<span class="keyword">true</span>);
<a name="l01495"></a>01495 }
<a name="l01496"></a>01496 
<a name="l01497"></a>01497 <span class="comment">//static</span>
<a name="l01498"></a><a class="code" href="classKToolBar.html#a01c3bfb32314c35f0298b3988c99c5cb">01498</a> KToolBar::IconText <a class="code" href="classKToolBar.html#a01c3bfb32314c35f0298b3988c99c5cb" title="Returns the global setting for &quot;Icon Text&quot;.">KToolBar::iconTextSetting</a>()
<a name="l01499"></a>01499 {
<a name="l01500"></a>01500     <a class="codeRef" href="qstring.html">QString</a> grpToolbar(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;Toolbar style&quot;</span>));
<a name="l01501"></a>01501     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> saver(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>(), grpToolbar);
<a name="l01502"></a>01502     <a class="codeRef" href="qstring.html">QString</a> icontext = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a955d1210aeb86d7ec5265557333ab338">readEntry</a>(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;IconText&quot;</span>),<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;IconOnly&quot;</span>));
<a name="l01503"></a>01503     <span class="keywordflow">if</span> ( icontext == <span class="stringliteral">&quot;IconTextRight&quot;</span> )
<a name="l01504"></a>01504         <span class="keywordflow">return</span> IconTextRight;
<a name="l01505"></a>01505     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( icontext == <span class="stringliteral">&quot;IconTextBottom&quot;</span> )
<a name="l01506"></a>01506         <span class="keywordflow">return</span> IconTextBottom;
<a name="l01507"></a>01507     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( icontext == <span class="stringliteral">&quot;TextOnly&quot;</span> )
<a name="l01508"></a>01508         <span class="keywordflow">return</span> TextOnly;
<a name="l01509"></a>01509     <span class="keywordflow">else</span>
<a name="l01510"></a>01510         <span class="keywordflow">return</span> IconOnly;
<a name="l01511"></a>01511 }
<a name="l01512"></a>01512 
<a name="l01513"></a>01513 <span class="keywordtype">void</span> KToolBar::applyAppearanceSettings(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *config, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;_configGroup, <span class="keywordtype">bool</span> forceGlobal)
<a name="l01514"></a>01514 {
<a name="l01515"></a>01515     <a class="codeRef" href="qstring.html">QString</a> configGroup = _configGroup.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ? settingsGroup() : _configGroup;
<a name="l01516"></a>01516     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; applyAppearanceSettings: configGroup=&quot; &lt;&lt; configGroup &lt;&lt; &quot; forceGlobal=&quot; &lt;&lt; forceGlobal &lt;&lt; endl;</span>
<a name="l01517"></a>01517 
<a name="l01518"></a>01518     <span class="comment">// If we have application-specific settings in the XML file,</span>
<a name="l01519"></a>01519     <span class="comment">// and nothing in the application&#39;s config file, then</span>
<a name="l01520"></a>01520     <span class="comment">// we don&#39;t apply the global defaults, the XML ones are preferred</span>
<a name="l01521"></a>01521     <span class="comment">// (see applySettings for a full explanation)</span>
<a name="l01522"></a>01522     <span class="comment">// This is the reason for the xmlgui tests below.</span>
<a name="l01523"></a>01523     <span class="keywordtype">bool</span> xmlgui = d-&gt;m_xmlguiClient &amp;&amp; !d-&gt;m_xmlguiClient-&gt;xmlFile().isEmpty();
<a name="l01524"></a>01524 
<a name="l01525"></a>01525     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *gconfig = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a71532b4619923ec5f7779c5f0065e6e7">KGlobal::config</a>();
<a name="l01526"></a>01526 
<a name="l01527"></a>01527     <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrIconText  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;IconText&quot;</span>);
<a name="l01528"></a>01528     <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrHighlight = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;Highlighting&quot;</span>);
<a name="l01529"></a>01529     <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrTrans     = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;TransparentMoving&quot;</span>);
<a name="l01530"></a>01530     <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrIconSize  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;IconSize&quot;</span>);
<a name="l01531"></a>01531 
<a name="l01532"></a>01532     <span class="comment">// we actually do this in two steps.</span>
<a name="l01533"></a>01533     <span class="comment">// First, we read in the global styles [Toolbar style] (from the KControl module).</span>
<a name="l01534"></a>01534     <span class="comment">// Then, if the toolbar is NOT &#39;mainToolBar&#39;, we will also try to read in [barname Toolbar style]</span>
<a name="l01535"></a>01535     <span class="keywordtype">bool</span> highlight;
<a name="l01536"></a>01536     <span class="keywordtype">int</span> transparent;
<a name="l01537"></a>01537     <span class="keywordtype">bool</span> applyIconText = !xmlgui; <span class="comment">// if xmlgui is used, global defaults won&#39;t apply</span>
<a name="l01538"></a>01538     <span class="keywordtype">bool</span> applyIconSize = !xmlgui;
<a name="l01539"></a>01539 
<a name="l01540"></a>01540     <span class="keywordtype">int</span> <a class="code" href="classKToolBar.html#a8863644b550afdc19af4654bafdcb378" title="Returns the current icon size for buttons.">iconSize</a> = d-&gt;IconSizeDefault;
<a name="l01541"></a>01541     <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a490ab97a6311fe2969b698fb3fbd976b" title="Returns the current text style for buttons.">iconText</a> = d-&gt;IconTextDefault;
<a name="l01542"></a>01542 
<a name="l01543"></a>01543     <span class="comment">// this is the first iteration</span>
<a name="l01544"></a>01544     <a class="codeRef" href="qstring.html">QString</a> grpToolbar(<a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;Toolbar style&quot;</span>));
<a name="l01545"></a>01545     { <span class="comment">// start block for KConfigGroupSaver</span>
<a name="l01546"></a>01546         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> saver(gconfig, grpToolbar);
<a name="l01547"></a>01547 
<a name="l01548"></a>01548         <span class="comment">// first, get the generic settings</span>
<a name="l01549"></a>01549         highlight   = gconfig-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrHighlight, <span class="keyword">true</span>);
<a name="l01550"></a>01550         transparent = gconfig-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrTrans, <span class="keyword">true</span>);
<a name="l01551"></a>01551 
<a name="l01552"></a>01552         <span class="comment">// we read in the IconText property *only* if we intend on actually</span>
<a name="l01553"></a>01553         <span class="comment">// honoring it</span>
<a name="l01554"></a>01554         <span class="keywordflow">if</span> (d-&gt;m_honorStyle)
<a name="l01555"></a>01555             d-&gt;IconTextDefault = gconfig-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a955d1210aeb86d7ec5265557333ab338">readEntry</a>(attrIconText, d-&gt;IconTextDefault);
<a name="l01556"></a>01556         <span class="keywordflow">else</span>
<a name="l01557"></a>01557             d-&gt;IconTextDefault = <span class="stringliteral">&quot;IconOnly&quot;</span>;
<a name="l01558"></a>01558 
<a name="l01559"></a>01559         <span class="comment">// Use the default icon size for toolbar icons.</span>
<a name="l01560"></a>01560         d-&gt;IconSizeDefault = gconfig-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a42af93a695b1a80094b873a855eb4ab2">readNumEntry</a>(attrIconSize, d-&gt;IconSizeDefault);
<a name="l01561"></a>01561 
<a name="l01562"></a>01562         iconSize = d-&gt;IconSizeDefault;
<a name="l01563"></a>01563         iconText = d-&gt;IconTextDefault;
<a name="l01564"></a>01564 
<a name="l01565"></a>01565         <span class="keywordflow">if</span> ( !forceGlobal &amp;&amp; config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a53f37b596e919041fca5f642ddfac963">hasGroup</a>(configGroup) )
<a name="l01566"></a>01566         {
<a name="l01567"></a>01567             config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a1754e470553c9f9ac2556a9d63ce61c9">setGroup</a>(configGroup);
<a name="l01568"></a>01568 
<a name="l01569"></a>01569             <span class="comment">// first, get the generic settings</span>
<a name="l01570"></a>01570             highlight   = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrHighlight, highlight);
<a name="l01571"></a>01571             transparent = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrTrans, transparent);
<a name="l01572"></a>01572 
<a name="l01573"></a>01573             <span class="comment">// read in the IconText property</span>
<a name="l01574"></a>01574             <span class="keywordflow">if</span> ( config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ac18cd9eea5bfba6ab9b9d9b4834249ec">hasKey</a>( attrIconText ) ) {
<a name="l01575"></a>01575                 iconText = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a955d1210aeb86d7ec5265557333ab338">readEntry</a>(attrIconText);
<a name="l01576"></a>01576                 applyIconText = <span class="keyword">true</span>;
<a name="l01577"></a>01577                 <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; read icontext=&quot; &lt;&lt; d-&gt;IconTextDefault &lt;&lt; &quot;, that will be the default&quot; &lt;&lt; endl;</span>
<a name="l01578"></a>01578             }
<a name="l01579"></a>01579 
<a name="l01580"></a>01580             <span class="comment">// now get the size</span>
<a name="l01581"></a>01581             <span class="keywordflow">if</span> ( config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#ac18cd9eea5bfba6ab9b9d9b4834249ec">hasKey</a>( attrIconSize ) ) {
<a name="l01582"></a>01582                 iconSize = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a42af93a695b1a80094b873a855eb4ab2">readNumEntry</a>(attrIconSize);
<a name="l01583"></a>01583                 applyIconSize = <span class="keyword">true</span>;
<a name="l01584"></a>01584             }
<a name="l01585"></a>01585         }
<a name="l01586"></a>01586 
<a name="l01587"></a>01587         <span class="comment">// revert back to the old group</span>
<a name="l01588"></a>01588     } <span class="comment">// end block for KConfigGroupSaver</span>
<a name="l01589"></a>01589 
<a name="l01590"></a>01590     <span class="keywordtype">bool</span> doUpdate = <span class="keyword">false</span>;
<a name="l01591"></a>01591 
<a name="l01592"></a>01592     IconText icon_text;
<a name="l01593"></a>01593     <span class="keywordflow">if</span> ( iconText == <span class="stringliteral">&quot;IconTextRight&quot;</span> )
<a name="l01594"></a>01594         icon_text = IconTextRight;
<a name="l01595"></a>01595     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( iconText == <span class="stringliteral">&quot;IconTextBottom&quot;</span> )
<a name="l01596"></a>01596         icon_text = IconTextBottom;
<a name="l01597"></a>01597     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( iconText == <span class="stringliteral">&quot;TextOnly&quot;</span> )
<a name="l01598"></a>01598         icon_text = TextOnly;
<a name="l01599"></a>01599     <span class="keywordflow">else</span>
<a name="l01600"></a>01600         icon_text = IconOnly;
<a name="l01601"></a>01601 
<a name="l01602"></a>01602     <span class="comment">// check if the icon/text has changed</span>
<a name="l01603"></a>01603     <span class="keywordflow">if</span> (icon_text != d-&gt;m_iconText &amp;&amp; applyIconText) {
<a name="l01604"></a>01604         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; applyAppearanceSettings setIconText &quot; &lt;&lt; icon_text &lt;&lt; endl;</span>
<a name="l01605"></a>01605         <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>(icon_text, <span class="keyword">false</span>);
<a name="l01606"></a>01606         doUpdate = <span class="keyword">true</span>;
<a name="l01607"></a>01607     }
<a name="l01608"></a>01608 
<a name="l01609"></a>01609     <span class="comment">// ...and check if the icon size has changed</span>
<a name="l01610"></a>01610     <span class="keywordflow">if</span> (iconSize != d-&gt;m_iconSize &amp;&amp; applyIconSize) {
<a name="l01611"></a>01611         <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">setIconSize</a>(iconSize, <span class="keyword">false</span>);
<a name="l01612"></a>01612         doUpdate = <span class="keyword">true</span>;
<a name="l01613"></a>01613     }
<a name="l01614"></a>01614 
<a name="l01615"></a>01615     <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *mw = <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>();
<a name="l01616"></a>01616 
<a name="l01617"></a>01617     <span class="comment">// ...and if we should highlight</span>
<a name="l01618"></a>01618     <span class="keywordflow">if</span> ( highlight != d-&gt;m_highlight ) {
<a name="l01619"></a>01619         d-&gt;m_highlight = highlight;
<a name="l01620"></a>01620         doUpdate = <span class="keyword">true</span>;
<a name="l01621"></a>01621     }
<a name="l01622"></a>01622 
<a name="l01623"></a>01623     <span class="comment">// ...and if we should move transparently</span>
<a name="l01624"></a>01624     <span class="keywordflow">if</span> ( mw &amp;&amp; transparent != (!mw-&gt;<a class="codeRef" href="qmainwindow.html#opaqueMoving">opaqueMoving</a>()) ) {
<a name="l01625"></a>01625         mw-&gt;<a class="codeRef" href="qmainwindow.html#setOpaqueMoving">setOpaqueMoving</a>( !transparent );
<a name="l01626"></a>01626     }
<a name="l01627"></a>01627 
<a name="l01628"></a>01628     <span class="keywordflow">if</span> (doUpdate)
<a name="l01629"></a>01629         doModeChange(); <span class="comment">// tell buttons what happened</span>
<a name="l01630"></a>01630 
<a name="l01631"></a>01631     <span class="keywordflow">if</span> (isVisible ())
<a name="l01632"></a>01632         updateGeometry();
<a name="l01633"></a>01633 }
<a name="l01634"></a>01634 
<a name="l01635"></a>01635 <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#acffde80f7dc18416b8342e22dff8198a" title="Read the toolbar settings from group configGroup in config and apply them.">KToolBar::applySettings</a>(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *config, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;_configGroup)
<a name="l01636"></a>01636 {
<a name="l01637"></a>01637     <span class="keywordflow">return</span> <a class="code" href="classKToolBar.html#acffde80f7dc18416b8342e22dff8198a" title="Read the toolbar settings from group configGroup in config and apply them.">applySettings</a>(config,_configGroup,<span class="keyword">false</span>);
<a name="l01638"></a>01638 }
<a name="l01639"></a>01639 
<a name="l01640"></a><a class="code" href="classKToolBar.html#acffde80f7dc18416b8342e22dff8198a">01640</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#acffde80f7dc18416b8342e22dff8198a" title="Read the toolbar settings from group configGroup in config and apply them.">KToolBar::applySettings</a>(<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> *config, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;_configGroup, <span class="keywordtype">bool</span> force)
<a name="l01641"></a>01641 {
<a name="l01642"></a>01642     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; applySettings group=&quot; &lt;&lt; _configGroup &lt;&lt; endl;</span>
<a name="l01643"></a>01643 
<a name="l01644"></a>01644     <a class="codeRef" href="qstring.html">QString</a> configGroup = _configGroup.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ? settingsGroup() : _configGroup;
<a name="l01645"></a>01645 
<a name="l01646"></a>01646     <span class="comment">/*</span>
<a name="l01647"></a>01647 <span class="comment">      Let&#39;s explain this a bit more in details.</span>
<a name="l01648"></a>01648 <span class="comment">      The order in which we apply settings is :</span>
<a name="l01649"></a>01649 <span class="comment">       Global config / &lt;appnamerc&gt; user settings                        if no XMLGUI is used</span>
<a name="l01650"></a>01650 <span class="comment">       Global config / App-XML attributes / &lt;appnamerc&gt; user settings   if XMLGUI is used</span>
<a name="l01651"></a>01651 <span class="comment"></span>
<a name="l01652"></a>01652 <span class="comment">      So in the first case, we simply read everything from KConfig as below,</span>
<a name="l01653"></a>01653 <span class="comment">      but in the second case we don&#39;t do anything here if there is no app-specific config,</span>
<a name="l01654"></a>01654 <span class="comment">      and the XMLGUI-related code (loadState()) uses the static methods of this class</span>
<a name="l01655"></a>01655 <span class="comment">      to get the global defaults.</span>
<a name="l01656"></a>01656 <span class="comment"></span>
<a name="l01657"></a>01657 <span class="comment">      Global config doesn&#39;t include position (index, offset, newline and hidden/shown).</span>
<a name="l01658"></a>01658 <span class="comment">    */</span>
<a name="l01659"></a>01659 
<a name="l01660"></a>01660     <span class="comment">// First the appearance stuff - the one which has a global config</span>
<a name="l01661"></a>01661     applyAppearanceSettings( config, configGroup );
<a name="l01662"></a>01662 
<a name="l01663"></a>01663     <span class="comment">// ...and now the position stuff</span>
<a name="l01664"></a>01664     <span class="keywordflow">if</span> ( config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a53f37b596e919041fca5f642ddfac963">hasGroup</a>(configGroup) || force )
<a name="l01665"></a>01665     {
<a name="l01666"></a>01666         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigGroupSaver.html">KConfigGroupSaver</a> cgs(config, configGroup);
<a name="l01667"></a>01667 
<a name="l01668"></a>01668         <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrPosition  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;Position&quot;</span>);
<a name="l01669"></a>01669         <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrIndex  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;Index&quot;</span>);
<a name="l01670"></a>01670         <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrOffset  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;Offset&quot;</span>);
<a name="l01671"></a>01671         <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrNewLine  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;NewLine&quot;</span>);
<a name="l01672"></a>01672         <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;attrHidden  = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a2ec23a16b6d999827c7b523f156cbcbb">KGlobal::staticQString</a>(<span class="stringliteral">&quot;Hidden&quot;</span>);
<a name="l01673"></a>01673 
<a name="l01674"></a>01674         <a class="codeRef" href="qstring.html">QString</a> position = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a955d1210aeb86d7ec5265557333ab338">readEntry</a>(attrPosition, d-&gt;PositionDefault);
<a name="l01675"></a>01675         <span class="keywordtype">int</span> index = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a42af93a695b1a80094b873a855eb4ab2">readNumEntry</a>(attrIndex, -1);
<a name="l01676"></a>01676         <span class="keywordtype">int</span> offset = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a42af93a695b1a80094b873a855eb4ab2">readNumEntry</a>(attrOffset, d-&gt;OffsetDefault);
<a name="l01677"></a>01677         <span class="keywordtype">bool</span> newLine = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrNewLine, d-&gt;NewLineDefault);
<a name="l01678"></a>01678         <span class="keywordtype">bool</span> hidden = config-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfigBase.html#a515c85fb1b7b3ddab4c6612cdb67bf74">readBoolEntry</a>(attrHidden, d-&gt;HiddenDefault);
<a name="l01679"></a>01679 
<a name="l01680"></a>01680         Dock pos(DockTop);
<a name="l01681"></a>01681         <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Top&quot;</span> )
<a name="l01682"></a>01682             pos = DockTop;
<a name="l01683"></a>01683         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Bottom&quot;</span> )
<a name="l01684"></a>01684             pos = DockBottom;
<a name="l01685"></a>01685         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Left&quot;</span> )
<a name="l01686"></a>01686             pos = DockLeft;
<a name="l01687"></a>01687         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Right&quot;</span> )
<a name="l01688"></a>01688             pos = DockRight;
<a name="l01689"></a>01689         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Floating&quot;</span> )
<a name="l01690"></a>01690             pos = DockTornOff;
<a name="l01691"></a>01691         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( position == <span class="stringliteral">&quot;Flat&quot;</span> )
<a name="l01692"></a>01692             pos = DockMinimized;
<a name="l01693"></a>01693 
<a name="l01694"></a>01694         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; applySettings hidden=&quot; &lt;&lt; hidden &lt;&lt; endl;</span>
<a name="l01695"></a>01695         <span class="keywordflow">if</span> (hidden)
<a name="l01696"></a>01696             hide();
<a name="l01697"></a>01697         <span class="keywordflow">else</span>
<a name="l01698"></a>01698             show();
<a name="l01699"></a>01699 
<a name="l01700"></a>01700         <span class="keywordflow">if</span> ( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l01701"></a>01701         {
<a name="l01702"></a>01702             <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; applySettings updating ToolbarInfo&quot; &lt;&lt; endl;</span>
<a name="l01703"></a>01703             d-&gt;toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset );
<a name="l01704"></a>01704             <a class="code" href="classKToolBar.html#a3f1aa1189e74f8b6977f3d9dedcd3f7f">positionYourself</a>( <span class="keyword">true</span> );
<a name="l01705"></a>01705         }
<a name="l01706"></a>01706         <span class="keywordflow">if</span> (isVisible ())
<a name="l01707"></a>01707             updateGeometry();
<a name="l01708"></a>01708     }
<a name="l01709"></a>01709 }
<a name="l01710"></a>01710 
<a name="l01711"></a>01711 <span class="keywordtype">bool</span> KToolBar::event( <a class="codeRef" href="qevent.html">QEvent</a> *e )
<a name="l01712"></a>01712 {
<a name="l01713"></a>01713     <span class="keywordflow">if</span> ( (e-&gt;<a class="codeRef" href="qevent.html#type">type</a>() == QEvent::LayoutHint) &amp;&amp; isUpdatesEnabled() )
<a name="l01714"></a>01714        d-&gt;repaintTimer.start( 100, <span class="keyword">true</span> );
<a name="l01715"></a>01715 
<a name="l01716"></a>01716     <span class="keywordflow">if</span> (e-&gt;<a class="codeRef" href="qevent.html#type">type</a>() == QEvent::ChildInserted )
<a name="l01717"></a>01717     {
<a name="l01718"></a>01718        <span class="comment">// Bypass QToolBar::event,</span>
<a name="l01719"></a>01719        <span class="comment">// it will show() the inserted child and we don&#39;t want to</span>
<a name="l01720"></a>01720        <span class="comment">// do that until we have rebuilt the layout.</span>
<a name="l01721"></a>01721        childEvent((<a class="codeRef" href="qchildevent.html">QChildEvent</a> *)e);
<a name="l01722"></a>01722        <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l01723"></a>01723     }
<a name="l01724"></a>01724 
<a name="l01725"></a>01725     <span class="keywordflow">return</span> QToolBar::event( e );
<a name="l01726"></a>01726 }
<a name="l01727"></a>01727 
<a name="l01728"></a>01728 <span class="keywordtype">void</span> KToolBar::slotRepaint()
<a name="l01729"></a>01729 {
<a name="l01730"></a>01730     setUpdatesEnabled( <span class="keyword">false</span> );
<a name="l01731"></a>01731     <span class="comment">// Send a resizeEvent to update the &quot;toolbar extension arrow&quot;</span>
<a name="l01732"></a>01732     <span class="comment">// (The button you get when your toolbar-items don&#39;t fit in</span>
<a name="l01733"></a>01733     <span class="comment">// the available space)</span>
<a name="l01734"></a>01734     <a class="codeRef" href="qresizeevent.html">QResizeEvent</a> ev(size(), size());
<a name="l01735"></a>01735     resizeEvent(&amp;ev);
<a name="l01736"></a>01736     <a class="codeRef" href="qapplication.html#sendPostedEvents-2">QApplication::sendPostedEvents</a>( <span class="keyword">this</span>, QEvent::LayoutHint );
<a name="l01737"></a>01737     setUpdatesEnabled( <span class="keyword">true</span> );
<a name="l01738"></a>01738     repaint( <span class="keyword">true</span> );
<a name="l01739"></a>01739 }
<a name="l01740"></a>01740 
<a name="l01741"></a>01741 <span class="keywordtype">void</span> KToolBar::toolBarPosChanged( <a class="codeRef" href="qtoolbar.html">QToolBar</a> *tb )
<a name="l01742"></a>01742 {
<a name="l01743"></a>01743     <span class="keywordflow">if</span> ( tb != <span class="keyword">this</span> )
<a name="l01744"></a>01744         <span class="keywordflow">return</span>;
<a name="l01745"></a>01745     <span class="keywordflow">if</span> ( d-&gt;oldPos == DockMinimized )
<a name="l01746"></a>01746         rebuildLayout();
<a name="l01747"></a>01747     d-&gt;oldPos = (QMainWindow::ToolBarDock)<a class="code" href="classKToolBar.html#a6223973b27d1192b533d13f521161b92" title="Returns the toolbar position.">barPos</a>();
<a name="l01748"></a>01748     <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l01749"></a>01749     <span class="keywordflow">if</span> ( kmw )
<a name="l01750"></a>01750         kmw-&gt;<a class="code" href="classKMainWindow.html#a5f60cfc96af7dc428ced559abb62c660" title="Apply a state change.">setSettingsDirty</a>();
<a name="l01751"></a>01751 }
<a name="l01752"></a>01752 
<a name="l01753"></a>01753 <span class="keyword">static</span> KToolBar::Dock stringToDock( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; attrPosition )
<a name="l01754"></a>01754 {
<a name="l01755"></a>01755     KToolBar::Dock dock = KToolBar::DockTop;
<a name="l01756"></a>01756     <span class="keywordflow">if</span> ( !attrPosition.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ) {
<a name="l01757"></a>01757         <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;top&quot;</span> )
<a name="l01758"></a>01758             dock = KToolBar::DockTop;
<a name="l01759"></a>01759         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;left&quot;</span> )
<a name="l01760"></a>01760             dock = KToolBar::DockLeft;
<a name="l01761"></a>01761         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;right&quot;</span> )
<a name="l01762"></a>01762             dock = KToolBar::DockRight;
<a name="l01763"></a>01763         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;bottom&quot;</span> )
<a name="l01764"></a>01764             dock = KToolBar::DockBottom;
<a name="l01765"></a>01765         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;floating&quot;</span> )
<a name="l01766"></a>01766             dock = KToolBar::DockTornOff;
<a name="l01767"></a>01767         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrPosition == <span class="stringliteral">&quot;flat&quot;</span> )
<a name="l01768"></a>01768             dock = KToolBar::DockMinimized;
<a name="l01769"></a>01769     }
<a name="l01770"></a>01770     <span class="keywordflow">return</span> dock;
<a name="l01771"></a>01771 }
<a name="l01772"></a>01772 
<a name="l01773"></a>01773 
<a name="l01774"></a><a class="code" href="classKToolBar.html#ab47720195db6c3f9e5b87fe0a7dc3853">01774</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#ab47720195db6c3f9e5b87fe0a7dc3853" title="Load state from an XML element, called by KXMLGUIBuilder.">KToolBar::loadState</a>( <span class="keyword">const</span> <a class="codeRef" href="qdomelement.html">QDomElement</a> &amp;element )
<a name="l01775"></a>01775 {
<a name="l01776"></a>01776     <a class="codeRef" href="qmainwindow.html">QMainWindow</a> *mw = <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>();
<a name="l01777"></a>01777 
<a name="l01778"></a>01778     <span class="keywordflow">if</span> ( !mw )
<a name="l01779"></a>01779         <span class="keywordflow">return</span>;
<a name="l01780"></a>01780 
<a name="l01781"></a>01781     {
<a name="l01782"></a>01782         <a class="codeRef" href="qcstring.html">QCString</a> <a class="code" href="classKToolBar.html#a450c58379184615d6694ca8ed7fc0ac0" title="Returns the toolbar&#39;s text.">text</a> = element.namedItem( <span class="stringliteral">&quot;text&quot;</span> ).toElement().<a class="codeRef" href="qdomelement.html#text">text</a>().utf8();
<a name="l01783"></a>01783         <span class="keywordflow">if</span> ( text.<a class="codeRef" href="qcstring.html#isEmpty">isEmpty</a>() )
<a name="l01784"></a>01784             text = element.namedItem( <span class="stringliteral">&quot;Text&quot;</span> ).toElement().<a class="codeRef" href="qdomelement.html#text">text</a>().utf8();
<a name="l01785"></a>01785         <span class="keywordflow">if</span> ( !text.<a class="codeRef" href="qcstring.html#isEmpty">isEmpty</a>() )
<a name="l01786"></a>01786             <a class="code" href="classKToolBar.html#a3ed35ae2836a155ead5eb6780bb3510f" title="Assign a (translated) text to this toolbar.">setText</a>( i18n( text ) );
<a name="l01787"></a>01787     }
<a name="l01788"></a>01788 
<a name="l01789"></a>01789     {
<a name="l01790"></a>01790         <a class="codeRef" href="qcstring.html">QCString</a> attrFullWidth = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;fullWidth&quot;</span> ).lower().latin1();
<a name="l01791"></a>01791         <span class="keywordflow">if</span> ( !attrFullWidth.<a class="codeRef" href="qcstring.html#isEmpty">isEmpty</a>() )
<a name="l01792"></a>01792             <a class="code" href="classKToolBar.html#af8f4554e0a3f770f1b7f1d6d1382d944" title="Set toolbar to full parent size (default).">setFullSize</a>( attrFullWidth == <span class="stringliteral">&quot;true&quot;</span> );
<a name="l01793"></a>01793     }
<a name="l01794"></a>01794 
<a name="l01795"></a>01795     <span class="comment">/*</span>
<a name="l01796"></a>01796 <span class="comment">      This method is called in order to load toolbar settings from XML.</span>
<a name="l01797"></a>01797 <span class="comment">      However this can be used in two rather different cases:</span>
<a name="l01798"></a>01798 <span class="comment">      - for the initial loading of the app&#39;s XML. In that case the settings</span>
<a name="l01799"></a>01799 <span class="comment">        are only the defaults, the user&#39;s KConfig settings will override them</span>
<a name="l01800"></a>01800 <span class="comment">        (KDE4 TODO: how about saving those user settings into the local XML file instead?</span>
<a name="l01801"></a>01801 <span class="comment">        Then this whole thing would be simpler, no KConfig settings to apply afterwards.</span>
<a name="l01802"></a>01802 <span class="comment">        OTOH we&#39;d have to migrate those settings when the .rc version increases,</span>
<a name="l01803"></a>01803 <span class="comment">        like we do for shortcuts)</span>
<a name="l01804"></a>01804 <span class="comment"></span>
<a name="l01805"></a>01805 <span class="comment">      - for later re-loading when switching between parts in KXMLGUIFactory.</span>
<a name="l01806"></a>01806 <span class="comment">        In that case the XML contains the final settings, not the defaults.</span>
<a name="l01807"></a>01807 <span class="comment">        We do need the defaults, and the toolbar might have been completely</span>
<a name="l01808"></a>01808 <span class="comment">        deleted and recreated meanwhile. So we store the app-default settings</span>
<a name="l01809"></a>01809 <span class="comment">        into the XML.</span>
<a name="l01810"></a>01810 <span class="comment">     */</span>
<a name="l01811"></a>01811     <span class="keywordtype">bool</span> loadingAppDefaults = <span class="keyword">true</span>;
<a name="l01812"></a>01812     <span class="keywordflow">if</span> ( element.<a class="codeRef" href="qdomelement.html#hasAttribute">hasAttribute</a>( <span class="stringliteral">&quot;offsetDefault&quot;</span> ) )
<a name="l01813"></a>01813     {
<a name="l01814"></a>01814         <span class="comment">// this isn&#39;t the first time, so the defaults have been saved into the (in-memory) XML</span>
<a name="l01815"></a>01815         loadingAppDefaults = <span class="keyword">false</span>;
<a name="l01816"></a>01816         d-&gt;OffsetDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;offsetDefault&quot;</span> ).toInt();
<a name="l01817"></a>01817         d-&gt;NewLineDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;newlineDefault&quot;</span> ) == <span class="stringliteral">&quot;true&quot;</span>;
<a name="l01818"></a>01818         d-&gt;HiddenDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;hiddenDefault&quot;</span> ) == <span class="stringliteral">&quot;true&quot;</span>;
<a name="l01819"></a>01819         d-&gt;IconSizeDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;iconSizeDefault&quot;</span> ).toInt();
<a name="l01820"></a>01820         d-&gt;PositionDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;positionDefault&quot;</span> );
<a name="l01821"></a>01821         d-&gt;IconTextDefault = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;iconTextDefault&quot;</span> );
<a name="l01822"></a>01822     }
<a name="l01823"></a>01823     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; loadState loadingAppDefaults=&quot; &lt;&lt; loadingAppDefaults &lt;&lt; endl;</span>
<a name="l01824"></a>01824 
<a name="l01825"></a>01825     Dock dock = stringToDock( element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;position&quot;</span> ).lower() );
<a name="l01826"></a>01826 
<a name="l01827"></a>01827     {
<a name="l01828"></a>01828         <a class="codeRef" href="qcstring.html">QCString</a> attrIconText = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;iconText&quot;</span> ).lower().latin1();
<a name="l01829"></a>01829         <span class="keywordflow">if</span> ( !attrIconText.<a class="codeRef" href="qcstring.html#isEmpty">isEmpty</a>() ) {
<a name="l01830"></a>01830             <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; loadState attrIconText=&quot; &lt;&lt; attrIconText &lt;&lt; endl;</span>
<a name="l01831"></a>01831             <span class="keywordflow">if</span> ( attrIconText == <span class="stringliteral">&quot;icontextright&quot;</span> )
<a name="l01832"></a>01832                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( KToolBar::IconTextRight );
<a name="l01833"></a>01833             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrIconText == <span class="stringliteral">&quot;textonly&quot;</span> )
<a name="l01834"></a>01834                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( KToolBar::TextOnly );
<a name="l01835"></a>01835             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrIconText == <span class="stringliteral">&quot;icontextbottom&quot;</span> )
<a name="l01836"></a>01836                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( KToolBar::IconTextBottom );
<a name="l01837"></a>01837             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( attrIconText == <span class="stringliteral">&quot;icononly&quot;</span> )
<a name="l01838"></a>01838                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( KToolBar::IconOnly );
<a name="l01839"></a>01839         } <span class="keywordflow">else</span>
<a name="l01840"></a>01840     {
<a name="l01841"></a>01841         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; loadState no iconText attribute in XML, using iconTextSetting=&quot; &lt;&lt; iconTextSetting() &lt;&lt; endl;</span>
<a name="l01842"></a>01842             <span class="comment">// Use global setting</span>
<a name="l01843"></a>01843             <span class="keywordflow">if</span> (d-&gt;m_honorStyle)
<a name="l01844"></a>01844                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( <a class="code" href="classKToolBar.html#a01c3bfb32314c35f0298b3988c99c5cb" title="Returns the global setting for &quot;Icon Text&quot;.">iconTextSetting</a>() );
<a name="l01845"></a>01845             <span class="keywordflow">else</span>
<a name="l01846"></a>01846                 <a class="code" href="classKToolBar.html#a5585b66009e25e9244436cbe7b24e3d1" title="Set the kind of painting for buttons.">setIconText</a>( d-&gt;IconTextDefault );
<a name="l01847"></a>01847     }
<a name="l01848"></a>01848     }
<a name="l01849"></a>01849 
<a name="l01850"></a>01850     <a class="codeRef" href="qstring.html">QString</a> attrIconSize = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;iconSize&quot;</span> ).lower();
<a name="l01851"></a>01851     <span class="keywordtype">int</span> iconSize = d-&gt;IconSizeDefault;
<a name="l01852"></a>01852     <span class="keywordflow">if</span> ( !attrIconSize.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l01853"></a>01853         iconSize = attrIconSize.<a class="codeRef" href="qstring.html#toInt">toInt</a>();
<a name="l01854"></a>01854     <a class="code" href="classKToolBar.html#a9f988a903913fa8d5515db39fcf01b6e" title="Set the icon size to load.">setIconSize</a>( iconSize );
<a name="l01855"></a>01855 
<a name="l01856"></a>01856     <span class="keywordtype">int</span> index = -1; <span class="comment">// append by default. This is very important, otherwise</span>
<a name="l01857"></a>01857     <span class="comment">// with all 0 indexes, we keep reversing the toolbars.</span>
<a name="l01858"></a>01858     {
<a name="l01859"></a>01859         <a class="codeRef" href="qstring.html">QString</a> attrIndex = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;index&quot;</span> ).lower();
<a name="l01860"></a>01860         <span class="keywordflow">if</span> ( !attrIndex.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l01861"></a>01861             index = attrIndex.<a class="codeRef" href="qstring.html#toInt">toInt</a>();
<a name="l01862"></a>01862     }
<a name="l01863"></a>01863 
<a name="l01864"></a>01864     <span class="keywordtype">int</span> offset = d-&gt;OffsetDefault;
<a name="l01865"></a>01865     <span class="keywordtype">bool</span> newLine = d-&gt;NewLineDefault;
<a name="l01866"></a>01866     <span class="keywordtype">bool</span> hidden = d-&gt;HiddenDefault;
<a name="l01867"></a>01867 
<a name="l01868"></a>01868     {
<a name="l01869"></a>01869         <a class="codeRef" href="qstring.html">QString</a> attrOffset = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;offset&quot;</span> );
<a name="l01870"></a>01870         <span class="keywordflow">if</span> ( !attrOffset.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l01871"></a>01871             offset = attrOffset.<a class="codeRef" href="qstring.html#toInt">toInt</a>();
<a name="l01872"></a>01872     }
<a name="l01873"></a>01873 
<a name="l01874"></a>01874     {
<a name="l01875"></a>01875         <a class="codeRef" href="qstring.html">QString</a> attrNewLine = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;newline&quot;</span> ).lower();
<a name="l01876"></a>01876         <span class="keywordflow">if</span> ( !attrNewLine.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l01877"></a>01877             newLine = attrNewLine == <span class="stringliteral">&quot;true&quot;</span>;
<a name="l01878"></a>01878     }
<a name="l01879"></a>01879 
<a name="l01880"></a>01880     {
<a name="l01881"></a>01881         <a class="codeRef" href="qstring.html">QString</a> attrHidden = element.<a class="codeRef" href="qdomelement.html#attribute">attribute</a>( <span class="stringliteral">&quot;hidden&quot;</span> ).lower();
<a name="l01882"></a>01882         <span class="keywordflow">if</span> ( !attrHidden.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ) {
<a name="l01883"></a>01883             hidden = attrHidden  == <span class="stringliteral">&quot;true&quot;</span>;
<a name="l01884"></a>01884         }
<a name="l01885"></a>01885     }
<a name="l01886"></a>01886 
<a name="l01887"></a>01887     d-&gt;toolBarInfo = KToolBarPrivate::ToolBarInfo( dock, index, newLine, offset );
<a name="l01888"></a>01888     mw-&gt;<a class="codeRef" href="qmainwindow.html#addDockWindow">addDockWindow</a>( <span class="keyword">this</span>, dock, newLine );
<a name="l01889"></a>01889     mw-&gt;<a class="codeRef" href="qmainwindow.html#moveDockWindow">moveDockWindow</a>( <span class="keyword">this</span>, dock, newLine, index, offset );
<a name="l01890"></a>01890 
<a name="l01891"></a>01891     <span class="comment">// Apply the highlight button setting</span>
<a name="l01892"></a>01892     d-&gt;m_highlight = <a class="code" href="classKToolBar.html#aa0e3e3c3ef50ef084b44c2f826440b4b" title="Returns the global setting for &quot;Highlight buttons under mouse&quot;.">highlightSetting</a>();
<a name="l01893"></a>01893 
<a name="l01894"></a>01894     <span class="keywordflow">if</span> ( hidden )
<a name="l01895"></a>01895         hide();
<a name="l01896"></a>01896     <span class="keywordflow">else</span>
<a name="l01897"></a>01897         show();
<a name="l01898"></a>01898 
<a name="l01899"></a>01899     <span class="keywordflow">if</span> ( loadingAppDefaults )
<a name="l01900"></a>01900     {
<a name="l01901"></a>01901         getAttributes( d-&gt;PositionDefault, d-&gt;IconTextDefault, index );
<a name="l01902"></a>01902         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; loadState IconTextDefault=&quot; &lt;&lt; d-&gt;IconTextDefault &lt;&lt; endl;</span>
<a name="l01903"></a>01903         d-&gt;OffsetDefault = offset;
<a name="l01904"></a>01904         d-&gt;NewLineDefault = newLine;
<a name="l01905"></a>01905         d-&gt;HiddenDefault = hidden;
<a name="l01906"></a>01906         d-&gt;IconSizeDefault = <a class="code" href="classKToolBar.html#a8863644b550afdc19af4654bafdcb378" title="Returns the current icon size for buttons.">iconSize</a>;
<a name="l01907"></a>01907     }
<a name="l01908"></a>01908     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; loadState hidden=&quot; &lt;&lt; hidden &lt;&lt; endl;</span>
<a name="l01909"></a>01909 
<a name="l01910"></a>01910     <span class="comment">// Apply transparent-toolbar-moving setting (ok, this is global to the mainwindow,</span>
<a name="l01911"></a>01911     <span class="comment">// but we do it only if there are toolbars...)</span>
<a name="l01912"></a>01912     <span class="comment">// KDE4: move to KMainWindow</span>
<a name="l01913"></a>01913     <span class="keywordflow">if</span> ( <a class="code" href="classKToolBar.html#aea8b6b5d5980bf5de2be30e79f7bc94e" title="Returns the global setting for &quot;Toolbars transparent when moving&quot;.">transparentSetting</a>() != !mw-&gt;<a class="codeRef" href="qmainwindow.html#opaqueMoving">opaqueMoving</a>() )
<a name="l01914"></a>01914         mw-&gt;<a class="codeRef" href="qmainwindow.html#setOpaqueMoving">setOpaqueMoving</a>( !<a class="code" href="classKToolBar.html#aea8b6b5d5980bf5de2be30e79f7bc94e" title="Returns the global setting for &quot;Toolbars transparent when moving&quot;.">transparentSetting</a>() );
<a name="l01915"></a>01915 }
<a name="l01916"></a>01916 
<a name="l01917"></a>01917 <span class="keywordtype">int</span> KToolBar::dockWindowIndex()
<a name="l01918"></a>01918 {
<a name="l01919"></a>01919     <span class="keywordtype">int</span> index = 0;
<a name="l01920"></a>01920     Q_ASSERT( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() );
<a name="l01921"></a>01921     <span class="keywordflow">if</span> ( <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() ) {
<a name="l01922"></a>01922         QMainWindow::ToolBarDock dock;
<a name="l01923"></a>01923         <span class="keywordtype">bool</span> newLine;
<a name="l01924"></a>01924         <span class="keywordtype">int</span> offset;
<a name="l01925"></a>01925         <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;getLocation( <span class="keyword">this</span>, dock, index, newLine, offset );
<a name="l01926"></a>01926     }
<a name="l01927"></a>01927     <span class="keywordflow">return</span> index;
<a name="l01928"></a>01928 }
<a name="l01929"></a>01929 
<a name="l01930"></a>01930 <span class="keywordtype">void</span> KToolBar::getAttributes( <a class="codeRef" href="qstring.html">QString</a> &amp;position, <a class="codeRef" href="qstring.html">QString</a> &amp;icontext, <span class="keywordtype">int</span> &amp;index )
<a name="l01931"></a>01931 {
<a name="l01932"></a>01932     <span class="comment">// get all of the stuff to save</span>
<a name="l01933"></a>01933     <span class="keywordflow">switch</span> ( <a class="code" href="classKToolBar.html#a6223973b27d1192b533d13f521161b92" title="Returns the toolbar position.">barPos</a>() ) {
<a name="l01934"></a>01934     <span class="keywordflow">case</span> KToolBar::Flat:
<a name="l01935"></a>01935         position = <span class="stringliteral">&quot;Flat&quot;</span>;
<a name="l01936"></a>01936         <span class="keywordflow">break</span>;
<a name="l01937"></a>01937     <span class="keywordflow">case</span> KToolBar::Bottom:
<a name="l01938"></a>01938         position = <span class="stringliteral">&quot;Bottom&quot;</span>;
<a name="l01939"></a>01939         <span class="keywordflow">break</span>;
<a name="l01940"></a>01940     <span class="keywordflow">case</span> KToolBar::Left:
<a name="l01941"></a>01941         position = <span class="stringliteral">&quot;Left&quot;</span>;
<a name="l01942"></a>01942         <span class="keywordflow">break</span>;
<a name="l01943"></a>01943     <span class="keywordflow">case</span> KToolBar::Right:
<a name="l01944"></a>01944         position = <span class="stringliteral">&quot;Right&quot;</span>;
<a name="l01945"></a>01945         <span class="keywordflow">break</span>;
<a name="l01946"></a>01946     <span class="keywordflow">case</span> KToolBar::Floating:
<a name="l01947"></a>01947         position = <span class="stringliteral">&quot;Floating&quot;</span>;
<a name="l01948"></a>01948         <span class="keywordflow">break</span>;
<a name="l01949"></a>01949     <span class="keywordflow">case</span> KToolBar::Top:
<a name="l01950"></a>01950     <span class="keywordflow">default</span>:
<a name="l01951"></a>01951         position = <span class="stringliteral">&quot;Top&quot;</span>;
<a name="l01952"></a>01952         <span class="keywordflow">break</span>;
<a name="l01953"></a>01953     }
<a name="l01954"></a>01954 
<a name="l01955"></a>01955     index = dockWindowIndex();
<a name="l01956"></a>01956 
<a name="l01957"></a>01957     <span class="keywordflow">switch</span> (d-&gt;m_iconText) {
<a name="l01958"></a>01958     <span class="keywordflow">case</span> KToolBar::IconTextRight:
<a name="l01959"></a>01959         icontext = <span class="stringliteral">&quot;IconTextRight&quot;</span>;
<a name="l01960"></a>01960         <span class="keywordflow">break</span>;
<a name="l01961"></a>01961     <span class="keywordflow">case</span> KToolBar::IconTextBottom:
<a name="l01962"></a>01962         icontext = <span class="stringliteral">&quot;IconTextBottom&quot;</span>;
<a name="l01963"></a>01963         <span class="keywordflow">break</span>;
<a name="l01964"></a>01964     <span class="keywordflow">case</span> KToolBar::TextOnly:
<a name="l01965"></a>01965         icontext = <span class="stringliteral">&quot;TextOnly&quot;</span>;
<a name="l01966"></a>01966         <span class="keywordflow">break</span>;
<a name="l01967"></a>01967     <span class="keywordflow">case</span> KToolBar::IconOnly:
<a name="l01968"></a>01968     <span class="keywordflow">default</span>:
<a name="l01969"></a>01969         icontext = <span class="stringliteral">&quot;IconOnly&quot;</span>;
<a name="l01970"></a>01970         <span class="keywordflow">break</span>;
<a name="l01971"></a>01971     }
<a name="l01972"></a>01972     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; getAttributes: icontext=&quot; &lt;&lt; icontext &lt;&lt; endl;</span>
<a name="l01973"></a>01973 }
<a name="l01974"></a>01974 
<a name="l01975"></a>01975 <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a6fc9ad28ecce08ecf6af0950ee15f402" title="Instruct the toolbar to save it&#39;s current state to either the app config file or to the XML-GUI resou...">KToolBar::saveState</a>( <a class="codeRef" href="qdomelement.html">QDomElement</a> &amp;current )
<a name="l01976"></a>01976 {
<a name="l01977"></a>01977     Q_ASSERT( !current.isNull() );
<a name="l01978"></a>01978     <a class="codeRef" href="qstring.html">QString</a> position, icontext;
<a name="l01979"></a>01979     <span class="keywordtype">int</span> index = -1;
<a name="l01980"></a>01980     getAttributes( position, icontext, index );
<a name="l01981"></a>01981 
<a name="l01982"></a>01982     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;noMerge&quot;</span>, <span class="stringliteral">&quot;1&quot;</span> );
<a name="l01983"></a>01983     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;position&quot;</span>, position );
<a name="l01984"></a>01984     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;iconText&quot;</span>, icontext );
<a name="l01985"></a>01985     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;index&quot;</span>, index );
<a name="l01986"></a>01986     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;offset&quot;</span>, offset() );
<a name="l01987"></a>01987     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;newline&quot;</span>, newLine() );
<a name="l01988"></a>01988     <span class="keywordflow">if</span> ( isHidden() )
<a name="l01989"></a>01989         current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;hidden&quot;</span>, <span class="stringliteral">&quot;true&quot;</span> );
<a name="l01990"></a>01990     d-&gt;modified = <span class="keyword">true</span>;
<a name="l01991"></a>01991 
<a name="l01992"></a>01992     <span class="comment">// TODO if this method is used by more than KXMLGUIBuilder, e.g. to save XML settings to *disk*,</span>
<a name="l01993"></a>01993     <span class="comment">// then the stuff below shouldn&#39;t always be done.</span>
<a name="l01994"></a>01994     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;offsetDefault&quot;</span>, d-&gt;OffsetDefault );
<a name="l01995"></a>01995     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;newlineDefault&quot;</span>, d-&gt;NewLineDefault );
<a name="l01996"></a>01996     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;hiddenDefault&quot;</span>, d-&gt;HiddenDefault ? <span class="stringliteral">&quot;true&quot;</span> : <span class="stringliteral">&quot;false&quot;</span> );
<a name="l01997"></a>01997     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;iconSizeDefault&quot;</span>, d-&gt;IconSizeDefault );
<a name="l01998"></a>01998     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;positionDefault&quot;</span>, d-&gt;PositionDefault );
<a name="l01999"></a>01999     current.<a class="codeRef" href="qdomelement.html#setAttribute">setAttribute</a>( <span class="stringliteral">&quot;iconTextDefault&quot;</span>, d-&gt;IconTextDefault );
<a name="l02000"></a>02000 
<a name="l02001"></a>02001     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; saveState: saving index=&quot; &lt;&lt; index &lt;&lt; &quot; iconText=&quot; &lt;&lt; icontext &lt;&lt; &quot; hidden=&quot; &lt;&lt; isHidden() &lt;&lt; endl;</span>
<a name="l02002"></a>02002 }
<a name="l02003"></a>02003 
<a name="l02004"></a>02004 <span class="comment">// Called by KMainWindow::finalizeGUI</span>
<a name="l02005"></a><a class="code" href="classKToolBar.html#a3f1aa1189e74f8b6977f3d9dedcd3f7f">02005</a> <span class="keywordtype">void</span> <a class="code" href="classKToolBar.html#a3f1aa1189e74f8b6977f3d9dedcd3f7f">KToolBar::positionYourself</a>( <span class="keywordtype">bool</span> force )
<a name="l02006"></a>02006 {
<a name="l02007"></a>02007     <span class="keywordflow">if</span> (force)
<a name="l02008"></a>02008         d-&gt;positioned = <span class="keyword">false</span>;
<a name="l02009"></a>02009 
<a name="l02010"></a>02010     <span class="keywordflow">if</span> ( d-&gt;positioned || !<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>() )
<a name="l02011"></a>02011     {
<a name="l02012"></a>02012         <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; positionYourself d-&gt;positioned=true  ALREADY DONE&quot; &lt;&lt; endl;</span>
<a name="l02013"></a>02013         <span class="keywordflow">return</span>;
<a name="l02014"></a>02014     }
<a name="l02015"></a>02015     <span class="comment">// we can&#39;t test for ForceHide after moveDockWindow because QDockArea</span>
<a name="l02016"></a>02016     <span class="comment">// does a reparent() with showIt == true</span>
<a name="l02017"></a>02017     <span class="keywordtype">bool</span> hidden = isHidden();
<a name="l02018"></a>02018     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; positionYourself  dock=&quot; &lt;&lt; d-&gt;toolBarInfo.dock &lt;&lt; &quot; newLine=&quot; &lt;&lt; d-&gt;toolBarInfo.newline &lt;&lt; &quot; index=&quot; &lt;&lt; d-&gt;toolBarInfo.index &lt;&lt; &quot; offset=&quot; &lt;&lt; d-&gt;toolBarInfo.offset &lt;&lt; endl;</span>
<a name="l02019"></a>02019     <a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>()-&gt;moveDockWindow( <span class="keyword">this</span>, d-&gt;toolBarInfo.dock,
<a name="l02020"></a>02020                                   d-&gt;toolBarInfo.newline,
<a name="l02021"></a>02021                                   d-&gt;toolBarInfo.index,
<a name="l02022"></a>02022                                   d-&gt;toolBarInfo.offset );
<a name="l02023"></a>02023 
<a name="l02024"></a>02024     <span class="comment">//kdDebug(220) &lt;&lt; name() &lt;&lt; &quot; positionYourself dockWindowIndex=&quot; &lt;&lt; dockWindowIndex() &lt;&lt; endl;</span>
<a name="l02025"></a>02025     <span class="keywordflow">if</span> ( hidden )
<a name="l02026"></a>02026         hide();
<a name="l02027"></a>02027     <span class="keywordflow">else</span>
<a name="l02028"></a>02028         show();
<a name="l02029"></a>02029     <span class="comment">// This method can only have an effect once - unless force is set</span>
<a name="l02030"></a>02030     d-&gt;positioned = <span class="keyword">true</span>;
<a name="l02031"></a>02031 }
<a name="l02032"></a>02032 
<a name="l02033"></a>02033 <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a> *KToolBar::contextMenu()
<a name="l02034"></a>02034 {
<a name="l02035"></a>02035   <span class="keywordflow">if</span> ( context )
<a name="l02036"></a>02036     <span class="keywordflow">return</span> context;
<a name="l02037"></a>02037   <span class="comment">// Construct our context popup menu. Name it qt_dockwidget_internal so it</span>
<a name="l02038"></a>02038   <span class="comment">// won&#39;t be deleted by QToolBar::clear().</span>
<a name="l02039"></a>02039   context = <span class="keyword">new</span> <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a>( <span class="keyword">this</span>, <span class="stringliteral">&quot;qt_dockwidget_internal&quot;</span> );
<a name="l02040"></a>02040   context-&gt;<a class="code" href="classKPopupMenu.html#a3f07d9c1ec99c9e84b8ee07dfdf2c053" title="Inserts a title item with no icon.">insertTitle</a>(i18n(<span class="stringliteral">&quot;Toolbar Menu&quot;</span>));
<a name="l02041"></a>02041 
<a name="l02042"></a>02042   <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a> *orient = <span class="keyword">new</span> <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a>( context, <span class="stringliteral">&quot;orient&quot;</span> );
<a name="l02043"></a>02043   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;toolbar position string&quot;</span>,<span class="stringliteral">&quot;Top&quot;</span>),  CONTEXT_TOP );
<a name="l02044"></a>02044   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;toolbar position string&quot;</span>,<span class="stringliteral">&quot;Left&quot;</span>), CONTEXT_LEFT );
<a name="l02045"></a>02045   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;toolbar position string&quot;</span>,<span class="stringliteral">&quot;Right&quot;</span>), CONTEXT_RIGHT );
<a name="l02046"></a>02046   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;toolbar position string&quot;</span>,<span class="stringliteral">&quot;Bottom&quot;</span>), CONTEXT_BOTTOM );
<a name="l02047"></a>02047   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertSeparator">insertSeparator</a>(-1);
<a name="l02048"></a>02048   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;toolbar position string&quot;</span>,<span class="stringliteral">&quot;Floating&quot;</span>), CONTEXT_FLOAT );
<a name="l02049"></a>02049   orient-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;min toolbar&quot;</span>, <span class="stringliteral">&quot;Flat&quot;</span>), CONTEXT_FLAT );
<a name="l02050"></a>02050 
<a name="l02051"></a>02051   <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a> *mode = <span class="keyword">new</span> <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a>( context, <span class="stringliteral">&quot;mode&quot;</span> );
<a name="l02052"></a>02052   mode-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Icons Only&quot;</span>), CONTEXT_ICONS );
<a name="l02053"></a>02053   mode-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Text Only&quot;</span>), CONTEXT_TEXT );
<a name="l02054"></a>02054   mode-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Text Alongside Icons&quot;</span>), CONTEXT_TEXTRIGHT );
<a name="l02055"></a>02055   mode-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Text Under Icons&quot;</span>), CONTEXT_TEXTUNDER );
<a name="l02056"></a>02056 
<a name="l02057"></a>02057   <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a> *size = <span class="keyword">new</span> <a class="code" href="classKPopupMenu.html" title="A menu with title items.">KPopupMenu</a>( context, <span class="stringliteral">&quot;size&quot;</span> );
<a name="l02058"></a>02058   size-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Default&quot;</span>), CONTEXT_ICONSIZES );
<a name="l02059"></a>02059   <span class="comment">// Query the current theme for available sizes</span>
<a name="l02060"></a>02060   <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconTheme.html">KIconTheme</a> *theme = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGlobal.html#a7005487680376266c61372ea7ff3c080">KGlobal::instance</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html#a2770b5cce2fdb923bf6d2f3a78dbc6a8">iconLoader</a>()-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconLoader.html#aee9215921209fa4b608bfed37b8a72c5">theme</a>();
<a name="l02061"></a>02061   <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;</a> avSizes;
<a name="l02062"></a>02062   <span class="keywordflow">if</span> (theme)
<a name="l02063"></a>02063   {
<a name="l02064"></a>02064       <span class="keywordflow">if</span> (!::qstrcmp(<a class="codeRef" href="qobject.html#name">QObject::name</a>(), <span class="stringliteral">&quot;mainToolBar&quot;</span>))
<a name="l02065"></a>02065           avSizes = theme-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconTheme.html#a3eac9cfb6f8360c2b78bf6e31de56a1b">querySizes</a>( <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82aa93d89e9cb5f184569d0e78f13982a06">KIcon::MainToolbar</a>);
<a name="l02066"></a>02066       <span class="keywordflow">else</span>
<a name="l02067"></a>02067           avSizes = theme-&gt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIconTheme.html#a3eac9cfb6f8360c2b78bf6e31de56a1b">querySizes</a>( <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKIcon.html#a20145b9c0aecf124fadc35cd30c18f82a085b2f483cdfd6158de55aba647318e4">KIcon::Toolbar</a>);
<a name="l02068"></a>02068   }
<a name="l02069"></a>02069 
<a name="l02070"></a>02070   d-&gt;iconSizes = avSizes;
<a name="l02071"></a>02071   qHeapSort(avSizes);
<a name="l02072"></a>02072 
<a name="l02073"></a>02073   <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;::Iterator</a> it;
<a name="l02074"></a>02074   <span class="keywordflow">if</span> (avSizes.<a class="codeRef" href="qvaluelist.html#count">count</a>() &lt; 10) {
<a name="l02075"></a>02075       <span class="comment">// Fixed or threshold type icons</span>
<a name="l02076"></a>02076       <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;::Iterator</a> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/namespaceKStdAccel.html#a8407902cbc74699e1a95168fee54c827">end</a>(avSizes.<a class="codeRef" href="qvaluelist.html#end">end</a>());
<a name="l02077"></a>02077       <span class="keywordflow">for</span> (it=avSizes.<a class="codeRef" href="qvaluelist.html#begin">begin</a>(); it!=<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/namespaceKStdAccel.html#a8407902cbc74699e1a95168fee54c827">end</a>; ++it) {
<a name="l02078"></a>02078           <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a450c58379184615d6694ca8ed7fc0ac0" title="Returns the toolbar&#39;s text.">text</a>;
<a name="l02079"></a>02079           <span class="keywordflow">if</span> ( *it &lt; 19 )
<a name="l02080"></a>02080               text = i18n(<span class="stringliteral">&quot;Small (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02081"></a>02081           <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*it &lt; 25)
<a name="l02082"></a>02082               text = i18n(<span class="stringliteral">&quot;Medium (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02083"></a>02083           <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*it &lt; 35)
<a name="l02084"></a>02084               text = i18n(<span class="stringliteral">&quot;Large (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02085"></a>02085           <span class="keywordflow">else</span>
<a name="l02086"></a>02086               text = i18n(<span class="stringliteral">&quot;Huge (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02087"></a>02087           <span class="comment">//we use the size as an id, with an offset</span>
<a name="l02088"></a>02088           size-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( text, CONTEXT_ICONSIZES + *it );
<a name="l02089"></a>02089       }
<a name="l02090"></a>02090   }
<a name="l02091"></a>02091   <span class="keywordflow">else</span> {
<a name="l02092"></a>02092       <span class="comment">// Scalable icons.</span>
<a name="l02093"></a>02093       <span class="keyword">const</span> <span class="keywordtype">int</span> progression[] = {16, 22, 32, 48, 64, 96, 128, 192, 256};
<a name="l02094"></a>02094 
<a name="l02095"></a>02095       it = avSizes.<a class="codeRef" href="qvaluelist.html#begin">begin</a>();
<a name="l02096"></a>02096       <span class="keywordflow">for</span> (uint i = 0; i &lt; 9; i++) {
<a name="l02097"></a>02097           <span class="keywordflow">while</span> (it++ != avSizes.<a class="codeRef" href="qvaluelist.html#end">end</a>()) {
<a name="l02098"></a>02098               <span class="keywordflow">if</span> (*it &gt;= progression[i]) {
<a name="l02099"></a>02099                   <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKToolBar.html#a450c58379184615d6694ca8ed7fc0ac0" title="Returns the toolbar&#39;s text.">text</a>;
<a name="l02100"></a>02100                   <span class="keywordflow">if</span> ( *it &lt; 19 )
<a name="l02101"></a>02101                       text = i18n(<span class="stringliteral">&quot;Small (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02102"></a>02102                   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*it &lt; 25)
<a name="l02103"></a>02103                       text = i18n(<span class="stringliteral">&quot;Medium (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02104"></a>02104                   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*it &lt; 35)
<a name="l02105"></a>02105                       text = i18n(<span class="stringliteral">&quot;Large (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02106"></a>02106                   <span class="keywordflow">else</span>
<a name="l02107"></a>02107                       text = i18n(<span class="stringliteral">&quot;Huge (%1x%2)&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(*it).arg(*it);
<a name="l02108"></a>02108                   <span class="comment">//we use the size as an id, with an offset</span>
<a name="l02109"></a>02109                   size-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( text, CONTEXT_ICONSIZES + *it );
<a name="l02110"></a>02110                   <span class="keywordflow">break</span>;
<a name="l02111"></a>02111               }
<a name="l02112"></a>02112           }
<a name="l02113"></a>02113       }
<a name="l02114"></a>02114   }
<a name="l02115"></a>02115 
<a name="l02116"></a>02116   context-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Orientation&quot;</span>), orient );
<a name="l02117"></a>02117   orient-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_TOP, <span class="keyword">true</span>);
<a name="l02118"></a>02118   context-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Text Position&quot;</span>), mode );
<a name="l02119"></a>02119   context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_ICONS, <span class="keyword">true</span>);
<a name="l02120"></a>02120   context-&gt;<a class="codeRef" href="qpopupmenu.html#insertItem">insertItem</a>( i18n(<span class="stringliteral">&quot;Icon Size&quot;</span>), size );
<a name="l02121"></a>02121 
<a name="l02122"></a>02122   connect( context, SIGNAL( aboutToShow() ), <span class="keyword">this</span>, SLOT( slotContextAboutToShow() ) );
<a name="l02123"></a>02123   <span class="comment">// Unplugging a submenu from abouttohide leads to the popupmenu floating around</span>
<a name="l02124"></a>02124   <span class="comment">// So better simply call that code from after exec() returns (DF)</span>
<a name="l02125"></a>02125   <span class="comment">//connect( context, SIGNAL( aboutToHide() ), this, SLOT( slotContextAboutToHide() ) );</span>
<a name="l02126"></a>02126   <span class="keywordflow">return</span> context;
<a name="l02127"></a>02127 }
<a name="l02128"></a>02128 
<a name="l02129"></a>02129 <span class="keywordtype">void</span> KToolBar::slotContextAboutToShow()
<a name="l02130"></a>02130 {
<a name="l02131"></a>02131   <span class="comment">// The idea here is to reuse the &quot;static&quot; part of the menu to save time.</span>
<a name="l02132"></a>02132   <span class="comment">// But the &quot;Toolbars&quot; action is dynamic (can be a single action or a submenu)</span>
<a name="l02133"></a>02133   <span class="comment">// and ToolBarHandler::setupActions() deletes it, so better not keep it around.</span>
<a name="l02134"></a>02134   <span class="comment">// So we currently plug/unplug the last two actions of the menu.</span>
<a name="l02135"></a>02135   <span class="comment">// Another way would be to keep around the actions and plug them all into a (new each time) popupmenu.</span>
<a name="l02136"></a>02136   <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l02137"></a>02137   <span class="keywordflow">if</span> ( kmw ) {
<a name="l02138"></a>02138       kmw-&gt;<a class="code" href="classKMainWindow.html#a0d16ed7f0f0c187607d66ad6cde17a69">setupToolbarMenuActions</a>();
<a name="l02139"></a>02139       <span class="comment">// Only allow hiding a toolbar if the action is also plugged somewhere else (e.g. menubar)</span>
<a name="l02140"></a>02140       <a class="code" href="classKAction.html" title="Class to encapsulate user-driven action or event.">KAction</a> *tbAction = kmw-&gt;<a class="code" href="classKMainWindow.html#ae5bbb3fa1dbda76e4ca5eb11d4040d65" title="Returns a pointer to the mainwindows action responsible for the toolbars menu.">toolBarMenuAction</a>();
<a name="l02141"></a>02141       <span class="keywordflow">if</span> ( tbAction &amp;&amp; tbAction-&gt;containerCount() &gt; 0 )
<a name="l02142"></a>02142           tbAction-&gt;<a class="code" href="classKAction.html#a6aee71f8be93189171b2578759980751" title="&quot;Plug&quot; or insert this action into a given widget.">plug</a>(context);
<a name="l02143"></a>02143   }
<a name="l02144"></a>02144 
<a name="l02145"></a>02145   <span class="comment">// try to find &quot;configure toolbars&quot; action</span>
<a name="l02146"></a>02146   <a class="code" href="classKAction.html" title="Class to encapsulate user-driven action or event.">KAction</a> *configureAction = 0;
<a name="l02147"></a>02147   <span class="keyword">const</span> <span class="keywordtype">char</span>* actionName = <a class="code" href="namespaceKStdAction.html#afeceea2c9f84c16ec7b6771f36190b90" title="This will return the internal name of a given standard action.">KStdAction::name</a>(KStdAction::ConfigureToolbars);
<a name="l02148"></a>02148   <span class="keywordflow">if</span> ( d-&gt;m_xmlguiClient )
<a name="l02149"></a>02149     configureAction = d-&gt;m_xmlguiClient-&gt;actionCollection()-&gt;action(actionName);
<a name="l02150"></a>02150   <span class="keywordflow">if</span> ( !configureAction &amp;&amp; kmw )
<a name="l02151"></a>02151     configureAction = kmw-&gt;<a class="code" href="classKXMLGUIClient.html#a7f996e74cc024ccceb6d96fba355b9a0" title="Retrieves the entire action collection for the GUI client.">actionCollection</a>()-&gt;<a class="code" href="classKActionCollection.html#a78b5a9b8e1bd82d6a59fe67501a0fdc8" title="Return the KAction* at position &quot;index&quot; in the action collection.">action</a>(actionName);
<a name="l02152"></a>02152   <span class="keywordflow">if</span> ( configureAction )
<a name="l02153"></a>02153     configureAction-&gt;<a class="code" href="classKAction.html#a6aee71f8be93189171b2578759980751" title="&quot;Plug&quot; or insert this action into a given widget.">plug</a>(context);
<a name="l02154"></a>02154   <a class="code" href="classKEditToolbar.html#a120944edc5122b81dab9e56439f74674" title="Sets the default toolbar, which will be auto-selected when the constructor without the defaultToolbar...">KEditToolbar::setDefaultToolbar</a>(<a class="codeRef" href="qobject.html#name">QObject::name</a>());
<a name="l02155"></a>02155 
<a name="l02156"></a>02156   <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = CONTEXT_ICONS; i &lt;= CONTEXT_TEXTUNDER; ++i)
<a name="l02157"></a>02157     context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(i, <span class="keyword">false</span>);
<a name="l02158"></a>02158 
<a name="l02159"></a>02159   <span class="keywordflow">switch</span>( d-&gt;m_iconText )
<a name="l02160"></a>02160   {
<a name="l02161"></a>02161         <span class="keywordflow">case</span> IconOnly:
<a name="l02162"></a>02162         <span class="keywordflow">default</span>:
<a name="l02163"></a>02163             context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_ICONS, <span class="keyword">true</span>);
<a name="l02164"></a>02164             <span class="keywordflow">break</span>;
<a name="l02165"></a>02165         <span class="keywordflow">case</span> IconTextRight:
<a name="l02166"></a>02166             context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_TEXTRIGHT, <span class="keyword">true</span>);
<a name="l02167"></a>02167             <span class="keywordflow">break</span>;
<a name="l02168"></a>02168         <span class="keywordflow">case</span> TextOnly:
<a name="l02169"></a>02169             context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_TEXT, <span class="keyword">true</span>);
<a name="l02170"></a>02170             <span class="keywordflow">break</span>;
<a name="l02171"></a>02171         <span class="keywordflow">case</span> IconTextBottom:
<a name="l02172"></a>02172             context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>(CONTEXT_TEXTUNDER, <span class="keyword">true</span>);
<a name="l02173"></a>02173             <span class="keywordflow">break</span>;
<a name="l02174"></a>02174   }
<a name="l02175"></a>02175 
<a name="l02176"></a>02176   <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;::ConstIterator</a> iIt = d-&gt;iconSizes.begin();
<a name="l02177"></a>02177   <a class="codeRef" href="qvaluelist.html">QValueList&lt;int&gt;::ConstIterator</a> iEnd = d-&gt;iconSizes.end();
<a name="l02178"></a>02178   <span class="keywordflow">for</span> (; iIt != iEnd; ++iIt )
<a name="l02179"></a>02179       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_ICONSIZES + *iIt, <span class="keyword">false</span> );
<a name="l02180"></a>02180 
<a name="l02181"></a>02181   context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_ICONSIZES, <span class="keyword">false</span> );
<a name="l02182"></a>02182 
<a name="l02183"></a>02183   context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_ICONSIZES + d-&gt;m_iconSize, <span class="keyword">true</span> );
<a name="l02184"></a>02184 
<a name="l02185"></a>02185   <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = CONTEXT_TOP; i &lt;= CONTEXT_FLAT; ++i )
<a name="l02186"></a>02186       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( i, <span class="keyword">false</span> );
<a name="l02187"></a>02187 
<a name="l02188"></a>02188   <span class="keywordflow">switch</span> ( <a class="code" href="classKToolBar.html#a6223973b27d1192b533d13f521161b92" title="Returns the toolbar position.">barPos</a>() )
<a name="l02189"></a>02189   {
<a name="l02190"></a>02190   <span class="keywordflow">case</span> KToolBar::Flat:
<a name="l02191"></a>02191       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_FLAT, <span class="keyword">true</span> );
<a name="l02192"></a>02192       <span class="keywordflow">break</span>;
<a name="l02193"></a>02193   <span class="keywordflow">case</span> KToolBar::Bottom:
<a name="l02194"></a>02194       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_BOTTOM, <span class="keyword">true</span> );
<a name="l02195"></a>02195       <span class="keywordflow">break</span>;
<a name="l02196"></a>02196   <span class="keywordflow">case</span> KToolBar::Left:
<a name="l02197"></a>02197       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_LEFT, <span class="keyword">true</span> );
<a name="l02198"></a>02198       <span class="keywordflow">break</span>;
<a name="l02199"></a>02199   <span class="keywordflow">case</span> KToolBar::Right:
<a name="l02200"></a>02200       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_RIGHT, <span class="keyword">true</span> );
<a name="l02201"></a>02201       <span class="keywordflow">break</span>;
<a name="l02202"></a>02202   <span class="keywordflow">case</span> KToolBar::Floating:
<a name="l02203"></a>02203       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_FLOAT, <span class="keyword">true</span> );
<a name="l02204"></a>02204       <span class="keywordflow">break</span>;
<a name="l02205"></a>02205   <span class="keywordflow">case</span> KToolBar::Top:
<a name="l02206"></a>02206       context-&gt;<a class="codeRef" href="qpopupmenu.html#setItemChecked">setItemChecked</a>( CONTEXT_TOP, <span class="keyword">true</span> );
<a name="l02207"></a>02207       <span class="keywordflow">break</span>;
<a name="l02208"></a>02208   <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
<a name="l02209"></a>02209   }
<a name="l02210"></a>02210 }
<a name="l02211"></a>02211 
<a name="l02212"></a>02212 <span class="keywordtype">void</span> KToolBar::slotContextAboutToHide()
<a name="l02213"></a>02213 {
<a name="l02214"></a>02214   <span class="comment">// We have to unplug whatever slotContextAboutToShow plugged into the menu.</span>
<a name="l02215"></a>02215   <span class="comment">// Unplug the toolbar menu action</span>
<a name="l02216"></a>02216   <a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *kmw = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classKMainWindow.html" title="KDE top level main window">KMainWindow</a> *<span class="keyword">&gt;</span>(<a class="codeRef" href="qtoolbar.html#mainWindow">mainWindow</a>());
<a name="l02217"></a>02217   <span class="keywordflow">if</span> ( kmw &amp;&amp; kmw-&gt;<a class="code" href="classKMainWindow.html#ae5bbb3fa1dbda76e4ca5eb11d4040d65" title="Returns a pointer to the mainwindows action responsible for the toolbars menu.">toolBarMenuAction</a>() )
<a name="l02218"></a>02218     <span class="keywordflow">if</span> ( kmw-&gt;<a class="code" href="classKMainWindow.html#ae5bbb3fa1dbda76e4ca5eb11d4040d65" title="Returns a pointer to the mainwindows action responsible for the toolbars menu.">toolBarMenuAction</a>()-&gt;containerCount() &gt; 1 )
<a name="l02219"></a>02219       kmw-&gt;<a class="code" href="classKMainWindow.html#ae5bbb3fa1dbda76e4ca5eb11d4040d65" title="Returns a pointer to the mainwindows action responsible for the toolbars menu.">toolBarMenuAction</a>()-&gt;<a class="code" href="classKAction.html#accac212cc07184ac4f8ba2cabdba6396" title="&quot;Unplug&quot; or remove this action from a given widget.">unplug</a>(context);
<a name="l02220"></a>02220 
<a name="l02221"></a>02221   <span class="comment">// Unplug the configure toolbars action too, since it&#39;s afterwards anyway</span>
<a name="l02222"></a>02222   <a class="code" href="classKAction.html" title="Class to encapsulate user-driven action or event.">KAction</a> *configureAction = 0;
<a name="l02223"></a>02223   <span class="keyword">const</span> <span class="keywordtype">char</span>* actionName = <a class="code" href="namespaceKStdAction.html#afeceea2c9f84c16ec7b6771f36190b90" title="This will return the internal name of a given standard action.">KStdAction::name</a>(KStdAction::ConfigureToolbars);
<a name="l02224"></a>02224   <span class="keywordflow">if</span> ( d-&gt;m_xmlguiClient )
<a name="l02225"></a>02225     configureAction = d-&gt;m_xmlguiClient-&gt;actionCollection()-&gt;action(actionName);
<a name="l02226"></a>02226   <span class="keywordflow">if</span> ( !configureAction &amp;&amp; kmw )
<a name="l02227"></a>02227     configureAction = kmw-&gt;<a class="code" href="classKXMLGUIClient.html#a7f996e74cc024ccceb6d96fba355b9a0" title="Retrieves the entire action collection for the GUI client.">actionCollection</a>()-&gt;<a class="code" href="classKActionCollection.html#a78b5a9b8e1bd82d6a59fe67501a0fdc8" title="Return the KAction* at position &quot;index&quot; in the action collection.">action</a>(actionName);
<a name="l02228"></a>02228   <span class="keywordflow">if</span> ( configureAction )
<a name="l02229"></a>02229     configureAction-&gt;<a class="code" href="classKAction.html#accac212cc07184ac4f8ba2cabdba6396" title="&quot;Unplug&quot; or remove this action from a given widget.">unplug</a>(context);
<a name="l02230"></a>02230 
<a name="l02231"></a>02231   <a class="codeRef" href="qptrlistiterator.html">QPtrListIterator&lt;QWidget&gt;</a> it( widgets );
<a name="l02232"></a>02232   <a class="codeRef" href="qwidget.html">QWidget</a> *wdg;
<a name="l02233"></a>02233   <span class="keywordflow">while</span> ( ( wdg = it.current() ) != 0 ) {
<a name="l02234"></a>02234     <span class="keywordflow">if</span> ( wdg-&gt;inherits( <span class="stringliteral">&quot;QToolButton&quot;</span> ) )
<a name="l02235"></a>02235       static_cast&lt;QToolButton*&gt;( wdg )-&gt;setDown( <span class="keyword">false</span> );
<a name="l02236"></a>02236     ++it;
<a name="l02237"></a>02237   }
<a name="l02238"></a>02238 }
<a name="l02239"></a>02239 
<a name="l02240"></a>02240 <span class="keywordtype">void</span> KToolBar::widgetDestroyed()
<a name="l02241"></a>02241 {
<a name="l02242"></a>02242     removeWidgetInternal( (<a class="codeRef" href="qwidget.html">QWidget</a>*)sender() );
<a name="l02243"></a>02243 }
<a name="l02244"></a>02244 
<a name="l02245"></a>02245 <span class="keywordtype">void</span> KToolBar::removeWidgetInternal( <a class="codeRef" href="qwidget.html">QWidget</a> * w )
<a name="l02246"></a>02246 {
<a name="l02247"></a>02247     widgets.<a class="codeRef" href="qptrlist.html#removeRef">removeRef</a>( w );
<a name="l02248"></a>02248     <a class="codeRef" href="qmap.html">QMap&lt; QWidget*, int &gt;::Iterator</a> it = widget2id.<a class="codeRef" href="qmap.html#find">find</a>( w );
<a name="l02249"></a>02249     <span class="keywordflow">if</span> ( it == widget2id.<a class="codeRef" href="qmap.html#end">end</a>() )
<a name="l02250"></a>02250         <span class="keywordflow">return</span>;
<a name="l02251"></a>02251     id2widget.<a class="codeRef" href="qmap.html#remove">remove</a>( *it );
<a name="l02252"></a>02252     widget2id.<a class="codeRef" href="qmap.html#remove">remove</a>( it );
<a name="l02253"></a>02253 }
<a name="l02254"></a>02254 
<a name="l02255"></a>02255 <span class="keywordtype">void</span> KToolBar::virtual_hook( <span class="keywordtype">int</span>, <span class="keywordtype">void</span>* )
<a name="l02256"></a>02256 { <span class="comment">/*BASE::virtual_hook( id, data );*/</span> }
<a name="l02257"></a>02257 
<a name="l02258"></a>02258 <span class="preprocessor">#include &quot;ktoolbar.moc&quot;</span>
<a name="l02259"></a>02259 
</pre></div></div>
</div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>kdeui</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul>
<!--
<h2>Class Picker</h2>
<div style="text-align: center;">
<form name="guideform">
<select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option value="annotated.html">-- Choose --</option>
  <option value="classKAboutApplication.html">kaboutapplication</option>,  <option value="classKAboutContainer.html">kaboutcontainer</option>,  <option value="classKAboutContainerBase.html">kaboutcontainerbase</option>,  <option value="classKAboutContributor.html">kaboutcontributor</option>,  <option value="classKAboutDialog.html">kaboutdialog</option>,  <option value="classKAboutKDE.html">kaboutkde</option>,  <option value="classKAboutWidget.html">kaboutwidget</option>,  <option value="classKAccelGen_1_1Deref.html">kaccelgen::deref</option>,  <option value="classKAccelGen_1_1Deref__Key.html">kaccelgen::deref__key</option>,  <option value="classKAction.html">kaction</option>,  <option value="classKActionCollection.html">kactioncollection</option>,  <option value="classKActionMenu.html">kactionmenu</option>,  <option value="classKActionSelector.html">kactionselector</option>,  <option value="classKActiveLabel.html">kactivelabel</option>,  <option value="classKAnimWidget.html">kanimwidget</option>,  <option value="classKArrowButton.html">karrowbutton</option>,  <option value="classKAuthIcon.html">kauthicon</option>,  <option value="classKBugReport.html">kbugreport</option>,  <option value="classKButtonBox.html">kbuttonbox</option>,  <option value="classKCharSelect.html">kcharselect</option>,  <option value="classKCharSelectTable.html">kcharselecttable</option>,  <option value="classKCModule.html">kcmodule</option>,  <option value="classKColor.html">kcolor</option>,  <option value="classKColorButton.html">kcolorbutton</option>,  <option value="classKColorCells.html">kcolorcells</option>,  <option value="classKColorCombo.html">kcolorcombo</option>,  <option value="classKColorDialog.html">kcolordialog</option>,  <option value="classKColorDrag.html">kcolordrag</option>,  <option value="classKColorPatch.html">kcolorpatch</option>,  <option value="classKComboBox.html">kcombobox</option>,  <option value="classKCommand.html">kcommand</option>,  <option value="classKCommandHistory.html">kcommandhistory</option>,  <option value="classKCompletionBox.html">kcompletionbox</option>,  <option value="classKConfigDialog.html">kconfigdialog</option>,  <option value="classKContextMenuManager.html">kcontextmenumanager</option>,  <option value="classKCursor.html">kcursor</option>,  <option value="classKCursorPrivate.html">kcursorprivate</option>,  <option value="classKCursorPrivateAutoHideEventFilter.html">kcursorprivateautohideeventfilter</option>,  <option value="classKDateInternalMonthPicker.html">kdateinternalmonthpicker</option>,  <option value="classKDateInternalWeekSelector.html">kdateinternalweekselector</option>,  <option value="classKDateInternalYearSelector.html">kdateinternalyearselector</option>,  <option value="classKDatePicker.html">kdatepicker</option>,  <option value="classKDateTable.html">kdatetable</option>,  <option value="classKDateTimeWidget.html">kdatetimewidget</option>,  <option value="classKDateValidator.html">kdatevalidator</option>,  <option value="classKDateWidget.html">kdatewidget</option>,  <option value="classKDCOPActionProxy.html">kdcopactionproxy</option>,  <option value="classKDEPrivate_1_1ToolBarHandler.html">kdeprivate::toolbarhandler</option>,  <option value="classKDialog.html">kdialog</option>,  <option value="classKDialogBase.html">kdialogbase</option>,  <option value="classKDialogBaseButton.html">kdialogbasebutton</option>,  <option value="classKDialogBaseTile.html">kdialogbasetile</option>,  <option value="classKDictSpellingHighlighter.html">kdictspellinghighlighter</option>,  <option value="classKDockButton__Private.html">kdockbutton__private</option>,  <option value="classKDockMainWindow.html">kdockmainwindow</option>,  <option value="classKDockManager.html">kdockmanager</option>,  <option value="classKDockSplitter.html">kdocksplitter</option>,  <option value="classKDockTabGroup.html">kdocktabgroup</option>,  <option value="classKDockWidget.html">kdockwidget</option>,  <option value="classKDockWidgetAbstractHeader.html">kdockwidgetabstractheader</option>,  <option value="classKDockWidgetAbstractHeaderDrag.html">kdockwidgetabstractheaderdrag</option>,  <option value="classKDockWidgetHeader.html">kdockwidgetheader</option>,  <option value="classKDockWidgetHeaderDrag.html">kdockwidgetheaderdrag</option>,  <option value="classKDockWidgetPrivate.html">kdockwidgetprivate</option>,  <option value="classKDockWindow.html">kdockwindow</option>,  <option value="classKDoubleNumInput.html">kdoublenuminput</option>,  <option value="classKDoubleSpinBox.html">kdoublespinbox</option>,  <option value="classKDoubleValidator.html">kdoublevalidator</option>,  <option value="classKDualColorButton.html">kdualcolorbutton</option>,  <option value="classKEdit.html">kedit</option>,  <option value="classKEditListBox.html">keditlistbox</option>,  <option value="classKEditListBox_1_1CustomEditor.html">keditlistbox::customeditor</option>,  <option value="classKEditToolbar.html">kedittoolbar</option>,  <option value="classKEditToolbarWidget.html">kedittoolbarwidget</option>,  <option value="classKFloatValidator.html">kfloatvalidator</option>,  <option value="classKFontChooser.html">kfontchooser</option>,  <option value="classKFontCombo.html">kfontcombo</option>,  <option value="classKFontDialog.html">kfontdialog</option>,  <option value="classKFontRequester.html">kfontrequester</option>,  <option value="classKGradientSelector.html">kgradientselector</option>,  <option value="classKGuiItem.html">kguiitem</option>,  <option value="classKHelpMenu.html">khelpmenu</option>,  <option value="classKHistoryCombo.html">khistorycombo</option>,  <option value="classKHSSelector.html">khsselector</option>,  <option value="classKIconView.html">kiconview</option>,  <option value="classKIconViewItem.html">kiconviewitem</option>,  <option value="classKIconViewSearchLine.html">kiconviewsearchline</option>,  <option value="classKImageTrackLabel.html">kimagetracklabel</option>,  <option value="classKInputDialog.html">kinputdialog</option>,  <option value="classKIntNumInput.html">kintnuminput</option>,  <option value="classKIntSpinBox.html">kintspinbox</option>,  <option value="classKIntValidator.html">kintvalidator</option>,  <option value="classKJanusWidget.html">kjanuswidget</option>,  <option value="classKKeyButton.html">kkeybutton</option>,  <option value="classKKeyChooser.html">kkeychooser</option>,  <option value="classKKeyDialog.html">kkeydialog</option>,  <option value="classKLanguageButton.html">klanguagebutton</option>,  <option value="classKLed.html">kled</option>,  <option value="classKLineEdit.html">klineedit</option>,  <option value="classKLineEditDlg.html">klineeditdlg</option>,  <option value="classKListAction.html">klistaction</option>,  <option value="classKListBox.html">klistbox</option>,  <option value="classKListView.html">klistview</option>,  <option value="classKListViewItem.html">klistviewitem</option>,  <option value="classKListViewLineEdit.html">klistviewlineedit</option>,  <option value="classKListViewSearchLine.html">klistviewsearchline</option>,  <option value="classKListViewSearchLineWidget.html">klistviewsearchlinewidget</option>,  <option value="classKMacroCommand.html">kmacrocommand</option>,  <option value="classKMainWindow.html">kmainwindow</option>,  <option value="classKMainWindowInterface.html">kmainwindowinterface</option>,  <option value="classKMenuBar.html">kmenubar</option>,  <option value="classKMessageBox.html">kmessagebox</option>,  <option value="classKMimeTypeValidator.html">kmimetypevalidator</option>,  <option value="classKNamedCommand.html">knamedcommand</option>,  <option value="classKNumInput.html">knuminput</option>,  <option value="classKPaletteTable.html">kpalettetable</option>,  <option value="classKPanelApplet.html">kpanelapplet</option>,  <option value="classKPanelAppMenu.html">kpanelappmenu</option>,  <option value="classKPanelExtension.html">kpanelextension</option>,  <option value="classKPanelMenu.html">kpanelmenu</option>,  <option value="classKPassivePopup.html">kpassivepopup</option>,  <option value="classKPasswordDialog.html">kpassworddialog</option>,  <option value="classKPasswordEdit.html">kpasswordedit</option>,  <option value="classKPasteTextAction.html">kpastetextaction</option>,  <option value="classKPixmapIO.html">kpixmapio</option>,  <option value="classKPixmapRegionSelectorDialog.html">kpixmapregionselectordialog</option>,  <option value="classKPixmapRegionSelectorWidget.html">kpixmapregionselectorwidget</option>,  <option value="classKPopupFrame.html">kpopupframe</option>,  <option value="classKPopupMenu.html">kpopupmenu</option>,  <option value="classKPopupTitle.html">kpopuptitle</option>,  <option value="classKProgress.html">kprogress</option>,  <option value="classKProgressDialog.html">kprogressdialog</option>,  <option value="classKPushButton.html">kpushbutton</option>,  <option value="classKRadioAction.html">kradioaction</option>,  <option value="classKRecentFilesAction.html">krecentfilesaction</option>,  <option value="classKRestrictedLine.html">krestrictedline</option>,  <option value="classKRootPermsIcon.html">krootpermsicon</option>,  <option value="classKRootPixmap.html">krootpixmap</option>,  <option value="classKRuler.html">kruler</option>,  <option value="classKScrollView.html">kscrollview</option>,  <option value="classKSelectAction.html">kselectaction</option>,  <option value="classKSelector.html">kselector</option>,  <option value="classKSeparator.html">kseparator</option>,  <option value="classKShortcutDialog.html">kshortcutdialog</option>,  <option value="classKSpell.html">kspell</option>,  <option value="classKSpellConfig.html">kspellconfig</option>,  <option value="classKSplashScreen.html">ksplashscreen</option>,  <option value="classKSqueezedTextLabel.html">ksqueezedtextlabel</option>,  <option value="classKStatusBar.html">kstatusbar</option>,  <option value="classKStatusBarLabel.html">kstatusbarlabel</option>,  <option value="classKStdGuiItem.html">kstdguiitem</option>,  <option value="classKStringListValidator.html">kstringlistvalidator</option>,  <option value="classKSwitchLanguageDialog.html">kswitchlanguagedialog</option>,  <option value="classKSyntaxHighlighter.html">ksyntaxhighlighter</option>,  <option value="classKSystemTray.html">ksystemtray</option>,  <option value="classKTabBar.html">ktabbar</option>,  <option value="classKTabCtl.html">ktabctl</option>,  <option value="classKTabWidget.html">ktabwidget</option>,  <option value="classKTextBrowser.html">ktextbrowser</option>,  <option value="classKTextEdit.html">ktextedit</option>,  <option value="classKTimeWidget.html">ktimewidget</option>,  <option value="classKTimezoneWidget.html">ktimezonewidget</option>,  <option value="classKTipDatabase.html">ktipdatabase</option>,  <option value="classKTipDialog.html">ktipdialog</option>,  <option value="classKToggleAction.html">ktoggleaction</option>,  <option value="classKToggleFullScreenAction.html">ktogglefullscreenaction</option>,  <option value="classKToggleToolBarAction.html">ktoggletoolbaraction</option>,  <option value="classKToolBar.html">ktoolbar</option>,  <option value="classKToolBarButton.html">ktoolbarbutton</option>,  <option value="classKToolBarButtonList.html">ktoolbarbuttonlist</option>,  <option value="classKToolBarLabelAction.html">ktoolbarlabelaction</option>,  <option value="classKToolBarPopupAction.html">ktoolbarpopupaction</option>,  <option value="classKToolBarRadioGroup.html">ktoolbarradiogroup</option>,  <option value="classKURLLabel.html">kurllabel</option>,  <option value="classKValueSelector.html">kvalueselector</option>,  <option value="classKWidgetAction.html">kwidgetaction</option>,  <option value="classKWindowInfo.html">kwindowinfo</option>,  <option value="classKWizard.html">kwizard</option>,  <option value="classKWordWrap.html">kwordwrap</option>,  <option value="classKWritePermsIcon.html">kwritepermsicon</option>,  <option value="classKXMLGUIBuilder.html">kxmlguibuilder</option>,  <option value="classKXMLGUIClient.html">kxmlguiclient</option>,  <option value="classKXMLGUIFactory.html">kxmlguifactory</option>,  <option value="classKXYSelector.html">kxyselector</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../arts/html/index.html">arts</a></li><li><a href="../../dcop/html/index.html">dcop</a></li><li><a href="../../dnssd/html/index.html">dnssd</a></li><li><a href="../../interfaces/html/index.html">interfaces</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/interface/html/index.html">interface</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/library/html/index.html">library</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/kspeech/html/index.html">kspeech</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/ktexteditor/html/index.html">ktexteditor</a></li><li><a href="../../kabc/html/index.html">kabc</a></li><li><a href="../../kate/html/index.html">kate</a></li><li><a href="../../kcmshell/html/index.html">kcmshell</a></li><li><a href="../../kdecore/html/index.html">kdecore</a></li><li><a href="../../kded/html/index.html">kded</a></li><li><a href="../../kdefx/html/index.html">kdefx</a></li><li><a href="../../kdeprint/html/index.html">kdeprint</a></li><li><a href="../../kdesu/html/index.html">kdesu</a></li><li><a href="../../kdeui/html/index.html">kdeui</a></li><li><a href="../../kdoctools/html/index.html">kdoctools</a></li><li><a href="../../khtml/html/index.html">khtml</a></li><li><a href="../../kimgio/html/index.html">kimgio</a></li><li><a href="../../kinit/html/index.html">kinit</a></li><li><a href="../../kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/bookmarks/html/index.html">bookmarks</a></li><li>&nbsp;&nbsp;<a href="../../kio/httpfilter/html/index.html">httpfilter</a></li><li>&nbsp;&nbsp;<a href="../../kio/kfile/html/index.html">kfile</a></li><li>&nbsp;&nbsp;<a href="../../kio/kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/kioexec/html/index.html">kioexec</a></li><li>&nbsp;&nbsp;<a href="../../kio/kpasswdserver/html/index.html">kpasswdserver</a></li><li>&nbsp;&nbsp;<a href="../../kio/kssl/html/index.html">kssl</a></li><li><a href="../../kioslave/html/index.html">kioslave</a></li><li>&nbsp;&nbsp;<a href="../../kioslave/http/html/index.html">http</a></li><li><a href="../../kjs/html/index.html">kjs</a></li><li><a href="../../kmdi/html/index.html">kmdi</a></li><li>&nbsp;&nbsp;<a href="../../kmdi/kmdi/html/index.html">kmdi</a></li><li><a href="../../knewstuff/html/index.html">knewstuff</a></li><li><a href="../../kparts/html/index.html">kparts</a></li><li><a href="../../kresources/html/index.html">kresources</a></li><li><a href="../../kspell2/html/index.html">kspell2</a></li><li><a href="../../kunittest/html/index.html">kunittest</a></li><li><a href="../../kutils/html/index.html">kutils</a></li><li><a href="../../kwallet/html/index.html">kwallet</a></li><li><a href="../../libkmid/html/index.html">libkmid</a></li><li><a href="../../libkscreensaver/html/index.html">libkscreensaver</a></li>
</ul></div></div>


        </td>
</tr>
</table>

<span class="doNotDisplay">
  <a href="http://www.kde.org/" accesskey="8">KDE Home</a> |
  <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> |
  <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a>
</span>


<div style="height: 8px"></div>

<div id="footer">
  <div id="footer_left">
    Maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">Allen Winter</a>.
<br/>
    KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
    <a href="http://www.kde.org/contact/impressum.php">Legal</a>
  </div>
  <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div>
</div>

<!--
WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL
BE BLOCKED INSTANTLY AND PERMANENTLY!
<a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a>
WARNING END
-->

</body>
</html>