diff options
Diffstat (limited to 'doc/src/snippets/code')
9 files changed, 14 insertions, 14 deletions
diff --git a/doc/src/snippets/code/doc_src_containers.qdoc b/doc/src/snippets/code/doc_src_containers.qdoc index 5cf2aab..1f86f60 100644 --- a/doc/src/snippets/code/doc_src_containers.qdoc +++ b/doc/src/snippets/code/doc_src_containers.qdoc @@ -216,7 +216,7 @@ while (i.hasNext()) //! [17] QLinkedList<QString> list; ... -foreach (QString str, list) +foreach (const QString &str, list) qDebug() << str; //! [17] @@ -224,7 +224,7 @@ foreach (QString str, list) //! [18] QLinkedList<QString> list; ... -foreach (QString str, list) { +foreach (const QString &str, list) { if (str.isEmpty()) break; qDebug() << str; @@ -235,7 +235,7 @@ foreach (QString str, list) { //! [19] QMap<QString, int> map; ... -foreach (QString str, map.keys()) +foreach (const QString &str, map.keys()) qDebug() << str << ":" << map.value(str); //! [19] @@ -243,7 +243,7 @@ foreach (QString str, map.keys()) //! [20] QMultiMap<QString, int> map; ... -foreach (QString str, map.uniqueKeys()) { +foreach (const QString &str, map.uniqueKeys()) { foreach (int i, map.values(str)) qDebug() << str << ":" << i; } diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index c46159c..0593567 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -250,12 +250,12 @@ export PATH //! [38] cd /home/user/qt/%VERSION% -./configure -platform linux-g++ -xplatform symbian/linux-armcc -arch symbian +./configure -platform linux-g++ -xplatform symbian/linux-armcc //! [38] //! [39] cd /home/user/qt/%VERSION% -./configure -platform linux-g++ -xplatform symbian/linux-gcce -arch symbian -no-webkit +./configure -platform linux-g++ -xplatform symbian/linux-gcce -no-webkit //! [39] //! [40] diff --git a/doc/src/snippets/code/doc_src_qalgorithms.qdoc b/doc/src/snippets/code/doc_src_qalgorithms.qdoc index 78634a2..f5a73c6 100644 --- a/doc/src/snippets/code/doc_src_qalgorithms.qdoc +++ b/doc/src/snippets/code/doc_src_qalgorithms.qdoc @@ -217,7 +217,7 @@ QStringList list; list << "AlPha" << "beTA" << "gamma" << "DELTA"; QMap<QString, QString> map; -foreach (QString str, list) +foreach (const QString &str, list) map.insert(str.toLower(), str); list = map.values(); diff --git a/doc/src/snippets/code/doc_src_qset.qdoc b/doc/src/snippets/code/doc_src_qset.qdoc index ac48edb..c6e1933 100644 --- a/doc/src/snippets/code/doc_src_qset.qdoc +++ b/doc/src/snippets/code/doc_src_qset.qdoc @@ -80,7 +80,7 @@ while (i != set.constEnd()) { //! [6] QSet<QString> set; ... -foreach (QString value, set) +foreach (const QString &value, set) qDebug() << value; //! [6] diff --git a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc index 3d88a0d..f29d3ba 100644 --- a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc +++ b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc @@ -47,7 +47,7 @@ foreach (variable, container) //! [1] QList<QString> list; ... -foreach (QString str, list) +foreach (const QString &str, list) cout << str.ascii() << endl; //! [1] diff --git a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp index 2e64505..fb62347 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp @@ -51,7 +51,7 @@ connect(quitButton, SIGNAL(clicked()), &app, SLOT(quit())); //! [2] -foreach (QString path, app.libraryPaths()) +foreach (const QString &path, app.libraryPaths()) do_something(path); //! [2] diff --git a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp index c93a25c..766b249 100644 --- a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp +++ b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp @@ -158,13 +158,13 @@ appname -session id //! [10] -foreach (QString command, mySession.restartCommand()) +foreach (const QString &command, mySession.restartCommand()) do_something(command); //! [10] //! [11] -foreach (QString command, mySession.discardCommand()) +foreach (const QString &command, mySession.discardCommand()) do_something(command); //! [11] diff --git a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp index 3871289..99deb20 100644 --- a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp +++ b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp @@ -68,7 +68,7 @@ void MyWidget::lookedUp(const QHostInfo &host) return; } - foreach (QHostAddress address, host.addresses()) + foreach (const QHostAddress &address, host.addresses()) qDebug() << "Found address:" << address.toString(); } //! [3] diff --git a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp index 5c9421f..937dbb9 100644 --- a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp +++ b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp @@ -39,7 +39,7 @@ ****************************************************************************/ //! [0] -foreach (QSslCertificate cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem, +foreach (const QSslCertificate &cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem, QRegExp::Wildcard)) { qDebug() << cert.issuerInfo(QSslCertificate::Organization); } |