Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3328

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- q3combobox.cpp -->
<head>
  <title>Qt 4.6: Q3ComboBox Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//Q3ComboBox"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Q3ComboBox Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
</h1>
<p>The Q3ComboBox widget is a combined button and popup list. <a href="#details">More...</a></p>
<pre> #include &lt;Q3ComboBox&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qcombobox">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="q3combobox-members.html">List of all members, including inherited members</a></li>
<li><a href="q3combobox-obsolete.html">Obsolete members</a></li>
</ul>
<hr />
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#Policy-enum">Policy</a></b> { NoInsertion, AtTop, AtCurrent, AtBottom, AfterCurrent, BeforeCurrent }</td></tr>
</table>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="q3combobox.html#autoCompletion-prop">autoCompletion</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3combobox.html#count-prop">count</a></b> : const int</div></li>
<li><div class="fn"><b><a href="q3combobox.html#currentItem-prop">currentItem</a></b> : int</div></li>
<li><div class="fn"><b><a href="q3combobox.html#currentText-prop">currentText</a></b> : QString</div></li>
<li><div class="fn"><b><a href="q3combobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> : bool</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="q3combobox.html#editable-prop">editable</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3combobox.html#insertionPolicy-prop">insertionPolicy</a></b> : Policy</div></li>
<li><div class="fn"><b><a href="q3combobox.html#maxCount-prop">maxCount</a></b> : int</div></li>
<li><div class="fn"><b><a href="q3combobox.html#sizeLimit-prop">sizeLimit</a></b> : int</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#Q3ComboBox">Q3ComboBox</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#Q3ComboBox-2">Q3ComboBox</a></b> ( bool <i>rw</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#dtor.Q3ComboBox">~Q3ComboBox</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#autoCompletion-prop">autoCompletion</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#autoResize">autoResize</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#changeItem">changeItem</a></b> ( const QString &amp; <i>t</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#changeItem-2">changeItem</a></b> ( const QPixmap &amp; <i>im</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#changeItem-3">changeItem</a></b> ( const QPixmap &amp; <i>im</i>, const QString &amp; <i>t</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#count-prop">count</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#currentItem-prop">currentItem</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#currentText-prop">currentText</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#editable-prop">editable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#hide">hide</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertItem">insertItem</a></b> ( const QString &amp; <i>t</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertItem-2">insertItem</a></b> ( const QPixmap &amp; <i>pixmap</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertItem-3">insertItem</a></b> ( const QPixmap &amp; <i>pixmap</i>, const QString &amp; <i>text</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertStrList">insertStrList</a></b> ( const char ** <i>strings</i>, int <i>numStrings</i> = -1, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertStrList-2">insertStrList</a></b> ( const Q3StrList &amp; <i>list</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertStrList-3">insertStrList</a></b> ( const Q3StrList * <i>list</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertStringList">insertStringList</a></b> ( const QStringList &amp; <i>list</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Policy </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertionPolicy-prop">insertionPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QLineEdit * </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#lineEdit">lineEdit</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Q3ListBox * </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#listBox">listBox</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#maxCount-prop">maxCount</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const QPixmap * </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#pixmap">pixmap</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#popup">popup</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#removeItem">removeItem</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#autoCompletion-prop">setAutoCompletion</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setAutoResize">setAutoResize</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#currentItem-prop">setCurrentItem</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#currentText-prop">setCurrentText</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#duplicatesEnabled-prop">setDuplicatesEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#editable-prop">setEditable</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setEnabled">setEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setFont">setFont</a></b> ( const QFont &amp; <i>font</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#insertionPolicy-prop">setInsertionPolicy</a></b> ( Policy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setLineEdit">setLineEdit</a></b> ( QLineEdit * <i>edit</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setListBox">setListBox</a></b> ( Q3ListBox * <i>newListBox</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#maxCount-prop">setMaxCount</a></b> ( int )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setPalette">setPalette</a></b> ( const QPalette &amp; <i>palette</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#sizeLimit-prop">setSizeLimit</a></b> ( int )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setValidator">setValidator</a></b> ( const QValidator * <i>v</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#sizeLimit-prop">sizeLimit</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#text">text</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const QValidator * </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#validator">validator</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#clearEdit">clearEdit</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#clearValidator">clearValidator</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#setEditText">setEditText</a></b> ( const QString &amp; <i>newText</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#activated">activated</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#activated-2">activated</a></b> ( const QString &amp; <i>string</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#highlighted">highlighted</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#highlighted-2">highlighted</a></b> ( const QString &amp; <i>string</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#textChanged">textChanged</a></b> ( const QString &amp; <i>string</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#updateMask">updateMask</a></b> ()</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#paintEvent">paintEvent</a></b> ( QPaintEvent * )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combobox.html#wheelEvent">wheelEvent</a></b> ( QWheelEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3ComboBox widget is a combined button and popup list.</p>
<p>A combobox is a selection widget which displays the current item and can pop up a list of items. A combobox may be editable in which case the user can enter arbitrary strings.</p>
<p>Comboboxes provide a means of showing the user's current choice out of a list of options in a way that takes up the minimum amount of screen space.</p>
<p>Q3ComboBox supports three different display styles: Aqua/Motif 1.x, Motif 2.0 and Windows. In Motif 1.x, a combobox was called XmOptionMenu. In Motif 2.0, OSF introduced an improved combobox and named that XmComboBox. Q3ComboBox provides both.</p>
<p>Q3ComboBox provides two different constructors. The simplest constructor creates an &quot;old-style&quot; combobox in Motif (or Aqua) style:</p>
<pre> Q3ComboBox *c = new Q3ComboBox(this, tr(&quot;read-only combobox&quot;));</pre>
<p>The other constructor creates a new-style combobox in Motif style, and can create both read-only and editable comboboxes:</p>
<pre> Q3ComboBox *c1 = new Q3ComboBox(false, this, tr(&quot;read-only combobox&quot;));
 Q3ComboBox *c2 = new Q3ComboBox(true, this, tr(&quot;editable combobox&quot;));</pre>
<p>New-style comboboxes use a list box in both Motif and Windows styles, and both the content size and the on-screen size of the list box can be limited with <a href="q3combobox.html#sizeLimit-prop">sizeLimit</a>() and <a href="q3combobox.html#maxCount-prop">setMaxCount</a>() respectively. Old-style comboboxes use a popup in Aqua and Motif style, and that popup will happily grow larger than the desktop if you put enough data into it.</p>
<p>The two constructors create identical-looking comboboxes in Windows style.</p>
<p>Comboboxes can contain pixmaps as well as strings; the <a href="q3combobox.html#insertItem">insertItem</a>() and <a href="q3combobox.html#changeItem">changeItem</a>() functions are suitably overloaded. For editable comboboxes, the function <a href="q3combobox.html#clearEdit">clearEdit</a>() is provided, to clear the displayed string without changing the combobox's contents.</p>
<p>A combobox emits two signals, <a href="q3combobox.html#activated">activated</a>() and <a href="q3combobox.html#highlighted">highlighted</a>(), when a new item has been activated (selected) or highlighted (made current). Both signals exist in two versions, one with a <tt>QString</tt> argument and one with an <tt>int</tt> argument. If the user highlights or activates a pixmap, only the <tt>int</tt> signals are emitted. Whenever the text of an editable combobox is changed the <a href="q3combobox.html#textChanged">textChanged</a>() signal is emitted.</p>
<p>When the user enters a new string in an editable combobox, the widget may or may not insert it, and it can insert it in several locations. The default policy is is <tt>AtBottom</tt> but you can change this using <a href="q3combobox.html#insertionPolicy-prop">setInsertionPolicy</a>().</p>
<p>It is possible to constrain the input to an editable combobox using <a href="qvalidator.html">QValidator</a>; see <a href="q3combobox.html#setValidator">setValidator</a>(). By default, any input is accepted.</p>
<p>If the combobox is not editable then it has a default <a href="qwidget.html#focusPolicy-prop">focusPolicy</a>() of <tt>TabFocus</tt>, i.e&#x2e; it will not grab focus if clicked. This differs from both Windows and Motif. If the combobox is editable then it has a default <a href="qwidget.html#focusPolicy-prop">focusPolicy</a>() of <tt>StrongFocus</tt>, i.e&#x2e; it will grab focus if clicked.</p>
<p>A combobox can be populated using the insert functions, <a href="q3combobox.html#insertStringList">insertStringList</a>() and <a href="q3combobox.html#insertItem">insertItem</a>() for example. Items can be changed with <a href="q3combobox.html#changeItem">changeItem</a>(). An item can be removed with <a href="q3combobox.html#removeItem">removeItem</a>() and all items can be removed with <a href="q3combobox.html#clear">clear</a>(). The text of the current item is returned by <a href="q3combobox.html#currentText-prop">currentText</a>(), and the text of a numbered item is returned with <a href="q3combobox.html#text">text</a>(). The current item can be set with <a href="q3combobox.html#currentItem-prop">setCurrentItem</a>() or <a href="q3combobox.html#currentText-prop">setCurrentText</a>(). The number of items in the combobox is returned by <a href="q3combobox.html#count-prop">count</a>(); the maximum number of items can be set with <a href="q3combobox.html#maxCount-prop">setMaxCount</a>(). You can allow editing using <a href="q3combobox.html#editable-prop">setEditable</a>(). For editable comboboxes you can set auto-completion using <a href="q3combobox.html#autoCompletion-prop">setAutoCompletion</a>() and whether or not the user can add duplicates is set with <a href="q3combobox.html#duplicatesEnabled-prop">setDuplicatesEnabled</a>().</p>
<p>Depending on the style, Q3ComboBox will use a list box or a popup menu to display the list of items. See <a href="q3combobox.html#setListBox">setListBox</a>() for more information.</p>
<p>{GUI Design Handbook}{GUI Design Handbook: Combo Box, Drop-Down List Box}</p>
<p>See also <a href="qcombobox.html">QComboBox</a>, <a href="qlineedit.html">QLineEdit</a>, and <a href="qspinbox.html">QSpinBox</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<a name="//apple_ref/cpp/tag/Q3ComboBox/Policy"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/NoInsertion"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/AtTop"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/AtCurrent"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/AtBottom"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/AfterCurrent"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/BeforeCurrent"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/NoInsert"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/InsertAtTop"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/InsertAtCurrent"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/InsertAtBottom"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/InsertAfterCurrent"></a>
<a name="//apple_ref/cpp/econst/Q3ComboBox/InsertBeforeCurrent"></a>
<h3 class="fn"><a name="Policy-enum"></a>enum Q3ComboBox::Policy</h3>
<p>This enum specifies what the <a href="q3combobox.html" class="compat">Q3ComboBox</a> should do when a new string is entered by the user.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>Q3ComboBox::NoInsertion</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">the string will not be inserted into the combobox.</td></tr>
<tr><td valign="top"><tt>Q3ComboBox::AtTop</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">insert the string as the first item in the combobox.</td></tr>
<tr><td valign="top"><tt>Q3ComboBox::AtCurrent</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">replace the previously selected item with the string the user has entered.</td></tr>
<tr><td valign="top"><tt>Q3ComboBox::AtBottom</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">insert the string as the last item in the combobox.</td></tr>
<tr><td valign="top"><tt>Q3ComboBox::AfterCurrent</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">insert the string after the previously selected item.</td></tr>
<tr><td valign="top"><tt>Q3ComboBox::BeforeCurrent</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">insert the string before the previously selected item.</td></tr>
</table></p>
<p><a href="q3combobox.html#activated">activated</a>() is always emitted when the string is entered.</p>
<p>If inserting the new string would cause the combobox to breach its content size limit, the item at the other end of the list is deleted. The definition of &quot;other end&quot; is implementation-dependent.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3ComboBox/autoCompletion"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setAutoCompletion"></a>
<h3 class="fn"><a name="autoCompletion-prop"></a>autoCompletion : bool</h3>
<p>This property holds whether auto-completion is enabled.</p>
<p>This property can only be set for editable comboboxes, for non-editable comboboxes it has no effect. It is false by default.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>autoCompletion</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setAutoCompletion</b> ( bool )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/count"></a>
<h3 class="fn"><a name="count-prop"></a>count : const int</h3>
<p>This property holds the number of items in the combobox.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>count</b> () const</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/currentItem"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setCurrentItem"></a>
<h3 class="fn"><a name="currentItem-prop"></a>currentItem : int</h3>
<p>This property holds the index of the current item in the combobox.</p>
<p>Note that the <a href="q3combobox.html#activated">activated</a>() and <a href="q3combobox.html#highlighted">highlighted</a>() signals are only emitted when the user changes the current item, not when it is changed programmatically.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>currentItem</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setCurrentItem</b> ( int <i>index</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/currentText"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setCurrentText"></a>
<h3 class="fn"><a name="currentText-prop"></a>currentText : <a href="qstring.html">QString</a></h3>
<p>This property holds the text of the combobox's current item.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>currentText</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setCurrentText</b> ( const QString &amp; )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/duplicatesEnabled"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setDuplicatesEnabled"></a>
<h3 class="fn"><a name="duplicatesEnabled-prop"></a>duplicatesEnabled : bool</h3>
<p>This property holds whether duplicates are allowed.</p>
<p>If the combobox is editable and the user enters some text in the combobox's lineedit and presses Enter (and the <a href="q3combobox.html#insertionPolicy-prop">insertionPolicy</a>() is not <tt>NoInsertion</tt>), then what happens is this:</p>
<ul>
<li>If the text is not already in the list, the text is inserted.</li>
<li>If the text is in the list and this property is true (the default), the text is inserted.</li>
<li>If the text is in the list and this property is false, the text is <i>not</i> inserted; instead the item which has matching text becomes the current item.</li>
</ul>
<p>This property only affects user-interaction. You can use <a href="q3combobox.html#insertItem">insertItem</a>() to insert duplicates if you wish regardless of this setting.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>duplicatesEnabled</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setDuplicatesEnabled</b> ( bool <i>enable</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/editable"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setEditable"></a>
<h3 class="fn"><a name="editable-prop"></a>editable : bool</h3>
<p>This property holds whether the combobox is editable.</p>
<p>This property's default is false. Note that the combobox will be cleared if this property is set to true for a 1.x Motif style combobox. To avoid this, use setEditable() before inserting any items. Also note that the 1.x version of Motif didn't have any editable comboboxes, so the combobox will change its appearance to a 2.0 style Motif combobox is it is set to be editable.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>editable</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setEditable</b> ( bool )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/insertionPolicy"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setInsertionPolicy"></a>
<h3 class="fn"><a name="insertionPolicy-prop"></a>insertionPolicy : <a href="q3combobox.html#Policy-enum">Policy</a></h3>
<p>This property holds the position of the items inserted by the user.</p>
<p>The default insertion policy is <tt>AtBottom</tt>. See <a href="q3combobox.html#Policy-enum">Policy</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">Policy </td><td class="memItemRight" valign="bottom"><b>insertionPolicy</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setInsertionPolicy</b> ( Policy <i>policy</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/maxCount"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setMaxCount"></a>
<h3 class="fn"><a name="maxCount-prop"></a>maxCount : int</h3>
<p>This property holds the maximum number of items allowed in the combobox.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>maxCount</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setMaxCount</b> ( int )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ComboBox/sizeLimit"></a>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setSizeLimit"></a>
<h3 class="fn"><a name="sizeLimit-prop"></a>sizeLimit : int</h3>
<p>This property holds the maximum on-screen size of the combobox.</p>
<p>This property is ignored for both Motif 1.x style and non-editable comboboxes in Mac style. The default limit is ten lines. If the number of items in the combobox is or grows larger than lines, a scroll bar is added.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>sizeLimit</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setSizeLimit</b> ( int )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3ComboBox/Q3ComboBox"></a>
<h3 class="fn"><a name="Q3ComboBox"></a>Q3ComboBox::Q3ComboBox ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a combobox widget with parent <i>parent</i> called <i>name</i>.</p>
<p>This constructor creates a popup list if the program uses Motif (or Aqua) look and feel; this is compatible with Motif 1.x and Aqua.</p>
<p>Note: If you use this constructor to create your <a href="q3combobox.html" class="compat">Q3ComboBox</a>, then the <a href="q3combobox.html#pixmap">pixmap</a>() function will always return 0. To workaround this, use the other constructor.</p>
<h3 class="fn"><a name="Q3ComboBox-2"></a>Q3ComboBox::Q3ComboBox ( bool <i>rw</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a combobox with a maximum size and either Motif 2.0 or Windows look and feel.</p>
<p>The input field can be edited if <i>rw</i> is true, otherwise the user may only choose one of the items in the combobox.</p>
<p>The <i>parent</i> and <i>name</i> arguments are passed on to the <a href="qwidget.html">QWidget</a> constructor.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/~Q3ComboBox"></a>
<h3 class="fn"><a name="dtor.Q3ComboBox"></a>Q3ComboBox::~Q3ComboBox ()</h3>
<p>Destroys the combobox.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/activated"></a>
<h3 class="fn"><a name="activated"></a>void Q3ComboBox::activated ( int <i>index</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when a new item has been activated (selected). The <i>index</i> is the position of the item in the combobox.</p>
<p>This signal is not emitted if the item is changed programmatically, e.g&#x2e; using <a href="q3combobox.html#currentItem-prop">setCurrentItem</a>().</p>
<h3 class="fn"><a name="activated-2"></a>void Q3ComboBox::activated ( const <a href="qstring.html">QString</a> &amp; <i>string</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This is an overloaded function.</p>
<p>This signal is emitted when a new item has been activated (selected). <i>string</i> is the selected string.</p>
<p>You can also use the activated(int) signal, but be aware that its argument is meaningful only for selected strings, not for user entered strings.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/autoResize"></a>
<h3 class="fn"><a name="autoResize"></a>bool Q3ComboBox::autoResize () const</h3>
<p>Returns true if auto-resize is enabled; otherwise returns false.</p>
<p>See also <a href="q3combobox.html#setAutoResize">setAutoResize</a>() and <a href="q3combobox-obsolete.html#autoResize-prop" class="obsolete">autoResize</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/changeItem"></a>
<h3 class="fn"><a name="changeItem"></a>void Q3ComboBox::changeItem ( const <a href="qstring.html">QString</a> &amp; <i>t</i>, int <i>index</i> )</h3>
<p>Replaces the item at position <i>index</i> with the text <i>t</i>.</p>
<h3 class="fn"><a name="changeItem-2"></a>void Q3ComboBox::changeItem ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>im</i>, int <i>index</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces the item at position <i>index</i> with the pixmap <i>im</i>, unless the combobox is editable.</p>
<p>See also <a href="q3combobox.html#insertItem">insertItem</a>().</p>
<h3 class="fn"><a name="changeItem-3"></a>void Q3ComboBox::changeItem ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>im</i>, const <a href="qstring.html">QString</a> &amp; <i>t</i>, int <i>index</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces the item at position <i>index</i> with the pixmap <i>im</i> and the text <i>t</i>.</p>
<p>See also <a href="q3combobox.html#insertItem">insertItem</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/clear"></a>
<h3 class="fn"><a name="clear"></a>void Q3ComboBox::clear ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Removes all combobox items.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/clearEdit"></a>
<h3 class="fn"><a name="clearEdit"></a>void Q3ComboBox::clearEdit ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Clears the line edit without changing the combobox's contents. Does nothing if the combobox isn't editable.</p>
<p>This is particularly useful when using a combobox as a line edit with history. For example you can connect the combobox's <a href="q3combobox.html#activated">activated</a>() signal to clearEdit() in order to present the user with a new, empty line as soon as Enter is pressed.</p>
<p>See also <a href="q3combobox.html#setEditText">setEditText</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/clearValidator"></a>
<h3 class="fn"><a name="clearValidator"></a>void Q3ComboBox::clearValidator ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>This slot is equivalent to setValidator( 0 ).</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/focusInEvent"></a>
<h3 class="fn"><a name="focusInEvent"></a>void Q3ComboBox::focusInEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/focusOutEvent"></a>
<h3 class="fn"><a name="focusOutEvent"></a>void Q3ComboBox::focusOutEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/hide"></a>
<h3 class="fn"><a name="hide"></a>void Q3ComboBox::hide ()</h3>
<p>Hides the combobox.</p>
<p>See also <a href="qwidget.html#hide">QWidget::hide</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/highlighted"></a>
<h3 class="fn"><a name="highlighted"></a>void Q3ComboBox::highlighted ( int <i>index</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when a new item has been set to be the current item. The <i>index</i> is the position of the item in the combobox.</p>
<p>This signal is not emitted if the item is changed programmatically, e.g&#x2e; using <a href="q3combobox.html#currentItem-prop">setCurrentItem</a>().</p>
<h3 class="fn"><a name="highlighted-2"></a>void Q3ComboBox::highlighted ( const <a href="qstring.html">QString</a> &amp; <i>string</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This is an overloaded function.</p>
<p>This signal is emitted when a new item has been set to be the current item. <i>string</i> is the item's text.</p>
<p>You can also use the highlighted(int) signal.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/insertItem"></a>
<h3 class="fn"><a name="insertItem"></a>void Q3ComboBox::insertItem ( const <a href="qstring.html">QString</a> &amp; <i>t</i>, int <i>index</i> = -1 )</h3>
<p>Inserts a text item with text <i>t</i>, at position <i>index</i>. The item will be appended if <i>index</i> is negative.</p>
<h3 class="fn"><a name="insertItem-2"></a>void Q3ComboBox::insertItem ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i>, int <i>index</i> = -1 )</h3>
<p>This is an overloaded function.</p>
<p>Inserts a <i>pixmap</i> item at position <i>index</i>. The item will be appended if <i>index</i> is negative.</p>
<h3 class="fn"><a name="insertItem-3"></a>void Q3ComboBox::insertItem ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i>, const <a href="qstring.html">QString</a> &amp; <i>text</i>, int <i>index</i> = -1 )</h3>
<p>This is an overloaded function.</p>
<p>Inserts a <i>pixmap</i> item with additional text <i>text</i> at position <i>index</i>. The item will be appended if <i>index</i> is negative.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/insertStrList"></a>
<h3 class="fn"><a name="insertStrList"></a>void Q3ComboBox::insertStrList ( const char ** <i>strings</i>, int <i>numStrings</i> = -1, int <i>index</i> = -1 )</h3>
<p>Inserts the array of char * <i>strings</i> at position <i>index</i> in the combobox.</p>
<p>The <i>numStrings</i> argument is the number of strings. If <i>numStrings</i> is -1 (default), the <i>strings</i> array must be terminated with 0.</p>
<p>Example:</p>
<pre> static const char* items[] = { &quot;red&quot;, &quot;green&quot;, &quot;blue&quot;, 0 };
 combo-&gt;insertStrList( items );</pre>
<p>See also <a href="q3combobox.html#insertStringList">insertStringList</a>().</p>
<h3 class="fn"><a name="insertStrList-2"></a>void Q3ComboBox::insertStrList ( const <a href="q3strlist.html">Q3StrList</a> &amp; <i>list</i>, int <i>index</i> = -1 )</h3>
<p>This is an overloaded function.</p>
<p>Inserts the <i>list</i> of strings at position <i>index</i> in the combobox.</p>
<p>This is only for compatibility since it does not support Unicode strings. See <a href="q3combobox.html#insertStringList">insertStringList</a>().</p>
<h3 class="fn"><a name="insertStrList-3"></a>void Q3ComboBox::insertStrList ( const <a href="q3strlist.html">Q3StrList</a> * <i>list</i>, int <i>index</i> = -1 )</h3>
<p>This is an overloaded function.</p>
<p>Inserts the <i>list</i> of strings at position <i>index</i> in the combobox.</p>
<p>This is only for compatibility since it does not support Unicode strings. See <a href="q3combobox.html#insertStringList">insertStringList</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/insertStringList"></a>
<h3 class="fn"><a name="insertStringList"></a>void Q3ComboBox::insertStringList ( const <a href="qstringlist.html">QStringList</a> &amp; <i>list</i>, int <i>index</i> = -1 )</h3>
<p>Inserts the <i>list</i> of strings at position <i>index</i> in the combobox.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/keyPressEvent"></a>
<h3 class="fn"><a name="keyPressEvent"></a>void Q3ComboBox::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/lineEdit"></a>
<h3 class="fn"><a name="lineEdit"></a><a href="qlineedit.html">QLineEdit</a> * Q3ComboBox::lineEdit () const</h3>
<p>Returns the line edit, or 0 if there is no line edit.</p>
<p>Only editable listboxes have a line editor.</p>
<p>See also <a href="q3combobox.html#setLineEdit">setLineEdit</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/listBox"></a>
<h3 class="fn"><a name="listBox"></a><a href="q3listbox.html">Q3ListBox</a> * Q3ComboBox::listBox () const</h3>
<p>Returns the current list box, or 0 if there is no list box. (<a href="q3combobox.html" class="compat">Q3ComboBox</a> can use <a href="porting4.html#qpopupmenu">QPopupMenu</a> instead of <a href="porting4.html#qlistbox">QListBox</a>.) Provided to match <a href="q3combobox.html#setListBox">setListBox</a>().</p>
<p>See also <a href="q3combobox.html#setListBox">setListBox</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/mouseDoubleClickEvent"></a>
<h3 class="fn"><a name="mouseDoubleClickEvent"></a>void Q3ComboBox::mouseDoubleClickEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget::mouseDoubleClickEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/mouseMoveEvent"></a>
<h3 class="fn"><a name="mouseMoveEvent"></a>void Q3ComboBox::mouseMoveEvent ( <a href="qmouseevent.html">QMouseEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/mousePressEvent"></a>
<h3 class="fn"><a name="mousePressEvent"></a>void Q3ComboBox::mousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/mouseReleaseEvent"></a>
<h3 class="fn"><a name="mouseReleaseEvent"></a>void Q3ComboBox::mouseReleaseEvent ( <a href="qmouseevent.html">QMouseEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/paintEvent"></a>
<h3 class="fn"><a name="paintEvent"></a>void Q3ComboBox::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/pixmap"></a>
<h3 class="fn"><a name="pixmap"></a>const <a href="qpixmap.html">QPixmap</a> * Q3ComboBox::pixmap ( int <i>index</i> ) const</h3>
<p>Returns the pixmap item at position <i>index</i>, or 0 if the item is not a pixmap.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/popup"></a>
<h3 class="fn"><a name="popup"></a>void Q3ComboBox::popup ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Pops up the combobox popup list.</p>
<p>If the list is empty, no items appear.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/removeItem"></a>
<h3 class="fn"><a name="removeItem"></a>void Q3ComboBox::removeItem ( int <i>index</i> )</h3>
<p>Removes the item at position <i>index</i>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/resizeEvent"></a>
<h3 class="fn"><a name="resizeEvent"></a>void Q3ComboBox::resizeEvent ( <a href="qresizeevent.html">QResizeEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setAutoResize"></a>
<h3 class="fn"><a name="setAutoResize"></a>void Q3ComboBox::setAutoResize ( bool <i>enable</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>If <i>enable</i> is true, enable auto-resize; disable it otherwise.</p>
<p>See also <a href="q3combobox-obsolete.html#autoResize-prop" class="obsolete">autoResize</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setEditText"></a>
<h3 class="fn"><a name="setEditText"></a>void Q3ComboBox::setEditText ( const <a href="qstring.html">QString</a> &amp; <i>newText</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Sets the text in the line edit to <i>newText</i> without changing the combobox's contents. Does nothing if the combobox isn't editable.</p>
<p>This is useful e.g&#x2e; for providing a good starting point for the user's editing and entering the change in the combobox only when the user presses Enter.</p>
<p>See also <a href="q3combobox.html#clearEdit">clearEdit</a>() and <a href="q3combobox.html#insertItem">insertItem</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setEnabled"></a>
<h3 class="fn"><a name="setEnabled"></a>void Q3ComboBox::setEnabled ( bool <i>enable</i> )</h3>
<p>Enables the combobox if <i>enable</i> is true; otherwise disables it.</p>
<p>See also <a href="qwidget.html#enabled-prop">QWidget::enabled</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setFont"></a>
<h3 class="fn"><a name="setFont"></a>void Q3ComboBox::setFont ( const <a href="qfont.html">QFont</a> &amp; <i>font</i> )</h3>
<p>Sets the font for both the combobox button and the combobox popup list to <i>font</i>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setLineEdit"></a>
<h3 class="fn"><a name="setLineEdit"></a>void Q3ComboBox::setLineEdit ( <a href="qlineedit.html">QLineEdit</a> * <i>edit</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the line edit to use <i>edit</i> instead of the current line edit.</p>
<p>See also <a href="q3combobox.html#lineEdit">lineEdit</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setListBox"></a>
<h3 class="fn"><a name="setListBox"></a>void Q3ComboBox::setListBox ( <a href="q3listbox.html">Q3ListBox</a> * <i>newListBox</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the combobox to use <i>newListBox</i> instead of the current list box or popup. As a side effect, it clears the combobox of its current contents.</p>
<p><b>Warning:</b> <a href="q3combobox.html" class="compat">Q3ComboBox</a> assumes that newListBox-&gt;text(n) returns non-null for 0 &lt;= n &lt; newListbox-&gt;<a href="q3combobox.html#count-prop">count</a>(). This assumption is necessary because of the line edit in <a href="q3combobox.html" class="compat">Q3ComboBox</a>.</p>
<p>See also <a href="q3combobox.html#listBox">listBox</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setPalette"></a>
<h3 class="fn"><a name="setPalette"></a>void Q3ComboBox::setPalette ( const <a href="qpalette.html">QPalette</a> &amp; <i>palette</i> )</h3>
<p>Sets the palette for both the combobox button and the combobox popup list to <i>palette</i>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/setValidator"></a>
<h3 class="fn"><a name="setValidator"></a>void Q3ComboBox::setValidator ( const <a href="qvalidator.html">QValidator</a> * <i>v</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Applies the validator <i>v</i> to the combobox so that only text which is valid according to <i>v</i> is accepted.</p>
<p>This function does nothing if the combobox is not editable.</p>
<p>See also <a href="q3combobox.html#validator">validator</a>(), <a href="q3combobox.html#clearValidator">clearValidator</a>(), and <a href="qvalidator.html">QValidator</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/sizeHint"></a>
<h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> Q3ComboBox::sizeHint () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<p>This implementation caches the size hint to avoid resizing when the contents change dynamically. To invalidate the cached value call <a href="q3combobox.html#setFont">setFont</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/text"></a>
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> Q3ComboBox::text ( int <i>index</i> ) const</h3>
<p>Returns the text item at position <i>index</i>, or <a href="qstring.html#null-var">QString::null</a> if the item is not a string.</p>
<p>See also <a href="q3combobox.html#currentText-prop">currentText</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/textChanged"></a>
<h3 class="fn"><a name="textChanged"></a>void Q3ComboBox::textChanged ( const <a href="qstring.html">QString</a> &amp; <i>string</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is used for editable comboboxes. It is emitted whenever the contents of the text entry field changes. <i>string</i> contains the new text.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/updateMask"></a>
<h3 class="fn"><a name="updateMask"></a>void Q3ComboBox::updateMask ()&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Updates the widget mask.</p>
<p>See also <a href="qwidget.html#setMask">QWidget::setMask</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/validator"></a>
<h3 class="fn"><a name="validator"></a>const <a href="qvalidator.html">QValidator</a> * Q3ComboBox::validator () const</h3>
<p>Returns the validator which constrains editing for this combobox if there is one; otherwise returns 0.</p>
<p>See also <a href="q3combobox.html#setValidator">setValidator</a>(), <a href="q3combobox.html#clearValidator">clearValidator</a>(), and <a href="qvalidator.html">QValidator</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboBox/wheelEvent"></a>
<h3 class="fn"><a name="wheelEvent"></a>void Q3ComboBox::wheelEvent ( <a href="qwheelevent.html">QWheelEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>