summaryrefslogtreecommitdiffstats
path: root/examples/tools
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-24 09:45:33 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-27 13:04:30 (GMT)
commit3643028959f0b38350e57e60ba4000435b75e592 (patch)
treec129e4dee11487abd437ab8ebd993ba261e06fa6 /examples/tools
parentcf66c667a97c0079141eb3f2d9e997b7378ae792 (diff)
parentc36139c665e61866aff4bf8572890a735167a7d0 (diff)
downloadQt-3643028959f0b38350e57e60ba4000435b75e592.zip
Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.gz
Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.bz2
Merge commit 'qt/master-stable'
Conflicts: configure.exe qmake/Makefile.unix qmake/generators/makefile.cpp src/corelib/global/qglobal.h src/corelib/kernel/kernel.pri src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qsharedmemory_unix.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/kernel/qaction.cpp src/gui/kernel/qaction.h src/gui/kernel/qaction_p.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget.h src/gui/kernel/qwidget_mac.mm src/gui/painting/qgraphicssystemfactory.cpp src/gui/styles/qwindowsstyle.cpp src/gui/text/qfontengine_qpf.cpp src/gui/widgets/qabstractscrollarea_p.h src/network/access/qnetworkaccessdebugpipebackend.cpp src/network/socket/qlocalsocket_unix.cpp src/network/socket/qnativesocketengine_p.h src/network/socket/qnativesocketengine_unix.cpp src/openvg/qpaintengine_vg.cpp tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qdir/tst_qdir.cpp tests/auto/qfile/tst_qfile.cpp tests/auto/qobject/tst_qobject.cpp tests/auto/qpathclipper/qpathclipper.pro tests/auto/qprocess/tst_qprocess.cpp tests/auto/qsettings/tst_qsettings.cpp tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qsqlquerymodel/qsqlquerymodel.pro tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro tests/auto/qsqltablemodel/qsqltablemodel.pro tests/auto/qsqlthread/qsqlthread.pro tests/auto/qwidget/tst_qwidget.cpp
Diffstat (limited to 'examples/tools')
-rw-r--r--examples/tools/codecs/encodedfiles/.gitattributes2
-rw-r--r--examples/tools/codecs/encodedfiles/iso-8859-1.txt12
-rw-r--r--examples/tools/codecs/encodedfiles/iso-8859-15.txt16
-rw-r--r--examples/tools/completer/mainwindow.cpp24
-rw-r--r--examples/tools/completer/mainwindow.h3
-rw-r--r--examples/tools/regexp/regexpdialog.cpp1
6 files changed, 38 insertions, 20 deletions
diff --git a/examples/tools/codecs/encodedfiles/.gitattributes b/examples/tools/codecs/encodedfiles/.gitattributes
deleted file mode 100644
index 996aab2..0000000
--- a/examples/tools/codecs/encodedfiles/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-iso-8859-15.txt -crlf
-iso-8859-1.txt -crlf
diff --git a/examples/tools/codecs/encodedfiles/iso-8859-1.txt b/examples/tools/codecs/encodedfiles/iso-8859-1.txt
index 4a7ebe3..d7fcaca 100644
--- a/examples/tools/codecs/encodedfiles/iso-8859-1.txt
+++ b/examples/tools/codecs/encodedfiles/iso-8859-1.txt
@@ -1,6 +1,6 @@
-Paulo Coelho: O Gênio e as Rosas
-Anna Hallström, Urban Östberg: Svår svenska
-Darrell Huff: How to Lie with Statistics
-Franz Kafka: Das Schloß
-Walter Moers: Die 13½ Leben des Käpt'n Blaubär
-Dag Solstad: Forsøk på å beskrive det ugjennomtrengelige
+Paulo Coelho: O Gênio e as Rosas
+Anna Hallström, Urban Östberg: Svår svenska
+Darrell Huff: How to Lie with Statistics
+Franz Kafka: Das Schloß
+Walter Moers: Die 13½ Leben des Käpt'n Blaubär
+Dag Solstad: Forsøk på å beskrive det ugjennomtrengelige
diff --git a/examples/tools/codecs/encodedfiles/iso-8859-15.txt b/examples/tools/codecs/encodedfiles/iso-8859-15.txt
index cd43ea3..be2d83c 100644
--- a/examples/tools/codecs/encodedfiles/iso-8859-15.txt
+++ b/examples/tools/codecs/encodedfiles/iso-8859-15.txt
@@ -1,8 +1,8 @@
-Paulo Coelho: O Gênio e as Rosas
-Jean-Pierre Coffe: À table en famille avec 15 ¤ par jour
-Anna Hallström, Urban Östberg: Svår svenska
-Darrell Huff: How to Lie with Statistics
-Franz Kafka: Das Schloß
-Helena Lehecková: T¨ekkiä suomalaisille
-Arthur Rimbaud: ¼uvres complètes
-Dag Solstad: Forsøk på å beskrive det ugjennomtrengelige
+Paulo Coelho: O Gênio e as Rosas
+Jean-Pierre Coffe: À table en famille avec 15 ¤ par jour
+Anna Hallström, Urban Östberg: Svår svenska
+Darrell Huff: How to Lie with Statistics
+Franz Kafka: Das Schloß
+Helena Lehecková: T¨ekkiä suomalaisille
+Arthur Rimbaud: ¼uvres complètes
+Dag Solstad: Forsøk på å beskrive det ugjennomtrengelige
diff --git a/examples/tools/completer/mainwindow.cpp b/examples/tools/completer/mainwindow.cpp
index 8ea1c39..c98482a 100644
--- a/examples/tools/completer/mainwindow.cpp
+++ b/examples/tools/completer/mainwindow.cpp
@@ -78,6 +78,12 @@ MainWindow::MainWindow(QWidget *parent)
//! [0]
//! [1]
+ QLabel *maxVisibleLabel = new QLabel;
+ maxVisibleLabel->setText(tr("Max Visible Items"));
+ maxVisibleSpinBox = new QSpinBox;
+ maxVisibleSpinBox->setRange(3,25);
+ maxVisibleSpinBox->setValue(10);
+
wrapCheckBox = new QCheckBox;
wrapCheckBox->setText(tr("Wrap around completions"));
wrapCheckBox->setChecked(true);
@@ -90,6 +96,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(modelCombo, SIGNAL(activated(int)), this, SLOT(changeModel()));
connect(modeCombo, SIGNAL(activated(int)), this, SLOT(changeMode(int)));
connect(caseCombo, SIGNAL(activated(int)), this, SLOT(changeCase(int)));
+ connect(maxVisibleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeMaxVisible(int)));
//! [2]
//! [3]
@@ -99,9 +106,10 @@ MainWindow::MainWindow(QWidget *parent)
layout->addWidget(modelLabel, 0, 0); layout->addWidget(modelCombo, 0, 1);
layout->addWidget(modeLabel, 1, 0); layout->addWidget(modeCombo, 1, 1);
layout->addWidget(caseLabel, 2, 0); layout->addWidget(caseCombo, 2, 1);
- layout->addWidget(wrapCheckBox, 3, 0);
- layout->addWidget(contentsLabel, 4, 0, 1, 2);
- layout->addWidget(lineEdit, 5, 0, 1, 2);
+ layout->addWidget(maxVisibleLabel, 3, 0); layout->addWidget(maxVisibleSpinBox, 3, 1);
+ layout->addWidget(wrapCheckBox, 4, 0);
+ layout->addWidget(contentsLabel, 5, 0, 1, 2);
+ layout->addWidget(lineEdit, 6, 0, 1, 2);
centralWidget->setLayout(layout);
setCentralWidget(centralWidget);
@@ -205,6 +213,7 @@ void MainWindow::changeModel()
{
delete completer;
completer = new QCompleter(this);
+ completer->setMaxVisibleItems(maxVisibleSpinBox->value());
switch (modelCombo->currentIndex()) {
default:
@@ -256,9 +265,16 @@ void MainWindow::changeModel()
//! [14]
//! [15]
+void MainWindow::changeMaxVisible(int max)
+{
+ completer->setMaxVisibleItems(max);
+}
+//! [15]
+
+//! [16]
void MainWindow::about()
{
QMessageBox::about(this, tr("About"), tr("This example demonstrates the "
"different features of the QCompleter class."));
}
-//! [15]
+//! [16]
diff --git a/examples/tools/completer/mainwindow.h b/examples/tools/completer/mainwindow.h
index f6c962b..30b8d26 100644
--- a/examples/tools/completer/mainwindow.h
+++ b/examples/tools/completer/mainwindow.h
@@ -52,6 +52,7 @@ class QLabel;
class QLineEdit;
class QProgressBar;
class QCheckBox;
+class QSpinBox;
QT_END_NAMESPACE
//! [0]
@@ -67,6 +68,7 @@ private slots:
void changeCase(int);
void changeMode(int);
void changeModel();
+ void changeMaxVisible(int);
//! [0]
//! [1]
@@ -77,6 +79,7 @@ private:
QComboBox *caseCombo;
QComboBox *modeCombo;
QComboBox *modelCombo;
+ QSpinBox *maxVisibleSpinBox;
QCheckBox *wrapCheckBox;
QCompleter *completer;
QLabel *contentsLabel;
diff --git a/examples/tools/regexp/regexpdialog.cpp b/examples/tools/regexp/regexpdialog.cpp
index 42cb617..7aab1be 100644
--- a/examples/tools/regexp/regexpdialog.cpp
+++ b/examples/tools/regexp/regexpdialog.cpp
@@ -69,6 +69,7 @@ RegExpDialog::RegExpDialog(QWidget *parent)
syntaxComboBox->addItem(tr("Regular expression v2"), QRegExp::RegExp2);
syntaxComboBox->addItem(tr("Wildcard"), QRegExp::Wildcard);
syntaxComboBox->addItem(tr("Fixed string"), QRegExp::FixedString);
+ syntaxComboBox->addItem(tr("W3C Xml Schema 1.1"), QRegExp::W3CXmlSchema11);
syntaxLabel = new QLabel(tr("&Pattern Syntax:"));
syntaxLabel->setBuddy(syntaxComboBox);