From 22550ed78d454353c4f0f5e6b5f7dee4a6943ade Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 27 Jan 2013 13:43:23 +0800 Subject: Doc: Fix broken \keyword link Fix 19 counts of "Can't link to 'default-constructed value'" warnings. There was only one link to "default-constructed values", so the cleanest solution was to change the keyword. Also included a related typo fix. Change-Id: I84b47743ecb72a1b2731ef65080fa1e630d478a4 Reviewed-by: Laszlo Papp Reviewed-by: Jerome Pasion --- src/corelib/doc/src/containers.qdoc | 2 +- src/corelib/kernel/qvariant.cpp | 2 +- src/corelib/tools/qpair.qdoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc index 9f63eb0a7e..30d86eac63 100644 --- a/src/corelib/doc/src/containers.qdoc +++ b/src/corelib/doc/src/containers.qdoc @@ -221,7 +221,7 @@ \codeline \snippet streaming/main.cpp 2 - \keyword default-constructed values + \keyword default-constructed value The documentation of certain container class functions refer to \e{default-constructed values}; for example, QVector diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 60ab5506a4..d70d8d9a68 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2958,7 +2958,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Returns the stored value converted to the template type \c{T}. Call canConvert() to find out whether a type can be converted. - If the value cannot be converted, \l{default-constructed value} + If the value cannot be converted, a \l{default-constructed value} will be returned. If the type \c{T} is supported by QVariant, this function behaves diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc index a79486115d..55353dc258 100644 --- a/src/corelib/tools/qpair.qdoc +++ b/src/corelib/tools/qpair.qdoc @@ -84,7 +84,7 @@ /*! \fn QPair::QPair() Constructs an empty pair. The \c first and \c second elements are - initialized with \l{default-constructed values}. + initialized with \l{default-constructed value}s. */ /*! -- cgit v1.2.3 From f262815f2ef147113780312a410eccdf4b318a82 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 26 Jan 2013 13:39:56 +0100 Subject: Fix some more old references and links to Nokia Task-number: QTBUG-28156 Change-Id: I9ba0d6f1e92103219bec1e61e716b6b2f269a8ad Reviewed-by: Laszlo Papp Reviewed-by: Jerome Pasion --- src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp | 8 ++++---- src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp | 10 +++++----- src/corelib/doc/snippets/qxmlstreamwriter/main.cpp | 4 ++-- src/corelib/doc/src/eventsandfilters.qdoc | 2 +- src/corelib/global/qnamespace.qdoc | 2 +- src/corelib/io/qurl.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp index 432b0b9167..ca178e03a0 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp @@ -45,7 +45,7 @@ QUrl url("http://www.example.com/List of holidays.xml"); //! [1] -QUrl url = QUrl::fromEncoded("http://qt.nokia.com/List%20of%20holidays.xml"); +QUrl url = QUrl::fromEncoded("http://qt-project.org/List%20of%20holidays.xml"); //! [1] @@ -73,10 +73,10 @@ http://www.example.com/cgi-bin/drawgraph.cgi?type(pie)color(green) //! [5] -QUrl baseUrl("http://qt.nokia.com/support"); -QUrl relativeUrl("../products/solutions"); +QUrl baseUrl("http://qt.digia.com/Support/"); +QUrl relativeUrl("../Product/Library/"); qDebug(baseUrl.resolved(relativeUrl).toString()); -// prints "http://qt.nokia.com/products/solutions" +// prints "http://qt.digia.com/Product/Library/" //! [5] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index eef026af75..759c31c098 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -258,7 +258,7 @@ if (url.startsWith("ftp:")) //! [26] -QByteArray url("http://qt.nokia.com/index.html"); +QByteArray url("http://qt-project.org/doc/qt-5.0/qtdoc/index.html"); if (url.endsWith(".html")) ... //! [26] @@ -286,16 +286,16 @@ QByteArray z = x.mid(5); // z == "pineapples" //! [30] -QByteArray x("Qt by NOKIA"); +QByteArray x("Qt by DIGIA"); QByteArray y = x.toLower(); -// y == "qt by nokia" +// y == "qt by digia" //! [30] //! [31] -QByteArray x("Qt by NOKIA"); +QByteArray x("Qt by DIGIA"); QByteArray y = x.toUpper(); -// y == "QT BY NOKIA" +// y == "QT BY DIGIA" //! [31] diff --git a/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp b/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp index 2a436f1a4c..5af3596171 100644 --- a/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp +++ b/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp @@ -61,8 +61,8 @@ int main(int argc, char *argv[]) stream.writeAttribute("folded", "no"); //! [write element] stream.writeStartElement("bookmark"); - stream.writeAttribute("href", "http://qt.nokia.com/"); - stream.writeTextElement("title", "Qt Home"); + stream.writeAttribute("href", "http://qt-project.org/"); + stream.writeTextElement("title", "Qt Project"); stream.writeEndElement(); // bookmark //! [write element] stream.writeEndElement(); // folder diff --git a/src/corelib/doc/src/eventsandfilters.qdoc b/src/corelib/doc/src/eventsandfilters.qdoc index 6986309c42..22a6d240dc 100644 --- a/src/corelib/doc/src/eventsandfilters.qdoc +++ b/src/corelib/doc/src/eventsandfilters.qdoc @@ -100,7 +100,7 @@ event delivery mechanisms are flexible. The documentation for QCoreApplication::notify() concisely tells the whole story; the \e{Qt Quarterly} article - \l{http://doc.qt.nokia.com/qq/qq11-events.html}{Another Look at Events} + \l{http://doc.qt.digia.com/qq/qq11-events.html}{Another Look at Events} rehashes it less concisely. Here we will explain enough for 95% of applications. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 0b0d089ba5..448451fc12 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2492,7 +2492,7 @@ "\l{http://bugreports.qt-project.org/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"), whereas Qt::ElideRight is appropriate for other strings (e.g., - "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). + "\l{http://doc.qt.digia.com/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). \sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag, QTabBar::elideMode */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2a439b3a7c..38eb0ed1e3 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3861,7 +3861,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \section1 Examples: \list - \li qt.nokia.com becomes http://qt.nokia.com + \li qt-project.org becomes http://qt-project.org \li ftp.qt-project.org becomes ftp://ftp.qt-project.org \li hostname becomes http://hostname \li /home/user/test.html becomes file:///home/user/test.html -- cgit v1.2.3 From 747348f4556440aa21c0c8aeb76cbd71da49d007 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 24 Jan 2013 14:59:55 +0100 Subject: Doc: Fixing snippets and input file for a Qt Core article. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -copied snippet and input files from Qt Widgets. -adapted new paths in the resource-system.qdoc file. -removed the old path entry in qdocconf. Task-number: QTBUG-29101 Change-Id: Ieeb118106756a1a39890ab219294de18f437c56c Reviewed-by: Topi Reiniƶ Reviewed-by: Nico Vertriest Reviewed-by: Geir Vattekar --- src/corelib/doc/qtcore.qdocconf | 3 +- .../doc/snippets/resource-system/application.pro | 14 + .../doc/snippets/resource-system/application.qrc | 10 + .../doc/snippets/resource-system/mainwindow.cpp | 392 +++++++++++++++++++++ src/corelib/doc/src/resource-system.qdoc | 6 +- 5 files changed, 420 insertions(+), 5 deletions(-) create mode 100644 src/corelib/doc/snippets/resource-system/application.pro create mode 100644 src/corelib/doc/snippets/resource-system/application.qrc create mode 100644 src/corelib/doc/snippets/resource-system/mainwindow.cpp (limited to 'src/corelib') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index cb87530f54..dc239ccf6f 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -36,7 +36,6 @@ exampledirs += \ ../ \ snippets \ ../../../examples/threads/ \ - ../../../examples/tools/ \ - ../../../examples/widgets/ + ../../../examples/tools/ imagedirs += images diff --git a/src/corelib/doc/snippets/resource-system/application.pro b/src/corelib/doc/snippets/resource-system/application.pro new file mode 100644 index 0000000000..652cc73485 --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/application.pro @@ -0,0 +1,14 @@ +QT += widgets + +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp +#! [0] +RESOURCES = application.qrc +#! [0] + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/application +INSTALLS += target + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/src/corelib/doc/snippets/resource-system/application.qrc b/src/corelib/doc/snippets/resource-system/application.qrc new file mode 100644 index 0000000000..0a776fab4d --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/application.qrc @@ -0,0 +1,10 @@ + + + images/copy.png + images/cut.png + images/new.png + images/open.png + images/paste.png + images/save.png + + diff --git a/src/corelib/doc/snippets/resource-system/mainwindow.cpp b/src/corelib/doc/snippets/resource-system/mainwindow.cpp new file mode 100644 index 0000000000..8bdd0303de --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/mainwindow.cpp @@ -0,0 +1,392 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +#include + +#include "mainwindow.h" +//! [0] + +//! [1] +MainWindow::MainWindow() +//! [1] //! [2] +{ + textEdit = new QPlainTextEdit; + setCentralWidget(textEdit); + + createActions(); + createMenus(); + createToolBars(); + createStatusBar(); + + readSettings(); + + connect(textEdit->document(), SIGNAL(contentsChanged()), + this, SLOT(documentWasModified())); + + setCurrentFile(""); + setUnifiedTitleAndToolBarOnMac(true); +} +//! [2] + +//! [3] +void MainWindow::closeEvent(QCloseEvent *event) +//! [3] //! [4] +{ + if (maybeSave()) { + writeSettings(); + event->accept(); + } else { + event->ignore(); + } +} +//! [4] + +//! [5] +void MainWindow::newFile() +//! [5] //! [6] +{ + if (maybeSave()) { + textEdit->clear(); + setCurrentFile(""); + } +} +//! [6] + +//! [7] +void MainWindow::open() +//! [7] //! [8] +{ + if (maybeSave()) { + QString fileName = QFileDialog::getOpenFileName(this); + if (!fileName.isEmpty()) + loadFile(fileName); + } +} +//! [8] + +//! [9] +bool MainWindow::save() +//! [9] //! [10] +{ + if (curFile.isEmpty()) { + return saveAs(); + } else { + return saveFile(curFile); + } +} +//! [10] + +//! [11] +bool MainWindow::saveAs() +//! [11] //! [12] +{ + QString fileName = QFileDialog::getSaveFileName(this); + if (fileName.isEmpty()) + return false; + + return saveFile(fileName); +} +//! [12] + +//! [13] +void MainWindow::about() +//! [13] //! [14] +{ + QMessageBox::about(this, tr("About Application"), + tr("The Application example demonstrates how to " + "write modern GUI applications using Qt, with a menu bar, " + "toolbars, and a status bar.")); +} +//! [14] + +//! [15] +void MainWindow::documentWasModified() +//! [15] //! [16] +{ + setWindowModified(textEdit->document()->isModified()); +} +//! [16] + +//! [17] +void MainWindow::createActions() +//! [17] //! [18] +{ + newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this); + newAct->setShortcuts(QKeySequence::New); + newAct->setStatusTip(tr("Create a new file")); + connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); + +//! [19] + openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this); + openAct->setShortcuts(QKeySequence::Open); + openAct->setStatusTip(tr("Open an existing file")); + connect(openAct, SIGNAL(triggered()), this, SLOT(open())); +//! [18] //! [19] + + saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this); + saveAct->setShortcuts(QKeySequence::Save); + saveAct->setStatusTip(tr("Save the document to disk")); + connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); + + saveAsAct = new QAction(tr("Save &As..."), this); + saveAsAct->setShortcuts(QKeySequence::SaveAs); + saveAsAct->setStatusTip(tr("Save the document under a new name")); + connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); + +//! [20] + exitAct = new QAction(tr("E&xit"), this); + exitAct->setShortcuts(QKeySequence::Quit); +//! [20] + exitAct->setStatusTip(tr("Exit the application")); + connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); + +//! [21] + cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this); +//! [21] + cutAct->setShortcuts(QKeySequence::Cut); + cutAct->setStatusTip(tr("Cut the current selection's contents to the " + "clipboard")); + connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut())); + + copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this); + copyAct->setShortcuts(QKeySequence::Copy); + copyAct->setStatusTip(tr("Copy the current selection's contents to the " + "clipboard")); + connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy())); + + pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this); + pasteAct->setShortcuts(QKeySequence::Paste); + pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current " + "selection")); + connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste())); + + aboutAct = new QAction(tr("&About"), this); + aboutAct->setStatusTip(tr("Show the application's About box")); + connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); + +//! [22] + aboutQtAct = new QAction(tr("About &Qt"), this); + aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); + connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); +//! [22] + +//! [23] + cutAct->setEnabled(false); +//! [23] //! [24] + copyAct->setEnabled(false); + connect(textEdit, SIGNAL(copyAvailable(bool)), + cutAct, SLOT(setEnabled(bool))); + connect(textEdit, SIGNAL(copyAvailable(bool)), + copyAct, SLOT(setEnabled(bool))); +} +//! [24] + +//! [25] //! [26] +void MainWindow::createMenus() +//! [25] //! [27] +{ + fileMenu = menuBar()->addMenu(tr("&File")); + fileMenu->addAction(newAct); +//! [28] + fileMenu->addAction(openAct); +//! [28] + fileMenu->addAction(saveAct); +//! [26] + fileMenu->addAction(saveAsAct); + fileMenu->addSeparator(); + fileMenu->addAction(exitAct); + + editMenu = menuBar()->addMenu(tr("&Edit")); + editMenu->addAction(cutAct); + editMenu->addAction(copyAct); + editMenu->addAction(pasteAct); + + menuBar()->addSeparator(); + + helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(aboutAct); + helpMenu->addAction(aboutQtAct); +} +//! [27] + +//! [29] //! [30] +void MainWindow::createToolBars() +{ + fileToolBar = addToolBar(tr("File")); + fileToolBar->addAction(newAct); +//! [29] //! [31] + fileToolBar->addAction(openAct); +//! [31] + fileToolBar->addAction(saveAct); + + editToolBar = addToolBar(tr("Edit")); + editToolBar->addAction(cutAct); + editToolBar->addAction(copyAct); + editToolBar->addAction(pasteAct); +} +//! [30] + +//! [32] +void MainWindow::createStatusBar() +//! [32] //! [33] +{ + statusBar()->showMessage(tr("Ready")); +} +//! [33] + +//! [34] //! [35] +void MainWindow::readSettings() +//! [34] //! [36] +{ + QSettings settings("QtProject", "Application Example"); + QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + QSize size = settings.value("size", QSize(400, 400)).toSize(); + resize(size); + move(pos); +} +//! [35] //! [36] + +//! [37] //! [38] +void MainWindow::writeSettings() +//! [37] //! [39] +{ + QSettings settings("QtProject", "Application Example"); + settings.setValue("pos", pos()); + settings.setValue("size", size()); +} +//! [38] //! [39] + +//! [40] +bool MainWindow::maybeSave() +//! [40] //! [41] +{ + if (textEdit->document()->isModified()) { + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("Application"), + tr("The document has been modified.\n" + "Do you want to save your changes?"), + QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); + if (ret == QMessageBox::Save) + return save(); + else if (ret == QMessageBox::Cancel) + return false; + } + return true; +} +//! [41] + +//! [42] +void MainWindow::loadFile(const QString &fileName) +//! [42] //! [43] +{ + QFile file(fileName); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return; + } + + QTextStream in(&file); +#ifndef QT_NO_CURSOR + QApplication::setOverrideCursor(Qt::WaitCursor); +#endif + textEdit->setPlainText(in.readAll()); +#ifndef QT_NO_CURSOR + QApplication::restoreOverrideCursor(); +#endif + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File loaded"), 2000); +} +//! [43] + +//! [44] +bool MainWindow::saveFile(const QString &fileName) +//! [44] //! [45] +{ + QFile file(fileName); + if (!file.open(QFile::WriteOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot write file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return false; + } + + QTextStream out(&file); +#ifndef QT_NO_CURSOR + QApplication::setOverrideCursor(Qt::WaitCursor); +#endif + out << textEdit->toPlainText(); +#ifndef QT_NO_CURSOR + QApplication::restoreOverrideCursor(); +#endif + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File saved"), 2000); + return true; +} +//! [45] + +//! [46] +void MainWindow::setCurrentFile(const QString &fileName) +//! [46] //! [47] +{ + curFile = fileName; + textEdit->document()->setModified(false); + setWindowModified(false); + + QString shownName = curFile; + if (curFile.isEmpty()) + shownName = "untitled.txt"; + setWindowFilePath(shownName); +} +//! [47] + +//! [48] +QString MainWindow::strippedName(const QString &fullFileName) +//! [48] //! [49] +{ + return QFileInfo(fullFileName).fileName(); +} +//! [49] diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc index 18a6759d53..1dec196d21 100644 --- a/src/corelib/doc/src/resource-system.qdoc +++ b/src/corelib/doc/src/resource-system.qdoc @@ -50,7 +50,7 @@ Here's an example \c .qrc file: - \quotefile mainwindows/application/application.qrc + \quotefile resource-system/application.qrc The resource files listed in the \c .qrc file are files that are part of the application's source tree. The specified paths are @@ -122,7 +122,7 @@ mentioned in the application's \c .pro file so that \c qmake knows about it. For example: - \snippet mainwindows/application/application.pro 0 + \snippet resource-system/application.pro 0 \c qmake will produce make rules to generate a file called \c qrc_application.cpp that is linked into the application. This @@ -167,7 +167,7 @@ pass a resource path instead of a file name to the QIcon, QImage, or QPixmap constructor: - \snippet mainwindows/application/mainwindow.cpp 21 + \snippet resource-system/mainwindow.cpp 21 See the \l{mainwindows/application}{Application} example for an actual application that uses Qt's resource system to store its -- cgit v1.2.3 From 7bb43454b83ab0f055248b80defe0b985e59ed64 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 27 Jan 2013 12:58:38 +0800 Subject: Fix minor typos in docs, printed messages & comments Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion --- src/corelib/kernel/qmetaobject_moc_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h index 70b9d80f2d..c791f017d4 100644 --- a/src/corelib/kernel/qmetaobject_moc_p.h +++ b/src/corelib/kernel/qmetaobject_moc_p.h @@ -71,7 +71,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc break; } /* - We musn't convert 'char * const *' into 'const char **' + We mustn't convert 'char * const *' into 'const char **' and we must beware of 'Bar'. */ if (t[i] == '&' || t[i] == '*' ||t[i] == '<') -- cgit v1.2.3 From f0c8e63e5bbd5d5265478a8740cc7f0d587bfdb9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 28 Jan 2013 16:50:59 +0100 Subject: Fix documented signature for QtMessageHandler Task-number: QTBUG-29352 Change-Id: I46190a59cd73e53e778551a2d33c6b2801e9587e Reviewed-by: Thiago Macieira --- src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index a3a458fbc7..62ce04a6f8 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -535,7 +535,7 @@ CApaApplication *myApplicationFactory(); //! [49] -void myMessageHandler(QtMsgType, const QMessageLogContext &, const char *); +void myMessageHandler(QtMsgType, const QMessageLogContext &, const QString &); //! [49] //! [50] -- cgit v1.2.3 From d48534302c903113be25a61184b4c9dfb7060df4 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 5 Jan 2013 23:50:35 +0800 Subject: Doc: Fix description about Qt::UniqueConnection Qt::UniqueConnection is a flag, not a standalone connection type. Change-Id: Ibafb7306f3d60753a4381897488131e6484d368f Reviewed-by: Thiago Macieira --- src/corelib/global/qnamespace.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f157190591..02342599a2 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -523,11 +523,11 @@ application to deadlock. \value UniqueConnection - Same as AutoConnection, but the connection is made only if - it does not duplicate an existing connection. i.e., if the - same signal is already connected to the same slot for the - same pair of objects, then the connection will fail. This - connection type was introduced in Qt 4.6. + This is a flag that can be combined with any one of the above + connection types, using a bitwise OR. When Qt::UniqueConnection is + set, QObject::connect() will fail if the connection already exists + (i.e. if the same signal is already connected to the same slot + for the same pair of objects). This flag was introduced in Qt 4.6. With queued connections, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the -- cgit v1.2.3 From 52a317092eb7693c83c4917282283ea53fecd220 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Wed, 23 Jan 2013 19:39:47 +0800 Subject: Doc: Fix references to Qt Test QtTestLib and QTestLib don't exist. The proper name is "QtTest" (code) or "Qt Test" (English) http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation http://lists.qt-project.org/pipermail/interest/2012-December/005221.html Files paths in qttestlib.qdocconf can't be changed easily however, as it breaks things. So, they're left as they are. Change-Id: Ifbc44ea858c453bedad8cd7723f847e67fc7a85a Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira Reviewed-by: Jerome Pasion --- src/corelib/kernel/qobject_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index d8bc87d13e..e4b4ce8b42 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -69,7 +69,7 @@ class QThreadData; class QObjectConnectionListVector; namespace QtSharedPointer { struct ExternalRefCountData; } -/* for QtTestLib */ +/* for Qt Test */ struct QSignalSpyCallbackSet { typedef void (*BeginCallback)(QObject *caller, int signal_or_method_index, void **argv); -- cgit v1.2.3 From 4b6bd14063875167a018495373a978ca3f003229 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Jan 2013 12:33:42 -0800 Subject: Let ICC 13 build Qt again if the system compiler is GCC 4.7. GCC 4.7 has new builtins in x86intrin.h that ICC 13 does not (yet) understand, causing compilation errors. /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/adxintrin.h(36): error: identifier "__builtin_ia32_addcarryx_u32" is undefined Change-Id: I1845ccc3bf3ac15aef063bc3f998c5839fa51866 Reviewed-by: Olivier Goffart --- src/corelib/tools/qsimd_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 2d0e554de8..3f570c7a44 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -141,7 +141,8 @@ QT_BEGIN_HEADER #endif // other x86 intrinsics -#if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) +#if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) && \ + (!defined(Q_CC_INTEL) || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) #define QT_COMPILER_SUPPORTS_X86INTRIN #include #endif -- cgit v1.2.3 From 06a6d1da589d68d72ef70bc0b19ab9ef39593164 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 30 Jan 2013 17:20:33 +0100 Subject: substitute fixed version numbers in qdocconf files with variables Change-Id: Ie57765c10a8e90d6fc74ee5a8fd84bfc7cd8bcf2 Reviewed-by: Jerome Pasion Reviewed-by: Joerg Bornemann --- src/corelib/doc/qtcore.qdocconf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index cb87530f54..ac58bda07f 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtCore description = Qt Core Reference Documentation url = http://qt-project.org/doc/qtcore -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = core qhp.projects = QtCore qhp.QtCore.file = qtcore.qhp -qhp.QtCore.namespace = org.qt-project.qtcore.501 +qhp.QtCore.namespace = org.qt-project.qtcore.$QT_VERSION_TAG qhp.QtCore.virtualFolder = qtcore qhp.QtCore.indexTitle = Qt Core qhp.QtCore.indexRoot = -qhp.QtCore.filterAttributes = qtcore 5.0.1 qtrefdoc -qhp.QtCore.customFilters.Qt.name = QtCore 5.0.1 -qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.1 +qhp.QtCore.filterAttributes = qtcore $QT_VERSION qtrefdoc +qhp.QtCore.customFilters.Qt.name = QtCore $QT_VERSION +qhp.QtCore.customFilters.Qt.filterAttributes = qtcore $QT_VERSION qhp.QtCore.subprojects = classes qhp.QtCore.subprojects.classes.title = C++ Classes qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes -- cgit v1.2.3 From 2aa9f5d153ee9db1c904fdf98e814feb938e7bb2 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 1 Feb 2013 11:05:49 +0100 Subject: Bump Qt version to 5.0.2 Change-Id: I573601fb609cdb632fbb422920801a24be4c0448 Reviewed-by: Lars Knoll --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 6da275712f..13bdc7553f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -45,11 +45,11 @@ #include -#define QT_VERSION_STR "5.0.1" +#define QT_VERSION_STR "5.0.2" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x050001 +#define QT_VERSION 0x050002 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ -- cgit v1.2.3 From c5c584c116798c495d78a4d89c568a77bc065010 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 1 Feb 2013 14:39:23 +0100 Subject: Optimize code sample of QObject::isSignalConnected Since isSignalConnected is meant to be used in performance critical code, and that QMetaMethod::fromSignal is relatively slow, it is better to have it a a static variable in the code sample, as a good recommendation on how to use it. Since QMetaMethod::fromSignal should not change during the life of the program, it should be safe. Also, if different threads run at the same time, both should lead to the same result. Change-Id: Ib6113d11ca93f216bc3a92aea4eaa4da6a4151ca Reviewed-by: Thiago Macieira --- src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp index 932a006436..bafd3f8eb8 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp @@ -480,7 +480,8 @@ QObject::disconnect(lineEdit, &QLineEdit::textChanged, //! [48] //! [49] -if (isSignalConnected(QMetaMethod::fromSignal(&MyObject::valueChanged))) { +static const QMetaMethod valueChangedSignal = QMetaMethod::fromSignal(&MyObject::valueChanged); +if (isSignalConnected(valueChangedSignal)) { QByteArray data; data = get_the_value(); // expensive operation emit valueChanged(data); -- cgit v1.2.3 From 86ca28774be1f91af26b518f0e945f00ffe6ba4a Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 17:23:29 +0000 Subject: Add the missing "\since 5.0" reference for the QTimer method Change-Id: I9f2bb97eed7a1e2eb92865920f815055c847c84e Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtimer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index d0c2dd6380..667c490d31 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -385,6 +385,7 @@ void QTimer::setInterval(int msec) /*! \property QTimer::remainingTime + \since 5.0 \brief the remaining time in milliseconds Returns the timer's remaining value in milliseconds left until the timeout. -- cgit v1.2.3 From 91e12dca757a8ef5c4691b70eb80db61a9d47e83 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 19 Jan 2013 16:17:51 +0100 Subject: QThread documentation: do not discourage the reimplementation of QThread The new QThread documentation now really discourage to reimplement QThread. But in fact, there are many cases where it is perfectly fine. And the example given is even a case where using worker object is wrong. The examle even contains a leak since the thread will never stop and will even leak. This changes put back some sentences from before commit d4ad9dbbf96884c0899e8f8116a8a056facd52d5. The sample code has been re-writen. Notice how reimpementing run takes less lines of code, less runtime overhead, no leaks, and also is more complete than the previous example. Change-Id: I6cb80826e917dd5ce442ccad2572ec692ccb25ab Reviewed-by: Andre Somers Reviewed-by: Geir Vattekar Reviewed-by: Debao Zhang Reviewed-by: Thiago Macieira --- .../snippets/code/src_corelib_thread_qthread.cpp | 79 +++++++++++++++------- src/corelib/kernel/qobject.cpp | 6 +- src/corelib/thread/qthread.cpp | 62 +++++++---------- 3 files changed, 82 insertions(+), 65 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp index f0bc759320..c33c8bb48a 100644 --- a/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Olivier Goffart ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -38,41 +38,68 @@ ** ****************************************************************************/ -//! [0] -class Worker : public QObject +#include +class MyObject; + +//! [reimpl-run] +class WorkerThread : public QThread { Q_OBJECT - -public slots: - void doWork() { - ... + void run() Q_DECL_OVERRIDE { + QString result; + /* expensive or blocking operation */ + emit resultReady(result); } +signals: + void resultReady(const QString &s); }; -void MyObject::putWorkerInAThread() +void MyObject::startWorkInAThread() { - Worker *worker = new Worker; - QThread *workerThread = new QThread(this); - - connect(workerThread, &QThread::started, worker, &Worker::doWork); - connect(workerThread, &QThread::finished, worker, &Worker::deleteLater); - worker->moveToThread(workerThread); - - // Starts an event loop, and emits workerThread->started() + WorkerThread *workerThread = new WorkerThread(this); + connect(workerThread, &WorkerThread::resultReady, this, &MyObject::handleResults); + connect(workerThread, &WorkerThread::finished, workerThread, &QObject::deleteLater); workerThread->start(); } -//! [0] +//! [reimpl-run] + -//! [1] -class AdvancedThreadManager : public QThread +//! [worker] +class Worker : public QObject { -protected: - void run() - { - /* ... other code to initialize thread... */ + Q_OBJECT + QThread workerThread; - // Begin event handling - exec(); +public slots: + void doWork(const QString ¶meter) { + // ... + emit resultReady(result); } + +signals: + void resultReady(const QString &result); +}; + +class Controller : public QObject +{ + Q_OBJECT + QThread workerThread; +public: + Controller() { + Worker *worker = new Worker; + worker->moveToThread(&workerThread); + connect(workerThread, &QThread::finished, worker, &QObject::deleteLater); + connect(this, &Controller::operate, worker, &Worker::doWork); + connect(worker, &Worker::resultReady, this, &Controller::handleResults); + workerThread.start(); + } + ~Controller() { + workerThread.quit(); + workerThread.wait(); + } +public slots: + void handleResults(const QString &); +signals: + void operate(const QString &); }; -//! [1] +//! [worker] diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index d125946781..a82242939d 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1917,7 +1917,11 @@ void QObject::removeEventFilter(QObject *obj) loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the - event loop is started. + event loop is started. If deleteLater() is called after the main event loop + has stopped, the object will not be deleted. + Since Qt 4.8, if deleteLater() is called on an object that lives in a + thread with no running event loop, the object will be destroyed when the + thread finishes. Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will \e not perform the deferred deletion; for the object to be diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 712681024d..bd8c6341c1 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -178,21 +178,38 @@ QThreadPrivate::~QThreadPrivate() \ingroup thread A QThread object manages one thread of control within the - program. To make code run in a separate thread, simply create a - QThread, change the thread affinity of the QObject(s) that - contain the code, and start() the new event loop. For example: + program. QThreads begin executing in run(). By default, run() starts the + event loop by calling exec() and runs a Qt event loop inside the thread. - \snippet code/src_corelib_thread_qthread.cpp 0 + You can use worker objects by moving them to the thread using + QObject::moveToThread. + + \snippet code/src_corelib_thread_qthread.cpp worker The code inside the Worker's slot would then execute in a - separate thread. In this example, the QThread triggers the - Worker's doWork() slot upon starting, and frees the Worker's - memory upon terminating. However, you are free to connect the + separate thread. However, you are free to connect the Worker's slots to any signal, from any object, in any thread. It is safe to connect signals and slots across different threads, thanks to a mechanism called \l{Qt::QueuedConnection}{queued connections}. + Another way to make code run in a separate thread, is to subclass QThread + and reimplement run(). For example: + + \snippet code/src_corelib_thread_qthread.cpp reimpl-run + + In that example, the thread will exit after the run function has returned. + There will not be any event loop running in the thread unless you call + exec(). + + It is important to remember that a QThread object usually lives + in the thread where it was created, not in the thread that it + manages. This oft-overlooked detail means that a QThread's slots + will be executed in the context of its home thread, not in the + context of the thread it is managing. For this reason, + implementing new slots in a QThread subclass is error-prone and + discouraged. + \note If you interact with an object, using any technique other than queued signal/slot connections (e.g. direct function calls), then the usual multithreading precautions need to be taken. @@ -200,7 +217,6 @@ QThreadPrivate::~QThreadPrivate() \note It is not possible to change the thread affinity of GUI objects; they must remain in the main thread. - \section1 Managing threads QThread will notifiy you via a signal when the thread is @@ -244,36 +260,6 @@ QThreadPrivate::~QThreadPrivate() \l{Mandelbrot Example}, as that is the name of the QThread subclass). Note that this is currently not available with release builds on Windows. - \section1 Subclassing QThread - - Subclassing QThread is unnecessary for most purposes, since - QThread provides fully-functional thread management capabilities. - Nonetheless, QThread can be subclassed if you wish to implement - advanced thread management. This is done by adding new member - functions to the subclass, and/or by reimplementing run(). - QThread's run() function is analogous to an application's main() - function -- it is executed when the thread is started, and the - thread will end when it returns. - - \note Prior to Qt 4.4, the only way to use QThread for parallel - processing was to subclass it and implement the processing code - inside run(). This approach is now considered \b {bad practice}; - a QThread should only manage a thread, not process data. - - If you require event handling and signal/slot connections to - work in your thread, and if you reimplement run(), you must - explicitly call exec() at the end of your reimplementation: - - \snippet code/src_corelib_thread_qthread.cpp 1 - - It is important to remember that a QThread object usually lives - in the thread where it was created, not in the thread that it - manages. This oft-overlooked detail means that a QThread's slots - will be executed in the context of its home thread, not in the - context of the thread it is managing. For this reason, - implementing new slots in a QThread subclass is error-prone and - discouraged. - \sa {Thread Support in Qt}, QThreadStorage, QMutex, QSemaphore, QWaitCondition, {Mandelbrot Example}, {Semaphores Example}, {Wait Conditions Example} */ -- cgit v1.2.3 From e01343352ed8c1ac9cde0418bf72b6dec5099246 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 30 Jan 2013 18:00:01 +0100 Subject: fix doc page urls they are versioned nowadays Change-Id: I839db633e9d7d63c9d445f8e914b529bd7ce60a2 Reviewed-by: Jerome Pasion --- src/corelib/doc/qtcore.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 60cdce7a26..0e275ee8d4 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtCore description = Qt Core Reference Documentation -url = http://qt-project.org/doc/qtcore +url = http://qt-project.org/doc/qt-$QT_VER/qtcore version = $QT_VERSION examplesinstallpath = core -- cgit v1.2.3 From 334101df92ece6becf1b342ae4b79cb3bf726a69 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 07:27:05 +0000 Subject: Do not use the non-existent state() method reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-29094 Change-Id: I715018a82b7f8405dee023cbe5f2481883cad3e2 Reviewed-by: Topi Reiniƶ Reviewed-by: Jerome Pasion --- src/corelib/xml/qxmlstream.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 455df4ec73..4be4593e95 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -1958,7 +1958,7 @@ QStringRef QXmlStreamReader::text() const } -/*! If the state() is \l DTD, this function returns the DTD's +/*! If the tokenType() is \l DTD, this function returns the DTD's notation declarations. Otherwise an empty vector is returned. The QXmlStreamNotationDeclarations class is defined to be a QVector @@ -1973,7 +1973,7 @@ QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const } -/*! If the state() is \l DTD, this function returns the DTD's +/*! If the tokenType() is \l DTD, this function returns the DTD's unparsed (external) entity declarations. Otherwise an empty vector is returned. The QXmlStreamEntityDeclarations class is defined to be a QVector @@ -1990,7 +1990,7 @@ QXmlStreamEntityDeclarations QXmlStreamReader::entityDeclarations() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's name. Otherwise an empty string is returned. */ @@ -2005,7 +2005,7 @@ QStringRef QXmlStreamReader::dtdName() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's public identifier. Otherwise an empty string is returned. */ @@ -2020,7 +2020,7 @@ QStringRef QXmlStreamReader::dtdPublicId() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's system identifier. Otherwise an empty string is returned. */ @@ -2032,7 +2032,7 @@ QStringRef QXmlStreamReader::dtdSystemId() const return QStringRef(); } -/*! If the state() is \l StartElement, this function returns the +/*! If the tokenType() is \l StartElement, this function returns the element's namespace declarations. Otherwise an empty vector is returned. @@ -2845,7 +2845,7 @@ bool QXmlStreamReader::isStandaloneDocument() const /*! \since 4.4 - If the state() is \l StartDocument, this function returns the + If the tokenType() is \l StartDocument, this function returns the version string as specified in the XML declaration. Otherwise an empty string is returned. */ @@ -2860,7 +2860,7 @@ QStringRef QXmlStreamReader::documentVersion() const /*! \since 4.4 - If the state() is \l StartDocument, this function returns the + If the tokenType() is \l StartDocument, this function returns the encoding string as specified in the XML declaration. Otherwise an empty string is returned. */ -- cgit v1.2.3 From d7cad756efc89281f0294fec4ce84df1188c8aad Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 5 Feb 2013 19:03:25 +0100 Subject: Replace nokia in example by Qt Project Change-Id: I23adfd6a1cf02c8c99996b698fb780988434b9a7 Reviewed-by: Gabriel de Dietrich --- src/corelib/doc/snippets/qstring/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 0fdb88cd8b..6149e9d051 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -856,8 +856,8 @@ void Widget::toLongLongFunction() void Widget::toLowerFunction() { //! [75] - QString str = "Qt by NOKIA"; - str = str.toLower(); // str == "qt by nokia" + QString str = "The QT PROJECT"; + str = str.toLower(); // str == "the qt project" //! [75] } -- cgit v1.2.3 From 05ce12849b2e266210b71a432ce65883a1fdbe60 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 6 Feb 2013 09:48:46 +0100 Subject: Spell "Qt" correctly Change-Id: Idf2b5c888f159ee8ffdb81ed74e685c40951c6b4 Reviewed-by: Frederik Gladhorn --- src/corelib/doc/snippets/qstring/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 6149e9d051..6ee3088138 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -856,7 +856,7 @@ void Widget::toLongLongFunction() void Widget::toLowerFunction() { //! [75] - QString str = "The QT PROJECT"; + QString str = "The Qt PROJECT"; str = str.toLower(); // str == "the qt project" //! [75] } -- cgit v1.2.3 From ba2a0d652c3366638fb18218b632de8512fb1c9c Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 6 Feb 2013 11:06:17 +0100 Subject: Clean up whitespace Change-Id: I3413e0f55df07a35ad2e93da9bae2ca7f9b8d4c1 Reviewed-by: Oswald Buddenhagen --- src/corelib/xml/qxmlstream.g | 58 +++++++++++++++++++++--------------------- src/corelib/xml/qxmlstream_p.h | 58 +++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 58 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g index dc0bb353c9..cd7b4fe14e 100644 --- a/src/corelib/xml/qxmlstream.g +++ b/src/corelib/xml/qxmlstream.g @@ -207,18 +207,18 @@ public: inline QStringRef addToStringStorage(const QStringRef &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); } inline QStringRef addToStringStorage(const QString &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); @@ -525,7 +525,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::StartElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); if (publicNamespaceDeclarations.size()) publicNamespaceDeclarations.clear(); @@ -536,7 +536,7 @@ bool QXmlStreamReaderPrivate::parse() Tag &tag = tagStack_pop(); namespaceUri = tag.namespaceDeclaration.namespaceUri; name = tag.name; - qualifiedName = tag.qualifiedName; + qualifiedName = tag.qualifiedName; isEmptyElement = false; return true; } @@ -545,7 +545,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::EndElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); clearTextBuffer(); break; @@ -559,7 +559,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::Comment: case QXmlStreamReader::Characters: isCDATA = false; - isWhitespace = true; + isWhitespace = true; text.clear(); clearTextBuffer(); break; @@ -571,21 +571,21 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::ProcessingInstruction: processingInstructionTarget.clear(); processingInstructionData.clear(); - clearTextBuffer(); + clearTextBuffer(); break; case QXmlStreamReader::NoToken: case QXmlStreamReader::Invalid: break; case QXmlStreamReader::StartDocument: - lockEncoding = true; + lockEncoding = true; documentVersion.clear(); documentEncoding.clear(); #ifndef QT_NO_TEXTCODEC - if(decoder->hasFailure()) { - raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); - readBuffer.clear(); - return false; - } + if (decoder->hasFailure()) { + raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); + readBuffer.clear(); + return false; + } #endif // fall through default: @@ -1225,7 +1225,7 @@ cdata ::= langle_bang CDATA_START; case $rule_number: { setType(QXmlStreamReader::Characters); isCDATA = true; - isWhitespace = false; + isWhitespace = false; int pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); @@ -1294,7 +1294,7 @@ scan_content_char ::= SPACE; resume($rule_number); return false; } - break; + break; ./ content_char_list ::= content_char_list char_ref; @@ -1310,11 +1310,11 @@ content_char_list ::= scan_content_char; character_content ::= content_char_list %prec SHIFT_THERE; /. case $rule_number: - if (!textBuffer.isEmpty()) { + if (!textBuffer.isEmpty()) { setType(QXmlStreamReader::Characters); text = &textBuffer; - } - break; + } + break; ./ literal ::= QUOTE QUOTE; @@ -1361,7 +1361,7 @@ literal_content_start ::= LETTER | DIGIT | RANGLE | HASH | LBRACK | RBRACK | LPA literal_content_start ::= SPACE; /. case $rule_number: - if (normalizeLiterals) + if (normalizeLiterals) textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' '); break; ./ @@ -1405,7 +1405,7 @@ entity_value ::= QUOTE entity_value_content_with_dblquote QUOTE; entity_value ::= DBLQUOTE entity_value_content_with_quote DBLQUOTE; /. case $rule_number: - sym(1) = sym(2); + sym(1) = sym(2); break; ./ @@ -1609,7 +1609,7 @@ unresolved_entity ::= UNRESOLVED_ENTITY; } setType(QXmlStreamReader::EntityReference); name = &unresolvedEntity; - break; + break; ./ entity_ref ::= AMPERSAND name SEMICOLON; @@ -1646,10 +1646,10 @@ entity_ref ::= AMPERSAND name SEMICOLON; } } - injectToken(UNRESOLVED_ENTITY); - unresolvedEntity = symString(2).toString(); - textBuffer.chop(2 + sym(2).len); - clearSym(); + injectToken(UNRESOLVED_ENTITY); + unresolvedEntity = symString(2).toString(); + textBuffer.chop(2 + sym(2).len); + clearSym(); } break; ./ diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index 8276fe2721..68b7ff7af3 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -701,18 +701,18 @@ public: inline QStringRef addToStringStorage(const QStringRef &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); } inline QStringRef addToStringStorage(const QString &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); @@ -1019,7 +1019,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::StartElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); if (publicNamespaceDeclarations.size()) publicNamespaceDeclarations.clear(); @@ -1030,7 +1030,7 @@ bool QXmlStreamReaderPrivate::parse() Tag &tag = tagStack_pop(); namespaceUri = tag.namespaceDeclaration.namespaceUri; name = tag.name; - qualifiedName = tag.qualifiedName; + qualifiedName = tag.qualifiedName; isEmptyElement = false; return true; } @@ -1039,7 +1039,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::EndElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); clearTextBuffer(); break; @@ -1053,7 +1053,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::Comment: case QXmlStreamReader::Characters: isCDATA = false; - isWhitespace = true; + isWhitespace = true; text.clear(); clearTextBuffer(); break; @@ -1065,21 +1065,21 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::ProcessingInstruction: processingInstructionTarget.clear(); processingInstructionData.clear(); - clearTextBuffer(); + clearTextBuffer(); break; case QXmlStreamReader::NoToken: case QXmlStreamReader::Invalid: break; case QXmlStreamReader::StartDocument: - lockEncoding = true; + lockEncoding = true; documentVersion.clear(); documentEncoding.clear(); #ifndef QT_NO_TEXTCODEC - if(decoder->hasFailure()) { - raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); - readBuffer.clear(); - return false; - } + if (decoder->hasFailure()) { + raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); + readBuffer.clear(); + return false; + } #endif // fall through default: @@ -1550,7 +1550,7 @@ bool QXmlStreamReaderPrivate::parse() case 101: { setType(QXmlStreamReader::Characters); isCDATA = true; - isWhitespace = false; + isWhitespace = false; int pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); @@ -1597,14 +1597,14 @@ bool QXmlStreamReaderPrivate::parse() resume(130); return false; } - break; + break; case 139: - if (!textBuffer.isEmpty()) { + if (!textBuffer.isEmpty()) { setType(QXmlStreamReader::Characters); text = &textBuffer; - } - break; + } + break; case 140: case 141: @@ -1624,7 +1624,7 @@ bool QXmlStreamReaderPrivate::parse() break; case 173: - if (normalizeLiterals) + if (normalizeLiterals) textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' '); break; @@ -1651,7 +1651,7 @@ bool QXmlStreamReaderPrivate::parse() case 178: case 179: - sym(1) = sym(2); + sym(1) = sym(2); break; case 180: @@ -1789,7 +1789,7 @@ bool QXmlStreamReaderPrivate::parse() } setType(QXmlStreamReader::EntityReference); name = &unresolvedEntity; - break; + break; case 240: { sym(1).len += sym(2).len + 1; @@ -1823,10 +1823,10 @@ bool QXmlStreamReaderPrivate::parse() } } - injectToken(UNRESOLVED_ENTITY); - unresolvedEntity = symString(2).toString(); - textBuffer.chop(2 + sym(2).len); - clearSym(); + injectToken(UNRESOLVED_ENTITY); + unresolvedEntity = symString(2).toString(); + textBuffer.chop(2 + sym(2).len); + clearSym(); } break; -- cgit v1.2.3 From 2f555cf6b772b84d0bb01c5b6ee8b27e9d7437e5 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Feb 2013 14:05:22 +0100 Subject: Fix typo in QString documentation. Change-Id: Ic7ee426e17bb851d948ff5a772559d80ec7fa059 Reviewed-by: Jerome Pasion --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 21aa3b6ffb..61d5073a1f 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4932,7 +4932,7 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2, lists of strings to the user. On Mac OS X since Qt 4.3, this function compares according the - "Order for sorted lists" setting in the International prefereces panel. + "Order for sorted lists" setting in the International preferences panel. \sa compare(), QTextCodec::locale() */ -- cgit v1.2.3 From 9b52415fc90b3572426e9769dfc3db09cab9c74f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Feb 2013 12:13:38 +0100 Subject: Fix broken IANA link in QTextCodec documentation. Change-Id: I81708691ada600c444a60a8f9b007b0ce64f8b68 Reviewed-by: Jerome Pasion --- src/corelib/doc/src/external-resources.qdoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc index c92f752476..86df385d9e 100644 --- a/src/corelib/doc/src/external-resources.qdoc +++ b/src/corelib/doc/src/external-resources.qdoc @@ -64,4 +64,9 @@ /*! \externalpage http://www.ietf.org/rfc/rfc2045.txt \title RFC 2045 -*/ \ No newline at end of file +*/ + +/*! + \externalpage http://www.iana.org/assignments/character-sets/character-sets.xml + \title IANA character-sets encoding file +*/ -- cgit v1.2.3 From bf915eeea29a482712c2d479d6cc1625315ec5f8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 4 Feb 2013 12:13:55 +0100 Subject: export QT_CONFIG only in Qt5Core.pc there is no point in duplicating the information in every module. host_bins is exported only here as well. Change-Id: I2f816e1cade9761a2c0d97c7ca1c90293095bfb1 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/corelib/corelib.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index bf2fd3c84a..4462203a11 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -54,7 +54,10 @@ HOST_BINS = $$[QT_HOST_BINS/raw] host_bins.name = host_bins host_bins.variable = HOST_BINS -QMAKE_PKGCONFIG_VARIABLES += host_bins +qt_conf.name = qt_config +qt_conf.variable = QT_CONFIG + +QMAKE_PKGCONFIG_VARIABLES += host_bins qt_conf ctest_macros_file.input = $$PWD/Qt5CTestMacros.cmake ctest_macros_file.output = $$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake -- cgit v1.2.3 From a620c67e6454f2197f60b076a4baf543a6675eae Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 5 Feb 2013 14:15:45 +0100 Subject: Fix copy-paste errors in QtPrivate::ConnectionTypes That resulted in error such as: qobject_impl.h(82) : error C2078: too many initializers This should have been tested by tst_QObject::connectManyArguments, but the test did not work because the detection of defined QMetaType was broken for const references. That will be fixed in a latter commit. Task-number: QTBUG-29130 Change-Id: I78514c251358c0e8adf33af724d87ab114230cd3 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h index fbc523b8b7..7ed4d33e96 100644 --- a/src/corelib/kernel/qobject_impl.h +++ b/src/corelib/kernel/qobject_impl.h @@ -78,14 +78,14 @@ namespace QtPrivate { { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[5] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[6] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[7] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; #else -- cgit v1.2.3 From 8200e49bbef6fe05b904908d6439e8aa2c645c45 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Feb 2013 12:16:47 -0800 Subject: Allow x86intrin.h with ICC 13.1 The Intel C++ Composer XE 2013 Update 2 (a.k.a. ICC 13.1) has fixed the bug of the undefined intrinsics. Change-Id: If837a0800725d55fed7eff39b9d52c359dabb073 Reviewed-by: Olivier Goffart --- src/corelib/tools/qsimd_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 3f570c7a44..2156c2235f 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -142,7 +142,7 @@ QT_BEGIN_HEADER // other x86 intrinsics #if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) && \ - (!defined(Q_CC_INTEL) || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) + (!defined(Q_CC_INTEL)|| __INTEL_COMPILER >= 1310 || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) #define QT_COMPILER_SUPPORTS_X86INTRIN #include #endif -- cgit v1.2.3 From 5221ae5f424f24000d877d2a4394e2d75a052cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Feb 2013 11:58:07 +0100 Subject: Update documentation for QIODevice::readData(). readData() might be called with a maxSize of 0, regardless of the device being buffered or not. Task-number: QTBUG-28968 Change-Id: I666ed4d601341107722c86fe217f617ef748363d Reviewed-by: Thiago Macieira --- src/corelib/io/qiodevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 4f3518aeb8..4df9c6b911 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1640,8 +1640,8 @@ QString QIODevice::errorString() const all the requested information was read and therefore does not retry reading if there was a problem. - This function will be called with maxSize 0 when the device is - buffered and the buffer was emptied by a call to read(). + This function might be called with a maxSize of 0, which can be used to + perform post-reading operations. \sa read(), readLine(), writeData() */ -- cgit v1.2.3 From e7a242b27b961c64613542c75c69954d1c7bd315 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 8 Feb 2013 12:32:14 +0100 Subject: QProcessEnvironment: Permit magic cmd variables The cmd shell inserts magic variables starting with a = into the environment. Task-number: QTCREATORBUG-8716 Change-Id: I2f140032aea4fb1d77633c6baf90d7b536e2812a Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index d249bb17fb..693778e629 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -364,7 +364,8 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() if (wchar_t *envStrings = GetEnvironmentStringsW()) { for (const wchar_t *entry = envStrings; *entry; ) { const int entryLen = int(wcslen(entry)); - if (const wchar_t *equal = wcschr(entry, L'=')) { + // + 1 to permit magic cmd variable names starting with = + if (const wchar_t *equal = wcschr(entry + 1, L'=')) { int nameLen = equal - entry; QString name = QString::fromWCharArray(entry, nameLen); QString value = QString::fromWCharArray(equal + 1, entryLen - nameLen - 1); -- cgit v1.2.3 From 316d8ececa3314ec16baf46ec4f1c5440cd951ef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 8 Feb 2013 00:48:57 +0100 Subject: Don't duplicate the 'top-level' include dir in all modules. This is the /include directory which is independent of the module and which only has to be used once. As everything uses QtCore, it is enough to set it only there. The CI system is a special case, in that it tests things before installation. Handle that case too. Change-Id: Idcdf9617e199b7d490cb3553cce07f1f464b3bec Reviewed-by: Stephen Kelly --- src/corelib/Qt5CTestMacros.cmake | 12 ++++++++++++ src/corelib/Qt5CoreConfigExtras.cmake.in | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index c5d10c9b5b..60b98a7138 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -94,6 +94,18 @@ function(test_module_includes) include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS}) add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n" ) + + # Because the CI system tests built packages before installation, + # the include dir allowing module-includes for the new module is not + # the same as the dir for QtCore (because that is at the installation + # location). The CI system is untypical here in that it attempts to use + # packages while they are in an intermediate state, so we work around + # that in the test system. + set(packages_string + "${packages_string} + include_directories(\"\${Qt5${qtmodule}_DIR}/../../../include\")\n" + ) + set(libraries_string "${libraries_string} Qt5::${qtmodule}") endwhile() diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 06ff6dc831..3c0c753c3c 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -44,9 +44,9 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) !!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE) -list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") !!ELSE -list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF !!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS) -- cgit v1.2.3 From 8943a5a28e0559bce2bd412453840f951f796fbf Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 11 Feb 2013 13:20:30 +0100 Subject: Don't calculate the install prefix again in the extra cmake files. The parent file has already set a variable for it. Change-Id: I90ddda355a580f44ea7e1e44cc7df717fa0a8b7b Reviewed-by: Alexander Neundorf Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreConfigExtras.cmake.in | 14 ++++++-------- src/corelib/Qt5CoreMacros.cmake | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 3c0c753c3c..4e0fcda20e 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -1,12 +1,10 @@ -get_filename_component(_qt5_corelib_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) - if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) set_target_properties(Qt5::qmake PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -18,7 +16,7 @@ if (NOT TARGET Qt5::moc) set_target_properties(Qt5::moc PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -32,7 +30,7 @@ if (NOT TARGET Qt5::rcc) set_target_properties(Qt5::rcc PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -44,7 +42,7 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) !!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE) -list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5Core_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5Core_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") !!ELSE list(APPEND Qt5Core_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF @@ -80,7 +78,7 @@ if (NOT TARGET Qt5::WinMain) set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(Qt5::WinMain PROPERTIES !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION_DEBUG \"${_qt5_corelib_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" + IMPORTED_LOCATION_DEBUG \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" !!ELSE IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" !!ENDIF @@ -91,7 +89,7 @@ if (NOT TARGET Qt5::WinMain) set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(Qt5::WinMain PROPERTIES !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION_RELEASE \"${_qt5_corelib_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" + IMPORTED_LOCATION_RELEASE \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" !!ELSE IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" !!ENDIF diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 614b79ab88..e3115db8ee 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -234,7 +234,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) foreach(_module ${_qt5_modules}) if (NOT Qt5${_module}_FOUND) - find_package(Qt5${_module} PATHS ${_qt5_corelib_install_prefix} NO_DEFAULT_PATH) + find_package(Qt5${_module} PATHS ${_qt5Core_install_prefix} NO_DEFAULT_PATH) if (NOT Qt5${_module}_FOUND) message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") endif() -- cgit v1.2.3