Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4974

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcombobox.cpp -->
  <title>Qt 4.8: QComboBox Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QComboBox</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QComboBox Class Reference</h1>
<!-- $$$QComboBox-brief -->
<p>The QComboBox widget is a combined button and popup list. <a href="#details">More...</a></p>
<!-- @@@QComboBox -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QComboBox&gt;</span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p>
<p><b>Inherited by: </b><a href="qfontcombobox.html">QFontComboBox</a>.</p>
<ul>
<li><a href="qcombobox-members.html">List of all members, including inherited members</a></li>
<li><a href="qcombobox-obsolete.html">Obsolete members</a></li>
<li><a href="qcombobox-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#InsertPolicy-enum">InsertPolicy</a></b> { NoInsert, InsertAtTop, InsertAtCurrent, InsertAtBottom, ..., InsertAlphabetically }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#SizeAdjustPolicy-enum">SizeAdjustPolicy</a></b> { AdjustToContents, AdjustToContentsOnFirstShow, AdjustToMinimumContentsLength, AdjustToMinimumContentsLengthWithIcon }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qcombobox.html#count-prop">count</a></b> : const int</li>
<li class="fn"><b><a href="qcombobox.html#currentIndex-prop">currentIndex</a></b> : int</li>
<li class="fn"><b><a href="qcombobox.html#currentText-prop">currentText</a></b> : const QString</li>
<li class="fn"><b><a href="qcombobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qcombobox.html#editable-prop">editable</a></b> : bool</li>
<li class="fn"><b><a href="qcombobox.html#frame-prop">frame</a></b> : bool</li>
<li class="fn"><b><a href="qcombobox.html#iconSize-prop">iconSize</a></b> : QSize</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qcombobox.html#insertPolicy-prop">insertPolicy</a></b> : InsertPolicy</li>
<li class="fn"><b><a href="qcombobox.html#maxCount-prop">maxCount</a></b> : int</li>
<li class="fn"><b><a href="qcombobox.html#maxVisibleItems-prop">maxVisibleItems</a></b> : int</li>
<li class="fn"><b><a href="qcombobox.html#minimumContentsLength-prop">minimumContentsLength</a></b> : int</li>
<li class="fn"><b><a href="qcombobox.html#modelColumn-prop">modelColumn</a></b> : int</li>
<li class="fn"><b><a href="qcombobox.html#sizeAdjustPolicy-prop">sizeAdjustPolicy</a></b> : SizeAdjustPolicy</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#QComboBox">QComboBox</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#dtor.QComboBox">~QComboBox</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#addItem">addItem</a></b> ( const QString &amp; <i>text</i>, const QVariant &amp; <i>userData</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#addItem-2">addItem</a></b> ( const QIcon &amp; <i>icon</i>, const QString &amp; <i>text</i>, const QVariant &amp; <i>userData</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#addItems">addItems</a></b> ( const QStringList &amp; <i>texts</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCompleter * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#completer">completer</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#count-prop">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#currentIndex-prop">currentIndex</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#currentText-prop">currentText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#findData">findData</a></b> ( const QVariant &amp; <i>data</i>, int <i>role</i> = Qt::UserRole, Qt::MatchFlags <i>flags</i> = static_cast&lt;Qt::MatchFlags&gt; ( Qt::MatchExactly | Qt::MatchCaseSensitive ) ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#findText">findText</a></b> ( const QString &amp; <i>text</i>, Qt::MatchFlags <i>flags</i> = static_cast&lt;Qt::MatchFlags&gt; ( Qt::MatchExactly | Qt::MatchCaseSensitive ) ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#frame-prop">hasFrame</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#hidePopup">hidePopup</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#iconSize-prop">iconSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertItem">insertItem</a></b> ( int <i>index</i>, const QString &amp; <i>text</i>, const QVariant &amp; <i>userData</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertItem-2">insertItem</a></b> ( int <i>index</i>, const QIcon &amp; <i>icon</i>, const QString &amp; <i>text</i>, const QVariant &amp; <i>userData</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertItems">insertItems</a></b> ( int <i>index</i>, const QStringList &amp; <i>list</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> InsertPolicy </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertPolicy-prop">insertPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertSeparator">insertSeparator</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#editable-prop">isEditable</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#itemData">itemData</a></b> ( int <i>index</i>, int <i>role</i> = Qt::UserRole ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractItemDelegate * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#itemDelegate">itemDelegate</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#itemIcon">itemIcon</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#itemText">itemText</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QLineEdit * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#lineEdit">lineEdit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#maxCount-prop">maxCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#maxVisibleItems-prop">maxVisibleItems</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#minimumContentsLength-prop">minimumContentsLength</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractItemModel * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#model">model</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#modelColumn-prop">modelColumn</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#removeItem">removeItem</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#rootModelIndex">rootModelIndex</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setCompleter">setCompleter</a></b> ( QCompleter * <i>completer</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#duplicatesEnabled-prop">setDuplicatesEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#editable-prop">setEditable</a></b> ( bool <i>editable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#frame-prop">setFrame</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#iconSize-prop">setIconSize</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#insertPolicy-prop">setInsertPolicy</a></b> ( InsertPolicy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setItemData">setItemData</a></b> ( int <i>index</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::UserRole )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setItemDelegate">setItemDelegate</a></b> ( QAbstractItemDelegate * <i>delegate</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setItemIcon">setItemIcon</a></b> ( int <i>index</i>, const QIcon &amp; <i>icon</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setItemText">setItemText</a></b> ( int <i>index</i>, const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setLineEdit">setLineEdit</a></b> ( QLineEdit * <i>edit</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#maxCount-prop">setMaxCount</a></b> ( int <i>max</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#maxVisibleItems-prop">setMaxVisibleItems</a></b> ( int <i>maxItems</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#minimumContentsLength-prop">setMinimumContentsLength</a></b> ( int <i>characters</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setModel">setModel</a></b> ( QAbstractItemModel * <i>model</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#modelColumn-prop">setModelColumn</a></b> ( int <i>visibleColumn</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setRootModelIndex">setRootModelIndex</a></b> ( const QModelIndex &amp; <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#sizeAdjustPolicy-prop">setSizeAdjustPolicy</a></b> ( SizeAdjustPolicy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setValidator">setValidator</a></b> ( const QValidator * <i>validator</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setView">setView</a></b> ( QAbstractItemView * <i>itemView</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#showPopup">showPopup</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> SizeAdjustPolicy </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#sizeAdjustPolicy-prop">sizeAdjustPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QValidator * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#validator">validator</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractItemView * </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#view">view</a></b> () const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#minimumSizeHint">minimumSizeHint</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#clearEditText">clearEditText</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#currentIndex-prop">setCurrentIndex</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#setEditText">setEditText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#activated">activated</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#activated-2">activated</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#currentIndexChanged-2">currentIndexChanged</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#editTextChanged">editTextChanged</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#highlighted">highlighted</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#highlighted-2">highlighted</a></b> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#initStyleOption">initStyleOption</a></b> ( QStyleOptionComboBox * <i>option</i> ) const</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#changeEvent">changeEvent</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#contextMenuEvent">contextMenuEvent</a></b> ( QContextMenuEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#hideEvent">hideEvent</a></b> ( QHideEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#inputMethodEvent">inputMethodEvent</a></b> ( QInputMethodEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#inputMethodQuery">inputMethodQuery</a></b> ( Qt::InputMethodQuery <i>query</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#keyReleaseEvent">keyReleaseEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#showEvent">showEvent</a></b> ( QShowEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qcombobox.html#wheelEvent">wheelEvent</a></b> ( QWheelEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QComboBox-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QComboBox widget is a combined button and popup list.</p>
<p>A QComboBox provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.</p>
<p>A combobox is a selection widget that displays the current item, and can pop up a list of selectable items. A combobox may be editable, allowing the user to modify each item in the list.</p>
<p>Comboboxes can contain pixmaps as well as strings; the <a href="qcombobox.html#insertItem">insertItem</a>() and <a href="qcombobox.html#setItemText">setItemText</a>() functions are suitably overloaded. For editable comboboxes, the function <a href="qcombobox.html#clearEditText">clearEditText</a>() is provided, to clear the displayed string without changing the combobox's contents.</p>
<p>There are two signals emitted if the current item of a combobox changes, <a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a>() and <a href="qcombobox.html#activated">activated</a>(). <a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a>() is always emitted regardless if the change was done programmatically or by user interaction, while <a href="qcombobox.html#activated">activated</a>() is only emitted when the change is caused by user interaction. The <a href="qcombobox.html#highlighted">highlighted</a>() signal is emitted when the user highlights an item in the combobox popup list. All three signals exist in two versions, one with a <a href="qstring.html">QString</a> argument and one with an <tt>int</tt> argument. If the user selects or highlights a pixmap, only the <tt>int</tt> signals are emitted. Whenever the text of an editable combobox is changed the <a href="qcombobox.html#editTextChanged">editTextChanged</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 <a href="qcombobox.html#InsertPolicy-enum">AtBottom</a> but you can change this using <a href="qcombobox.html#insertPolicy-prop">setInsertPolicy</a>().</p>
<p>It is possible to constrain the input to an editable combobox using <a href="qvalidator.html">QValidator</a>; see <a href="qcombobox.html#setValidator">setValidator</a>(). By default, any input is accepted.</p>
<p>A combobox can be populated using the insert functions, <a href="qcombobox.html#insertItem">insertItem</a>() and <a href="qcombobox.html#insertItems">insertItems</a>() for example. Items can be changed with <a href="qcombobox.html#setItemText">setItemText</a>(). An item can be removed with <a href="qcombobox.html#removeItem">removeItem</a>() and all items can be removed with <a href="qcombobox.html#clear">clear</a>(). The text of the current item is returned by <a href="qcombobox.html#currentText-prop">currentText</a>(), and the text of a numbered item is returned with <a href="qcombobox-qt3.html#text" class="compat">text</a>(). The current item can be set with <a href="qcombobox.html#currentIndex-prop">setCurrentIndex</a>(). The number of items in the combobox is returned by <a href="qcombobox.html#count-prop">count</a>(); the maximum number of items can be set with <a href="qcombobox.html#maxCount-prop">setMaxCount</a>(). You can allow editing using <a href="qcombobox.html#editable-prop">setEditable</a>(). For editable comboboxes you can set auto-completion using <a href="qcombobox.html#setCompleter">setCompleter</a>() and whether or not the user can add duplicates is set with <a href="qcombobox.html#duplicatesEnabled-prop">setDuplicatesEnabled</a>().</p>
<p>QComboBox uses the <a href="model-view-programming.html">model/view framework</a> for its popup list and to store its items. By default a <a href="qstandarditemmodel.html">QStandardItemModel</a> stores the items and a <a href="qlistview.html">QListView</a> subclass displays the popuplist. You can access the model and view directly (with <a href="qcombobox.html#model">model</a>() and <a href="qcombobox.html#view">view</a>()), but QComboBox also provides functions to set and get item data (e.g&#x2e;, <a href="qcombobox.html#setItemData">setItemData</a>() and <a href="qcombobox.html#itemText">itemText</a>()). You can also set a new model and view (with <a href="qcombobox.html#setModel">setModel</a>() and <a href="qcombobox.html#setView">setView</a>()). For the text and icon in the combobox label, the data in the model that has the <a href="qt.html#ItemDataRole-enum">Qt::DisplayRole</a> and <a href="qt.html#ItemDataRole-enum">Qt::DecorationRole</a> is used. Note that you cannot alter the <a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a> of the <a href="qcombobox.html#view">view</a>(), e.g&#x2e;, by using <a href="qabstractitemview.html#selectionMode-prop">setSelectionMode()</a>.</p>
<p class="centerAlign"><img src="images/qstyle-comboboxes.png" alt="Comboboxes in the different built-in styles." /></p></div>
<p><b>See also </b><a href="qlineedit.html">QLineEdit</a>, <a href="qspinbox.html">QSpinBox</a>, <a href="qradiobutton.html">QRadioButton</a>, <a href="qbuttongroup.html">QButtonGroup</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Combo Box, Drop-Down List Box</a>.</p>
<!-- @@@QComboBox -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$InsertPolicy$$$NoInsert$$$InsertAtTop$$$InsertAtCurrent$$$InsertAtBottom$$$InsertAfterCurrent$$$InsertBeforeCurrent$$$InsertAlphabetically$$$NoInsertion$$$AtTop$$$AtCurrent$$$AtBottom$$$AfterCurrent$$$BeforeCurrent -->
<h3 class="fn"><a name="InsertPolicy-enum"></a>enum QComboBox::<span class="name">InsertPolicy</span></h3>
<p>This enum specifies what the <a href="qcombobox.html">QComboBox</a> should do when a new string is entered by the user.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QComboBox::NoInsert</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The string will not be inserted into the combobox.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertAtTop</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The string will be inserted as the first item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertAtCurrent</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The current item will be <i>replaced</i> by the string.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertAtBottom</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The string will be inserted after the last item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertAfterCurrent</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">The string is inserted after the current item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertBeforeCurrent</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">The string is inserted before the current item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::InsertAlphabetically</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">The string is inserted in the alphabetic order in the combobox.</td></tr>
</table>
<!-- @@@InsertPolicy -->
<!-- $$$SizeAdjustPolicy$$$AdjustToContents$$$AdjustToContentsOnFirstShow$$$AdjustToMinimumContentsLength$$$AdjustToMinimumContentsLengthWithIcon -->
<h3 class="fn"><a name="SizeAdjustPolicy-enum"></a>enum QComboBox::<span class="name">SizeAdjustPolicy</span></h3>
<p>This enum specifies how the size hint of the <a href="qcombobox.html">QComboBox</a> should adjust when new content is added or content changes.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QComboBox::AdjustToContents</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The combobox will always adjust to the contents</td></tr>
<tr><td class="topAlign"><tt>QComboBox::AdjustToContentsOnFirstShow</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The combobox will adjust to its contents the first time it is shown.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::AdjustToMinimumContentsLength</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">Use AdjustToContents or AdjustToContentsOnFirstShow instead.</td></tr>
<tr><td class="topAlign"><tt>QComboBox::AdjustToMinimumContentsLengthWithIcon</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The combobox will adjust to <a href="qcombobox.html#minimumContentsLength-prop">minimumContentsLength</a> plus space for an icon. For performance reasons use this policy on large models.</td></tr>
</table>
<!-- @@@SizeAdjustPolicy -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$count-prop$$$count -->
<h3 class="fn"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3>
<p>This property holds the number of items in the combobox.</p>
<p>By default, for an empty combo box, this property has a value of 0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>count</b></span> () const</td></tr>
</table>
<!-- @@@count -->
<!-- $$$currentIndex-prop$$$currentIndex$$$setCurrentIndexint$$$currentIndexChangedint$$$currentIndexChangedconstQString& -->
<h3 class="fn"><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type">int</span></h3>
<p>This property holds the index of the current item in the combobox.</p>
<p>The current index can change when inserting or removing items.</p>
<p>By default, for an empty combo box or a combo box in which no current item is set, this property has a value of -1.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>currentIndex</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentIndex</b></span> ( int <i>index</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a></b></span> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcombobox.html#currentIndexChanged-2">currentIndexChanged</a></b></span> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<!-- @@@currentIndex -->
<!-- $$$currentText-prop$$$currentText -->
<h3 class="fn"><a name="currentText-prop"></a><span class="name">currentText</span> : const <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the current text.</p>
<p>If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>currentText</b></span> () const</td></tr>
</table>
<p><b>See also </b><a href="qcombobox.html#editable-prop">editable</a>.</p>
<!-- @@@currentText -->
<!-- $$$duplicatesEnabled-prop$$$duplicatesEnabled$$$setDuplicatesEnabledbool -->
<h3 class="fn"><a name="duplicatesEnabled-prop"></a><span class="name">duplicatesEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether the user can enter duplicate items into the combobox.</p>
<p>Note that it is always possible to programmatically insert duplicate items into the combobox.</p>
<p>By default, this property is false (duplicates are not allowed).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>duplicatesEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDuplicatesEnabled</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@duplicatesEnabled -->
<!-- $$$editable-prop$$$isEditable$$$setEditablebool -->
<h3 class="fn"><a name="editable-prop"></a><span class="name">editable</span> : <span class="type">bool</span></h3>
<p>This property holds whether the combo box can be edited by the user.</p>
<p>By default, this property is false. The effect of editing depends on the insert policy.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isEditable</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setEditable</b></span> ( bool <i>editable</i> )</td></tr>
</table>
<p><b>See also </b><a href="qcombobox.html#InsertPolicy-enum">InsertPolicy</a>.</p>
<!-- @@@editable -->
<!-- $$$frame-prop$$$hasFrame$$$setFramebool -->
<h3 class="fn"><a name="frame-prop"></a><span class="name">frame</span> : <span class="type">bool</span></h3>
<p>This property holds whether the combo box draws itself with a frame.</p>
<p>If enabled (the default) the combo box draws itself inside a frame, otherwise the combo box draws itself without any frame.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>hasFrame</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFrame</b></span> ( bool )</td></tr>
</table>
<!-- @@@frame -->
<!-- $$$iconSize-prop$$$iconSize$$$setIconSizeconstQSize& -->
<h3 class="fn"><a name="iconSize-prop"></a><span class="name">iconSize</span> : <span class="type"><a href="qsize.html">QSize</a></span></h3>
<p>This property holds the size of the icons shown in the combobox.</p>
<p>Unless explicitly set this returns the default value of the current style. This size is the maximum size that icons can have; icons of smaller size are not scaled up.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSize </td><td class="memItemRight bottomAlign"><span class="name"><b>iconSize</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIconSize</b></span> ( const QSize &amp; <i>size</i> )</td></tr>
</table>
<!-- @@@iconSize -->
<!-- $$$insertPolicy-prop$$$insertPolicy$$$setInsertPolicyInsertPolicy -->
<h3 class="fn"><a name="insertPolicy-prop"></a><span class="name">insertPolicy</span> : <span class="type"><a href="qcombobox.html#InsertPolicy-enum">InsertPolicy</a></span></h3>
<p>This property holds the policy used to determine where user-inserted items should appear in the combobox.</p>
<p>The default value is <a href="qcombobox.html#InsertPolicy-enum">AtBottom</a>, indicating that new items will appear at the bottom of the list of items.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> InsertPolicy </td><td class="memItemRight bottomAlign"><span class="name"><b>insertPolicy</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInsertPolicy</b></span> ( InsertPolicy <i>policy</i> )</td></tr>
</table>
<p><b>See also </b><a href="qcombobox.html#InsertPolicy-enum">InsertPolicy</a>.</p>
<!-- @@@insertPolicy -->
<!-- $$$maxCount-prop$$$maxCount$$$setMaxCountint -->
<h3 class="fn"><a name="maxCount-prop"></a><span class="name">maxCount</span> : <span class="type">int</span></h3>
<p>This property holds the maximum number of items allowed in the combobox.</p>
<p><b>Note:</b> If you set the maximum number to be less then the current amount of items in the combobox, the extra items will be truncated. This also applies if you have set an external model on the combobox.</p>
<p>By default, this property's value is derived from the highest signed integer available (typically 2147483647).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>maxCount</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaxCount</b></span> ( int <i>max</i> )</td></tr>
</table>
<!-- @@@maxCount -->
<!-- $$$maxVisibleItems-prop$$$maxVisibleItems$$$setMaxVisibleItemsint -->
<h3 class="fn"><a name="maxVisibleItems-prop"></a><span class="name">maxVisibleItems</span> : <span class="type">int</span></h3>
<p>This property holds the maximum allowed size on screen of the combo box, measured in items.</p>
<p>By default, this property has a value of 10.</p>
<p><b>Note:</b> This property is ignored for non-editable comboboxes in styles that returns true for <a href="qstyle.html#StyleHint-enum">QStyle::SH_ComboBox_Popup</a> such as the Mac style or the Gtk+ Style.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>maxVisibleItems</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaxVisibleItems</b></span> ( int <i>maxItems</i> )</td></tr>
</table>
<!-- @@@maxVisibleItems -->
<!-- $$$minimumContentsLength-prop$$$minimumContentsLength$$$setMinimumContentsLengthint -->
<h3 class="fn"><a name="minimumContentsLength-prop"></a><span class="name">minimumContentsLength</span> : <span class="type">int</span></h3>
<p>This property holds the minimum number of characters that should fit into the combobox.</p>
<p>The default value is 0.</p>
<p>If this property is set to a positive value, the <a href="qcombobox.html#minimumSizeHint">minimumSizeHint</a>() and <a href="qcombobox.html#sizeHint">sizeHint</a>() take it into account.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>minimumContentsLength</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMinimumContentsLength</b></span> ( int <i>characters</i> )</td></tr>
</table>
<p><b>See also </b><a href="qcombobox.html#sizeAdjustPolicy-prop">sizeAdjustPolicy</a>.</p>
<!-- @@@minimumContentsLength -->
<!-- $$$modelColumn-prop$$$modelColumn$$$setModelColumnint -->
<h3 class="fn"><a name="modelColumn-prop"></a><span class="name">modelColumn</span> : <span class="type">int</span></h3>
<p>This property holds the column in the model that is visible.</p>
<p>If set prior to populating the combo box, the pop-up view will not be affected and will show the first column (using this property's default value).</p>
<p>By default, this property has a value of 0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>modelColumn</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setModelColumn</b></span> ( int <i>visibleColumn</i> )</td></tr>
</table>
<!-- @@@modelColumn -->
<!-- $$$sizeAdjustPolicy-prop$$$sizeAdjustPolicy$$$setSizeAdjustPolicySizeAdjustPolicy -->
<h3 class="fn"><a name="sizeAdjustPolicy-prop"></a><span class="name">sizeAdjustPolicy</span> : <span class="type"><a href="qcombobox.html#SizeAdjustPolicy-enum">SizeAdjustPolicy</a></span></h3>
<p>This property holds the policy describing how the size of the combobox changes when the content changes.</p>
<p>The default value is <a href="qcombobox.html#SizeAdjustPolicy-enum">AdjustToContentsOnFirstShow</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> SizeAdjustPolicy </td><td class="memItemRight bottomAlign"><span class="name"><b>sizeAdjustPolicy</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSizeAdjustPolicy</b></span> ( SizeAdjustPolicy <i>policy</i> )</td></tr>
</table>
<p><b>See also </b><a href="qcombobox.html#SizeAdjustPolicy-enum">SizeAdjustPolicy</a>.</p>
<!-- @@@sizeAdjustPolicy -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QComboBox[overload1]$$$QComboBoxQWidget* -->
<h3 class="fn"><a name="QComboBox"></a>QComboBox::<span class="name">QComboBox</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a combobox with the given <i>parent</i>, using the default model <a href="qstandarditemmodel.html">QStandardItemModel</a>.</p>
<!-- @@@QComboBox -->
<!-- $$$~QComboBox[overload1]$$$~QComboBox -->
<h3 class="fn"><a name="dtor.QComboBox"></a>QComboBox::<span class="name">~QComboBox</span> ()</h3>
<p>Destroys the combobox.</p>
<!-- @@@~QComboBox -->
<!-- $$$activated[overload1]$$$activatedint -->
<h3 class="fn"><a name="activated"></a><span class="type">void</span> QComboBox::<span class="name">activated</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3>
<p>This signal is sent when the user chooses an item in the combobox. The item's <i>index</i> is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal <a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a>().</p>
<!-- @@@activated -->
<!-- $$$activated$$$activatedconstQString& -->
<h3 class="fn"><a name="activated-2"></a><span class="type">void</span> QComboBox::<span class="name">activated</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [signal]</tt></h3>
<p>This signal is sent when the user chooses an item in the combobox. The item's <i>text</i> is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal <a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a>().</p>
<!-- @@@activated -->
<!-- $$$addItem[overload1]$$$addItemconstQString&constQVariant& -->
<h3 class="fn"><a name="addItem"></a><span class="type">void</span> QComboBox::<span class="name">addItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>userData</i> = QVariant() )</h3>
<p>Adds an item to the combobox with the given <i>text</i>, and containing the specified <i>userData</i> (stored in the <a href="qt.html#ItemDataRole-enum">Qt::UserRole</a>). The item is appended to the list of existing items.</p>
<!-- @@@addItem -->
<!-- $$$addItem$$$addItemconstQIcon&constQString&constQVariant& -->
<h3 class="fn"><a name="addItem-2"></a><span class="type">void</span> QComboBox::<span class="name">addItem</span> ( const <span class="type"><a href="qicon.html">QIcon</a></span> &amp; <i>icon</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>userData</i> = QVariant() )</h3>
<p>Adds an item to the combobox with the given <i>icon</i> and <i>text</i>, and containing the specified <i>userData</i> (stored in the <a href="qt.html#ItemDataRole-enum">Qt::UserRole</a>). The item is appended to the list of existing items.</p>
<!-- @@@addItem -->
<!-- $$$addItems[overload1]$$$addItemsconstQStringList& -->
<h3 class="fn"><a name="addItems"></a><span class="type">void</span> QComboBox::<span class="name">addItems</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>texts</i> )</h3>
<p>Adds each of the strings in the given <i>texts</i> to the combobox. Each item is appended to the list of existing items in turn.</p>
<!-- @@@addItems -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QComboBox::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QComboBox::<span class="name">clear</span> ()<tt> [slot]</tt></h3>
<p>Clears the combobox, removing all items.</p>
<p>Note: If you have set an external model on the combobox this model will still be cleared when calling this function.</p>
<!-- @@@clear -->
<!-- $$$clearEditText[overload1]$$$clearEditText -->
<h3 class="fn"><a name="clearEditText"></a><span class="type">void</span> QComboBox::<span class="name">clearEditText</span> ()<tt> [slot]</tt></h3>
<p>Clears the contents of the line edit used for editing in the combobox.</p>
<!-- @@@clearEditText -->
<!-- $$$completer[overload1]$$$completer -->
<h3 class="fn"><a name="completer"></a><span class="type"><a href="qcompleter.html">QCompleter</a></span> * QComboBox::<span class="name">completer</span> () const</h3>
<p>Returns the completer that is used to auto complete text input for the combobox.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qcombobox.html#setCompleter">setCompleter</a>() and <a href="qcombobox.html#editable-prop">editable</a>.</p>
<!-- @@@completer -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQContextMenuEvent* -->
<h3 class="fn"><a name="contextMenuEvent"></a><span class="type">void</span> QComboBox::<span class="name">contextMenuEvent</span> ( <span class="type"><a href="qcontextmenuevent.html">QContextMenuEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget::contextMenuEvent</a>().</p>
<!-- @@@contextMenuEvent -->
<!-- $$$currentIndexChanged[overload1]$$$currentIndexChangedint -->
<h3 class="fn"><a name="currentIndexChanged"></a><span class="type">void</span> QComboBox::<span class="name">currentIndexChanged</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3>
<p>This signal is sent whenever the <a href="qcombobox.html#currentIndex-prop">currentIndex</a> in the combobox changes either through user interaction or programmatically. The item's <i>index</i> is passed or -1 if the combobox becomes empty or the <a href="qcombobox.html#currentIndex-prop">currentIndex</a> was reset.</p>
<p>This function was introduced in Qt 4.1.</p>
<!-- @@@currentIndexChanged -->
<!-- $$$currentIndexChanged$$$currentIndexChangedconstQString& -->
<h3 class="fn"><a name="currentIndexChanged-2"></a><span class="type">void</span> QComboBox::<span class="name">currentIndexChanged</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [signal]</tt></h3>
<p>This signal is sent whenever the <a href="qcombobox.html#currentIndex-prop">currentIndex</a> in the combobox changes either through user interaction or programmatically. The item's <i>text</i> is passed.</p>
<p>This function was introduced in Qt 4.1.</p>
<!-- @@@currentIndexChanged -->
<!-- $$$editTextChanged[overload1]$$$editTextChangedconstQString& -->
<h3 class="fn"><a name="editTextChanged"></a><span class="type">void</span> QComboBox::<span class="name">editTextChanged</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by <i>text</i>.</p>
<!-- @@@editTextChanged -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QComboBox::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$findData[overload1]$$$findDataconstQVariant&intQt::MatchFlags -->
<h3 class="fn"><a name="findData"></a><span class="type">int</span> QComboBox::<span class="name">findData</span> ( const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>data</i>, <span class="type">int</span> <i>role</i> = Qt::UserRole, <span class="type"><a href="qt.html#MatchFlag-enum">Qt::MatchFlags</a></span> <i>flags</i> = static_cast&lt;Qt::MatchFlags&gt; ( Qt::MatchExactly | Qt::MatchCaseSensitive ) ) const</h3>
<p>Returns the index of the item containing the given <i>data</i> for the given <i>role</i>; otherwise returns -1.</p>
<p>The <i>flags</i> specify how the items in the combobox are searched.</p>
<!-- @@@findData -->
<!-- $$$findText[overload1]$$$findTextconstQString&Qt::MatchFlags -->
<h3 class="fn"><a name="findText"></a><span class="type">int</span> QComboBox::<span class="name">findText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, <span class="type"><a href="qt.html#MatchFlag-enum">Qt::MatchFlags</a></span> <i>flags</i> = static_cast&lt;Qt::MatchFlags&gt; ( Qt::MatchExactly | Qt::MatchCaseSensitive ) ) const</h3>
<p>Returns the index of the item containing the given <i>text</i>; otherwise returns -1.</p>
<p>The <i>flags</i> specify how the items in the combobox are searched.</p>
<!-- @@@findText -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn"><a name="focusInEvent"></a><span class="type">void</span> QComboBox::<span class="name">focusInEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn"><a name="focusOutEvent"></a><span class="type">void</span> QComboBox::<span class="name">focusOutEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$hideEvent[overload1]$$$hideEventQHideEvent* -->
<h3 class="fn"><a name="hideEvent"></a><span class="type">void</span> QComboBox::<span class="name">hideEvent</span> ( <span class="type"><a href="qhideevent.html">QHideEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#hideEvent">QWidget::hideEvent</a>().</p>
<!-- @@@hideEvent -->
<!-- $$$hidePopup[overload1]$$$hidePopup -->
<h3 class="fn"><a name="hidePopup"></a><span class="type">void</span> QComboBox::<span class="name">hidePopup</span> ()<tt> [virtual]</tt></h3>
<p>Hides the list of items in the combobox if it is currently visible and resets the internal state, so that if the custom pop-up was shown inside the reimplemented <a href="qcombobox.html#showPopup">showPopup</a>(), then you also need to reimplement the hidePopup() function to hide your custom pop-up and call the base class implementation to reset the internal state whenever your custom pop-up widget is hidden.</p>
<p><b>See also </b><a href="qcombobox.html#showPopup">showPopup</a>().</p>
<!-- @@@hidePopup -->
<!-- $$$highlighted[overload1]$$$highlightedint -->
<h3 class="fn"><a name="highlighted"></a><span class="type">void</span> QComboBox::<span class="name">highlighted</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3>
<p>This signal is sent when an item in the combobox popup list is highlighted by the user. The item's <i>index</i> is passed.</p>
<!-- @@@highlighted -->
<!-- $$$highlighted$$$highlightedconstQString& -->
<h3 class="fn"><a name="highlighted-2"></a><span class="type">void</span> QComboBox::<span class="name">highlighted</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [signal]</tt></h3>
<p>This signal is sent when an item in the combobox popup list is highlighted by the user. The item's <i>text</i> is passed.</p>
<!-- @@@highlighted -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionComboBox* -->
<h3 class="fn"><a name="initStyleOption"></a><span class="type">void</span> QComboBox::<span class="name">initStyleOption</span> ( <span class="type"><a href="qstyleoptioncombobox.html">QStyleOptionComboBox</a></span> * <i>option</i> ) const<tt> [protected]</tt></h3>
<p>Initialize <i>option</i> with the values from this <a href="qcombobox.html">QComboBox</a>. This method is useful for subclasses when they need a <a href="qstyleoptioncombobox.html">QStyleOptionComboBox</a>, but don't want to fill in all the information themselves.</p>
<p><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn"><a name="inputMethodEvent"></a><span class="type">void</span> QComboBox::<span class="name">inputMethodEvent</span> ( <span class="type"><a href="qinputmethodevent.html">QInputMethodEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget::inputMethodEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn"><a name="inputMethodQuery"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QComboBox::<span class="name">inputMethodQuery</span> ( <span class="type"><a href="qt.html#InputMethodQuery-enum">Qt::InputMethodQuery</a></span> <i>query</i> ) const<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget::inputMethodQuery</a>().</p>
<!-- @@@inputMethodQuery -->
<!-- $$$insertItem[overload1]$$$insertItemintconstQString&constQVariant& -->
<h3 class="fn"><a name="insertItem"></a><span class="type">void</span> QComboBox::<span class="name">insertItem</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>userData</i> = QVariant() )</h3>
<p>Inserts the <i>text</i> and <i>userData</i> (stored in the <a href="qt.html#ItemDataRole-enum">Qt::UserRole</a>) into the combobox at the given <i>index</i>.</p>
<p>If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.</p>
<p><b>See also </b><a href="qcombobox.html#insertItems">insertItems</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertItem$$$insertItemintconstQIcon&constQString&constQVariant& -->
<h3 class="fn"><a name="insertItem-2"></a><span class="type">void</span> QComboBox::<span class="name">insertItem</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qicon.html">QIcon</a></span> &amp; <i>icon</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>userData</i> = QVariant() )</h3>
<p>Inserts the <i>icon</i>, <i>text</i> and <i>userData</i> (stored in the <a href="qt.html#ItemDataRole-enum">Qt::UserRole</a>) into the combobox at the given <i>index</i>.</p>
<p>If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.</p>
<p><b>See also </b><a href="qcombobox.html#insertItems">insertItems</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertItems[overload1]$$$insertItemsintconstQStringList& -->
<h3 class="fn"><a name="insertItems"></a><span class="type">void</span> QComboBox::<span class="name">insertItems</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>list</i> )</h3>
<p>Inserts the strings from the <i>list</i> into the combobox as separate items, starting at the <i>index</i> specified.</p>
<p>If the index is equal to or higher than the total number of items, the new items are appended to the list of existing items. If the index is zero or negative, the new items are prepended to the list of existing items.</p>
<p><b>See also </b><a href="qcombobox.html#insertItem">insertItem</a>().</p>
<!-- @@@insertItems -->
<!-- $$$insertSeparator[overload1]$$$insertSeparatorint -->
<h3 class="fn"><a name="insertSeparator"></a><span class="type">void</span> QComboBox::<span class="name">insertSeparator</span> ( <span class="type">int</span> <i>index</i> )</h3>
<p>Inserts a separator item into the combobox at the given <i>index</i>.</p>
<p>If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qcombobox.html#insertItem">insertItem</a>().</p>
<!-- @@@insertSeparator -->
<!-- $$$itemData[overload1]$$$itemDataintint -->
<h3 class="fn"><a name="itemData"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QComboBox::<span class="name">itemData</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>role</i> = Qt::UserRole ) const</h3>
<p>Returns the data for the given <i>role</i> in the given <i>index</i> in the combobox, or <a href="qvariant.html#Type-enum">QVariant::Invalid</a> if there is no data for this role.</p>
<p><b>See also </b><a href="qcombobox.html#setItemData">setItemData</a>().</p>
<!-- @@@itemData -->
<!-- $$$itemDelegate[overload1]$$$itemDelegate -->
<h3 class="fn"><a name="itemDelegate"></a><span class="type"><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a></span> * QComboBox::<span class="name">itemDelegate</span> () const</h3>
<p>Returns the item delegate used by the popup list view.</p>
<p><b>See also </b><a href="qcombobox.html#setItemDelegate">setItemDelegate</a>().</p>
<!-- @@@itemDelegate -->
<!-- $$$itemIcon[overload1]$$$itemIconint -->
<h3 class="fn"><a name="itemIcon"></a><span class="type"><a href="qicon.html">QIcon</a></span> QComboBox::<span class="name">itemIcon</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the icon for the given <i>index</i> in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#setItemIcon">setItemIcon</a>().</p>
<!-- @@@itemIcon -->
<!-- $$$itemText[overload1]$$$itemTextint -->
<h3 class="fn"><a name="itemText"></a><span class="type"><a href="qstring.html">QString</a></span> QComboBox::<span class="name">itemText</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the text for the given <i>index</i> in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#setItemText">setItemText</a>().</p>
<!-- @@@itemText -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn"><a name="keyPressEvent"></a><span class="type">void</span> QComboBox::<span class="name">keyPressEvent</span> ( <span class="type"><a href="qkeyevent.html">QKeyEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$keyReleaseEvent[overload1]$$$keyReleaseEventQKeyEvent* -->
<h3 class="fn"><a name="keyReleaseEvent"></a><span class="type">void</span> QComboBox::<span class="name">keyReleaseEvent</span> ( <span class="type"><a href="qkeyevent.html">QKeyEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyReleaseEvent">QWidget::keyReleaseEvent</a>().</p>
<!-- @@@keyReleaseEvent -->
<!-- $$$lineEdit[overload1]$$$lineEdit -->
<h3 class="fn"><a name="lineEdit"></a><span class="type"><a href="qlineedit.html">QLineEdit</a></span> * QComboBox::<span class="name">lineEdit</span> () const</h3>
<p>Returns the line edit used to edit items in the combobox, or 0 if there is no line edit.</p>
<p>Only editable combo boxes have a line edit.</p>
<p><b>See also </b><a href="qcombobox.html#setLineEdit">setLineEdit</a>().</p>
<!-- @@@lineEdit -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn"><a name="minimumSizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QComboBox::<span class="name">minimumSizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<!-- @@@minimumSizeHint -->
<!-- $$$model[overload1]$$$model -->
<h3 class="fn"><a name="model"></a><span class="type"><a href="qabstractitemmodel.html">QAbstractItemModel</a></span> * QComboBox::<span class="name">model</span> () const</h3>
<p>Returns the model used by the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#setModel">setModel</a>().</p>
<!-- @@@model -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn"><a name="mousePressEvent"></a><span class="type">void</span> QComboBox::<span class="name">mousePressEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn"><a name="mouseReleaseEvent"></a><span class="type">void</span> QComboBox::<span class="name">mouseReleaseEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn"><a name="paintEvent"></a><span class="type">void</span> QComboBox::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$removeItem[overload1]$$$removeItemint -->
<h3 class="fn"><a name="removeItem"></a><span class="type">void</span> QComboBox::<span class="name">removeItem</span> ( <span class="type">int</span> <i>index</i> )</h3>
<p>Removes the item at the given <i>index</i> from the combobox. This will update the current index if the index is removed.</p>
<p>This function does nothing if <i>index</i> is out of range.</p>
<!-- @@@removeItem -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> QComboBox::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$rootModelIndex[overload1]$$$rootModelIndex -->
<h3 class="fn"><a name="rootModelIndex"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QComboBox::<span class="name">rootModelIndex</span> () const</h3>
<p>Returns the root model item index for the items in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#setRootModelIndex">setRootModelIndex</a>().</p>
<!-- @@@rootModelIndex -->
<!-- $$$setCompleter[overload1]$$$setCompleterQCompleter* -->
<h3 class="fn"><a name="setCompleter"></a><span class="type">void</span> QComboBox::<span class="name">setCompleter</span> ( <span class="type"><a href="qcompleter.html">QCompleter</a></span> * <i>completer</i> )</h3>
<p>Sets the <i>completer</i> to use instead of the current completer. If <i>completer</i> is 0, auto completion is disabled.</p>
<p>By default, for an editable combo box, a <a href="qcompleter.html">QCompleter</a> that performs case insensitive inline completion is automatically created.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qcombobox.html#completer">completer</a>().</p>
<!-- @@@setCompleter -->
<!-- $$$setEditText[overload1]$$$setEditTextconstQString& -->
<h3 class="fn"><a name="setEditText"></a><span class="type">void</span> QComboBox::<span class="name">setEditText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [slot]</tt></h3>
<p>Sets the <i>text</i> in the combobox's text edit.</p>
<!-- @@@setEditText -->
<!-- $$$setItemData[overload1]$$$setItemDataintconstQVariant&int -->
<h3 class="fn"><a name="setItemData"></a><span class="type">void</span> QComboBox::<span class="name">setItemData</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i>, <span class="type">int</span> <i>role</i> = Qt::UserRole )</h3>
<p>Sets the data <i>role</i> for the item on the given <i>index</i> in the combobox to the specified <i>value</i>.</p>
<p><b>See also </b><a href="qcombobox.html#itemData">itemData</a>().</p>
<!-- @@@setItemData -->
<!-- $$$setItemDelegate[overload1]$$$setItemDelegateQAbstractItemDelegate* -->
<h3 class="fn"><a name="setItemDelegate"></a><span class="type">void</span> QComboBox::<span class="name">setItemDelegate</span> ( <span class="type"><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a></span> * <i>delegate</i> )</h3>
<p>Sets the item <i>delegate</i> for the popup list view. The combobox takes ownership of the delegate.</p>
<p><b>Warning:</b> You should not share the same instance of a delegate between comboboxes, widget mappers or views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal, and attempt to access, modify or close an editor that has already been closed.</p>
<p><b>See also </b><a href="qcombobox.html#itemDelegate">itemDelegate</a>().</p>
<!-- @@@setItemDelegate -->
<!-- $$$setItemIcon[overload1]$$$setItemIconintconstQIcon& -->
<h3 class="fn"><a name="setItemIcon"></a><span class="type">void</span> QComboBox::<span class="name">setItemIcon</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qicon.html">QIcon</a></span> &amp; <i>icon</i> )</h3>
<p>Sets the <i>icon</i> for the item on the given <i>index</i> in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#itemIcon">itemIcon</a>().</p>
<!-- @@@setItemIcon -->
<!-- $$$setItemText[overload1]$$$setItemTextintconstQString& -->
<h3 class="fn"><a name="setItemText"></a><span class="type">void</span> QComboBox::<span class="name">setItemText</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Sets the <i>text</i> for the item on the given <i>index</i> in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#itemText">itemText</a>().</p>
<!-- @@@setItemText -->
<!-- $$$setLineEdit[overload1]$$$setLineEditQLineEdit* -->
<h3 class="fn"><a name="setLineEdit"></a><span class="type">void</span> QComboBox::<span class="name">setLineEdit</span> ( <span class="type"><a href="qlineedit.html">QLineEdit</a></span> * <i>edit</i> )</h3>
<p>Sets the line <i>edit</i> to use instead of the current line edit widget.</p>
<p>The combo box takes ownership of the line edit.</p>
<p><b>See also </b><a href="qcombobox.html#lineEdit">lineEdit</a>().</p>
<!-- @@@setLineEdit -->
<!-- $$$setModel[overload1]$$$setModelQAbstractItemModel* -->
<h3 class="fn"><a name="setModel"></a><span class="type">void</span> QComboBox::<span class="name">setModel</span> ( <span class="type"><a href="qabstractitemmodel.html">QAbstractItemModel</a></span> * <i>model</i> )</h3>
<p>Sets the model to be <i>model</i>. <i>model</i> must not be 0. If you want to clear the contents of a model, call <a href="qcombobox.html#clear">clear</a>().</p>
<p><b>See also </b><a href="qcombobox.html#model">model</a>() and <a href="qcombobox.html#clear">clear</a>().</p>
<!-- @@@setModel -->
<!-- $$$setRootModelIndex[overload1]$$$setRootModelIndexconstQModelIndex& -->
<h3 class="fn"><a name="setRootModelIndex"></a><span class="type">void</span> QComboBox::<span class="name">setRootModelIndex</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> )</h3>
<p>Sets the root model item <i>index</i> for the items in the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#rootModelIndex">rootModelIndex</a>().</p>
<!-- @@@setRootModelIndex -->
<!-- $$$setValidator[overload1]$$$setValidatorconstQValidator* -->
<h3 class="fn"><a name="setValidator"></a><span class="type">void</span> QComboBox::<span class="name">setValidator</span> ( const <span class="type"><a href="qvalidator.html">QValidator</a></span> * <i>validator</i> )</h3>
<p>Sets the <i>validator</i> to use instead of the current validator.</p>
<p><b>See also </b><a href="qcombobox.html#validator">validator</a>().</p>
<!-- @@@setValidator -->
<!-- $$$setView[overload1]$$$setViewQAbstractItemView* -->
<h3 class="fn"><a name="setView"></a><span class="type">void</span> QComboBox::<span class="name">setView</span> ( <span class="type"><a href="qabstractitemview.html">QAbstractItemView</a></span> * <i>itemView</i> )</h3>
<p>Sets the view to be used in the combobox popup to the given <i>itemView</i>. The combobox takes ownership of the view.</p>
<p>Note: If you want to use the convenience views (like <a href="qlistwidget.html">QListWidget</a>, <a href="qtablewidget.html">QTableWidget</a> or <a href="qtreewidget.html">QTreeWidget</a>), make sure to call <a href="qcombobox.html#setModel">setModel</a>() on the combobox with the convenience widgets model before calling this function.</p>
<p><b>See also </b><a href="qcombobox.html#view">view</a>().</p>
<!-- @@@setView -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn"><a name="showEvent"></a><span class="type">void</span> QComboBox::<span class="name">showEvent</span> ( <span class="type"><a href="qshowevent.html">QShowEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$showPopup[overload1]$$$showPopup -->
<h3 class="fn"><a name="showPopup"></a><span class="type">void</span> QComboBox::<span class="name">showPopup</span> ()<tt> [virtual]</tt></h3>
<p>Displays the list of items in the combobox. If the list is empty then the no items will be shown.</p>
<p>If you reimplement this function to show a custom pop-up, make sure you call <a href="qcombobox.html#hidePopup">hidePopup</a>() to reset the internal state.</p>
<p><b>See also </b><a href="qcombobox.html#hidePopup">hidePopup</a>().</p>
<!-- @@@showPopup -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QComboBox::<span class="name">sizeHint</span> () const<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 change the <a href="qcombobox.html#sizeAdjustPolicy-prop">sizeAdjustPolicy</a>.</p>
<!-- @@@sizeHint -->
<!-- $$$validator[overload1]$$$validator -->
<h3 class="fn"><a name="validator"></a>const <span class="type"><a href="qvalidator.html">QValidator</a></span> * QComboBox::<span class="name">validator</span> () const</h3>
<p>Returns the validator that is used to constrain text input for the combobox.</p>
<p><b>See also </b><a href="qcombobox.html#setValidator">setValidator</a>() and <a href="qcombobox.html#editable-prop">editable</a>.</p>
<!-- @@@validator -->
<!-- $$$view[overload1]$$$view -->
<h3 class="fn"><a name="view"></a><span class="type"><a href="qabstractitemview.html">QAbstractItemView</a></span> * QComboBox::<span class="name">view</span> () const</h3>
<p>Returns the list view used for the combobox popup.</p>
<p><b>See also </b><a href="qcombobox.html#setView">setView</a>().</p>
<!-- @@@view -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQWheelEvent* -->
<h3 class="fn"><a name="wheelEvent"></a><span class="type">void</span> QComboBox::<span class="name">wheelEvent</span> ( <span class="type"><a href="qwheelevent.html">QWheelEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>().</p>
<!-- @@@wheelEvent -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>