summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/examples/completer.qdoc16
-rw-r--r--examples/tools/completer/mainwindow.cpp4
2 files changed, 14 insertions, 6 deletions
diff --git a/doc/src/examples/completer.qdoc b/doc/src/examples/completer.qdoc
index 9aaaf66052..3805a7cbc3 100644
--- a/doc/src/examples/completer.qdoc
+++ b/doc/src/examples/completer.qdoc
@@ -100,9 +100,9 @@
\section1 MainWindow Class Definition
- The \c MainWindow class is a subclass of QMainWindow and implements four
- private slots - \c about(), \c changeCase(), \c changeMode(), and
- \c changeModel().
+ The \c MainWindow class is a subclass of QMainWindow and implements five
+ private slots - \c about(), \c changeCase(), \c changeMode(), \c changeModel(),
+ and \c changeMaxVisible().
\snippet examples/tools/completer/mainwindow.h 0
@@ -126,6 +126,9 @@
\snippet examples/tools/completer/mainwindow.cpp 0
+ The \c maxVisibleSpinBox is created and determines the number of visible
+ item in the completer
+
The \c wrapCheckBox is then set up. This \c checkBox determines if the
\c{completer}'s \l{QCompleter::setWrapAround()}{setWrapAround()} property
is enabled or disabled.
@@ -242,10 +245,15 @@
\snippet examples/tools/completer/mainwindow.cpp 14
- The \c about() function provides a brief description about the example.
+ The \c changeMaxVisible() update the maximum number of visible items in
+ the completer.
\snippet examples/tools/completer/mainwindow.cpp 15
+ The \c about() function provides a brief description about the example.
+
+ \snippet examples/tools/completer/mainwindow.cpp 16
+
\section1 \c main() Function
The \c main() function instantiates QApplication and \c MainWindow and
diff --git a/examples/tools/completer/mainwindow.cpp b/examples/tools/completer/mainwindow.cpp
index 06f16de175..c98482a536 100644
--- a/examples/tools/completer/mainwindow.cpp
+++ b/examples/tools/completer/mainwindow.cpp
@@ -75,15 +75,15 @@ MainWindow::MainWindow(QWidget *parent)
caseCombo->addItem(tr("Case Insensitive"));
caseCombo->addItem(tr("Case Sensitive"));
caseCombo->setCurrentIndex(0);
+//! [0]
+//! [1]
QLabel *maxVisibleLabel = new QLabel;
maxVisibleLabel->setText(tr("Max Visible Items"));
maxVisibleSpinBox = new QSpinBox;
maxVisibleSpinBox->setRange(3,25);
maxVisibleSpinBox->setValue(10);
-//! [0]
-//! [1]
wrapCheckBox = new QCheckBox;
wrapCheckBox->setText(tr("Wrap around completions"));
wrapCheckBox->setChecked(true);