1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602
|
<?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" />
<!-- q3combobox.cpp -->
<title>Qt 4.8: Q3ComboBox Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<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>Qt3SupportLight</li>
<li>Q3ComboBox</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">Q3ComboBox Class Reference</h1>
<!-- $$$Q3ComboBox-brief -->
<p>The Q3ComboBox widget is a combined button and popup list. <a href="#details">More...</a></p>
<!-- @@@Q3ComboBox -->
<pre class="cpp"> <span class="preprocessor">#include <Q3ComboBox></span></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><b>Inherits: </b><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>
<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="q3combobox.html#Policy-enum">Policy</a></b> { NoInsertion, AtTop, AtCurrent, AtBottom, AfterCurrent, BeforeCurrent }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="q3combobox.html#autoCompletion-prop">autoCompletion</a></b> : bool</li>
<li class="fn"><b><a href="q3combobox.html#count-prop">count</a></b> : const int</li>
<li class="fn"><b><a href="q3combobox.html#currentItem-prop">currentItem</a></b> : int</li>
<li class="fn"><b><a href="q3combobox.html#currentText-prop">currentText</a></b> : QString</li>
<li class="fn"><b><a href="q3combobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="q3combobox.html#editable-prop">editable</a></b> : bool</li>
<li class="fn"><b><a href="q3combobox.html#insertionPolicy-prop">insertionPolicy</a></b> : Policy</li>
<li class="fn"><b><a href="q3combobox.html#maxCount-prop">maxCount</a></b> : int</li>
<li class="fn"><b><a href="q3combobox.html#sizeLimit-prop">sizeLimit</a></b> : int</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="q3combobox.html#Q3ComboBox">Q3ComboBox</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#dtor.Q3ComboBox">~Q3ComboBox</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#autoCompletion-prop">autoCompletion</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#autoResize">autoResize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#changeItem">changeItem</a></b> ( const QString & <i>t</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#changeItem-2">changeItem</a></b> ( const QPixmap & <i>im</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#changeItem-3">changeItem</a></b> ( const QPixmap & <i>im</i>, const QString & <i>t</i>, int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#count-prop">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#currentItem-prop">currentItem</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#currentText-prop">currentText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#duplicatesEnabled-prop">duplicatesEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#editable-prop">editable</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#hide">hide</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertItem">insertItem</a></b> ( const QString & <i>t</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertItem-2">insertItem</a></b> ( const QPixmap & <i>pixmap</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertItem-3">insertItem</a></b> ( const QPixmap & <i>pixmap</i>, const QString & <i>text</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertStrList-2">insertStrList</a></b> ( const Q3StrList & <i>list</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertStringList">insertStringList</a></b> ( const QStringList & <i>list</i>, int <i>index</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Policy </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertionPolicy-prop">insertionPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QLineEdit * </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#lineEdit">lineEdit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q3ListBox * </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#listBox">listBox</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#maxCount-prop">maxCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QPixmap * </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#pixmap">pixmap</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#popup">popup</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#removeItem">removeItem</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#autoCompletion-prop">setAutoCompletion</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setAutoResize">setAutoResize</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#currentItem-prop">setCurrentItem</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#currentText-prop">setCurrentText</a></b> ( const QString & )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.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="q3combobox.html#editable-prop">setEditable</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setEnabled">setEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setFont">setFont</a></b> ( const QFont & <i>font</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#insertionPolicy-prop">setInsertionPolicy</a></b> ( Policy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setLineEdit">setLineEdit</a></b> ( QLineEdit * <i>edit</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setListBox">setListBox</a></b> ( Q3ListBox * <i>newListBox</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#maxCount-prop">setMaxCount</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setPalette">setPalette</a></b> ( const QPalette & <i>palette</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#sizeLimit-prop">setSizeLimit</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setValidator">setValidator</a></b> ( const QValidator * <i>v</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#sizeLimit-prop">sizeLimit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#text">text</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QValidator * </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#validator">validator</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 QSize </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.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="q3combobox.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#clearEdit">clearEdit</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#clearValidator">clearValidator</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#setEditText">setEditText</a></b> ( const QString & <i>newText</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="q3combobox.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="q3combobox.html#activated-2">activated</a></b> ( const QString & <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.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="q3combobox.html#highlighted-2">highlighted</a></b> ( const QString & <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#textChanged">textChanged</a></b> ( const QString & <i>string</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="q3combobox.html#updateMask">updateMask</a></b> ()</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="q3combobox.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="q3combobox.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="q3combobox.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="q3combobox.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.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="q3combobox.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.html#paintEvent">paintEvent</a></b> ( QPaintEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3combobox.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="q3combobox.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>
<!-- $$$Q3ComboBox-description -->
<div class="descr">
<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 "old-style" combobox in Motif (or Aqua) style:</p>
<pre class="cpp"> <span class="type">Q3ComboBox</span> <span class="operator">*</span>c <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Q3ComboBox</span>(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"read-only combobox"</span>));</pre>
<p>The other constructor creates a new-style combobox in Motif style, and can create both read-only and editable comboboxes:</p>
<pre class="cpp"> <span class="type">Q3ComboBox</span> <span class="operator">*</span>c1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Q3ComboBox</span>(<span class="keyword">false</span><span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"read-only combobox"</span>));
<span class="type">Q3ComboBox</span> <span class="operator">*</span>c2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Q3ComboBox</span>(<span class="keyword">true</span><span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"editable combobox"</span>));</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. 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. 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>
</div>
<p><b>See also </b><a href="qcombobox.html">QComboBox</a>, <a href="qlineedit.html">QLineEdit</a>, and <a href="qspinbox.html">QSpinBox</a>.</p>
<!-- @@@Q3ComboBox -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Policy$$$NoInsertion$$$AtTop$$$AtCurrent$$$AtBottom$$$AfterCurrent$$$BeforeCurrent$$$NoInsert$$$InsertAtTop$$$InsertAtCurrent$$$InsertAtBottom$$$InsertAfterCurrent$$$InsertBeforeCurrent -->
<h3 class="fn"><a name="Policy-enum"></a>enum Q3ComboBox::<span class="name">Policy</span></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>
<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>Q3ComboBox::NoInsertion</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>Q3ComboBox::AtTop</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">insert the string as the first item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>Q3ComboBox::AtCurrent</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">replace the previously selected item with the string the user has entered.</td></tr>
<tr><td class="topAlign"><tt>Q3ComboBox::AtBottom</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">insert the string as the last item in the combobox.</td></tr>
<tr><td class="topAlign"><tt>Q3ComboBox::AfterCurrent</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">insert the string after the previously selected item.</td></tr>
<tr><td class="topAlign"><tt>Q3ComboBox::BeforeCurrent</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">insert the string before the previously selected item.</td></tr>
</table>
<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 "other end" is implementation-dependent.</p>
<!-- @@@Policy -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoCompletion-prop$$$autoCompletion$$$setAutoCompletionbool -->
<h3 class="fn"><a name="autoCompletion-prop"></a><span class="name">autoCompletion</span> : <span class="type">bool</span></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">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoCompletion</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoCompletion</b></span> ( bool )</td></tr>
</table>
<!-- @@@autoCompletion -->
<!-- $$$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><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 -->
<!-- $$$currentItem-prop$$$currentItem$$$setCurrentItemint -->
<h3 class="fn"><a name="currentItem-prop"></a><span class="name">currentItem</span> : <span class="type">int</span></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">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>currentItem</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentItem</b></span> ( int <i>index</i> )</td></tr>
</table>
<!-- @@@currentItem -->
<!-- $$$currentText-prop$$$currentText$$$setCurrentTextconstQString& -->
<h3 class="fn"><a name="currentText-prop"></a><span class="name">currentText</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the text of the combobox's current item.</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>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentText</b></span> ( const QString & )</td></tr>
</table>
<!-- @@@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 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">
<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$$$editable$$$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 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">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>editable</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 )</td></tr>
</table>
<!-- @@@editable -->
<!-- $$$insertionPolicy-prop$$$insertionPolicy$$$setInsertionPolicyPolicy -->
<h3 class="fn"><a name="insertionPolicy-prop"></a><span class="name">insertionPolicy</span> : <span class="type"><a href="q3combobox.html#Policy-enum">Policy</a></span></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">
<tr><td class="memItemLeft topAlign rightAlign"> Policy </td><td class="memItemRight bottomAlign"><span class="name"><b>insertionPolicy</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInsertionPolicy</b></span> ( Policy <i>policy</i> )</td></tr>
</table>
<!-- @@@insertionPolicy -->
<!-- $$$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>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"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaxCount</b></span> ( int )</td></tr>
</table>
<!-- @@@maxCount -->
<!-- $$$sizeLimit-prop$$$sizeLimit$$$setSizeLimitint -->
<h3 class="fn"><a name="sizeLimit-prop"></a><span class="name">sizeLimit</span> : <span class="type">int</span></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">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>sizeLimit</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSizeLimit</b></span> ( int )</td></tr>
</table>
<!-- @@@sizeLimit -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3ComboBox[overload1]$$$Q3ComboBoxQWidget*constchar* -->
<h3 class="fn"><a name="Q3ComboBox"></a>Q3ComboBox::<span class="name">Q3ComboBox</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, const <span class="type">char</span> * <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>
<!-- @@@Q3ComboBox -->
<!-- $$$Q3ComboBox$$$Q3ComboBoxboolQWidget*constchar* -->
<h3 class="fn"><a name="Q3ComboBox-2"></a>Q3ComboBox::<span class="name">Q3ComboBox</span> ( <span class="type">bool</span> <i>rw</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, const <span class="type">char</span> * <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>
<!-- @@@Q3ComboBox -->
<!-- $$$~Q3ComboBox[overload1]$$$~Q3ComboBox -->
<h3 class="fn"><a name="dtor.Q3ComboBox"></a>Q3ComboBox::<span class="name">~Q3ComboBox</span> ()</h3>
<p>Destroys the combobox.</p>
<!-- @@@~Q3ComboBox -->
<!-- $$$activated[overload1]$$$activatedint -->
<h3 class="fn"><a name="activated"></a><span class="type">void</span> Q3ComboBox::<span class="name">activated</span> ( <span class="type">int</span> <i>index</i> )<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. using <a href="q3combobox.html#currentItem-prop">setCurrentItem</a>().</p>
<!-- @@@activated -->
<!-- $$$activated$$$activatedconstQString& -->
<h3 class="fn"><a name="activated-2"></a><span class="type">void</span> Q3ComboBox::<span class="name">activated</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>string</i> )<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>
<!-- @@@activated -->
<!-- $$$autoResize[overload1]$$$autoResize -->
<h3 class="fn"><a name="autoResize"></a><span class="type">bool</span> Q3ComboBox::<span class="name">autoResize</span> () const</h3>
<p>Returns true if auto-resize is enabled; otherwise returns false.</p>
<p><b>See also </b><a href="q3combobox.html#setAutoResize">setAutoResize</a>() and <a href="q3combobox-obsolete.html#autoResize-prop" class="obsolete">autoResize</a>.</p>
<!-- @@@autoResize -->
<!-- $$$changeItem[overload1]$$$changeItemconstQString&int -->
<h3 class="fn"><a name="changeItem"></a><span class="type">void</span> Q3ComboBox::<span class="name">changeItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>t</i>, <span class="type">int</span> <i>index</i> )</h3>
<p>Replaces the item at position <i>index</i> with the text <i>t</i>.</p>
<!-- @@@changeItem -->
<!-- $$$changeItem$$$changeItemconstQPixmap&int -->
<h3 class="fn"><a name="changeItem-2"></a><span class="type">void</span> Q3ComboBox::<span class="name">changeItem</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>im</i>, <span class="type">int</span> <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><b>See also </b><a href="q3combobox.html#insertItem">insertItem</a>().</p>
<!-- @@@changeItem -->
<!-- $$$changeItem$$$changeItemconstQPixmap&constQString&int -->
<h3 class="fn"><a name="changeItem-3"></a><span class="type">void</span> Q3ComboBox::<span class="name">changeItem</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>im</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>t</i>, <span class="type">int</span> <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><b>See also </b><a href="q3combobox.html#insertItem">insertItem</a>().</p>
<!-- @@@changeItem -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3ComboBox::<span class="name">clear</span> ()<tt> [slot]</tt></h3>
<p>Removes all combobox items.</p>
<!-- @@@clear -->
<!-- $$$clearEdit[overload1]$$$clearEdit -->
<h3 class="fn"><a name="clearEdit"></a><span class="type">void</span> Q3ComboBox::<span class="name">clearEdit</span> ()<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><b>See also </b><a href="q3combobox.html#setEditText">setEditText</a>().</p>
<!-- @@@clearEdit -->
<!-- $$$clearValidator[overload1]$$$clearValidator -->
<h3 class="fn"><a name="clearValidator"></a><span class="type">void</span> Q3ComboBox::<span class="name">clearValidator</span> ()<tt> [slot]</tt></h3>
<p>This slot is equivalent to setValidator( 0 ).</p>
<!-- @@@clearValidator -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn"><a name="focusInEvent"></a><span class="type">void</span> Q3ComboBox::<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> Q3ComboBox::<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 -->
<!-- $$$hide[overload1]$$$hide -->
<h3 class="fn"><a name="hide"></a><span class="type">void</span> Q3ComboBox::<span class="name">hide</span> ()</h3>
<p>Hides the combobox.</p>
<p><b>See also </b><a href="qwidget.html#hide">QWidget::hide</a>().</p>
<!-- @@@hide -->
<!-- $$$highlighted[overload1]$$$highlightedint -->
<h3 class="fn"><a name="highlighted"></a><span class="type">void</span> Q3ComboBox::<span class="name">highlighted</span> ( <span class="type">int</span> <i>index</i> )<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. using <a href="q3combobox.html#currentItem-prop">setCurrentItem</a>().</p>
<!-- @@@highlighted -->
<!-- $$$highlighted$$$highlightedconstQString& -->
<h3 class="fn"><a name="highlighted-2"></a><span class="type">void</span> Q3ComboBox::<span class="name">highlighted</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>string</i> )<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>
<!-- @@@highlighted -->
<!-- $$$insertItem[overload1]$$$insertItemconstQString&int -->
<h3 class="fn"><a name="insertItem"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>t</i>, <span class="type">int</span> <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>
<!-- @@@insertItem -->
<!-- $$$insertItem$$$insertItemconstQPixmap&int -->
<h3 class="fn"><a name="insertItem-2"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertItem</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>pixmap</i>, <span class="type">int</span> <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>
<!-- @@@insertItem -->
<!-- $$$insertItem$$$insertItemconstQPixmap&constQString&int -->
<h3 class="fn"><a name="insertItem-3"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertItem</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>pixmap</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i>, <span class="type">int</span> <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>
<!-- @@@insertItem -->
<!-- $$$insertStrList[overload1]$$$insertStrListconstchar**intint -->
<h3 class="fn"><a name="insertStrList"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertStrList</span> ( const <span class="type">char</span> ** <i>strings</i>, <span class="type">int</span> <i>numStrings</i> = -1, <span class="type">int</span> <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 class="cpp"> <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">char</span><span class="operator">*</span> items<span class="operator">[</span><span class="operator">]</span> <span class="operator">=</span> { <span class="string">"red"</span><span class="operator">,</span> <span class="string">"green"</span><span class="operator">,</span> <span class="string">"blue"</span><span class="operator">,</span> <span class="number">0</span> };
combo<span class="operator">-</span><span class="operator">></span>insertStrList( items );</pre>
<p><b>See also </b><a href="q3combobox.html#insertStringList">insertStringList</a>().</p>
<!-- @@@insertStrList -->
<!-- $$$insertStrList$$$insertStrListconstQ3StrList&int -->
<h3 class="fn"><a name="insertStrList-2"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertStrList</span> ( const <span class="type"><a href="q3strlist.html">Q3StrList</a></span> & <i>list</i>, <span class="type">int</span> <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>
<!-- @@@insertStrList -->
<!-- $$$insertStrList$$$insertStrListconstQ3StrList*int -->
<h3 class="fn"><a name="insertStrList-3"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertStrList</span> ( const <span class="type"><a href="q3strlist.html">Q3StrList</a></span> * <i>list</i>, <span class="type">int</span> <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>
<!-- @@@insertStrList -->
<!-- $$$insertStringList[overload1]$$$insertStringListconstQStringList&int -->
<h3 class="fn"><a name="insertStringList"></a><span class="type">void</span> Q3ComboBox::<span class="name">insertStringList</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> & <i>list</i>, <span class="type">int</span> <i>index</i> = -1 )</h3>
<p>Inserts the <i>list</i> of strings at position <i>index</i> in the combobox.</p>
<!-- @@@insertStringList -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn"><a name="keyPressEvent"></a><span class="type">void</span> Q3ComboBox::<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 -->
<!-- $$$lineEdit[overload1]$$$lineEdit -->
<h3 class="fn"><a name="lineEdit"></a><span class="type"><a href="qlineedit.html">QLineEdit</a></span> * Q3ComboBox::<span class="name">lineEdit</span> () 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><b>See also </b><a href="q3combobox.html#setLineEdit">setLineEdit</a>().</p>
<!-- @@@lineEdit -->
<!-- $$$listBox[overload1]$$$listBox -->
<h3 class="fn"><a name="listBox"></a><span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * Q3ComboBox::<span class="name">listBox</span> () 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><b>See also </b><a href="q3combobox.html#setListBox">setListBox</a>().</p>
<!-- @@@listBox -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQMouseEvent* -->
<h3 class="fn"><a name="mouseDoubleClickEvent"></a><span class="type">void</span> Q3ComboBox::<span class="name">mouseDoubleClickEvent</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#mouseDoubleClickEvent">QWidget::mouseDoubleClickEvent</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn"><a name="mouseMoveEvent"></a><span class="type">void</span> Q3ComboBox::<span class="name">mouseMoveEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn"><a name="mousePressEvent"></a><span class="type">void</span> Q3ComboBox::<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> Q3ComboBox::<span class="name">mouseReleaseEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * )<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> Q3ComboBox::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$pixmap[overload1]$$$pixmapint -->
<h3 class="fn"><a name="pixmap"></a>const <span class="type"><a href="qpixmap.html">QPixmap</a></span> * Q3ComboBox::<span class="name">pixmap</span> ( <span class="type">int</span> <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>
<!-- @@@pixmap -->
<!-- $$$popup[overload1]$$$popup -->
<h3 class="fn"><a name="popup"></a><span class="type">void</span> Q3ComboBox::<span class="name">popup</span> ()<tt> [virtual]</tt></h3>
<p>Pops up the combobox popup list.</p>
<p>If the list is empty, no items appear.</p>
<!-- @@@popup -->
<!-- $$$removeItem[overload1]$$$removeItemint -->
<h3 class="fn"><a name="removeItem"></a><span class="type">void</span> Q3ComboBox::<span class="name">removeItem</span> ( <span class="type">int</span> <i>index</i> )</h3>
<p>Removes the item at position <i>index</i>.</p>
<!-- @@@removeItem -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> Q3ComboBox::<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 -->
<!-- $$$setAutoResize[overload1]$$$setAutoResizebool -->
<h3 class="fn"><a name="setAutoResize"></a><span class="type">void</span> Q3ComboBox::<span class="name">setAutoResize</span> ( <span class="type">bool</span> <i>enable</i> )<tt> [virtual]</tt></h3>
<p>If <i>enable</i> is true, enable auto-resize; disable it otherwise.</p>
<p><b>See also </b><a href="q3combobox-obsolete.html#autoResize-prop" class="obsolete">autoResize</a>.</p>
<!-- @@@setAutoResize -->
<!-- $$$setEditText[overload1]$$$setEditTextconstQString& -->
<h3 class="fn"><a name="setEditText"></a><span class="type">void</span> Q3ComboBox::<span class="name">setEditText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>newText</i> )<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. 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><b>See also </b><a href="q3combobox.html#clearEdit">clearEdit</a>() and <a href="q3combobox.html#insertItem">insertItem</a>().</p>
<!-- @@@setEditText -->
<!-- $$$setEnabled[overload1]$$$setEnabledbool -->
<h3 class="fn"><a name="setEnabled"></a><span class="type">void</span> Q3ComboBox::<span class="name">setEnabled</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>Enables the combobox if <i>enable</i> is true; otherwise disables it.</p>
<p><b>See also </b><a href="qwidget.html#enabled-prop">QWidget::enabled</a>.</p>
<!-- @@@setEnabled -->
<!-- $$$setFont[overload1]$$$setFontconstQFont& -->
<h3 class="fn"><a name="setFont"></a><span class="type">void</span> Q3ComboBox::<span class="name">setFont</span> ( const <span class="type"><a href="qfont.html">QFont</a></span> & <i>font</i> )</h3>
<p>Sets the font for both the combobox button and the combobox popup list to <i>font</i>.</p>
<!-- @@@setFont -->
<!-- $$$setLineEdit[overload1]$$$setLineEditQLineEdit* -->
<h3 class="fn"><a name="setLineEdit"></a><span class="type">void</span> Q3ComboBox::<span class="name">setLineEdit</span> ( <span class="type"><a href="qlineedit.html">QLineEdit</a></span> * <i>edit</i> )<tt> [virtual]</tt></h3>
<p>Sets the line edit to use <i>edit</i> instead of the current line edit.</p>
<p><b>See also </b><a href="q3combobox.html#lineEdit">lineEdit</a>().</p>
<!-- @@@setLineEdit -->
<!-- $$$setListBox[overload1]$$$setListBoxQ3ListBox* -->
<h3 class="fn"><a name="setListBox"></a><span class="type">void</span> Q3ComboBox::<span class="name">setListBox</span> ( <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>newListBox</i> )<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->text(n) returns non-null for 0 <= n < newListbox-><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><b>See also </b><a href="q3combobox.html#listBox">listBox</a>().</p>
<!-- @@@setListBox -->
<!-- $$$setPalette[overload1]$$$setPaletteconstQPalette& -->
<h3 class="fn"><a name="setPalette"></a><span class="type">void</span> Q3ComboBox::<span class="name">setPalette</span> ( const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i> )</h3>
<p>Sets the palette for both the combobox button and the combobox popup list to <i>palette</i>.</p>
<!-- @@@setPalette -->
<!-- $$$setValidator[overload1]$$$setValidatorconstQValidator* -->
<h3 class="fn"><a name="setValidator"></a><span class="type">void</span> Q3ComboBox::<span class="name">setValidator</span> ( const <span class="type"><a href="qvalidator.html">QValidator</a></span> * <i>v</i> )<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><b>See also </b><a href="q3combobox.html#validator">validator</a>(), <a href="q3combobox.html#clearValidator">clearValidator</a>(), and <a href="qvalidator.html">QValidator</a>.</p>
<!-- @@@setValidator -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> Q3ComboBox::<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 call <a href="q3combobox.html#setFont">setFont</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$text[overload1]$$$textint -->
<h3 class="fn"><a name="text"></a><span class="type"><a href="qstring.html">QString</a></span> Q3ComboBox::<span class="name">text</span> ( <span class="type">int</span> <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><b>See also </b><a href="q3combobox.html#currentText-prop">currentText</a>().</p>
<!-- @@@text -->
<!-- $$$textChanged[overload1]$$$textChangedconstQString& -->
<h3 class="fn"><a name="textChanged"></a><span class="type">void</span> Q3ComboBox::<span class="name">textChanged</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>string</i> )<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>
<!-- @@@textChanged -->
<!-- $$$updateMask[overload1]$$$updateMask -->
<h3 class="fn"><a name="updateMask"></a><span class="type">void</span> Q3ComboBox::<span class="name">updateMask</span> ()<tt> [protected]</tt></h3>
<p>Updates the widget mask.</p>
<p><b>See also </b><a href="qwidget.html#setMask">QWidget::setMask</a>().</p>
<!-- @@@updateMask -->
<!-- $$$validator[overload1]$$$validator -->
<h3 class="fn"><a name="validator"></a>const <span class="type"><a href="qvalidator.html">QValidator</a></span> * Q3ComboBox::<span class="name">validator</span> () const</h3>
<p>Returns the validator which constrains editing for this combobox if there is one; otherwise returns 0.</p>
<p><b>See also </b><a href="q3combobox.html#setValidator">setValidator</a>(), <a href="q3combobox.html#clearValidator">clearValidator</a>(), and <a href="qvalidator.html">QValidator</a>.</p>
<!-- @@@validator -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQWheelEvent* -->
<h3 class="fn"><a name="wheelEvent"></a><span class="type">void</span> Q3ComboBox::<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 class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation 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>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
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>
</body>
</html>
|