From 1ea0e706981006c48ad16a1ff8051df03610f20b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 16 May 2011 11:28:00 +0200 Subject: qdoc: Fixed QTBUG-19338 --- tools/qdoc3/ditaxmlgenerator.cpp | 5 ++++- tools/qdoc3/generator.cpp | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 342bb90..c45648b 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1199,7 +1199,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, Just output the href as if the image is in the images directory... */ - fileName = QLatin1String("images/") + protectEnc(atom->string()); + if (atom->string()[0] == '/') + fileName = QLatin1String("images") + atom->string(); + else + fileName = QLatin1String("images/") + atom->string(); } if (currentTag() != DT_xref) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index f05c030..81aba6b 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -783,10 +783,13 @@ QString Generator::imageFileName(const Node *relative, const QString& fileBase) if (filePath.isEmpty()) return QString(); - return QLatin1String("images/") - + Config::copyFile(relative->doc().location(), - filePath, userFriendlyFilePath, - outputDir() + QLatin1String("/images")); + QString path = Config::copyFile(relative->doc().location(), + filePath, + userFriendlyFilePath, + outputDir() + QLatin1String("/images")); + if (path[0] != '/') + return QLatin1String("images/") + path; + return QLatin1String("images") + path; } void Generator::setImageFileExtensions(const QStringList& extensions) -- cgit v0.12 From 237c620f6355fc81e85e65b9fd61249b0f77df5a Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 26 May 2011 17:01:33 +1000 Subject: Fixed failure of tst_qxmlquery::evaluateToReceiver Commit 8f95a19d330480bd86650c3d2e4e147d3bca5789 fixed the "missing Z" of QDateTime::toString for Qt::ISODate (see QTBUG-9698). The testdata for this test should have been updated at the same time, but it was forgotten. Reviewed-by: Jason McDonald Change-Id: I9b03519805533665afac15e0c970ac1c9e5d9ab4 --- tests/auto/qxmlquery/pushBaselines/allAtomics.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qxmlquery/pushBaselines/allAtomics.ref b/tests/auto/qxmlquery/pushBaselines/allAtomics.ref index cceabfe..ddb5bc7 100644 --- a/tests/auto/qxmlquery/pushBaselines/allAtomics.ref +++ b/tests/auto/qxmlquery/pushBaselines/allAtomics.ref @@ -1,6 +1,6 @@ startOfSequence() atomicValue(xs:untypedAtomic) -atomicValue(2002-10-10T23:02:11) +atomicValue(2002-10-10T23:02:11Z) atomicValue(2002-10-10) atomicValue() atomicValue() -- cgit v0.12 From 1bd6f1bd280ee6e1ecd4de2291c8ccfb4d06b7a4 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 16:10:38 +0200 Subject: Doc: Removed non-ASCII characters from the documentation. --- doc/src/platforms/supported-platforms.qdoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index 9d47695..ba59c37 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -334,8 +334,8 @@ \section2 Advanced Text Layout Engine - Qt for Windows CE supports TrueType® and raster fonts. Qt also has - extended Unicode support and right-to-left languages. Qt’s rich text + Qt for Windows CE supports TrueType and raster fonts. Qt also has + extended Unicode support and right-to-left languages. Qt's rich text engine adds capabilities for complex text layouts including tables, path tracing and text which flows around shapes. @@ -373,7 +373,7 @@ by embedded Linux. You can use Qt to create highly memory efficient devices and applications that have completely unique user experiences. - Qt runs anywhere Linux runs. Qt’s intuitive API means fewer lines of + Qt runs anywhere Linux runs. Qt's intuitive API means fewer lines of code and higher level functionality in less time. Use the code from one single code-base and rebuild for all \l{Supported Platforms} {supported platforms}. @@ -410,7 +410,7 @@ frame buffer} that will match the physical device display, pixel for pixel. This gives the developer a realistic testing infrastructure testing on the desktop where the frame buffer simulates the physical - device display’s width, height and color depth. + device display's width, height and color depth. \section2 Inter-Process Communication (IPC) @@ -421,7 +421,7 @@ \section2 Extended Font Format Qt supports a wide range of font formats on embedded Linux including: - TrueType®, Postscript® Type1 and Qt pre-rendered fonts. Qt has + TrueType, Postscript Type1 and Qt pre-rendered fonts. Qt has extended Unicode support including automatic data extraction at build time and automatic update at runtime. @@ -681,7 +681,7 @@ \group platform-details Qt is a cross-platform application and UI framework. Using Qt, - you can write web-enabled applications once and deploy them + you can write GUI applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code. -- cgit v0.12 From 26c29a2dd7efa4c66063d1255e1f694462cbae85 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 20:20:50 +0200 Subject: Doc: Added more appropriate links to help reduce confusion. Task-number: QTBUG-19919 --- src/gui/widgets/qtextedit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 6757d77..b6661c9 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -2472,6 +2472,8 @@ bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options) and the text edit will try to guess the right format. Use setHtml() or setPlainText() directly to avoid text edit's guessing. + + \sa toPlainText(), toHtml() */ void QTextEdit::setText(const QString &text) { -- cgit v0.12 From 9ed61311bce15b8f1bb4b30ee9133f1a2355f41d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 16 Jun 2011 20:24:11 +0200 Subject: Doc: Added a simple introduction to Qt and fixed links. --- doc/src/declarative/declarativeui.qdoc | 2 +- doc/src/declarative/qtquick-intro.qdoc | 2 +- doc/src/index.qdoc | 4 +- doc/src/qt-features.qdoc | 204 +++++++++++++++++++++++++++++++++ doc/src/qt4-intro.qdoc | 2 +- 5 files changed, 209 insertions(+), 5 deletions(-) create mode 100644 doc/src/qt-features.qdoc diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 56ab29f..d1d82d8 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -46,7 +46,7 @@ Qt applications. \section1 Getting Started \list -\o \l{Intro to Qt Quick}{Introduction to Qt Quick} +\o \l{Introduction to Qt Quick} \o \l{QML for Qt Programmers}{QML Programming for Qt Programmers} \o \l{Getting Started Programming with QML} diff --git a/doc/src/declarative/qtquick-intro.qdoc b/doc/src/declarative/qtquick-intro.qdoc index bdad2c3..4cd5db3 100644 --- a/doc/src/declarative/qtquick-intro.qdoc +++ b/doc/src/declarative/qtquick-intro.qdoc @@ -27,7 +27,7 @@ /*! \page qml-intro.html -\title Intro to Qt Quick +\title Introduction to Qt Quick Qt Quick is a collection of technologies that are designed to help developers create the kind of intuitive, modern, and fluid user interfaces that are diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 979c654..2ce6781 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -36,8 +36,8 @@ What is Qt \enddiv \list - \o \l{Qt Whitepaper}{Qt C++ Framework} - \o \l{Intro to Qt Quick}{Qt Quick} + \o \l{Qt Features Overview} + \o \l{Introduction to Qt Quick}{Qt Quick} \o \l{external: Qt Mobility Manual}{Qt Mobility} \o \l{Qt WebKit} \endlist diff --git a/doc/src/qt-features.qdoc b/doc/src/qt-features.qdoc new file mode 100644 index 0000000..0ae00b0 --- /dev/null +++ b/doc/src/qt-features.qdoc @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qt-overview.html + \title Qt Features Overview + + This document provides a summary of the most important features of Qt, + providing links to other pages in the documentation that cover these + features in more detail. It is not intended to be a comprehensive + guide to Qt's features. + + \section1 Fundamental Technologies in Qt + + Qt is built upon a set of core technologies, provided by the \l QtCore + and \l QtGui modules. These include the following: + + \list + \o \l{The Tulip Container Classes}, a set of template container classes. + \o \l{The Arthur Paint System}, the Qt 4 painting framework. + \o \l{The Interview Framework}, a model/view architecture for item views + and the \l{QtSQL Module}, which also uses this architecture. + \o \l{The Scribe Classes}, a framework for creating text documents, + performing low-level text layout and writing OpenDocument files. + \o A collection of \l{Qt Widget Gallery}{common desktop widgets}, styled + to fit in on each supported platform. + \o \l{The Qt 4 Main Window Classes}, a main window, toolbar, menu, and + docking architecture. + \o The \l{Graphics View} framework provides a canvas for producing + interactive graphics. + \o The \l{QtNetwork Module} provides support for TCP, UDP and local + sockets that are integrated with Qt's event model, including support + for Secure Socket Layer (SSL) communications, + \l{QNetworkProxy}{network proxy} servers and + \l{Bearer Management}{network bearer management}. + \o Enhanced \l{qt4-threads.html}{thread support} allows + \l{Signals & Slots}{signal-slot} connections across threads and + per-thread event loops. + Additionally, \l{Thread Support in Qt}{a framework for concurrent programming} + using Qt paradigms makes common threading tasks easier. + \o A \l{resource system} for embedding images and other resource files + into executable files makes it easier to deploy applications. + \o A \l{QTestLib Manual}{unit testing framework} for Qt applications and + libraries. + \endlist + + The mature classes provided by these technologies have been used to build + robust, cross-platform desktop applications. They are augmented by a number + of additional technologies and improvements that have appeared over the + lifetime of Qt 4. + + \section1 Graphical User Interfaces + + \div{class="float-right"} + \inlineimage gtk-tabwidget.png + \enddiv + \div{class="float-right"} + \inlineimage gtk-progressbar.png + \br + \inlineimage gtk-checkbox.png + \br + \inlineimage plastique-combobox.png + \br + \inlineimage plastique-radiobutton.png + \enddiv + + Alongside the support for traditional desktop user interfaces, Qt includes + support for declarative UI development with \l{Qt Quick}, a set of + technologies for creating fluid, dynamic user interfaces. A starting point + for exploring this approach can be found in the \l{Introduction to Qt Quick} + guide. + + Qt provides a range of standard user interface elements, called widgets, + for each supported platform. Widgets can be used as containers for other + widgets, as windows, and as regular controls that the user interacts with. + Where the platform supports it, widgets can be made to appear partially + transparent, and may be styled with \l{Qt Style Sheets}. + + Support for \l{QTouchEvent}{touch input} and \l{Gestures Programming}{gestures} + enable widgets to be used to create intuitive user interfaces for + touch-enabled devices. + + User interfaces can also be created dynamically at run-time with the + features provided by the \l{QtUiTools} module. + + A selection of available widgets are shown in the \l{Qt Widget Gallery}. + An introduction to the concepts behind widgets can be found in the + \l{Widgets Tutorial}. + + \clearfloat + \section1 Painting, Printing and Rendering + + \div{class="float-left"} + \inlineimage qpainter-affinetransformations.png + \enddiv + + Widgets are just one of many kinds of paint device that Qt can render onto. + This support for unified painting makes it possible for applications to use + the same painting code for different tasks, as well as allowing Qt to be + extended to support additional file formats. + + Qt provides support for common bitmap image formats, + \l{QtSvg Module}{Scalable Vector Graphics} (SVG) drawings and animations, + Postscript and Portable Document Format (PDF) files. Postscript and PDF are + integrated with \l{Printing with Qt}{Qt's printing system}, which also + allows printed output to be previewed. + + Interactive graphics can be created with the + \l{The Animation Framework}{animation framework}, allowing animations to be + used with both widgets and graphics items. Animations can be used with the + \l{The State Machine Framework}{state machine framework}, which provides a + way to express application logic and integrate it with the user interface. + Animations can be enhanced with a collection of + \l{QGraphicsEffect}{graphics effects} that operate on graphics items and + can be applied individually or combined to create more complex effects. + + Qt supports integration with \l{QtOpenGL}{OpenGL} on a number of levels, + providing convenience functions for handling textures and colors, as well + as providing support for pixel and sample buffers. Future support for + higher level 3D integration is provided by Qt3D enablers which include + \l{QMatrix4x4}{matrix multiplication}, \l{QQuaternion}{quaternions}, and an + API for \l{QGLShader}{vertex and fragment shaders}. + + Two APIs are provided for multimedia. The + \l{Phonon Overview}{Phonon Multimedia Framework} has traditionally been + used on desktop platforms. A set of + \l{QtMultimedia Module}{multimedia services} provides low-level access to + the system's audio system and is often used on mobile devices. + + \clearfloat + \section1 Infrastructure + + \div{class="float-right"} + \inlineimage qtscript-context2d.png + \enddiv + + Facilities for Inter-Process Communication (IPC) and Remote Procedure + Calling (RPC) mechanisms are available on platforms that support the + \l{intro-to-dbus.html}{D-Bus} message bus system. + + An \l{Undo Framework}{Undo framework} based on the + \l{Books about GUI Design#Design Patterns}{Command pattern} is designed to + enable a consistent approach to handling data in editing applications. + + The \l{QtScript} and \l{QtScriptTools} modules provide support for + application scripting and debugging using the ECMAScript language. + + The \l{QtHelp Module} provides the foundations of an interactive help + system that can be used in conjunction with Qt Creator or integrated into + applications directly. + + XML handling is supported in a number of places in Qt. The \l QtCore module + provides classes for reading and writing XML streams. The \l QtXmlPatterns + module includes XQuery, XPath and XSLT support, providing facilities for + XML processing beyond that supported by the QtXml module, which contains + SAX and DOM parsers. XML schema validation in the QtXmlPatterns module + covers large parts of version 1.0 of the specification. + + \clearfloat + \section1 Web Client Integration + + Integration between \l{Webkit in Qt}{Qt and WebKit} makes it possible for + developers to use a fully-featured Web browser engine to display documents + and access online services. Developers can access the browser's environment + to create documents and run scripts within one or more browser widgets. + + A \l{QWebElement}{DOM access API} for QtWebKit provides a cleaner and safer + way to access elements and structures of Web pages without the use of + JavaScript. + + \section1 Further Reading + + Many of the technologies mentioned here, as well as other, more specific + features, are listed in the \l{What's New in Qt 4} document. A complete + list of Qt's modules can be found on the \l{All Modules} page, which + also includes more domain-specific technologies. + + The tools that are supplied with Qt are covered by the listing in the + \l{Qt's Tools} document. +*/ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 41d8b2e..d75bdca 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -132,7 +132,7 @@ In Qt 4.4: \list - \o \l{Webkit in QT}{Qt WebKit integration}, making it possible for developers + \o \l{WebKit in Qt}{Qt WebKit integration}, making it possible for developers to use a fully-featured Web browser to display documents and access online services. \o A multimedia API provided by the \l{Phonon Overview}{Phonon Multimedia Framework}. -- cgit v0.12 From dd0e653981cfbba2d7ba6e74422bc8b206fab202 Mon Sep 17 00:00:00 2001 From: jasplin Date: Wed, 8 Jun 2011 17:13:13 +0200 Subject: Added -datatags option to QTestLib Passing the -datatags option to a QTestLib program prints the available data tags to standard output. Data tags for each test function (f() in this case) are printed in four different ways depending on the presence of local and global data tags: Case 1: No tags: f() Case 2: Local tags only: f() local tag 1 f() local tag 2 ... Case 3: Global tags only: f() __global__ global tag 1 f() __global__ global tag 2 ... Case 4: Local and global tags: f() local tag 1 __global__ global tag 1 f() local tag 2 __global__ global tag 1 ... f() local tag 1 __global__ global tag 2 f() local tag 2 __global__ global tag 2 ... ... Reviewed-by: Rohan McGovern Task-number: QTQAINFRA-226 Change-Id: I14de203b586a0085b8efda8e62772711e44677d2 --- doc/src/development/qtestlib.qdoc | 3 + src/testlib/qtestcase.cpp | 63 +++++++++++++++++++++ src/testlib/qtestlog.cpp | 11 ++++ tests/auto/selftests/expected_printdatatags.txt | 6 ++ .../expected_printdatatagswithglobaltags.txt | 12 ++++ .../auto/selftests/printdatatags/printdatatags.pro | 8 +++ .../selftests/printdatatags/tst_printdatatags.cpp | 48 ++++++++++++++++ .../printdatatagswithglobaltags.pro | 8 +++ .../tst_printdatatagswithglobaltags.cpp | 64 ++++++++++++++++++++++ tests/auto/selftests/selftests.pro | 3 +- tests/auto/selftests/selftests.qrc | 2 + tests/auto/selftests/tst_selftests.cpp | 14 +++++ 12 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 tests/auto/selftests/expected_printdatatags.txt create mode 100644 tests/auto/selftests/expected_printdatatagswithglobaltags.txt create mode 100644 tests/auto/selftests/printdatatags/printdatatags.pro create mode 100644 tests/auto/selftests/printdatatags/tst_printdatatags.cpp create mode 100644 tests/auto/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro create mode 100644 tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc index 80bf838..94c3c12 100644 --- a/doc/src/development/qtestlib.qdoc +++ b/doc/src/development/qtestlib.qdoc @@ -181,6 +181,9 @@ outputs the possible command line arguments and give some useful help. \o \c -functions \BR outputs all test functions available in the test. + \o \c -datatags \BR + outputs all data tags available in the test. + A global data tag is preceded by ' __global__ '. \o \c -o \e filename \BR write output to the specified file, rather than to standard output \o \c -silent \BR diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 023df89..efa0122 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1015,6 +1015,7 @@ static bool isValidSlot(const QMetaMethod &sl) } Q_TESTLIB_EXPORT bool printAvailableFunctions = false; +Q_TESTLIB_EXPORT bool printAvailableTags = false; Q_TESTLIB_EXPORT QStringList testFunctions; Q_TESTLIB_EXPORT QStringList testTags; @@ -1027,6 +1028,60 @@ static void qPrintTestSlots() } } +static void qPrintDataTags() +{ + // Get global data tags: + QTestTable::globalTestTable(); + invokeMethod(QTest::currentTestObject, "initTestCase_data()"); + const QTestTable *gTable = QTestTable::globalTestTable(); + + // Process test functions: + for (int i = 0; i < QTest::currentTestObject->metaObject()->methodCount(); ++i) { + QMetaMethod tf = QTest::currentTestObject->metaObject()->method(i); + if (isValidSlot(tf)) { + const char *slotName = tf.signature(); + + // Retrieve local tags: + QStringList localTags; + QTestTable table; + char member[512]; + char *slot = qstrdup(slotName); + slot[strlen(slot) - 2] = '\0'; + QTest::qt_snprintf(member, 512, "%s_data()", slot); + delete[] slot; + invokeMethod(QTest::currentTestObject, member); + for (int j = 0; j < table.dataCount(); ++j) + localTags << QLatin1String(table.testData(j)->dataTag()); + + // Print all tag combinations: + if (gTable->dataCount() == 0) { + if (localTags.count() == 0) { + // No tags at all, so just print the test function: + printf("%s\n", slotName); + } else { + // Only local tags, so print each of them: + for (int k = 0; k < localTags.size(); ++k) + printf("%s %s\n", slotName, localTags.at(k).toLatin1().data()); + } + } else { + for (int j = 0; j < gTable->dataCount(); ++j) { + if (localTags.count() == 0) { + // Only global tags, so print the current one: + printf("%s __global__ %s\n", slotName, gTable->testData(j)->dataTag()); + } else { + // Local and global tags, so print each of the local ones and + // the current global one: + for (int k = 0; k < localTags.size(); ++k) + printf( + "%s %s __global__ %s\n", slotName, + localTags.at(k).toLatin1().data(), gTable->testData(j)->dataTag()); + } + } + } + } + } +} + static int qToInt(char *str) { char *pEnd; @@ -1043,6 +1098,8 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) const char *testOptions = " options:\n" " -functions : Returns a list of current testfunctions\n" + " -datatags : Returns a list of current data tags.\n" + " A global data tag is preceded by ' __global__ '.\n" " -xunitxml : Outputs results as XML XUnit document\n" " -xml : Outputs results as XML document\n" " -lightxml : Outputs results as stream of XML tags\n" @@ -1094,6 +1151,12 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) qPrintTestSlots(); exit(0); } + } else if (strcmp(argv[i], "-datatags") == 0) { + QTest::printAvailableTags = true; + if (!qml) { + qPrintDataTags(); + exit(0); + } } else if(strcmp(argv[i], "-xunitxml") == 0){ QTestLog::setLogMode(QTestLog::XunitXML); } else if (strcmp(argv[i], "-xml") == 0) { diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 8a2d559..03fafe0 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -191,6 +191,8 @@ void initLogger() } } +extern Q_TESTLIB_EXPORT bool printAvailableTags; + } QTestLog::QTestLog() @@ -203,6 +205,9 @@ QTestLog::~QTestLog() void QTestLog::enterTestFunction(const char* function) { + if (QTest::printAvailableTags) + return; + QTEST_ASSERT(QTest::testLogger); QTEST_ASSERT(function); @@ -222,6 +227,9 @@ int QTestLog::unhandledIgnoreMessages() void QTestLog::leaveTestFunction() { + if (QTest::printAvailableTags) + return; + QTEST_ASSERT(QTest::testLogger); QTest::IgnoreResultList::clearList(QTest::ignoreResultList); @@ -244,6 +252,9 @@ void QTestLog::printUnhandledIgnoreMessages() void QTestLog::addPass(const char *msg) { + if (QTest::printAvailableTags) + return; + QTEST_ASSERT(QTest::testLogger); QTEST_ASSERT(msg); diff --git a/tests/auto/selftests/expected_printdatatags.txt b/tests/auto/selftests/expected_printdatatags.txt new file mode 100644 index 0000000..02390dc --- /dev/null +++ b/tests/auto/selftests/expected_printdatatags.txt @@ -0,0 +1,6 @@ +a() data tag a1 +a() data tag a2 +b() +c() data tag c1 +c() data tag c2 +c() data tag c3 diff --git a/tests/auto/selftests/expected_printdatatagswithglobaltags.txt b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt new file mode 100644 index 0000000..a91e1b8 --- /dev/null +++ b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt @@ -0,0 +1,12 @@ +a() data tag a1 __global__ global data tag 1 +a() data tag a2 __global__ global data tag 1 +a() data tag a1 __global__ global data tag 2 +a() data tag a2 __global__ global data tag 2 +b() __global__ global data tag 1 +b() __global__ global data tag 2 +c() data tag c1 __global__ global data tag 1 +c() data tag c2 __global__ global data tag 1 +c() data tag c3 __global__ global data tag 1 +c() data tag c1 __global__ global data tag 2 +c() data tag c2 __global__ global data tag 2 +c() data tag c3 __global__ global data tag 2 diff --git a/tests/auto/selftests/printdatatags/printdatatags.pro b/tests/auto/selftests/printdatatags/printdatatags.pro new file mode 100644 index 0000000..a134422 --- /dev/null +++ b/tests/auto/selftests/printdatatags/printdatatags.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +SOURCES += tst_printdatatags.cpp +QT = core + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = printdatatags diff --git a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp new file mode 100644 index 0000000..fe4bcf0 --- /dev/null +++ b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp @@ -0,0 +1,48 @@ +#include + +class tst_Foo: public QObject +{ + Q_OBJECT +private slots: + void a_data() const; + void a() const; + + void b() const; + + void c_data() const; + void c() const; +}; + +void tst_Foo::a_data() const +{ + QTest::addColumn("x"); + QTest::addColumn("y"); + + QTest::newRow("data tag a1 ") << 1 << 2; + QTest::newRow("data tag a2") << 1 << 2; +} + +void tst_Foo::a() const +{ +} + +void tst_Foo::b() const +{ +} + +void tst_Foo::c_data() const +{ + QTest::addColumn("x"); + + QTest::newRow("data tag c1") << 1; + QTest::newRow("data tag c2") << 1; + QTest::newRow("data tag c3") << 1; +} + +void tst_Foo::c() const +{ +} + +QTEST_MAIN(tst_Foo) + +#include "tst_printdatatags.moc" diff --git a/tests/auto/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro b/tests/auto/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro new file mode 100644 index 0000000..100ba1c --- /dev/null +++ b/tests/auto/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +SOURCES += tst_printdatatagswithglobaltags.cpp +QT = core + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = printdatatagswithglobaltags diff --git a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp new file mode 100644 index 0000000..cc58bec --- /dev/null +++ b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp @@ -0,0 +1,64 @@ +#include + +class tst_Foo: public QObject +{ + Q_OBJECT +private slots: + void initTestCase_data() const; + void initTestCase() const; + + void a_data() const; + void a() const; + + void b() const; + + void c_data() const; + void c() const; +}; + +void tst_Foo::initTestCase_data() const +{ + QTest::addColumn("f"); + QTest::addColumn("g"); + + QTest::newRow("global data tag 1 ") << 1 << 2; + QTest::newRow("global data tag 2") << 1 << 2; +} + +void tst_Foo::initTestCase() const +{ +} + +void tst_Foo::a_data() const +{ + QTest::addColumn("x"); + QTest::addColumn("y"); + + QTest::newRow("data tag a1 ") << 1 << 2; + QTest::newRow("data tag a2") << 1 << 2; +} + +void tst_Foo::a() const +{ +} + +void tst_Foo::b() const +{ +} + +void tst_Foo::c_data() const +{ + QTest::addColumn("x"); + + QTest::newRow("data tag c1") << 1; + QTest::newRow("data tag c2") << 1; + QTest::newRow("data tag c3") << 1; +} + +void tst_Foo::c() const +{ +} + +QTEST_MAIN(tst_Foo) + +#include "tst_printdatatagswithglobaltags.moc" diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro index 2f1c327..74cd075 100644 --- a/tests/auto/selftests/selftests.pro +++ b/tests/auto/selftests/selftests.pro @@ -5,7 +5,8 @@ SUBDIRS = subtest test warnings maxwarnings cmptest globaldata skipglobal skip \ skipinit skipinitdata datetime singleskip assert waitwithoutgui differentexec \ exceptionthrow qexecstringlist datatable commandlinedata\ benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \ - benchliboptions xunit badxml longstring + benchliboptions xunit badxml longstring printdatatags \ + printdatatagswithglobaltags INSTALLS = diff --git a/tests/auto/selftests/selftests.qrc b/tests/auto/selftests/selftests.qrc index f82722b..5bd0e12 100644 --- a/tests/auto/selftests/selftests.qrc +++ b/tests/auto/selftests/selftests.qrc @@ -89,6 +89,8 @@ expected_multiexec.txt expected_multiexec.xml expected_multiexec.xunitxml + expected_printdatatags.txt + expected_printdatatagswithglobaltags.txt expected_qexecstringlist.txt expected_singleskip.lightxml expected_singleskip.txt diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 1a95420..3686304 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -245,6 +245,8 @@ void tst_Selftests::runSubTest_data() << "xunit" << "longstring" << "badxml" + << "printdatatags" + << "printdatatagswithglobaltags" ; foreach (Logger const& logger, allLoggers()) { @@ -273,6 +275,12 @@ void tst_Selftests::runSubTest_data() else if (subtest == "badxml") { arguments << "-eventcounter"; } + else if (subtest == "printdatatags") { + arguments << "-datatags"; + } + else if (subtest == "printdatatagswithglobaltags") { + arguments << "-datatags"; + } // These tests don't work right with loggers other than plain, usually because // they internally supply arguments to themselves. @@ -289,6 +297,12 @@ void tst_Selftests::runSubTest_data() if (subtest == "waitwithoutgui") { continue; } + if (subtest == "printdatatags") { + continue; + } + if (subtest == "printdatatagswithglobaltags") { + continue; + } // `crashes' will not output valid XML on platforms without a crash handler if (subtest == "crashes") { continue; -- cgit v0.12 From 9c1e358df4b0af1a6299ea7932f8b2e8af840873 Mon Sep 17 00:00:00 2001 From: Jo Asplin Date: Wed, 22 Jun 2011 09:18:01 +0200 Subject: Compile on Symbian^3. Change-Id: Ie1f52be4e94ff1e51b9d5f47c75a8d2e8b7a63d4 --- tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro index e621d50..b242d60 100755 --- a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro +++ b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro @@ -11,3 +11,8 @@ CONFIG += release # Input SOURCES += main.cpp + +symbian: { + TARGET.CAPABILITY = NetworkServices + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE +} -- cgit v0.12 From 4246892bf3eefd67331369ad7dae487167373c92 Mon Sep 17 00:00:00 2001 From: Jo Asplin Date: Mon, 27 Jun 2011 10:42:40 +0200 Subject: Compile on symbian^3 Applies the fix of Commit 9c1e358df4b0af1a6299ea7932f8b2e8af840873 (review by Liang Qi) to four more test cases. Change-Id: I1483d4b7c2aecde960af5d98fb8b772aeba20ec5 Reviewed-by: Sergio Ahumada Reviewed-by: Liang Qi --- tests/benchmarks/corelib/io/qdir/tree/tree.pro | 5 +++++ tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro | 5 +++++ tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro | 5 +++++ tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/tests/benchmarks/corelib/io/qdir/tree/tree.pro b/tests/benchmarks/corelib/io/qdir/tree/tree.pro index 773f0f7..24a667e 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/tree.pro +++ b/tests/benchmarks/corelib/io/qdir/tree/tree.pro @@ -9,3 +9,8 @@ SOURCES += bench_qdir_tree.cpp RESOURCES += bench_qdir_tree.qrc QT -= gui + +symbian: { + TARGET.CAPABILITY = NetworkServices + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE +} diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro index e8014d6..6e823ff 100644 --- a/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro +++ b/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro @@ -4,3 +4,8 @@ TARGET = tst_bench_qthreadstorage SOURCES += tst_qthreadstorage.cpp QT -= gui + +symbian: { + TARGET.CAPABILITY = NetworkServices + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE +} diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro index e5b9346..30b10d2 100644 --- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro +++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro @@ -11,3 +11,8 @@ CONFIG += release # Input SOURCES += tst_qtcpserver.cpp + +symbian: { + TARGET.CAPABILITY = NetworkServices + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE +} diff --git a/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro index da34a02..85ca1e3 100644 --- a/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro +++ b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro @@ -11,3 +11,8 @@ CONFIG += release # Input SOURCES += tst_qsslsocket.cpp + +symbian: { + TARGET.CAPABILITY = NetworkServices + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE +} -- cgit v0.12 From 5634ea81e57f26a376db75bcea0eeb82d815817f Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 27 Jun 2011 17:30:41 +0200 Subject: Add license header to printdatatags autotests --- .../selftests/printdatatags/tst_printdatatags.cpp | 42 ++++++++++++++++++++++ .../tst_printdatatagswithglobaltags.cpp | 42 ++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp index fe4bcf0..4b533b3 100644 --- a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp +++ b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp @@ -1,3 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + #include class tst_Foo: public QObject diff --git a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp index cc58bec..931dc12 100644 --- a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp +++ b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp @@ -1,3 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + #include class tst_Foo: public QObject -- cgit v0.12 From c2760148330166934b8443b3794767b8347ab5ba Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 1 Jun 2011 17:13:51 +1000 Subject: Fixed compile of tst_qscriptextensionplugin on some Windows configurations The debug and release versions of staticplugin are qmake'd with the same destination directory. This causes the generated staticplugin .prl file to always refer to the debug versions of Qt libraries, even if Qt was configured with -release. The .prl mechanism is not useful for this test, so simply disable it to solve the problem. Reviewed-by: ckamm (cherry picked from commit f5a63feb8953799de7e787f333575ee37fae8a3f) --- tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro index a003338..65c4e8f 100644 --- a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro +++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro @@ -1,5 +1,6 @@ TEMPLATE = lib CONFIG += static plugin +CONFIG -= create_prl # not needed, and complicates debug/release SOURCES = staticplugin.cpp RESOURCES = staticplugin.qrc QT = core script -- cgit v0.12 From f822f0cc8958c09428fc3be4252d82af92802ca9 Mon Sep 17 00:00:00 2001 From: Jo Asplin Date: Mon, 27 Jun 2011 13:10:03 +0200 Subject: Disabled benchmarks referring to private headers. Certain benchmarks that referred to private headers are removed from the list of 'trusted' benchmarks. Benchmarks referring to private headers are considered bad practice for several reasons: 1) Such tests won't even build if private headers are not avaiable in the installed version of Qt. 2) APIs should be designed well enough to be fully testable through its public headers only. Change-Id: Iccd81e12829a7b7f4bd2b88a72f3e9722520f6e2 Reviewed-by: Rohan McGovern --- tests/benchmarks/gui/gui.pro | 5 ++--- tests/benchmarks/network/network.pro | 3 +-- tests/benchmarks/script/script.pro | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/benchmarks/gui/gui.pro b/tests/benchmarks/gui/gui.pro index d825458..06828f4 100644 --- a/tests/benchmarks/gui/gui.pro +++ b/tests/benchmarks/gui/gui.pro @@ -12,7 +12,6 @@ SUBDIRS = \ TRUSTED_BENCHMARKS += \ graphicsview/functional/GraphicsViewBenchmark \ - graphicsview/qgraphicsview \ - painting/qtracebench + graphicsview/qgraphicsview -include(../trusted-benchmarks.pri) \ No newline at end of file +include(../trusted-benchmarks.pri) diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro index 692a0a1..52817f9 100644 --- a/tests/benchmarks/network/network.pro +++ b/tests/benchmarks/network/network.pro @@ -6,8 +6,7 @@ SUBDIRS = \ socket TRUSTED_BENCHMARKS += \ - kernel/qhostinfo \ socket/qtcpserver \ ssl/qsslsocket -include(../trusted-benchmarks.pri) \ No newline at end of file +include(../trusted-benchmarks.pri) diff --git a/tests/benchmarks/script/script.pro b/tests/benchmarks/script/script.pro index 5da05e7..3216b24 100644 --- a/tests/benchmarks/script/script.pro +++ b/tests/benchmarks/script/script.pro @@ -13,7 +13,6 @@ SUBDIRS = \ TRUSTED_BENCHMARKS += \ qscriptclass \ qscriptvalue \ - qscriptengine \ qscriptqobject include(../trusted-benchmarks.pri) -- cgit v0.12 From da68cb3ef67f8cb83e568ae94cc8272247c3f548 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Wed, 29 Jun 2011 10:20:48 +0200 Subject: Adding QTDIR validation in tst_symbols autotest If the variable QTDIR is not set, you might end up checking all the system libraries symbols. Change-Id: I7b079d7e10fccad962cd3b2ced317eb35840bd71 Reviewed-by: Rohan McGovern --- tests/auto/symbols/tst_symbols.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/symbols/tst_symbols.cpp b/tests/auto/symbols/tst_symbols.cpp index d2c8c24..049c771 100644 --- a/tests/auto/symbols/tst_symbols.cpp +++ b/tests/auto/symbols/tst_symbols.cpp @@ -55,6 +55,8 @@ class tst_Symbols: public QObject { Q_OBJECT private slots: + void initTestCase(); + void prefix(); void globalObjects(); }; @@ -89,6 +91,12 @@ static QString symbolToLine(const QString &symbol, const QString &lib) return result; } +void tst_Symbols::initTestCase() +{ + QString qtDir = QString::fromLocal8Bit(qgetenv("QTDIR")); + QVERIFY2(!qtDir.isEmpty(), "This test needs $QTDIR"); +} + /* This test searches through all Qt libraries and searches for symbols starting with "global constructors keyed to " -- cgit v0.12 From 60cb54825f272547071d516ff8bd2d451b211147 Mon Sep 17 00:00:00 2001 From: Jo Asplin Date: Thu, 30 Jun 2011 13:34:36 +0200 Subject: Add test case name and drop parentheses for -datatags option. For completeness, the -datatags command-line option in QTestLib now prints the test case name at the start of each output line. NOTE: Although the file name is supposed to match the lower-case version of the test case name, this is currently not true in all cases (particularly not under tests/benchmarks). Even if there was a script to enforce this convention, the -datatags option now provides this information in a reliable way. This patch also drops the parentheses after the test function as these are always empty anyway. Data tags for each test function (f() in this case) are printed in four different ways depending on the presence of local and global data tags: Case 1: No tags: tst_MyTestCase f Case 2: Local tags only: tst_MyTestCase f local tag 1 tst_MyTestCase f local tag 2 ... Case 3: Global tags only: tst_MyTestCase f __global__ global tag 1 tst_MyTestCase f __global__ global tag 2 ... Case 4: Local and global tags: tst_MyTestCase f local tag 1 __global__ global tag 1 tst_MyTestCase f local tag 2 __global__ global tag 1 ... tst_MyTestCase f local tag 1 __global__ global tag 2 tst_MyTestCase f local tag 2 __global__ global tag 2 ... ... Change-Id: Id9273039a5d33527c32abf6eb1baef80193fa585 Reviewed-by: Rohan McGovern --- src/testlib/qtestcase.cpp | 25 +++++++++++++--------- tests/auto/selftests/expected_printdatatags.txt | 12 +++++------ .../expected_printdatatagswithglobaltags.txt | 24 ++++++++++----------- .../selftests/printdatatags/tst_printdatatags.cpp | 14 ++++++------ .../tst_printdatatagswithglobaltags.cpp | 18 ++++++++-------- 5 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index efa0122..d2ea988 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1035,20 +1035,19 @@ static void qPrintDataTags() invokeMethod(QTest::currentTestObject, "initTestCase_data()"); const QTestTable *gTable = QTestTable::globalTestTable(); + const QMetaObject *currTestMetaObj = QTest::currentTestObject->metaObject(); + // Process test functions: - for (int i = 0; i < QTest::currentTestObject->metaObject()->methodCount(); ++i) { - QMetaMethod tf = QTest::currentTestObject->metaObject()->method(i); + for (int i = 0; i < currTestMetaObj->methodCount(); ++i) { + QMetaMethod tf = currTestMetaObj->method(i); if (isValidSlot(tf)) { - const char *slotName = tf.signature(); - // Retrieve local tags: QStringList localTags; QTestTable table; char member[512]; - char *slot = qstrdup(slotName); + char *slot = qstrdup(tf.signature()); slot[strlen(slot) - 2] = '\0'; QTest::qt_snprintf(member, 512, "%s_data()", slot); - delete[] slot; invokeMethod(QTest::currentTestObject, member); for (int j = 0; j < table.dataCount(); ++j) localTags << QLatin1String(table.testData(j)->dataTag()); @@ -1057,27 +1056,33 @@ static void qPrintDataTags() if (gTable->dataCount() == 0) { if (localTags.count() == 0) { // No tags at all, so just print the test function: - printf("%s\n", slotName); + printf("%s %s\n", currTestMetaObj->className(), slot); } else { // Only local tags, so print each of them: for (int k = 0; k < localTags.size(); ++k) - printf("%s %s\n", slotName, localTags.at(k).toLatin1().data()); + printf( + "%s %s %s\n", + currTestMetaObj->className(), slot, localTags.at(k).toLatin1().data()); } } else { for (int j = 0; j < gTable->dataCount(); ++j) { if (localTags.count() == 0) { // Only global tags, so print the current one: - printf("%s __global__ %s\n", slotName, gTable->testData(j)->dataTag()); + printf( + "%s %s __global__ %s\n", + currTestMetaObj->className(), slot, gTable->testData(j)->dataTag()); } else { // Local and global tags, so print each of the local ones and // the current global one: for (int k = 0; k < localTags.size(); ++k) printf( - "%s %s __global__ %s\n", slotName, + "%s %s %s __global__ %s\n", currTestMetaObj->className(), slot, localTags.at(k).toLatin1().data(), gTable->testData(j)->dataTag()); } } } + + delete[] slot; } } } diff --git a/tests/auto/selftests/expected_printdatatags.txt b/tests/auto/selftests/expected_printdatatags.txt index 02390dc..ac22f23 100644 --- a/tests/auto/selftests/expected_printdatatags.txt +++ b/tests/auto/selftests/expected_printdatatags.txt @@ -1,6 +1,6 @@ -a() data tag a1 -a() data tag a2 -b() -c() data tag c1 -c() data tag c2 -c() data tag c3 +tst_MyTestCase a data tag a1 +tst_MyTestCase a data tag a2 +tst_MyTestCase b +tst_MyTestCase c data tag c1 +tst_MyTestCase c data tag c2 +tst_MyTestCase c data tag c3 diff --git a/tests/auto/selftests/expected_printdatatagswithglobaltags.txt b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt index a91e1b8..32feba4 100644 --- a/tests/auto/selftests/expected_printdatatagswithglobaltags.txt +++ b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt @@ -1,12 +1,12 @@ -a() data tag a1 __global__ global data tag 1 -a() data tag a2 __global__ global data tag 1 -a() data tag a1 __global__ global data tag 2 -a() data tag a2 __global__ global data tag 2 -b() __global__ global data tag 1 -b() __global__ global data tag 2 -c() data tag c1 __global__ global data tag 1 -c() data tag c2 __global__ global data tag 1 -c() data tag c3 __global__ global data tag 1 -c() data tag c1 __global__ global data tag 2 -c() data tag c2 __global__ global data tag 2 -c() data tag c3 __global__ global data tag 2 +tst_MyTestCase a data tag a1 __global__ global data tag 1 +tst_MyTestCase a data tag a2 __global__ global data tag 1 +tst_MyTestCase a data tag a1 __global__ global data tag 2 +tst_MyTestCase a data tag a2 __global__ global data tag 2 +tst_MyTestCase b __global__ global data tag 1 +tst_MyTestCase b __global__ global data tag 2 +tst_MyTestCase c data tag c1 __global__ global data tag 1 +tst_MyTestCase c data tag c2 __global__ global data tag 1 +tst_MyTestCase c data tag c3 __global__ global data tag 1 +tst_MyTestCase c data tag c1 __global__ global data tag 2 +tst_MyTestCase c data tag c2 __global__ global data tag 2 +tst_MyTestCase c data tag c3 __global__ global data tag 2 diff --git a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp index 4b533b3..79f8890 100644 --- a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp +++ b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp @@ -42,7 +42,7 @@ #include -class tst_Foo: public QObject +class tst_MyTestCase: public QObject { Q_OBJECT private slots: @@ -55,7 +55,7 @@ private slots: void c() const; }; -void tst_Foo::a_data() const +void tst_MyTestCase::a_data() const { QTest::addColumn("x"); QTest::addColumn("y"); @@ -64,15 +64,15 @@ void tst_Foo::a_data() const QTest::newRow("data tag a2") << 1 << 2; } -void tst_Foo::a() const +void tst_MyTestCase::a() const { } -void tst_Foo::b() const +void tst_MyTestCase::b() const { } -void tst_Foo::c_data() const +void tst_MyTestCase::c_data() const { QTest::addColumn("x"); @@ -81,10 +81,10 @@ void tst_Foo::c_data() const QTest::newRow("data tag c3") << 1; } -void tst_Foo::c() const +void tst_MyTestCase::c() const { } -QTEST_MAIN(tst_Foo) +QTEST_MAIN(tst_MyTestCase) #include "tst_printdatatags.moc" diff --git a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp index 931dc12..6b0e61b 100644 --- a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp +++ b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp @@ -42,7 +42,7 @@ #include -class tst_Foo: public QObject +class tst_MyTestCase: public QObject { Q_OBJECT private slots: @@ -58,7 +58,7 @@ private slots: void c() const; }; -void tst_Foo::initTestCase_data() const +void tst_MyTestCase::initTestCase_data() const { QTest::addColumn("f"); QTest::addColumn("g"); @@ -67,11 +67,11 @@ void tst_Foo::initTestCase_data() const QTest::newRow("global data tag 2") << 1 << 2; } -void tst_Foo::initTestCase() const +void tst_MyTestCase::initTestCase() const { } -void tst_Foo::a_data() const +void tst_MyTestCase::a_data() const { QTest::addColumn("x"); QTest::addColumn("y"); @@ -80,15 +80,15 @@ void tst_Foo::a_data() const QTest::newRow("data tag a2") << 1 << 2; } -void tst_Foo::a() const +void tst_MyTestCase::a() const { } -void tst_Foo::b() const +void tst_MyTestCase::b() const { } -void tst_Foo::c_data() const +void tst_MyTestCase::c_data() const { QTest::addColumn("x"); @@ -97,10 +97,10 @@ void tst_Foo::c_data() const QTest::newRow("data tag c3") << 1; } -void tst_Foo::c() const +void tst_MyTestCase::c() const { } -QTEST_MAIN(tst_Foo) +QTEST_MAIN(tst_MyTestCase) #include "tst_printdatatagswithglobaltags.moc" -- cgit v0.12 From 6a2f18140bbc41207eb2f5e2323b699600d89606 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:08:43 +0200 Subject: Modified \since command behavior slightly to handle project and version. (The since argument can contain a project name and version, defaulting to the qdoc project if only a version number is specified.) Refactored common code into the Generator class. Fixed \sincelist HTML generation for tables containing only one item. --- tools/qdoc3/ditaxmlgenerator.cpp | 83 ----------------------- tools/qdoc3/ditaxmlgenerator.h | 11 --- tools/qdoc3/doc.cpp | 2 +- tools/qdoc3/generator.cpp | 142 +++++++++++++++++++++++++++++++++++++-- tools/qdoc3/generator.h | 12 ++++ tools/qdoc3/htmlgenerator.cpp | 103 +++++----------------------- tools/qdoc3/htmlgenerator.h | 11 --- tools/qdoc3/node.cpp | 10 +++ tools/qdoc3/node.h | 2 +- 9 files changed, 174 insertions(+), 202 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index c49ff65..64f12d6 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -62,25 +62,6 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") int DitaXmlGenerator::id = 0; -QString DitaXmlGenerator::sinceTitles[] = - { - " New Namespaces", - " New Classes", - " New Member Functions", - " New Functions in Namespaces", - " New Global Functions", - " New Macros", - " New Enum Types", - " New Typedefs", - " New Properties", - " New Variables", - " New QML Elements", - " New Qml Properties", - " New Qml Signals", - " New Qml Methods", - "" - }; - /* The strings in this array must appear in the same order as the values in enum DitaXmlGenerator::DitaTag. @@ -3955,70 +3936,6 @@ void DitaXmlGenerator::findAllClasses(const InnerNode* node) } } -/*! - For generating the "New Classes... in 4.x" section on the - What's New in 4.x" page. - */ -void DitaXmlGenerator::findAllSince(const InnerNode* node) -{ - NodeList::const_iterator child = node->childNodes().constBegin(); - while (child != node->childNodes().constEnd()) { - QString sinceVersion = (*child)->since(); - if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) { - NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion); - if (nsmap == newSinceMaps.end()) - nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap()); - NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); - if (ncmap == newClassMaps.end()) - ncmap = newClassMaps.insert(sinceVersion,NodeMap()); - NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); - if (nqcmap == newQmlClassMaps.end()) - nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); - - if ((*child)->type() == Node::Function) { - FunctionNode *func = static_cast(*child); - if ((func->status() > Node::Obsolete) && - (func->metaness() != FunctionNode::Ctor) && - (func->metaness() != FunctionNode::Dtor)) { - nsmap.value().insert(func->name(),(*child)); - } - } - else if ((*child)->url().isEmpty()) { - if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - ncmap.value().insert(className,(*child)); - } - else if ((*child)->subType() == Node::QmlClass) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - nqcmap.value().insert(className,(*child)); - } - } - else { - QString name = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - name = (*child)->parent()->name()+"::"+name; - nsmap.value().insert(name,(*child)); - } - if ((*child)->isInnerNode()) { - findAllSince(static_cast(*child)); - } - } - ++child; - } -} - void DitaXmlGenerator::findAllFunctions(const InnerNode* node) { NodeList::ConstIterator c = node->childNodes().begin(); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 408f46c..d8d3563 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -51,12 +51,6 @@ QT_BEGIN_NAMESPACE -typedef QMultiMap NodeMultiMap; -typedef QMap NewSinceMaps; -typedef QMap ParentMaps; -typedef QMap NodeMap; -typedef QMap NewClassMaps; - typedef QMap GuidMap; typedef QMap GuidMaps; @@ -418,7 +412,6 @@ class DitaXmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); - void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -515,10 +508,6 @@ class DitaXmlGenerator : public PageGenerator #endif QMap funcIndex; QMap legaleseTexts; - NewSinceMaps newSinceMaps; - static QString sinceTitles[]; - NewClassMaps newClassMaps; - NewClassMaps newQmlClassMaps; static int id; static QString ditaTags[]; QStack xmlWriterStack; diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 479931d..37f68f8 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -828,7 +828,7 @@ void DocParser::parse(const QString& source, append(Atom::AnnotatedList, getArgument()); break; case CMD_SINCELIST: - append(Atom::SinceList, getArgument()); + append(Atom::SinceList, getRestOfLine().simplified()); break; case CMD_GENERATELIST: append(Atom::GeneratedList, getArgument()); diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 6c92e54..355c9b2 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -77,6 +77,25 @@ QString Generator::outDir; QString Generator::project; QHash Generator::outputPrefixes; +QString Generator::sinceTitles[] = + { + " New Namespaces", + " New Classes", + " New Member Functions", + " New Functions in Namespaces", + " New Global Functions", + " New Macros", + " New Enum Types", + " New Typedefs", + " New Properties", + " New Variables", + " New QML Elements", + " New QML Properties", + " New QML Signals", + " New QML Methods", + "" + }; + static void singularPlural(Text& text, const NodeList& nodes) { if (nodes.count() == 1) @@ -760,8 +779,18 @@ QString Generator::typeString(const Node *node) case Node::Class: return "class"; case Node::Fake: - default: - return "documentation"; + { + switch (node->subType()) { + case Node::QmlClass: + return "element"; + case Node::QmlPropertyGroup: + return "property group"; + case Node::QmlBasicType: + return "type"; + default: + return "documentation"; + } + } case Node::Enum: return "enum"; case Node::Typedef: @@ -770,6 +799,8 @@ QString Generator::typeString(const Node *node) return "function"; case Node::Property: return "property"; + default: + return "documentation"; } } @@ -1094,11 +1125,21 @@ void Generator::generateSince(const Node *node, CodeMarker *marker) text << " was introduced or modified in "; else text << " was introduced in "; - if (project.isEmpty()) - text << "version"; - else - text << project; - text << " " << node->since() << "." << Atom::ParaRight; + + QStringList since = node->since().split(" "); + if (since.count() == 1) { + // Handle legacy use of \since . + if (project.isEmpty()) + text << "version"; + else + text << project; + text << " " << since[0]; + } else { + // Reconstruct the string. + text << " " << since.join(" "); + } + + text << "." << Atom::ParaRight; generateText(text, node, marker); } } @@ -1349,4 +1390,91 @@ QStringList Generator::getMetadataElements(const InnerNode* inner, const QString return s; } +/*! + For generating the "New Classes... in 4.6" section on the + What's New in 4.6" page. + */ +void Generator::findAllSince(const InnerNode *node) +{ + NodeList::const_iterator child = node->childNodes().constBegin(); + + // Traverse the tree, starting at the node supplied. + + while (child != node->childNodes().constEnd()) { + + QString sinceString = (*child)->since(); + + if (((*child)->access() != Node::Private) && !sinceString.isEmpty()) { + + // Insert a new entry into each map for each new since string found. + NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceString); + if (nsmap == newSinceMaps.end()) + nsmap = newSinceMaps.insert(sinceString,NodeMultiMap()); + + NewClassMaps::iterator ncmap = newClassMaps.find(sinceString); + if (ncmap == newClassMaps.end()) + ncmap = newClassMaps.insert(sinceString,NodeMap()); + + NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceString); + if (nqcmap == newQmlClassMaps.end()) + nqcmap = newQmlClassMaps.insert(sinceString,NodeMap()); + + if ((*child)->type() == Node::Function) { + // Insert functions into the general since map. + FunctionNode *func = static_cast(*child); + if ((func->status() > Node::Obsolete) && + (func->metaness() != FunctionNode::Ctor) && + (func->metaness() != FunctionNode::Dtor)) { + nsmap.value().insert(func->name(),(*child)); + } + } + else if ((*child)->url().isEmpty()) { + if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { + // Insert classes into the since and class maps. + QString className = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + className = (*child)->parent()->name()+"::"+className; + + nsmap.value().insert(className,(*child)); + ncmap.value().insert(className,(*child)); + } + else if ((*child)->subType() == Node::QmlClass) { + // Insert QML elements into the since and element maps. + QString className = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + className = (*child)->parent()->name()+"::"+className; + + nsmap.value().insert(className,(*child)); + nqcmap.value().insert(className,(*child)); + } + else if ((*child)->type() == Node::QmlProperty) { + // Insert QML properties into the since map. + QString propertyName = (*child)->name(); + nsmap.value().insert(propertyName,(*child)); + } + } + else { + // Insert external documents into the general since map. + QString name = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + name = (*child)->parent()->name()+"::"+name; + + nsmap.value().insert(name,(*child)); + } + + // Find child nodes with since commands. + if ((*child)->isInnerNode()) { + findAllSince(static_cast(*child)); + } + } + ++child; + } +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index e5e9747..e66915b 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -57,6 +57,12 @@ QT_BEGIN_NAMESPACE +typedef QMap NodeMap; +typedef QMultiMap NodeMultiMap; +typedef QMap NewSinceMaps; +typedef QMap ParentMaps; +typedef QMap NewClassMaps; + class ClassNode; class Config; class CodeMarker; @@ -152,6 +158,7 @@ class Generator QString getMetadataElement(const InnerNode* inner, const QString& t); QStringList getMetadataElements(const InnerNode* inner, const QString& t); + void findAllSince(const InnerNode *node); private: void generateReimplementedFrom(const FunctionNode *func, @@ -180,6 +187,11 @@ class Generator const NodeList& subs, CodeMarker *marker); + static QString sinceTitles[]; + NewSinceMaps newSinceMaps; + NewClassMaps newClassMaps; + NewClassMaps newQmlClassMaps; + private: QString amp; QString lt; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 52da178..655c3b4 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -66,25 +66,6 @@ bool HtmlGenerator::debugging_on = false; QString HtmlGenerator::divNavTop = ""; -QString HtmlGenerator::sinceTitles[] = - { - " New Namespaces", - " New Classes", - " New Member Functions", - " New Functions in Namespaces", - " New Global Functions", - " New Macros", - " New Enum Types", - " New Typedefs", - " New Properties", - " New Variables", - " New QML Elements", - " New QML Properties", - " New QML Signals", - " New QML Methods", - "" - }; - static bool showBrokenLinks = false; static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); @@ -606,14 +587,18 @@ int HtmlGenerator::generateAtom(const Atom *atom, ncmap = newClassMaps.find(atom->string()); NewClassMaps::const_iterator nqcmap; nqcmap = newQmlClassMaps.find(atom->string()); + if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { QList
sections; QList
::ConstIterator s; + for (int i=0; itype()) { case Node::Fake: @@ -1346,6 +1331,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) // Generate brief text and status for modules. generateBrief(fake, marker); generateStatus(fake, marker); + generateSince(fake, marker); if (moduleNamespaceMap.contains(fake->name())) { out() << "" << divNavTop << "\n"; @@ -1362,6 +1348,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) // Generate brief text and status for modules. generateBrief(fake, marker); generateStatus(fake, marker); + generateSince(fake, marker); out() << "
    \n"; @@ -1393,6 +1380,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateQmlInherits(qml_cn, marker); generateQmlInheritedBy(qml_cn, marker); generateQmlInstantiates(qml_cn, marker); + generateSince(qml_cn, marker); QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker); if (!allQmlMembersLink.isEmpty()) { @@ -2242,9 +2230,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, for (int i=0; i element to contain all the
    elements. */ out() << "
    \n"; + numTableRows = 0; + + int curParNr = 0; + int curParOffset = 0; - for (int i=0; i\n"; curParOffset++; } - out() << "
    \n"; + if (classMap.count() > 0) + out() << "\n"; + out() << "\n"; } @@ -3357,70 +3348,6 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) } } -/*! - For generating the "New Classes... in 4.6" section on the - What's New in 4.6" page. - */ -void HtmlGenerator::findAllSince(const InnerNode *node) -{ - NodeList::const_iterator child = node->childNodes().constBegin(); - while (child != node->childNodes().constEnd()) { - QString sinceVersion = (*child)->since(); - if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) { - NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion); - if (nsmap == newSinceMaps.end()) - nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap()); - NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); - if (ncmap == newClassMaps.end()) - ncmap = newClassMaps.insert(sinceVersion,NodeMap()); - NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); - if (nqcmap == newQmlClassMaps.end()) - nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); - - if ((*child)->type() == Node::Function) { - FunctionNode *func = static_cast(*child); - if ((func->status() > Node::Obsolete) && - (func->metaness() != FunctionNode::Ctor) && - (func->metaness() != FunctionNode::Dtor)) { - nsmap.value().insert(func->name(),(*child)); - } - } - else if ((*child)->url().isEmpty()) { - if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - ncmap.value().insert(className,(*child)); - } - else if ((*child)->subType() == Node::QmlClass) { - QString className = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - className = (*child)->parent()->name()+"::"+className; - nsmap.value().insert(className,(*child)); - nqcmap.value().insert(className,(*child)); - } - } - else { - QString name = (*child)->name(); - if ((*child)->parent() && - (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) - name = (*child)->parent()->name()+"::"+name; - nsmap.value().insert(name,(*child)); - } - if ((*child)->isInnerNode()) { - findAllSince(static_cast(*child)); - } - } - ++child; - } -} - void HtmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 70ec0b7..e36c562 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -56,12 +56,6 @@ QT_BEGIN_NAMESPACE -typedef QMultiMap NodeMultiMap; -typedef QMap NewSinceMaps; -typedef QMap ParentMaps; -typedef QMap NodeMap; -typedef QMap NewClassMaps; - class HelpProjectWriter; class HtmlGenerator : public PageGenerator @@ -224,7 +218,6 @@ class HtmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); - void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -292,10 +285,6 @@ class HtmlGenerator : public PageGenerator NodeMap qmlClasses; QMap funcIndex; QMap legaleseTexts; - NewSinceMaps newSinceMaps; - static QString sinceTitles[]; - NewClassMaps newClassMaps; - NewClassMaps newQmlClassMaps; static int id; public: static bool debugging_on; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 683c210..87bbd93 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -157,6 +157,16 @@ void Node::setLink(LinkType linkType, const QString &link, const QString &desc) } /*! + Sets the information about the project and version a node was introduced + in. The string is simplified, removing excess whitespace before being + stored. +*/ +void Node::setSince(const QString &since) +{ + sinc = since.simplified(); +} + +/*! Returns a string representing the access specifier. */ QString Node::accessString() const diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index e1e9440..cb16bea 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -151,7 +151,7 @@ class Node void setDoc(const Doc& doc, bool replace = false); void setStatus(Status status) { sta = status; } void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; } - void setSince(const QString &since) { sinc = since; } + void setSince(const QString &since); void setRelates(InnerNode* pseudoParent); void setModuleName(const QString &module) { mod = module; } void setLink(LinkType linkType, const QString &link, const QString &desc); -- cgit v0.12 From 01b3f508d1f7e9951baf60f487feadfa98ba4751 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:13:55 +0200 Subject: Doc: Removed whitespace. --- doc/src/qt4-intro.qdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index d75bdca..1547a7c 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -610,7 +610,6 @@ introduced in Qt 4.7. \sincelist 4.7 - */ /*! -- cgit v0.12 From 609dc22f719ecb8d48349fd56f84960bbf46d731 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:14:30 +0200 Subject: Doc: Standardized on QtQuick for \since declarations. --- src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeimage.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativeitem.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 2 +- src/declarative/graphicsitems/qdeclarativepositioners.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativerepeater.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativetext.cpp | 8 ++++---- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 10 +++++----- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 8 ++++---- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index b7fcbb5..fb1bdf6 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -88,7 +88,7 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty bool AnimatedImage::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -97,7 +97,7 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty bool AnimatedImage::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 836ad49..bd6405c 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -215,7 +215,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() /*! \qmlproperty bool BorderImage::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -224,7 +224,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() /*! \qmlproperty bool BorderImage::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 4a465cc..93af16f 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1414,7 +1414,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h) /*! \qmlmethod Flickable::resizeContent(real width, real height, QPointF center) \preliminary - \since Quick 1.1 + \since QtQuick 1.1 Resizes the content to \a width x \a height about \a center. @@ -1454,7 +1454,7 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center) /*! \qmlmethod Flickable::returnToBounds() \preliminary - \since Quick 1.1 + \since QtQuick 1.1 Ensures the content is within legal bounds. diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index afc3eac..5da3f77 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2584,7 +2584,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode) /*! \qmlmethod GridView::positionViewAtBeginning() \qmlmethod GridView::positionViewAtEnd() - \since Quick 1.1 + \since QtQuick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index e6bb798..9b9d680 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -473,7 +473,7 @@ QRectF QDeclarativeImage::boundingRect() const /*! \qmlproperty bool Image::cache - \since Quick 1.1 + \since QtQuick 1.1 Specifies whether the image should be cached. The default value is true. Setting \a cache to false is useful when dealing with large images, @@ -482,7 +482,7 @@ QRectF QDeclarativeImage::boundingRect() const /*! \qmlproperty bool Image::mirror - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index ccf0de0..ee2d19d 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -3444,7 +3444,7 @@ qreal QDeclarativeItem::implicitHeight() const /*! \qmlproperty real Item::implicitWidth \qmlproperty real Item::implicitHeight - \since Quick 1.1 + \since QtQuick 1.1 Defines the natural width or height of the Item if no \l width or \l height is specified. diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 8695bc6..16a76e2 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -3007,7 +3007,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) /*! \qmlmethod ListView::positionViewAtBeginning() \qmlmethod ListView::positionViewAtEnd() - \since Quick 1.1 + \since QtQuick 1.1 Positions the view at the beginning or end, taking into account any header or footer. diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 18f008a..0e06a4c 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -419,7 +419,7 @@ void QDeclarativeMouseArea::setEnabled(bool a) /*! \qmlproperty bool MouseArea::preventStealing - \since Quick 1.1 + \since QtQuick 1.1 This property holds whether the mouse events may be stolen from this MouseArea. diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index f3d1a68..483cad4 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -584,7 +584,7 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) /*! \qmlproperty enumeration Row::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layoutDirection of the row. @@ -878,7 +878,7 @@ void QDeclarativeGrid::setFlow(Flow flow) /*! \qmlproperty enumeration Grid::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layout direction of the layout. @@ -1236,7 +1236,7 @@ void QDeclarativeFlow::setFlow(Flow flow) /*! \qmlproperty enumeration Flow::layoutDirection - \since Quick 1.1 + \since QtQuick 1.1 This property holds the layout direction of the layout. diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 813c255..e881b96 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -128,7 +128,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() /*! \qmlsignal Repeater::onItemAdded(int index, Item item) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when an item is added to the repeater. The \a index parameter holds the index at which the item has been inserted within the @@ -137,7 +137,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() /*! \qmlsignal Repeater::onItemRemoved(int index, Item item) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when an item is removed from the repeater. The \a index parameter holds the index at which the item was removed from the repeater, @@ -306,7 +306,7 @@ int QDeclarativeRepeater::count() const /*! \qmlmethod Item Repeater::itemAt(index) - \since Quick 1.1 + \since QtQuick 1.1 Returns the \l Item that has been created at the given \a index, or \c null if no item exists at \a index. diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 91c12d2..6d1b15d 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -1213,7 +1213,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode) /*! \qmlproperty int Text::lineCount - \since Quick 1.1 + \since QtQuick 1.1 Returns the number of lines visible in the text item. @@ -1229,7 +1229,7 @@ int QDeclarativeText::lineCount() const /*! \qmlproperty bool Text::truncated - \since Quick 1.1 + \since QtQuick 1.1 Returns true if the text has been truncated due to \l maximumLineCount or \l elide. @@ -1246,7 +1246,7 @@ bool QDeclarativeText::truncated() const /*! \qmlproperty int Text::maximumLineCount - \since Quick 1.1 + \since QtQuick 1.1 Set this property to limit the number of lines that the text item will show. If elide is set to Text.ElideRight, the text will be elided appropriately. @@ -1480,7 +1480,7 @@ qreal QDeclarativeText::paintedHeight() const /*! \qmlproperty real Text::lineHeight - \since Quick 1.1 + \since QtQuick 1.1 Sets the line height for the text. The value can be in pixels or a multiplier depending on lineHeightMode. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 42c520c..15a3cae 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -107,7 +107,7 @@ TextEdit { /*! \qmlsignal TextEdit::onLinkActivated(string link) - \since Quick 1.1 + \since QtQuick 1.1 This handler is called when the user clicks on a link embedded in the text. The link must be in rich text or HTML format and the @@ -616,7 +616,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode) /*! \qmlproperty int TextEdit::lineCount - \since Quick 1.1 + \since QtQuick 1.1 Returns the total number of lines in the textEdit item. */ @@ -710,7 +710,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos) /*! \qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters) - \since Quick 1.1 + \since QtQuick 1.1 Moves the cursor to \a position and updates the selection according to the optional \a mode parameter. (To only move the cursor, set the \l cursorPosition property.) @@ -1075,7 +1075,7 @@ void QDeclarativeTextEdit::setSelectByMouse(bool on) /*! \qmlproperty enum TextEdit::mouseSelectionMode - \since Quick 1.1 + \since QtQuick 1.1 Specifies how text should be selected using a mouse. @@ -1221,7 +1221,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) /*! \qmlmethod void TextEdit::deselect() - \since Quick 1.1 + \since QtQuick 1.1 Removes active text selection. */ diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index c59c919..1c64464 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1014,7 +1014,7 @@ int QDeclarativeTextInput::positionAt(int x) const /*! \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters) - \since Quick 1.1 + \since QtQuick 1.1 This function returns the character position at x pixels from the left of the textInput. Position 0 is before the @@ -1402,7 +1402,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property) /*! \qmlmethod void TextInput::deselect() - \since Quick 1.1 + \since QtQuick 1.1 Removes active text selection. */ @@ -1574,7 +1574,7 @@ void QDeclarativeTextInput::setSelectByMouse(bool on) /*! \qmlproperty enum TextInput::mouseSelectionMode - \since Quick 1.1 + \since QtQuick 1.1 Specifies how text should be selected using a mouse. @@ -1622,7 +1622,7 @@ void QDeclarativeTextInput::moveCursorSelection(int position) /*! \qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters) - \since Quick 1.1 + \since QtQuick 1.1 Moves the cursor to \a position and updates the selection according to the optional \a mode parameter. (To only move the cursor, set the \l cursorPosition property.) -- cgit v0.12 From 358e018dbb4b4dbdbfc702a6d462f113a1357e1e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 19:16:21 +0200 Subject: Doc: Fixed \since declarations. --- src/gui/kernel/qkeysequence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index f8e4e57..8635bf2 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -934,7 +934,7 @@ QKeySequence::QKeySequence(const QString &key) } /*! - \since 4.x + \since 4.7 Creates a key sequence from the \a key string based on \a format. */ QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) @@ -1131,7 +1131,7 @@ int QKeySequence::assign(const QString &ks) /*! \fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format) - \since 4.x + \since 4.7 Adds the given \a keys to the key sequence (based on \a format). \a keys may contain up to four key codes, provided they are -- cgit v0.12 From 86608d537eabc3cf7e1d1ddd1d0a2f90ccc2de2a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 30 Jun 2011 20:48:32 +0200 Subject: Doc: Clarified the range of return values from QLineF::angle(). Task-number: QTBUG-20197 --- src/corelib/tools/qline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp index af3b7d5..0f67652 100644 --- a/src/corelib/tools/qline.cpp +++ b/src/corelib/tools/qline.cpp @@ -564,8 +564,9 @@ qreal QLineF::length() const Returns the angle of the line in degrees. - Positive values for the angles mean counter-clockwise while negative values - mean the clockwise direction. Zero degrees is at the 3 o'clock position. + The return value will be in the range of values from 0.0 up to but not + including 360.0. The angles are measured counter-clockwise from a point + on the x-axis to the right of the origin (x > 0). \sa setAngle() */ -- cgit v0.12 From 93fd695001f7ac6fda3fd7f802ca15ab73ffbdfc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 19 Jul 2011 19:20:21 +0200 Subject: Doc: Removed the Google Analytics script. --- tools/qdoc3/test/qt-html-templates-online.qdocconf | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf index 03ed6fa..3584b68 100644 --- a/tools/qdoc3/test/qt-html-templates-online.qdocconf +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -181,16 +181,4 @@ HTML.footer = \ "
    \n" \ "
    \n" \ "\n" \ - " \n" \ - " \n" + " \n" -- cgit v0.12 From b1612707a9beab757847bbb1a7924c44b65e74b9 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 20 Jul 2011 17:07:51 +0200 Subject: Doc: Added a copy of the online style images for the qdoc manual. --- tools/qdoc3/doc/config/images/arrow_down.png | Bin 0 -> 177 bytes tools/qdoc3/doc/config/images/bg_l.png | Bin 0 -> 100 bytes tools/qdoc3/doc/config/images/bg_l_blank.png | Bin 0 -> 84 bytes tools/qdoc3/doc/config/images/bg_ll_blank.png | Bin 0 -> 320 bytes tools/qdoc3/doc/config/images/bg_r.png | Bin 0 -> 96 bytes tools/qdoc3/doc/config/images/bg_ul_blank.png | Bin 0 -> 304 bytes tools/qdoc3/doc/config/images/box_bg.png | Bin 0 -> 89 bytes tools/qdoc3/doc/config/images/breadcrumb.png | Bin 0 -> 134 bytes tools/qdoc3/doc/config/images/bullet_dn.png | Bin 0 -> 230 bytes tools/qdoc3/doc/config/images/bullet_gt.png | Bin 0 -> 124 bytes tools/qdoc3/doc/config/images/bullet_sq.png | Bin 0 -> 74 bytes tools/qdoc3/doc/config/images/bullet_up.png | Bin 0 -> 210 bytes tools/qdoc3/doc/config/images/feedbackground.png | Bin 0 -> 263 bytes tools/qdoc3/doc/config/images/header_bg.png | Bin 0 -> 114 bytes tools/qdoc3/doc/config/images/horBar.png | Bin 0 -> 2807 bytes tools/qdoc3/doc/config/images/page.png | Bin 0 -> 3102 bytes tools/qdoc3/doc/config/images/page_bg.png | Bin 0 -> 84 bytes tools/qdoc3/doc/config/images/spinner.gif | Bin 0 -> 2037 bytes tools/qdoc3/doc/config/images/sprites-combined.png | Bin 0 -> 62534 bytes 19 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/qdoc3/doc/config/images/arrow_down.png create mode 100755 tools/qdoc3/doc/config/images/bg_l.png create mode 100755 tools/qdoc3/doc/config/images/bg_l_blank.png create mode 100644 tools/qdoc3/doc/config/images/bg_ll_blank.png create mode 100755 tools/qdoc3/doc/config/images/bg_r.png create mode 100644 tools/qdoc3/doc/config/images/bg_ul_blank.png create mode 100755 tools/qdoc3/doc/config/images/box_bg.png create mode 100755 tools/qdoc3/doc/config/images/breadcrumb.png create mode 100644 tools/qdoc3/doc/config/images/bullet_dn.png create mode 100755 tools/qdoc3/doc/config/images/bullet_gt.png create mode 100755 tools/qdoc3/doc/config/images/bullet_sq.png create mode 100644 tools/qdoc3/doc/config/images/bullet_up.png create mode 100755 tools/qdoc3/doc/config/images/feedbackground.png create mode 100644 tools/qdoc3/doc/config/images/header_bg.png create mode 100755 tools/qdoc3/doc/config/images/horBar.png create mode 100644 tools/qdoc3/doc/config/images/page.png create mode 100755 tools/qdoc3/doc/config/images/page_bg.png create mode 100644 tools/qdoc3/doc/config/images/spinner.gif create mode 100755 tools/qdoc3/doc/config/images/sprites-combined.png diff --git a/tools/qdoc3/doc/config/images/arrow_down.png b/tools/qdoc3/doc/config/images/arrow_down.png new file mode 100644 index 0000000..9d01e97 Binary files /dev/null and b/tools/qdoc3/doc/config/images/arrow_down.png differ diff --git a/tools/qdoc3/doc/config/images/bg_l.png b/tools/qdoc3/doc/config/images/bg_l.png new file mode 100755 index 0000000..90b1da1 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bg_l.png differ diff --git a/tools/qdoc3/doc/config/images/bg_l_blank.png b/tools/qdoc3/doc/config/images/bg_l_blank.png new file mode 100755 index 0000000..5a9673d Binary files /dev/null and b/tools/qdoc3/doc/config/images/bg_l_blank.png differ diff --git a/tools/qdoc3/doc/config/images/bg_ll_blank.png b/tools/qdoc3/doc/config/images/bg_ll_blank.png new file mode 100644 index 0000000..95a1c45 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bg_ll_blank.png differ diff --git a/tools/qdoc3/doc/config/images/bg_r.png b/tools/qdoc3/doc/config/images/bg_r.png new file mode 100755 index 0000000..f0fb121 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bg_r.png differ diff --git a/tools/qdoc3/doc/config/images/bg_ul_blank.png b/tools/qdoc3/doc/config/images/bg_ul_blank.png new file mode 100644 index 0000000..7051261 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bg_ul_blank.png differ diff --git a/tools/qdoc3/doc/config/images/box_bg.png b/tools/qdoc3/doc/config/images/box_bg.png new file mode 100755 index 0000000..3322f92 Binary files /dev/null and b/tools/qdoc3/doc/config/images/box_bg.png differ diff --git a/tools/qdoc3/doc/config/images/breadcrumb.png b/tools/qdoc3/doc/config/images/breadcrumb.png new file mode 100755 index 0000000..0ded551 Binary files /dev/null and b/tools/qdoc3/doc/config/images/breadcrumb.png differ diff --git a/tools/qdoc3/doc/config/images/bullet_dn.png b/tools/qdoc3/doc/config/images/bullet_dn.png new file mode 100644 index 0000000..f776247 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bullet_dn.png differ diff --git a/tools/qdoc3/doc/config/images/bullet_gt.png b/tools/qdoc3/doc/config/images/bullet_gt.png new file mode 100755 index 0000000..7561b4e Binary files /dev/null and b/tools/qdoc3/doc/config/images/bullet_gt.png differ diff --git a/tools/qdoc3/doc/config/images/bullet_sq.png b/tools/qdoc3/doc/config/images/bullet_sq.png new file mode 100755 index 0000000..a84845e Binary files /dev/null and b/tools/qdoc3/doc/config/images/bullet_sq.png differ diff --git a/tools/qdoc3/doc/config/images/bullet_up.png b/tools/qdoc3/doc/config/images/bullet_up.png new file mode 100644 index 0000000..7de2f06 Binary files /dev/null and b/tools/qdoc3/doc/config/images/bullet_up.png differ diff --git a/tools/qdoc3/doc/config/images/feedbackground.png b/tools/qdoc3/doc/config/images/feedbackground.png new file mode 100755 index 0000000..3a38d99 Binary files /dev/null and b/tools/qdoc3/doc/config/images/feedbackground.png differ diff --git a/tools/qdoc3/doc/config/images/header_bg.png b/tools/qdoc3/doc/config/images/header_bg.png new file mode 100644 index 0000000..a436aa6 Binary files /dev/null and b/tools/qdoc3/doc/config/images/header_bg.png differ diff --git a/tools/qdoc3/doc/config/images/horBar.png b/tools/qdoc3/doc/config/images/horBar.png new file mode 100755 index 0000000..100fe91 Binary files /dev/null and b/tools/qdoc3/doc/config/images/horBar.png differ diff --git a/tools/qdoc3/doc/config/images/page.png b/tools/qdoc3/doc/config/images/page.png new file mode 100644 index 0000000..1db151b Binary files /dev/null and b/tools/qdoc3/doc/config/images/page.png differ diff --git a/tools/qdoc3/doc/config/images/page_bg.png b/tools/qdoc3/doc/config/images/page_bg.png new file mode 100755 index 0000000..9b3bd99 Binary files /dev/null and b/tools/qdoc3/doc/config/images/page_bg.png differ diff --git a/tools/qdoc3/doc/config/images/spinner.gif b/tools/qdoc3/doc/config/images/spinner.gif new file mode 100644 index 0000000..1ed786f Binary files /dev/null and b/tools/qdoc3/doc/config/images/spinner.gif differ diff --git a/tools/qdoc3/doc/config/images/sprites-combined.png b/tools/qdoc3/doc/config/images/sprites-combined.png new file mode 100755 index 0000000..3a48b21 Binary files /dev/null and b/tools/qdoc3/doc/config/images/sprites-combined.png differ -- cgit v0.12 From 78cba11c4d2d0620d51d3201255589f81bb60d8e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 21 Jul 2011 19:59:00 +0200 Subject: Doc: Fixed the example of an encoded URL in the class description. Task-number: QTBUG-20398 (cherry picked from commit 88b4736d8085db27abbe54ac6ece86f9badf154a) --- src/corelib/io/qurl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 4226f9e..60a4ce3 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -63,8 +63,9 @@ unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL - "http://b\uuml\c{}hler.example.com" would be sent to the server as - "http://xn--bhler-kva.example.com/List%20of%20applicants.xml". + "http://b\uuml\c{}hler.example.com/List of applicants.xml" would be sent to the server as + "http://xn--bhler-kva.example.com/List%20of%20applicants.xml", + and this can be verified by calling the toEncoded() function. A URL can also be constructed piece by piece by calling setScheme(), setUserName(), setPassword(), setHost(), setPort(), -- cgit v0.12 From 3f8b5c71d09f4f420575568ea991a856c96dd566 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 22 Jul 2011 15:06:28 +0200 Subject: qdoc: Fixed a crash caused by accessing a null pointer. --- tools/qdoc3/ditaxmlgenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ae7385e..9f512d3 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2098,9 +2098,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateSince(qcn, marker); enterSection("h2","Detailed Description"); generateBody(qcn, marker); - if (cn) + if (cn) { generateQmlText(cn->doc().body(), cn, marker, qcn->name()); - generateAlsoList(cn, marker); + generateAlsoList(cn, marker); + } leaveSection(); leaveSection(); // -- cgit v0.12 From 4fe2205d2fe1e8eaf3d4122c74a29862b5d04bfe Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 25 Jul 2011 22:08:21 +0200 Subject: Fix QString compares to "" Do not compare a QString to "". Instead use the .isEmpty() method. Change-Id: I91ca870c6cd20a72e98f7c782c3f7e4947760ef9 Reviewed-by: Rohan McGovern --- tools/macdeployqt/shared/shared.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp index c411683..d2ceedd 100644 --- a/tools/macdeployqt/shared/shared.cpp +++ b/tools/macdeployqt/shared/shared.cpp @@ -126,7 +126,7 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, bool useDebugLibs) while (part < parts.count()) { const QString currentPart = parts.at(part).simplified() ; ++part; - if (currentPart == "") + if (currentPart.isEmpty()) continue; if (state == QtPath) { -- cgit v0.12 From 4f2844f31f852a94cbdaa6de2f2e7a719473634a Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 28 Jul 2011 16:51:00 +0200 Subject: Fixed external link to DevNet Wiki. Reviewed-by: Geir Vattekar --- doc/src/qt-webpages.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index c993575..f67ff83 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -221,7 +221,7 @@ \title Forums on Qt Developer Network */ /*! - \externalpage http://developer.qt.nokia.com/wikis + \externalpage http://developer.qt.nokia.com/wiki \title Wiki on Qt Developer Network */ /*! -- cgit v0.12 From 8815bc982b8361517a4376db4eb0e1b402c2bd65 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 29 Jul 2011 12:03:07 +0200 Subject: Doc: Fixes to Qt tutorial Reviewed-by: Jerome Pasion --- doc/src/getting-started/gettingstartedqt.qdoc | 72 ++++++++++++++-------- .../tutorials/gettingStarted/gsQt/part2/main.cpp | 14 ++--- 2 files changed, 54 insertions(+), 32 deletions(-) diff --git a/doc/src/getting-started/gettingstartedqt.qdoc b/doc/src/getting-started/gettingstartedqt.qdoc index eda5ee1..d37e8e0 100644 --- a/doc/src/getting-started/gettingstartedqt.qdoc +++ b/doc/src/getting-started/gettingstartedqt.qdoc @@ -38,6 +38,12 @@ documentation, and find the information you need for the application you are developing. + The code for this tutorial is available in \c + {examples/tutorials/gettingStarted/gsQt} under your Qt + installation. If you are using the Qt SDK, you will find it in + \c{Examples/4.7/tutorials/gettingStarted/gsQt} (change \c{4.7} if + you are using a later Qt version). + \section1 Hello Notepad In this first example, we simply create and show a text edit in a @@ -139,28 +145,28 @@ Let us take a look at the code. \code - 1 #include - 2 - 3 int main(int argv, char **args) - 4 { - 5 QApplication app(argv, args); - 6 - 7 QTextEdit textEdit; - 8 QPushButton quitButton("Quit"); - 9 -10 QObject::connect(&quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); -11 -12 QVBoxLayout layout; -13 layout.addWidget(&textEdit); -14 layout.addWidget(&quitButton); -15 -16 QWidget window; -17 window.setLayout(&layout); -18 -19 window.show(); -20 -21 return app.exec(); -22 } + 1 #include + 2 + 3 int main(int argv, char **args) + 4 { + 5 QApplication app(argv, args); + 6 + 7 QTextEdit *textEdit = new QTextEdit; + 8 QPushButton *quitButton = new QPushButton("&Quit"); + 9 +10 QObject::connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); +11 +12 QVBoxLayout *layout = new QVBoxLayout; +13 layout->addWidget(textEdit); +14 layout->addWidget(quitButton); +15 +16 QWidget window; +17 window.setLayout(layout); +18 +19 window.show(); +20 +21 return app.exec(); +22 } \endcode Line 1 includes QtGui, which contains all of Qt's GUI classes. @@ -278,9 +284,25 @@ visible strings. This function is necessary when you want to provide your application in more than one language (e.g. English and Chinese). We will not go into details here, but you can follow - the \c {Qt Linguist} link from the learn more table. We will not - look at the implementation of \c quit() slot and the \c main() - function, but you can check out the source code if you want to. + the \c {Qt Linguist} link from the learn more table. + + Here is the \c quit() slot: + + \code +75 void Notepad::quit() +76 { +77 QMessageBox messageBox; +78 messageBox.setWindowTitle(tr("Notepad")); +79 messageBox.setText(tr("Do you really want to quit?")); +80 messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); +81 messageBox.setDefaultButton(QMessageBox::No); +82 if (messageBox.exec() == QMessageBox::Yes) +83 qApp->quit(); +84 } + \endcode + + We use the QMessageBox class to display a dialog that asks the + user whether he/she really wants to quit. \section2 Learn More diff --git a/examples/tutorials/gettingStarted/gsQt/part2/main.cpp b/examples/tutorials/gettingStarted/gsQt/part2/main.cpp index 24b4d77..afa26e1 100755 --- a/examples/tutorials/gettingStarted/gsQt/part2/main.cpp +++ b/examples/tutorials/gettingStarted/gsQt/part2/main.cpp @@ -44,17 +44,17 @@ int main(int argv, char **args) { QApplication app(argv, args); - QTextEdit textEdit; - QPushButton quitButton("&Quit"); + QTextEdit *textEdit = new QTextEdit; + QPushButton *quitButton = new QPushButton("&Quit"); - QObject::connect(&quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); + QObject::connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); - QVBoxLayout layout; - layout.addWidget(&textEdit); - layout.addWidget(&quitButton); + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(textEdit); + layout->addWidget(quitButton); QWidget window; - window.setLayout(&layout); + window.setLayout(layout); window.show(); -- cgit v0.12 From c8afa6feb8f87ae733bbb3237b1d2e84ab47b4de Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 10 Aug 2011 12:06:10 +0200 Subject: tests: fixed crash of tst_qdialog This test assumed that C++ exceptions could always be caught by the event loop. This is not the case when the Glib event loop is used. Skip the relevant portion of the test in that case. Change-Id: I2ad83386025a98f6c32202700c97e04ef3dff343 Reviewed-by: Kalle Lehtonen Reviewed-by: Sergio Ahumada (cherry picked from commit 569cd194d20e61d35768b210b4351f4eeb5c1ef8) --- tests/auto/qdialog/tst_qdialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index 6d9f798..86dde21 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -467,6 +467,22 @@ void tst_QDialog::throwInExec() #if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) QSKIP("Throwing exceptions in exec() is not supported on this platform.", SkipAll); #endif + +#if defined(Q_OS_LINUX) + // C++ exceptions can't be passed through glib callbacks. Skip the test if + // we're using the glib event loop. + QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); + if (dispatcher.contains("Glib")) { + QSKIP( + qPrintable(QString( + "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" + "Try running with QT_NO_GLIB=1 in environment." + ).arg(QString::fromLatin1(dispatcher))), + SkipAll + ); + } +#endif + int caughtExceptions = 0; try { ExceptionDialog dialog; -- cgit v0.12 From 484bce6d53c77ec8be8df6ca43cac52dc7e402a5 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 10 Aug 2011 12:06:10 +0200 Subject: tests: fixed crash of tst_qdialog This test assumed that C++ exceptions could always be caught by the event loop. This is not the case when the Glib event loop is used. Skip the relevant portion of the test in that case. Change-Id: I2ad83386025a98f6c32202700c97e04ef3dff343 Reviewed-by: Kalle Lehtonen Reviewed-by: Sergio Ahumada (cherry picked from commit 569cd194d20e61d35768b210b4351f4eeb5c1ef8) --- tests/auto/qdialog/tst_qdialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index 6d9f798..86dde21 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -467,6 +467,22 @@ void tst_QDialog::throwInExec() #if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) QSKIP("Throwing exceptions in exec() is not supported on this platform.", SkipAll); #endif + +#if defined(Q_OS_LINUX) + // C++ exceptions can't be passed through glib callbacks. Skip the test if + // we're using the glib event loop. + QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); + if (dispatcher.contains("Glib")) { + QSKIP( + qPrintable(QString( + "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" + "Try running with QT_NO_GLIB=1 in environment." + ).arg(QString::fromLatin1(dispatcher))), + SkipAll + ); + } +#endif + int caughtExceptions = 0; try { ExceptionDialog dialog; -- cgit v0.12 From 257477c65834570ddad6cfe804b2f0b132306b1c Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 9 Aug 2011 16:30:46 +0200 Subject: tests: Skip `qaudioinput' tests if there is no audio backend available This code was always passing when no audio backend was available, skip the tests in this case instead. Change-Id: I4c0060ff144fa497a21823ffcab101ff68b84e17 Reviewed-by: Rohan McGovern --- tests/auto/qaudioinput/tst_qaudioinput.cpp | 133 +++++++++++++++-------------- 1 file changed, 70 insertions(+), 63 deletions(-) diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp index 6025bdb..0004c42 100644 --- a/tests/auto/qaudioinput/tst_qaudioinput.cpp +++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp @@ -86,14 +86,14 @@ void tst_QAudioInput::initTestCase() // Only perform tests if audio input device exists! QList devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput); - if(devices.size() > 0) + if (devices.size() > 0) available = true; else { qWarning()<<"NOTE: no audio input device found, no test will be performed"; available = false; } - if(available) + if (available) audio = new QAudioInput(format, this); } @@ -124,6 +124,9 @@ void tst_QAudioInput::invalidFormat_data() void tst_QAudioInput::invalidFormat() { + if (!available) + QSKIP("No audio input device found, no test will be performed", SkipAll); + QFETCH(QAudioFormat, invalidFormat); QAudioInput audioInput(invalidFormat, this); @@ -140,81 +143,85 @@ void tst_QAudioInput::invalidFormat() void tst_QAudioInput::settings() { - if(available) { - // Confirm the setting we added in the init function. - QAudioFormat f = audio->format(); - - QVERIFY(format.channels() == f.channels()); - QVERIFY(format.frequency() == f.frequency()); - QVERIFY(format.sampleSize() == f.sampleSize()); - QVERIFY(format.codec() == f.codec()); - QVERIFY(format.byteOrder() == f.byteOrder()); - QVERIFY(format.sampleType() == f.sampleType()); - } + if (!available) + QSKIP("No audio input device found, no test will be performed", SkipAll); + + // Confirm the setting we added in the init function. + QAudioFormat f = audio->format(); + + QVERIFY(format.channels() == f.channels()); + QVERIFY(format.frequency() == f.frequency()); + QVERIFY(format.sampleSize() == f.sampleSize()); + QVERIFY(format.codec() == f.codec()); + QVERIFY(format.byteOrder() == f.byteOrder()); + QVERIFY(format.sampleType() == f.sampleType()); } void tst_QAudioInput::buffers() { - if(available) { - // Should always have a buffer size greater than zero. - int store = audio->bufferSize(); - audio->setBufferSize(4096); - QVERIFY(audio->bufferSize() > 0); - audio->setBufferSize(store); - QVERIFY(audio->bufferSize() == store); - } + if (!available) + QSKIP("No audio input device found, no test will be performed", SkipAll); + + // Should always have a buffer size greater than zero. + int store = audio->bufferSize(); + audio->setBufferSize(4096); + QVERIFY(audio->bufferSize() > 0); + audio->setBufferSize(store); + QVERIFY(audio->bufferSize() == store); } void tst_QAudioInput::notifyInterval() { - if(available) { - QVERIFY(audio->notifyInterval() == 1000); // Default + if (!available) + QSKIP("No audio input device found, no test will be performed", SkipAll); - audio->setNotifyInterval(500); - QVERIFY(audio->notifyInterval() == 500); // Custom + QVERIFY(audio->notifyInterval() == 1000); // Default - audio->setNotifyInterval(1000); // reset - } + audio->setNotifyInterval(500); + QVERIFY(audio->notifyInterval() == 500); // Custom + + audio->setNotifyInterval(1000); // reset } void tst_QAudioInput::pullFile() { - if(available) { - QFile filename(SRCDIR"test.raw"); - filename.open( QIODevice::WriteOnly | QIODevice::Truncate ); - - QSignalSpy readSignal(audio, SIGNAL(notify())); - QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State))); - - // Always have default states, before start - QVERIFY(audio->state() == QAudio::StoppedState); - QVERIFY(audio->error() == QAudio::NoError); - QVERIFY(audio->elapsedUSecs() == 0); - - audio->start(&filename); - QTest::qWait(20); - // Check state and periodSize() are valid non-zero values. - QVERIFY(audio->state() == QAudio::ActiveState); - QVERIFY(audio->error() == QAudio::NoError); - QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000); - QVERIFY(audio->periodSize() > 0); - QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState - - // Wait until finished... - QTest::qWait(5000); - - QVERIFY(readSignal.count() > 0); - QVERIFY(audio->processedUSecs() > 0); - - audio->stop(); - QTest::qWait(20); - QVERIFY(audio->state() == QAudio::StoppedState); - QVERIFY(audio->elapsedUSecs() == 0); - // Can only check to make sure we got at least 1 more signal, but can be more. - QVERIFY(stateSignal.count() > 1); - - filename.close(); - } + if (!available) + QSKIP("No audio input device found, no test will be performed", SkipAll); + + QFile filename(SRCDIR"test.raw"); + filename.open( QIODevice::WriteOnly | QIODevice::Truncate ); + + QSignalSpy readSignal(audio, SIGNAL(notify())); + QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State))); + + // Always have default states, before start + QVERIFY(audio->state() == QAudio::StoppedState); + QVERIFY(audio->error() == QAudio::NoError); + QVERIFY(audio->elapsedUSecs() == 0); + + audio->start(&filename); + QTest::qWait(20); + // Check state and periodSize() are valid non-zero values. + QVERIFY(audio->state() == QAudio::ActiveState); + QVERIFY(audio->error() == QAudio::NoError); + QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000); + QVERIFY(audio->periodSize() > 0); + QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState + + // Wait until finished... + QTest::qWait(5000); + + QVERIFY(readSignal.count() > 0); + QVERIFY(audio->processedUSecs() > 0); + + audio->stop(); + QTest::qWait(20); + QVERIFY(audio->state() == QAudio::StoppedState); + QVERIFY(audio->elapsedUSecs() == 0); + // Can only check to make sure we got at least 1 more signal, but can be more. + QVERIFY(stateSignal.count() > 1); + + filename.close(); } QTEST_MAIN(tst_QAudioInput) -- cgit v0.12 From b27c097e337200cab16aaf7a3632811a6c258c34 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 11 Aug 2011 17:54:19 +0200 Subject: Added language information to the pure documentation parser. --- tools/qdoc3/puredocparser.cpp | 5 +++++ tools/qdoc3/puredocparser.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/qdoc3/puredocparser.cpp b/tools/qdoc3/puredocparser.cpp index c7db1bf..0f21cbc 100644 --- a/tools/qdoc3/puredocparser.cpp +++ b/tools/qdoc3/puredocparser.cpp @@ -55,6 +55,11 @@ PureDocParser::~PureDocParser() { } +QString PureDocParser::language() +{ + return "qdoc"; +} + QStringList PureDocParser::sourceFileNameFilter() { return QStringList("*.qdoc"); diff --git a/tools/qdoc3/puredocparser.h b/tools/qdoc3/puredocparser.h index 7f0434d..814c829 100644 --- a/tools/qdoc3/puredocparser.h +++ b/tools/qdoc3/puredocparser.h @@ -64,6 +64,7 @@ public: PureDocParser(); virtual ~PureDocParser(); + virtual QString language(); virtual QStringList sourceFileNameFilter(); }; -- cgit v0.12 From cde8eaeab64c95f4445a1f5f900f11426e2b4029 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 11 Aug 2011 17:55:11 +0200 Subject: Improved comment finding code. Avoid snippet markers and prevent accidental reuse of comments for different objects. --- tools/qdoc3/qmlvisitor.cpp | 63 ++++++++++++++++++++++++++++------------------ tools/qdoc3/qmlvisitor.h | 2 ++ 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp index 98e188d..a8886de 100644 --- a/tools/qdoc3/qmlvisitor.cpp +++ b/tools/qdoc3/qmlvisitor.cpp @@ -69,18 +69,30 @@ QmlDocVisitor::~QmlDocVisitor() QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const { - QDeclarativeJS::AST::SourceLocation currentLoc; + QListIterator it(engine->comments()); + it.toBack(); - foreach (const QDeclarativeJS::AST::SourceLocation &loc, engine->comments()) { - if (loc.begin() >= offset) + while (it.hasPrevious()) { + + QDeclarativeJS::AST::SourceLocation loc = it.previous(); + + if (loc.begin() <= lastEndOffset) + // Return if we reach the end of the preceding structure. break; - else if (loc.begin() > lastEndOffset && loc.end() < offset) - currentLoc = loc; - } - if (currentLoc.isValid()) { - QString comment = document.mid(currentLoc.offset, currentLoc.length); - if (comment.startsWith("!") || comment.startsWith("*")) - return currentLoc; + + else if (usedComments.contains(loc.begin())) + // Return if we encounter a previously used comment. + break; + + else if (loc.begin() > lastEndOffset && loc.end() < offset) { + + // Only examine multiline comments in order to avoid snippet markers. + if (document.mid(loc.offset - 1, 1) == "*") { + QString comment = document.mid(loc.offset, loc.length); + if (comment.startsWith("!") || comment.startsWith("*")) + return loc; + } + } } return QDeclarativeJS::AST::SourceLocation(); @@ -93,20 +105,18 @@ void QmlDocVisitor::applyDocumentation(QDeclarativeJS::AST::SourceLocation locat if (loc.isValid()) { QString source = document.mid(loc.offset, loc.length); - if (source.startsWith(QLatin1String("!")) || - (source.startsWith(QLatin1String("*")) && - source[1] != QLatin1Char('*'))) { - - Location start(filePath); - start.setLineNo(loc.startLine); - start.setColumnNo(loc.startColumn); - Location finish(filePath); - finish.setLineNo(loc.startLine); - finish.setColumnNo(loc.startColumn); - - Doc doc(start, finish, source.mid(1), commands); - node->setDoc(doc); - } + + Location start(filePath); + start.setLineNo(loc.startLine); + start.setColumnNo(loc.startColumn); + Location finish(filePath); + finish.setLineNo(loc.startLine); + finish.setColumnNo(loc.startColumn); + + Doc doc(start, finish, source.mid(1), commands); + node->setDoc(doc); + + usedComments.insert(loc.offset); } } @@ -152,6 +162,11 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiImportList *imports) return true; } +void QmlDocVisitor::endVisit(QDeclarativeJS::AST::UiImportList *definition) +{ + lastEndOffset = definition->lastSourceLocation().end(); +} + /*! Visits public member declarations, such as signals and properties. These only include custom signals and properties. diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h index 1d3a401..28821a9 100644 --- a/tools/qdoc3/qmlvisitor.h +++ b/tools/qdoc3/qmlvisitor.h @@ -57,6 +57,7 @@ public: virtual ~QmlDocVisitor(); bool visit(QDeclarativeJS::AST::UiImportList *imports); + void endVisit(QDeclarativeJS::AST::UiImportList *definition); bool visit(QDeclarativeJS::AST::UiObjectDefinition *definition); void endVisit(QDeclarativeJS::AST::UiObjectDefinition *definition); @@ -77,6 +78,7 @@ private: QString document; QList > importList; QSet commands; + QSet usedComments; Tree *tree; InnerNode *current; }; -- cgit v0.12 From 84d51bff971607e2e32680841a355209d97a2235 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 25 Jul 2011 22:22:20 +0200 Subject: Fix files that don't end with a newline character These are cosmetic changes to files that do not end with a newline character. Change-Id: I5b3e270386a1ef1ea2c1f57a1de3f7e3a8a52f5a Reviewed-by: Rohan McGovern --- config.tests/mac/xcodeversion.cpp | 6 +++--- demos/embedded/lightmaps/lightmaps.h | 2 +- demos/embedded/lightmaps/mapzoom.h | 2 +- demos/embedded/lightmaps/slippymap.h | 2 +- demos/mobile/guitartuner/src/guitartuner.rc | 2 +- doc/src/snippets/qcolumnview/main.cpp | 2 +- doc/src/snippets/textdocument-imagedrop/main.cpp | 2 +- doc/src/snippets/textdocument-imagedrop/textedit.h | 6 +++--- examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp | 2 +- examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp | 2 +- examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp | 2 +- examples/tutorials/gettingStarted/gsQml/filedialog/file.h | 2 +- examples/tutorials/modelview/4_headers/main.cpp | 2 +- examples/tutorials/threads/clock/clockthread.h | 2 +- src/gui/dialogs/qfiledialog_win_p.h | 2 +- tools/macdeployqt/tests/tst_deployment_mac.cpp | 2 +- tools/qtconcurrent/codegenerator/src/codegenerator.cpp | 4 ++-- tools/qtestlib/wince/cetest/deployment.h | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config.tests/mac/xcodeversion.cpp b/config.tests/mac/xcodeversion.cpp index df208e3..0cc3777 100644 --- a/config.tests/mac/xcodeversion.cpp +++ b/config.tests/mac/xcodeversion.cpp @@ -73,7 +73,7 @@ int main(int argc, const char **argv) const char * ok3 ="3.0"; // ptr = fail1; // printf ("string: %s\n", ptr); - + int length = strlen(ptr); if (length < 3) // expect "x.y" at least return internal_error; @@ -94,6 +94,6 @@ int main(int argc, const char **argv) if (ptr[4] < '1') return fail; - + return success; -} \ No newline at end of file +} diff --git a/demos/embedded/lightmaps/lightmaps.h b/demos/embedded/lightmaps/lightmaps.h index 45b5c18..0e458ea 100644 --- a/demos/embedded/lightmaps/lightmaps.h +++ b/demos/embedded/lightmaps/lightmaps.h @@ -85,4 +85,4 @@ private: bool invert; }; -#endif \ No newline at end of file +#endif diff --git a/demos/embedded/lightmaps/mapzoom.h b/demos/embedded/lightmaps/mapzoom.h index ac70a23..935660c 100644 --- a/demos/embedded/lightmaps/mapzoom.h +++ b/demos/embedded/lightmaps/mapzoom.h @@ -66,4 +66,4 @@ private: QNetworkSession *networkSession; }; -#endif \ No newline at end of file +#endif diff --git a/demos/embedded/lightmaps/slippymap.h b/demos/embedded/lightmaps/slippymap.h index 64ba5c3..480dc81 100644 --- a/demos/embedded/lightmaps/slippymap.h +++ b/demos/embedded/lightmaps/slippymap.h @@ -84,4 +84,4 @@ private: QUrl m_url; }; -#endif \ No newline at end of file +#endif diff --git a/demos/mobile/guitartuner/src/guitartuner.rc b/demos/mobile/guitartuner/src/guitartuner.rc index 85cee0b..b4f7a11 100644 --- a/demos/mobile/guitartuner/src/guitartuner.rc +++ b/demos/mobile/guitartuner/src/guitartuner.rc @@ -20,4 +20,4 @@ BEGIN BEGIN VALUE "Translation", 0x409, 1252 END -END \ No newline at end of file +END diff --git a/doc/src/snippets/qcolumnview/main.cpp b/doc/src/snippets/qcolumnview/main.cpp index c39a4bb..fecff12 100644 --- a/doc/src/snippets/qcolumnview/main.cpp +++ b/doc/src/snippets/qcolumnview/main.cpp @@ -76,4 +76,4 @@ int main(int argc, char *argv[]) columnView.show(); return app.exec(); -} \ No newline at end of file +} diff --git a/doc/src/snippets/textdocument-imagedrop/main.cpp b/doc/src/snippets/textdocument-imagedrop/main.cpp index 24cd2de..0cdf3a1 100644 --- a/doc/src/snippets/textdocument-imagedrop/main.cpp +++ b/doc/src/snippets/textdocument-imagedrop/main.cpp @@ -49,4 +49,4 @@ int main(int argc, char * argv[]) textEdit->show(); return app.exec(); -} \ No newline at end of file +} diff --git a/doc/src/snippets/textdocument-imagedrop/textedit.h b/doc/src/snippets/textdocument-imagedrop/textedit.h index 9e0492b..9db9f17 100644 --- a/doc/src/snippets/textdocument-imagedrop/textedit.h +++ b/doc/src/snippets/textdocument-imagedrop/textedit.h @@ -46,11 +46,11 @@ class TextEdit : public QTextEdit { Q_OBJECT - -public: + +public: TextEdit(QWidget *parent=0); bool canInsertFromMimeData( const QMimeData *source ) const; void insertFromMimeData( const QMimeData *source ); }; -#endif \ No newline at end of file +#endif diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp index fde24d9..3b02c63 100644 --- a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp +++ b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp @@ -51,4 +51,4 @@ void DialogPlugin::registerTypes(const char *uri) } //FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs -Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); \ No newline at end of file +Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp index c675fc9..52bdfc7 100644 --- a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp +++ b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp @@ -221,4 +221,4 @@ void Directory::refresh() } m_fileList.append(file); } -} \ No newline at end of file +} diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp index 44b0915..17740f2 100644 --- a/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp +++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp @@ -54,4 +54,4 @@ void File::setName(const QString &str){ m_name = str; emit nameChanged(); } -} \ No newline at end of file +} diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h index 21e8ebb..6aa6a6a 100644 --- a/examples/tutorials/gettingStarted/gsQml/filedialog/file.h +++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h @@ -64,4 +64,4 @@ class File : public QObject{ QString m_name; }; -#endif \ No newline at end of file +#endif diff --git a/examples/tutorials/modelview/4_headers/main.cpp b/examples/tutorials/modelview/4_headers/main.cpp index c89829a..8a4ab8f 100755 --- a/examples/tutorials/modelview/4_headers/main.cpp +++ b/examples/tutorials/modelview/4_headers/main.cpp @@ -50,4 +50,4 @@ int main(int argc, char *argv[]) tableView.setModel( &myModel ); tableView.show(); return a.exec(); -} \ No newline at end of file +} diff --git a/examples/tutorials/threads/clock/clockthread.h b/examples/tutorials/threads/clock/clockthread.h index 966dbea..d77a52b 100644 --- a/examples/tutorials/threads/clock/clockthread.h +++ b/examples/tutorials/threads/clock/clockthread.h @@ -61,4 +61,4 @@ private slots: }; //! [1] -#endif // CLOCKTHREAD_H \ No newline at end of file +#endif // CLOCKTHREAD_H diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index 1ff29d2..1408057 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -240,4 +240,4 @@ DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog) STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE; STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE; }; -#endif \ No newline at end of file +#endif diff --git a/tools/macdeployqt/tests/tst_deployment_mac.cpp b/tools/macdeployqt/tests/tst_deployment_mac.cpp index 858dc45..5921199 100644 --- a/tools/macdeployqt/tests/tst_deployment_mac.cpp +++ b/tools/macdeployqt/tests/tst_deployment_mac.cpp @@ -230,4 +230,4 @@ void tst_deployment_mac::testFindAppBinarty() QTEST_MAIN(tst_deployment_mac) -#include "tst_deployment_mac.moc" \ No newline at end of file +#include "tst_deployment_mac.moc" diff --git a/tools/qtconcurrent/codegenerator/src/codegenerator.cpp b/tools/qtconcurrent/codegenerator/src/codegenerator.cpp index b8436b9..c81fe97 100644 --- a/tools/qtconcurrent/codegenerator/src/codegenerator.cpp +++ b/tools/qtconcurrent/codegenerator/src/codegenerator.cpp @@ -134,7 +134,7 @@ const Compound operator+(const Item &a, const char * const text) const Compound operator+(const char * const text, const Item &b) { - return Compound(Text(text), b); + return Compound(Text(text), b); } -} \ No newline at end of file +} diff --git a/tools/qtestlib/wince/cetest/deployment.h b/tools/qtestlib/wince/cetest/deployment.h index f3645e0..a5ef32d 100644 --- a/tools/qtestlib/wince/cetest/deployment.h +++ b/tools/qtestlib/wince/cetest/deployment.h @@ -72,4 +72,4 @@ private: inline void DeploymentHandler::setConnection(AbstractRemoteConnection *connection) { m_connection = connection; } inline AbstractRemoteConnection* DeploymentHandler::connection() const { return m_connection; } -#endif \ No newline at end of file +#endif -- cgit v0.12 From 3be7f871f07041477b5bca0182623b36afd2b3e6 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 13 Aug 2011 00:18:18 +0200 Subject: test: Fix `tst_qfiledialog' in a namespaced build Reviewed-by: Pierre Rossi --- tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 08d2e88..81da8a3 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -80,7 +80,9 @@ # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" #elif defined(Q_OS_UNIX) #ifdef QT_BUILD_INTERNAL +QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0); +QT_END_NAMESPACE #endif #endif -- cgit v0.12 From 1c4b284b54c8d0166f777b256d1ac3eedd8ea593 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 15 Aug 2011 13:30:25 +0200 Subject: Doc: Fixed qdoc warnings. --- src/corelib/io/qnoncontiguousbytedevice.cpp | 2 -- src/sql/models/qsqlrelationaltablemodel.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp index 5568920..d5ce56b 100644 --- a/src/corelib/io/qnoncontiguousbytedevice.cpp +++ b/src/corelib/io/qnoncontiguousbytedevice.cpp @@ -501,8 +501,6 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *dev } /*! - \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QRingBuffer *ringBuffer); - Create a QNonContiguousByteDevice out of a QRingBuffer. \internal diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp index 5b0406f..188259d 100644 --- a/src/sql/models/qsqlrelationaltablemodel.cpp +++ b/src/sql/models/qsqlrelationaltablemodel.cpp @@ -715,7 +715,7 @@ void QSqlRelationalTableModel::clear() \value InnerJoin - Inner join mode, return rows when there is at least one match in both tables. \value LeftJoin - Left join mode, returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2). - \see QSqlRelationalTableModel::setJoinMode + \sa QSqlRelationalTableModel::setJoinMode \since 4.8 */ @@ -724,7 +724,7 @@ void QSqlRelationalTableModel::clear() In InnerJoin mode (the default) these rows will not be showed: use the LeftJoin mode if you want to show them. - \see QSqlRelationalTableModel::JoinMode + \sa QSqlRelationalTableModel::JoinMode \since 4.8 */ void QSqlRelationalTableModel::setJoinMode( QSqlRelationalTableModel::JoinMode joinMode ) -- cgit v0.12 From 17a0782f2c0886ff19fc2c1a0bfbc96861ff2996 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 15 Aug 2011 15:51:57 +0200 Subject: Fixed infinite loop when loading certain SVGs. Task-number: QTBUG-16216 Reviewed-by: aavit --- src/svg/qsvgstructure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg/qsvgstructure.cpp b/src/svg/qsvgstructure.cpp index cc158ba..4d9fad5 100644 --- a/src/svg/qsvgstructure.cpp +++ b/src/svg/qsvgstructure.cpp @@ -369,7 +369,7 @@ QSvgNode * QSvgStructureNode::previousSiblingNode(QSvgNode *n) const { QSvgNode *prev = 0; QList::const_iterator itr = m_renderers.constBegin(); - while (itr != m_renderers.constEnd()) { + for (; itr != m_renderers.constEnd(); ++itr) { QSvgNode *node = *itr; if (node == n) return prev; -- cgit v0.12 From 540222f0d936a48f57ed36496fcb211cc437cb1b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 15 Aug 2011 19:10:30 +0200 Subject: Doc: Fixed qdoc warnings. --- src/corelib/io/qfile.cpp | 10 ++++++---- src/corelib/io/qfsfileengine.cpp | 16 +++++++++++++++ src/corelib/io/qfsfileengine_unix.cpp | 8 ++++++++ src/corelib/plugin/quuid.cpp | 14 +++++++------- src/corelib/tools/qlocale.qdoc | 4 ++++ src/gui/embedded/qscreen_qws.cpp | 1 + src/gui/painting/qpainter.cpp | 17 +++++++++------- src/gui/text/qfont.cpp | 5 +++-- src/gui/text/qfontdatabase.cpp | 10 ++++++---- src/gui/text/qfontmetrics.cpp | 3 ++- src/gui/text/qglyphrun.cpp | 3 ++- src/gui/text/qplatformfontdatabase_qpa.cpp | 28 ++++++++++++++++++++++++++- src/gui/text/qrawfont.cpp | 3 ++- src/imports/shaders/shadereffectitem.cpp | 20 ------------------- src/imports/shaders/shadereffectsource.cpp | 30 ----------------------------- src/network/kernel/qnetworkproxy.cpp | 7 ++++++- src/sql/models/qsqlrelationaltablemodel.cpp | 26 ++++++++++++++++--------- tools/qdoc3/test/qt-cpp-ignore.qdocconf | 3 ++- tools/qdoc3/test/qt-project.qdocconf | 2 +- 19 files changed, 120 insertions(+), 90 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 929b2f9..06c403a 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -366,9 +366,11 @@ QFilePrivate::setError(QFile::FileError err, int errNum) \value AutoCloseHandle The file handle passed into open() should be closed by close(), the default behaviour is that close just flushes - the file and the app is responsible for closing the file handle. When - opening a file by name, this flag is ignored as Qt always "owns" the + the file and the application is responsible for closing the file handle. + When opening a file by name, this flag is ignored as Qt always "owns" the file handle and must close it. + \value DontCloseHandle The file handle passed into open() will not be + closed by Qt. The application must ensure that close() is called. */ #ifdef QT3_SUPPORT @@ -1210,7 +1212,7 @@ bool QFile::open(int fd, OpenMode mode) Returns true if successful; otherwise returns false. When a QFile is opened using this function, behaviour of close() is - controlled by the AutoCloseHandle flag. + controlled by the \a handleFlags argument. If AutoCloseHandle is specified, and this function succeeds, then calling close() closes the adopted handle. Otherwise, close() does not actually close the file, but only flushes it. @@ -1269,7 +1271,7 @@ bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags) Returns true if successful; otherwise returns false. When a QFile is opened using this function, behaviour of close() is - controlled by the AutoCloseHandle flag. + controlled by the \a handleFlags argument. If AutoCloseHandle is specified, and this function succeeds, then calling close() closes the adopted handle. Otherwise, close() does not actually close the file, but only flushes it. diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 548f9cf..e1f3123 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -233,6 +233,14 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh) return open(openMode, fh, QFile::DontCloseHandle); } +/*! + Opens the file handle \a fh in \a openMode mode. Returns true + on success; otherwise returns false. + + The \a handleFlags argument specifies whether the file handle will be + closed by Qt. See the QFile::FileHandleFlags documentation for more + information. +*/ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHandleFlags handleFlags) { Q_D(QFSFileEngine); @@ -294,6 +302,14 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd) return open(openMode, fd, QFile::DontCloseHandle); } +/*! + Opens the file descriptor \a fd in \a openMode mode. Returns true + on success; otherwise returns false. + + The \a handleFlags argument specifies whether the file handle will be + closed by Qt. See the QFile::FileHandleFlags documentation for more + information. +*/ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandleFlags handleFlags) { Q_D(QFSFileEngine); diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 9de282a..4961722 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -252,6 +252,14 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode) return true; } +/*! + Opens the file descriptor specified by \a file in the mode given by + \a openMode. Returns true on success; otherwise returns false. + + The \a handleFlags argument specifies whether the file handle will be + closed by Qt. See the QFile::FileHandleFlags documentation for more + information. +*/ bool QFSFileEngine::open(QIODevice::OpenMode openMode, const RFile &file, QFile::FileHandleFlags handleFlags) { Q_D(QFSFileEngine); diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index eb29e6e..af63b79 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -387,17 +387,17 @@ QUuid::QUuid(const QByteArray &text) #endif /*! - Creates a QUuid object from the binary representation of the UUID, as - specified by RFC 4122 section 4.1.2. See toRfc4122() for a further - explanation of the order of bytes required. + \since 4.8 - The byte array accepted is NOT a human readable format. + Creates a QUuid object from the binary representation of the UUID given + by \a bytes, as specified by RFC 4122 section 4.1.2. See toRfc4122() for a + further explanation of the order of bytes required. - If the conversion fails, a null UUID is created. + The byte array accepted is \e not a human readable format. - \since 4.8 + If the conversion fails, a null UUID is created. - \sa toRfc4122(), QUuid() + \sa toRfc4122(), QUuid() */ QUuid QUuid::fromRfc4122(const QByteArray &bytes) { diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 5d4f305..95a7165 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -806,6 +806,10 @@ \internal */ /*! + \fn QSystemLocale::CurrencyToStringArgument::CurrencyToStringArgument(const QVariant &v, const QString &s) + \internal +*/ +/*! \variable QSystemLocale::CurrencyToStringArgument::value An input value that should be converted to its string representation. diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 2c10357..b17ade0 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -1545,6 +1545,7 @@ QImage::Format QScreenPrivate::preferredImageFormat() const \value SvgalibClass QSvgalibScreen \value ProxyClass QProxyScreen \value GLClass QGLScreen + \value IntfbClass QIntfbScreen \value CustomClass Unknown QScreen subclass \sa classId() diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 8e64f3b..efb016e 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5792,16 +5792,19 @@ void QPainter::drawImage(const QRectF &targetRect, const QImage &image, const QR d->engine->drawImage(QRectF(x, y, w, h), image, QRectF(sx, sy, sw, sh), flags); } +#if !defined(QT_NO_RAWFONT) /*! - Draws the glyphs represented by \a glyphs at \a position. The \a position gives the - edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font - selected on \a glyphs and at offsets given by the positions in \a glyphs. + \fn void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphs) + + Draws the specified \a glyphs at the given \a position. + The \a position gives the edge of the baseline for the string of glyphs. + The glyphs will be retrieved from the font selected by \a glyphs and at + offsets given by the positions in \a glyphs. \since 4.8 \sa QGlyphRun::setRawFont(), QGlyphRun::setPositions(), QGlyphRun::setGlyphIndexes() */ -#if !defined(QT_NO_RAWFONT) void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) { Q_D(QPainter); @@ -9251,9 +9254,9 @@ void QPainter::drawPixmapFragments(const PixmapFragment *fragments, int fragment \since 4.8 This function is used to draw the same \a pixmap with multiple target - and source rectangles. If \a sourceRects is 0, the whole pixmap will be - rendered at each of the target rectangles. The \a hints parameter can be - used to pass in drawing hints. + and source rectangles specified by \a targetRects. If \a sourceRects is 0, + the whole pixmap will be rendered at each of the target rectangles. + The \a hints parameter can be used to pass in drawing hints. This function is potentially faster than multiple calls to drawPixmap(), since the backend can optimize state changes. diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 2d6af3b..2df88e2 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -919,8 +919,9 @@ QString QFont::styleName() const /*! \since 4.8 - Sets the style name of the font. When set, other style properties - like \a style() and \a weight() will be ignored for font matching. + Sets the style name of the font to the given \a styleName. + When set, other style properties like style() and weight() will be ignored + for font matching. \sa styleName() */ diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 79503f9..1d463c4 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1943,8 +1943,9 @@ bool QFontDatabase::isScalable(const QString &family, /*! - Returns a list of the point sizes available for the font that has - family \a family and style \a style. The list may be empty. + \fn QList QFontDatabase::pointSizes(const QString &family, const QString &style) + Returns a list of the point sizes available for the font with the + given \a family and \a style. The list may be empty. \sa smoothSizes(), standardSizes() */ @@ -2052,8 +2053,9 @@ QFont QFontDatabase::font(const QString &family, const QString &style, /*! - Returns the point sizes of a font that has family \a family and - style \a style that will look attractive. The list may be empty. + \fn QList QFontDatabase::smoothSizes(const QString &family, const QString &style) + Returns the point sizes of a font with the given \a family and \a style + that will look attractive. The list may be empty. For non-scalable fonts and bitmap scalable fonts, this function is equivalent to pointSizes(). diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index f3d4107..1d93d54 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -442,9 +442,10 @@ bool QFontMetrics::inFont(QChar ch) const } /*! + \fn bool QFontMetrics::inFontUcs4(uint character) const \since 4.8 - Returns true if the character encoded in UCS-4/UTF-32 is a valid + Returns true if the given \a character encoded in UCS-4/UTF-32 is a valid character in the font; otherwise returns false. */ bool QFontMetrics::inFontUcs4(uint ucs4) const diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp index 2865d91..442f7cc 100644 --- a/src/gui/text/qglyphrun.cpp +++ b/src/gui/text/qglyphrun.cpp @@ -175,7 +175,8 @@ QRawFont QGlyphRun::rawFont() const } /*! - Sets the font in which to look up the glyph indexes to \a font. + Sets the font specified by \a rawFont to be the font used to look up the + glyph indexes. \sa rawFont(), setGlyphIndexes() */ diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index d1d1f94..e3eeca5 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -160,6 +160,9 @@ QSupportedWritingSystems::QSupportedWritingSystems(const QSupportedWritingSystem d->ref.ref(); } +/*! + Assigns the \a other supported writing systems object to this object. +*/ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWritingSystems &other) { if (d != other.d) { @@ -171,6 +174,9 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr return *this; } +/*! + Destroys the object. +*/ QSupportedWritingSystems::~QSupportedWritingSystems() { if (!d->ref.deref()) @@ -187,12 +193,26 @@ void QSupportedWritingSystems::detach() } } +/*! + Sets the supported state of the writing system given by \a writingSystem to + the value specified by \a support. A value of true indicates that the + writing system is supported; a value of false indicates that it is + unsupported. + + \sa supported() +*/ void QSupportedWritingSystems::setSupported(QFontDatabase::WritingSystem writingSystem, bool support) { detach(); d->vector[writingSystem] = support; } +/*! + Returns true if the writing system given by \a writingSystem is supported; + otherwise returns false. + + \sa setSupported() +*/ bool QSupportedWritingSystems::supported(QFontDatabase::WritingSystem writingSystem) const { return d->vector.at(writingSystem); @@ -295,7 +315,7 @@ QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData } /*! - + Releases the font handle and deletes any associated data loaded from a file. */ void QPlatformFontDatabase::releaseHandle(void *handle) { @@ -304,7 +324,13 @@ void QPlatformFontDatabase::releaseHandle(void *handle) } /*! + Returns the path to the font directory. + + The font directory is stored in the general Qt settings unless it has been + overridden by the \c QT_QPA_FONTDIR environment variable. + When using builds of Qt that do not support settings, the \c QT_QPA_FONTDIR + environment variable is the only way to specify the font directory. */ QString QPlatformFontDatabase::fontDir() const { diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index e3e5c57..60a6cb3 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -485,7 +485,8 @@ QVector QRawFont::glyphIndexesForString(const QString &text) const must be at least \a numChars, if that's still not enough, this function will return false, then you can resize \a glyphIndexes from the size returned in \a numGlyphs. - \sa glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphs, QTextLayout::glyphs(), QTextFragment::glyphs() + \sa glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphRun, + QTextLayout::glyphRuns(), QTextFragment::glyphRuns() */ bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const { diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp index 056581c..ca5c9a3 100644 --- a/src/imports/shaders/shadereffectitem.cpp +++ b/src/imports/shaders/shadereffectitem.cpp @@ -243,11 +243,6 @@ ShaderEffectItem::~ShaderEffectItem() */ -/*! - \property ShaderEffectItem::fragmentShader - \brief the OpenGL fragment shader code. -*/ - void ShaderEffectItem::setFragmentShader(const QString &code) { if (m_fragment_code.constData() == code.constData()) @@ -281,11 +276,6 @@ void ShaderEffectItem::setFragmentShader(const QString &code) */ -/*! - \property ShaderEffectItem::vertexShader - \brief the OpenGL vertex shader code. -*/ - void ShaderEffectItem::setVertexShader(const QString &code) { if (m_vertex_code.constData() == code.constData()) @@ -320,11 +310,6 @@ void ShaderEffectItem::setVertexShader(const QString &code) The default value is true. */ -/*! - \property ShaderEffectItem::blending - \brief the drawing is done using blending. -*/ - void ShaderEffectItem::setBlending(bool enable) { if (m_blending == enable) @@ -347,11 +332,6 @@ void ShaderEffectItem::setBlending(bool enable) The default value is QSize(1,1). */ -/*! - \property ShaderEffectItem::meshResolution - \brief the amount of triangles in the mesh for both x and y-axis. -*/ - void ShaderEffectItem::setMeshResolution(const QSize &size) { if (size == m_meshResolution) diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp index 6210c41..7916538 100644 --- a/src/imports/shaders/shadereffectsource.cpp +++ b/src/imports/shaders/shadereffectsource.cpp @@ -105,11 +105,6 @@ ShaderEffectSource::~ShaderEffectSource() sourceItem regardless of its clipping property. */ -/*! - \property ShaderEffectSource::sourceItem - \brief the Item which is the source for the effect. -*/ - void ShaderEffectSource::setSourceItem(QDeclarativeItem *item) { if (item == m_sourceItem) @@ -159,11 +154,6 @@ void ShaderEffectSource::setSourceItem(QDeclarativeItem *item) The default value is Qt.rect(0,0,0,0). */ -/*! - \property ShaderEffectSource::sourceRect - \brief the relative sourceRect for the source. -*/ - void ShaderEffectSource::setSourceRect(const QRectF &rect) { if (rect == m_sourceRect) @@ -192,11 +182,6 @@ void ShaderEffectSource::setSourceRect(const QRectF &rect) The default value is QSize(0,0). */ -/*! - \property ShaderEffectSource::textureSize - \brief the texture size for the source. -*/ - void ShaderEffectSource::setTextureSize(const QSize &size) { if (size == m_textureSize) @@ -227,11 +212,6 @@ void ShaderEffectSource::setTextureSize(const QSize &size) The default value is true. */ -/*! - \property ShaderEffectSource::live - \brief the flag tells whether source item content is changing between frames. -*/ - void ShaderEffectSource::setLive(bool s) { if (s == m_live) @@ -251,11 +231,6 @@ void ShaderEffectSource::setLive(bool s) The default value is false. */ -/*! - \property ShaderEffectSource::hideSource - \brief the flag tells whether original source item content should be hidden. -*/ - void ShaderEffectSource::setHideSource(bool hide) { if (hide == m_hideSource) @@ -283,11 +258,6 @@ void ShaderEffectSource::setHideSource(bool hide) */ -/*! - \property ShaderEffectSource::wrapMode - \brief the wrap parameter for the source after it has been mapped as a texture. -*/ - void ShaderEffectSource::setWrapMode(WrapMode mode) { if (mode == m_wrapMode) diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 6d4df44..71d61a4 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -1197,6 +1197,11 @@ void QNetworkProxyQuery::setUrl(const QUrl &url) } #ifndef QT_NO_BEARERMANAGEMENT +/*! + Returns the network configuration of the proxy query. + + \sa setNetworkConfiguration() +*/ QNetworkConfiguration QNetworkProxyQuery::networkConfiguration() const { return d ? d->config : QNetworkConfiguration(); @@ -1214,7 +1219,7 @@ QNetworkConfiguration QNetworkProxyQuery::networkConfiguration() const you should first start the QNetworkSession and obtain the active configuration from its properties. - \sa networkConfiguration + \sa networkConfiguration() */ void QNetworkProxyQuery::setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration) { diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp index 188259d..0edfaf4 100644 --- a/src/sql/models/qsqlrelationaltablemodel.cpp +++ b/src/sql/models/qsqlrelationaltablemodel.cpp @@ -710,24 +710,32 @@ void QSqlRelationalTableModel::clear() } -/*! \enum QSqlRelationalTableModel::JoinMode +/*! + \enum QSqlRelationalTableModel::JoinMode + \since 4.8 - \value InnerJoin - Inner join mode, return rows when there is at least one match in both tables. - \value LeftJoin - Left join mode, returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2). + This enum specifies the type of mode to use when joining two tables. - \sa QSqlRelationalTableModel::setJoinMode - \since 4.8 + \value InnerJoin Inner join mode, return rows when there is at least one + match in both tables. + \value LeftJoin Left join mode, returns all rows from the left table + (table_name1), even if there are no matches in the right + table (table_name2). + + \sa QSqlRelationalTableModel::setJoinMode() */ /*! - Sets the SQL join mode to show or hide rows with NULL foreign keys. - In InnerJoin mode (the default) these rows will not be showed: use the + \since 4.8 + Sets the SQL join mode to the value given by \a joinMode to show or hide + rows with NULL foreign keys. + + In InnerJoin mode (the default) these rows will not be shown; use the LeftJoin mode if you want to show them. \sa QSqlRelationalTableModel::JoinMode - \since 4.8 */ -void QSqlRelationalTableModel::setJoinMode( QSqlRelationalTableModel::JoinMode joinMode ) +void QSqlRelationalTableModel::setJoinMode(QSqlRelationalTableModel::JoinMode joinMode) { Q_D(QSqlRelationalTableModel); d->joinMode = joinMode; diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index 044eef4..5b41ae3 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -73,7 +73,8 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ Q_DECLARATIVE_EXPORT \ Q_GADGET \ QWEBKIT_EXPORT \ - Q_INVOKABLE + Q_INVOKABLE \ + Q_DECL_CONSTEXPR Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_DECLARE_INTERFACE \ Q_DECLARE_METATYPE \ diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf index fca6545..57bf797 100644 --- a/tools/qdoc3/test/qt-project.qdocconf +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -105,7 +105,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $QT_SOURCE_TREE/examples/tutorials \ $QT_SOURCE_TREE \ $QT_SOURCE_TREE/qmake/examples \ - $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs + $QT_SOURCE_TREE/src/3rdparty/webkit/Source/WebKit/qt/docs imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src/declarative/pics \ -- cgit v0.12 From 13e7d402c438fd2c527dbc302cf1103d5c835a2f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 26 Apr 2011 15:35:51 +0200 Subject: Make text rendering working outside the gui thread on Symbian. It was previously not possible to render text (QPainter::drawText) in a secondary thread on Symbian, it always resulted in some kind of panic. This patch corrects it. For S60 5.0 and earlier the behavior is not changed, threaded text rendering is only supported on Symbian^3 and newer. This also means QFontDatabase::supportsThreadedFontRendering() will return true from now on, but only on Symbian^3 and higher. Task-number: QTBUG-18516 Reviewed-by: mread (cherry picked from commit 0c62e02b80570bf8b92eff7acceb9018df61c89e) --- src/gui/kernel/qapplication_s60.cpp | 3 +++ src/gui/kernel/qt_s60_p.h | 26 ++++++++++++++++++++++++++ src/gui/text/qfontdatabase_s60.cpp | 30 +++++++++++++++++++----------- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b98bdbc..a53d273 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -2723,6 +2723,9 @@ QS60ThreadLocalData::QS60ThreadLocalData() QS60ThreadLocalData::~QS60ThreadLocalData() { + for (int i = 0; i < releaseFuncs.count(); ++i) + releaseFuncs[i](); + releaseFuncs.clear(); if (!usingCONEinstances) { delete screenDevice; wsSession.Close(); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 4295f60..3e6a293 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -97,6 +97,10 @@ static const int qt_symbian_max_screens = 4; //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13) +class QSymbianTypeFaceExtras; +typedef QHash QSymbianTypeFaceExtrasHash; +typedef void (*QThreadLocalReleaseFunc)(); + class Q_AUTOTEST_EXPORT QS60ThreadLocalData { public: @@ -105,6 +109,8 @@ public: bool usingCONEinstances; RWsSession wsSession; CWsScreenDevice *screenDevice; + QSymbianTypeFaceExtrasHash fontData; + QVector releaseFuncs; }; class QS60Data @@ -178,6 +184,8 @@ public: inline CWsScreenDevice* screenDevice(const QWidget *widget); inline CWsScreenDevice* screenDevice(int screenNumber); static inline int screenNumberForWidget(const QWidget *widget); + inline QSymbianTypeFaceExtrasHash& fontData(); + inline void addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func); static inline CCoeAppUi* appUi(); static inline CEikMenuBar* menuBar(); #ifdef Q_WS_S60 @@ -477,6 +485,24 @@ inline int QS60Data::screenNumberForWidget(const QWidget *widget) return qt_widget_private(const_cast(w))->symbianScreenNumber; } +inline QSymbianTypeFaceExtrasHash& QS60Data::fontData() +{ + if (!tls.hasLocalData()) { + tls.setLocalData(new QS60ThreadLocalData); + } + return tls.localData()->fontData; +} + +inline void QS60Data::addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func) +{ + if (!tls.hasLocalData()) { + tls.setLocalData(new QS60ThreadLocalData); + } + QS60ThreadLocalData *data = tls.localData(); + if (!data->releaseFuncs.contains(func)) + data->releaseFuncs.append(func); +} + inline CCoeAppUi* QS60Data::appUi() { return CCoeEnv::Static()-> AppUi(); diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 1c1bc29..d209726 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -166,7 +166,6 @@ public: COpenFontRasterizer *m_rasterizer; mutable QList m_extras; - mutable QHash m_extrasHash; mutable QSet m_applicationFontFamilies; }; @@ -269,8 +268,9 @@ void QSymbianFontDatabaseExtrasImplementation::clear() static_cast(db->symbianExtras); if (!dbExtras) return; // initializeDb() has never been called + QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData(); if (QSymbianTypeFaceExtras::symbianFontTableApiAvailable()) { - qDeleteAll(dbExtras->m_extrasHash); + qDeleteAll(extrasHash); } else { typedef QList::iterator iterator; for (iterator p = dbExtras->m_extras.begin(); p != dbExtras->m_extras.end(); ++p) { @@ -279,11 +279,16 @@ void QSymbianFontDatabaseExtrasImplementation::clear() } dbExtras->m_extras.clear(); } - dbExtras->m_extrasHash.clear(); + extrasHash.clear(); } void qt_cleanup_symbianFontDatabase() { + static bool cleanupDone = false; + if (cleanupDone) + return; + cleanupDone = true; + QFontDatabasePrivate *db = privateDb(); if (!db) return; @@ -334,9 +339,12 @@ COpenFont* OpenFontFromBitmapFont(const CBitmapFont* aBitmapFont) const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(const QString &aTypeface, bool bold, bool italic) const { + QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData(); + if (extrasHash.isEmpty() && QThread::currentThread() != QApplication::instance()->thread()) + S60->addThreadLocalReleaseFunc(clear); const QString typeface = qt_symbian_fontNameWithAppFontMarker(aTypeface); const QString searchKey = typeface + QString::number(int(bold)) + QString::number(int(italic)); - if (!m_extrasHash.contains(searchKey)) { + if (!extrasHash.contains(searchKey)) { TFontSpec searchSpec(qt_QString2TPtrC(typeface), 1); if (bold) searchSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold); @@ -350,7 +358,7 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c QScopedPointer sFont(font); QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font); sFont.take(); - m_extrasHash.insert(searchKey, extras); + extrasHash.insert(searchKey, extras); } else { const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, searchSpec); Q_ASSERT(err == KErrNone && font); @@ -364,20 +372,20 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c const TOpenFontFaceAttrib* const attrib = openFont->FaceAttrib(); const QString foundKey = QString((const QChar*)attrib->FullName().Ptr(), attrib->FullName().Length()); - if (!m_extrasHash.contains(foundKey)) { + if (!extrasHash.contains(foundKey)) { QScopedPointer sFont(font); QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font, openFont); sFont.take(); m_extras.append(extras); - m_extrasHash.insert(searchKey, extras); - m_extrasHash.insert(foundKey, extras); + extrasHash.insert(searchKey, extras); + extrasHash.insert(foundKey, extras); } else { m_store->ReleaseFont(font); - m_extrasHash.insert(searchKey, m_extrasHash.value(foundKey)); + extrasHash.insert(searchKey, extrasHash.value(foundKey)); } } } - return m_extrasHash.value(searchKey); + return extrasHash.value(searchKey); } void QSymbianFontDatabaseExtrasImplementation::removeAppFontData( @@ -971,7 +979,7 @@ bool QFontDatabase::removeAllApplicationFonts() bool QFontDatabase::supportsThreadedFontRendering() { - return false; + return QSymbianTypeFaceExtras::symbianFontTableApiAvailable(); } static -- cgit v0.12 From 2657bfa7c4de9f114331d1714a306b3999ae30d8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 16 Aug 2011 10:52:29 +0200 Subject: Fix bidi reordering of RTL text with embedded images According to the UBA, the object replacement character should be considered ON. There's no reason to special case its directionality, as the bidi algorithm will already have given it an implicit directionality. Task-number: QTBUG-20910 Reviewed-by: Lars --- src/gui/text/qtextengine.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 9301f16..9f148ee 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1534,8 +1534,6 @@ void QTextEngine::itemize() const while (uc < e) { switch (*uc) { case QChar::ObjectReplacementCharacter: - if (analysis->bidiLevel % 2) - --analysis->bidiLevel; analysis->script = QUnicodeTables::Common; analysis->flags = QScriptAnalysis::Object; break; -- cgit v0.12 From ebe1233c4fa3eb728f7e6b8355cb1b4c0dd65213 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 9 Aug 2011 09:41:16 +0200 Subject: Update uikit README: svg works, warn about thumb --- src/plugins/platforms/uikit/README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/uikit/README b/src/plugins/platforms/uikit/README index 81ef0bd..f6f3927 100644 --- a/src/plugins/platforms/uikit/README +++ b/src/plugins/platforms/uikit/README @@ -37,11 +37,11 @@ After configuring and building Qt you need to also build src/plugins/platforms/u Simulator: ---------- -configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations +configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations Device: ------- -configure -qpa -xplatform qpa/macx-iphonedevice-g++ -arch armv7 -no-neon -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations +configure -qpa -xplatform qpa/macx-iphonedevice-g++ -arch armv7 -no-neon -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations 2) XCode setup: - there are examples in the examples subdirectory of the platform plugin @@ -58,7 +58,8 @@ configure -qpa -xplatform qpa/macx-iphonedevice-g++ -arch armv7 -no-neon -develo to the include search paths. - add "$(SRCROOT)/../qmltest" to the include search path if you didn't copy but linked to the qmlapplicationviewer - - for device set the architecture to armv7 only + - for device set the architecture to armv7 only and make sure you + don't compile for thumb - to use sound in your application, Q_IMPORT_PLUGIN(phonon_av), #include , and call Phonon::Factory::setBackend(qt_plugin_instance_phonon_av()); -- cgit v0.12 From 6be1b235f7db38146f7080a4bfcfe3051ae54699 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 10 Aug 2011 09:38:37 +0200 Subject: Fix compilation with thumb2. Task-number: QTBUG-16402 Rubber-stamped-by: Thiago Macieira --- src/corelib/arch/qatomic_armv6.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/arch/qatomic_armv6.h b/src/corelib/arch/qatomic_armv6.h index 96b561e..dd465db 100644 --- a/src/corelib/arch/qatomic_armv6.h +++ b/src/corelib/arch/qatomic_armv6.h @@ -152,6 +152,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) asm volatile("0:\n" "ldrex %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" + "itt eq\n" "strexeq %[result], %[newValue], [%[_q_value]]\n" "teqeq %[result], #1\n" "beq 0b\n" @@ -210,6 +211,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu asm volatile("0:\n" "ldrex %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" + "itt eq\n" "strexeq %[result], %[newValue], [%[_q_value]]\n" "teqeq %[result], #1\n" "beq 0b\n" -- cgit v0.12 From 6e0dd8c70a467771f4633b8e0c39bc071fffe0b4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 10 Aug 2011 09:38:57 +0200 Subject: Use thumb instructions for uikit --- mkspecs/qpa/macx-iphonedevice-g++/qmake.conf | 6 +++--- src/plugins/platforms/uikit/README | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf index d69f58d..faec47d 100644 --- a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf +++ b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf @@ -43,10 +43,10 @@ QMAKE_CXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/b QMAKE_LINK = $$QMAKE_CXX QMAKE_LINK_SHLIB = $$QMAKE_CXX -QMAKE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_CFLAGS += -arch armv7 -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden -QMAKE_OBJECTIVE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 -QMAKE_LFLAGS += -arch armv7 -marm -miphoneos-version-min=4.2 -Wl,-syslibroot,$$QMAKE_IOS_SDK +QMAKE_OBJECTIVE_CFLAGS += -arch armv7 -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_LFLAGS += -arch armv7 -miphoneos-version-min=4.2 -Wl,-syslibroot,$$QMAKE_IOS_SDK QMAKE_LFLAGS += -framework Foundation -framework UIKit -framework QuartzCore -lz QMAKE_INCDIR_OPENGL = diff --git a/src/plugins/platforms/uikit/README b/src/plugins/platforms/uikit/README index f6f3927..795e72a 100644 --- a/src/plugins/platforms/uikit/README +++ b/src/plugins/platforms/uikit/README @@ -58,8 +58,7 @@ configure -qpa -xplatform qpa/macx-iphonedevice-g++ -arch armv7 -no-neon -develo to the include search paths. - add "$(SRCROOT)/../qmltest" to the include search path if you didn't copy but linked to the qmlapplicationviewer - - for device set the architecture to armv7 only and make sure you - don't compile for thumb + - for device set the architecture to armv7 only - to use sound in your application, Q_IMPORT_PLUGIN(phonon_av), #include , and call Phonon::Factory::setBackend(qt_plugin_instance_phonon_av()); -- cgit v0.12 From d3277f6d32395b373f45a63e462d3a345745e6f4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 17 Aug 2011 09:02:56 +0200 Subject: uikit: Fix warning. --- src/plugins/platforms/uikit/phonon_av/avmediaobject.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/uikit/phonon_av/avmediaobject.mm b/src/plugins/platforms/uikit/phonon_av/avmediaobject.mm index 388866f..9cbddc0 100644 --- a/src/plugins/platforms/uikit/phonon_av/avmediaobject.mm +++ b/src/plugins/platforms/uikit/phonon_av/avmediaobject.mm @@ -60,7 +60,7 @@ - (id)initWithMediaObject:(AVMediaObject *)obj { - if (self = [self init]) { + if ((self = [self init])) { mediaObject = obj; } return self; -- cgit v0.12 From 8cce6c8b2a2fe831d9b20a9c751e35a3bdb8f9b4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 17 Aug 2011 09:08:13 +0200 Subject: uikit: Fixes for Open GL ES 1 and for pre-3GS devices --- src/imports/imports.pro | 2 +- src/plugins/platforms/uikit/quikitwindow.mm | 31 ++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/imports/imports.pro b/src/imports/imports.pro index c1298e2..d0e24b0 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs SUBDIRS += folderlistmodel particles gestures -contains(QT_CONFIG, opengl): SUBDIRS += shaders +contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1): SUBDIRS += shaders diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index 6e018fe..640b92e 100644 --- a/src/plugins/platforms/uikit/quikitwindow.mm +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -53,6 +53,23 @@ #include +static GLint stencilBits() +{ + static GLint bits; + static bool initialized = false; + if (!initialized) { + glGetIntegerv(GL_STENCIL_BITS, &bits); + initialized = true; + } + return bits; +} + +static GLint depthBits() +{ + // we can choose between GL_DEPTH24_STENCIL8_OES and GL_DEPTH_COMPONENT16 + return stencilBits() > 0 ? 24 : 16; +} + class EAGLPlatformContext : public QPlatformGLContext { public: @@ -60,13 +77,13 @@ public: : mView(view) { mFormat.setWindowApi(QPlatformWindowFormat::OpenGL); - mFormat.setDepthBufferSize(24); + mFormat.setDepthBufferSize(depthBits()); mFormat.setAccumBufferSize(0); mFormat.setRedBufferSize(8); mFormat.setGreenBufferSize(8); mFormat.setBlueBufferSize(8); mFormat.setAlphaBufferSize(8); - mFormat.setStencilBufferSize(8); + mFormat.setStencilBufferSize(stencilBits()); mFormat.setSamples(0); mFormat.setSampleBuffers(false); mFormat.setDoubleBuffer(true); @@ -74,7 +91,7 @@ public: mFormat.setRgba(true); mFormat.setAlpha(true); mFormat.setAccum(false); - mFormat.setStencil(true); + mFormat.setStencil(stencilBits() > 0); mFormat.setStereo(false); mFormat.setDirectRendering(false); @@ -203,9 +220,13 @@ private: glGenRenderbuffers(1, &mDepthRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, mFramebufferWidth, mFramebufferHeight); + if (stencilBits() > 0) { + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, mFramebufferWidth, mFramebufferHeight); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); + } else { + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, mFramebufferWidth, mFramebufferHeight); + } glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); -- cgit v0.12 From a2709ef3f4410a1d1755e00353e6f969f8bb5613 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 17 Aug 2011 12:57:14 +0300 Subject: Symbian: Fix backspace on empty lines of multiline textedits Backspace on empty lines of multiline textedits didn't work because in Symbian the virtual keyboard only gets one block of text at a time, and there is some internal optimization in FEP that if the document is empty, backspace doesn't get generated. Fixed by faking document lenght to be one in cases where it is actually zero, except for password fields with hidden text, as an extra asterisk would be generated in those cases. Typically password fields are not multiline so this shouldn't be a problem. Task-number: QTBUG-20444 Reviewed-by: Sami Merila --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 2202d3a..e22e27c 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -1089,7 +1089,18 @@ TInt QCoeFepInputContext::DocumentLengthForFep() const return 0; QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText); - return variant.value().size() + m_preeditString.size(); + + int size = variant.value().size() + m_preeditString.size(); + + // To fix an issue with backspaces not being generated if document size is zero, + // fake document length to be at least one always, except when dealing with + // hidden text widgets, where this faking would generate extra asterisk. Since the + // primary use of hidden text widgets is password fields, they are unlikely to + // support multiple lines anyway. + if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText)) + size = 1; + + return size; } TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const @@ -1172,6 +1183,12 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc // FEP expects the preedit string to be part of the editor content, so let's mix it in. int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); text.insert(cursor, m_preeditString); + + // Add additional space to empty non-password text to compensate + // for the fake length we specified in DocumentLengthForFep(). + if (text.size() == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText)) + text += QChar(0x20); + aEditorContent.Copy(qt_QString2TPtrC(text.mid(aDocumentPosition, aLengthToRetrieve))); } -- cgit v0.12 From 3b5354386225974ea6db78c12f32cb81e2d50104 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 17 Aug 2011 13:14:57 +0200 Subject: Add a QApplication::queryKeyboardModifiers() method. QApplication::keyboardModifiers returns the keyboard modifiers from the last keypress event in this process, as documented. However there are use cases for querying keyboard modifiers as they currently are, see QTBUG-11243. Merge-request: 585 Reviewed-by: Frederik Gladhorn --- src/gui/kernel/qapplication.cpp | 21 ++++++++++++++++++++- src/gui/kernel/qapplication.h | 1 + src/gui/kernel/qapplication_mac.mm | 5 +++++ src/gui/kernel/qapplication_qws.cpp | 5 +++++ src/gui/kernel/qapplication_s60.cpp | 8 ++++++++ src/gui/kernel/qapplication_win.cpp | 5 +++++ src/gui/kernel/qapplication_x11.cpp | 15 +++++++++++++++ src/gui/kernel/qdnd_x11.cpp | 17 +---------------- 8 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index cd13894..15d37c3 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3321,7 +3321,7 @@ bool QApplication::desktopSettingsAware() one of the above events. If no keys are being held Qt::NoModifier is returned. - \sa mouseButtons() + \sa mouseButtons(), queryKeyboardModifiers() */ Qt::KeyboardModifiers QApplication::keyboardModifiers() @@ -3330,6 +3330,25 @@ Qt::KeyboardModifiers QApplication::keyboardModifiers() } /*! + \fn Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() + + Queries and returns the state of the modifier keys on the keyboard. + Unlike keyboardModifiers, this method returns the actual keys held + on the input device at the time of calling the method. + + It does not rely on the keypress events having been received by this + process, which makes it possible to check the modifiers while moving + a window, for instance. Note that in most cases, you should use + keyboardModifiers(), which is faster and more accurate since it contains + the state of the modifiers as they were when the currently processed + event was received. + + \sa keyboardModifiers() + + \since 4.8 +*/ + +/*! Returns the current state of the buttons on the mouse. The current state is updated syncronously as the event queue is emptied of events that will spontaneously change the mouse state (QEvent::MouseButtonPress and diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 01a246a..1548849 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -198,6 +198,7 @@ public: static void alert(QWidget *widget, int duration = 0); static Qt::KeyboardModifiers keyboardModifiers(); + static Qt::KeyboardModifiers queryKeyboardModifiers(); static Qt::MouseButtons mouseButtons(); static void setDesktopSettingsAware(bool); diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index c5ff799..1f75f09 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1395,6 +1395,11 @@ void QApplication::restoreOverrideCursor() } #endif // QT_NO_CURSOR +Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() +{ + return qt_mac_get_modifiers(GetCurrentEventKeyModifiers()); +} + QWidget *QApplication::topLevelAt(const QPoint &p) { #ifndef QT_MAC_USE_COCOA diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 3b6a075..193dfcd 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -2699,6 +2699,11 @@ void QApplication::alert(QWidget *, int) { } +Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() +{ + return keyboardModifiers(); // TODO proper implementation +} + int QApplication::qwsProcessEvent(QWSEvent* event) { Q_D(QApplication); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 5ac9803..31246f4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -115,6 +115,8 @@ QWidget *qt_button_down = 0; // widget got last button-down QSymbianControl *QSymbianControl::lastFocusedControl = 0; +static Qt::KeyboardModifiers app_keyboardModifiers = Qt::NoModifier; + QS60Data* qGlobalS60Data() { return qt_s60Data(); @@ -735,6 +737,7 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent) Qt::MouseButton button; mapS60MouseEventTypeToQt(&type, &button, &pEvent); Qt::KeyboardModifiers modifiers = mapToQtModifiers(pEvent.iModifiers); + app_keyboardModifiers = modifiers; QPoint widgetPos = translatePointForFixedNativeOrientation(pEvent.iPosition); TPoint controlScreenPos = PositionRelativeToScreen(); @@ -2590,6 +2593,11 @@ void QApplication::setEffectEnabled(Qt::UIEffect /* effect */, bool /* enable */ // TODO: Implement QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) } +Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() +{ + return app_keyboardModifiers; +} + TUint QApplicationPrivate::resolveS60ScanCode(TInt scanCode, TUint keysym) { if (!scanCode) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index c34e75f..756cb56 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1319,6 +1319,11 @@ Qt::KeyboardModifiers qt_win_getKeyboardModifiers() return modifiers; } +Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() +{ + return qt_win_getKeyboardModifiers(); +} + /***************************************************************************** Routines to find a Qt widget from a screen position *****************************************************************************/ diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 666fe85..ef8e2b8 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -3058,6 +3058,21 @@ void QApplicationPrivate::_q_alertTimeOut() } } +Qt::KeyboardModifiers QApplication::queryKeyboardModifiers() +{ + Window root; + Window child; + int root_x, root_y, win_x, win_y; + uint keybstate; + for (int i = 0; i < ScreenCount(X11->display); ++i) { + if (XQueryPointer(X11->display, QX11Info::appRootWindow(i), &root, &child, + &root_x, &root_y, &win_x, &win_y, &keybstate)) + return X11->translateModifiers(keybstate & 0x00ff); + } + return 0; + +} + /***************************************************************************** Special lookup functions for windows that have been reparented recently *****************************************************************************/ diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 0c683b4..5847021 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1112,21 +1112,6 @@ void qt_xdnd_send_leave() waiting_for_status = false; } -// TODO: remove and use QApplication::currentKeyboardModifiers() in Qt 4.8. -static Qt::KeyboardModifiers currentKeyboardModifiers() -{ - Window root; - Window child; - int root_x, root_y, win_x, win_y; - uint keybstate; - for (int i = 0; i < ScreenCount(X11->display); ++i) { - if (XQueryPointer(X11->display, QX11Info::appRootWindow(i), &root, &child, - &root_x, &root_y, &win_x, &win_y, &keybstate)) - return X11->translateModifiers(keybstate & 0x00ff); - } - return 0; -} - void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive) { DEBUG("xdndHandleDrop"); @@ -1183,7 +1168,7 @@ void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive) // Drop coming from another app? Update keyboard modifiers. if (!qt_xdnd_dragging) { - QApplicationPrivate::modifier_buttons = currentKeyboardModifiers(); + QApplicationPrivate::modifier_buttons = QApplication::queryKeyboardModifiers(); } QDropEvent de(qt_xdnd_current_position, possible_actions, dropData, -- cgit v0.12 From 744415e5e0f0e7084821599be99da504e2606032 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Aug 2011 17:04:31 +0200 Subject: fix copying webkit guide under windows patch by Rob Tomek. Task-number: QTBUG-19155 --- doc/doc.pri | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/doc.pri b/doc/doc.pri index 253e1b4..9d67386 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -14,6 +14,8 @@ win32:!win32-g++* { } COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide +COPYWEBKITTARGA = $$QT_BUILD_TREE/doc-build/html-qt +COPYWEBKITTARGB = $$QT_BUILD_TREE/doc/html $$unixstyle { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES @@ -21,12 +23,14 @@ $$unixstyle { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES QDOC = $$replace(QDOC, "/", "\\") COPYWEBKITGUIDE = $$replace(COPYWEBKITGUIDE, "/", "\\") + COPYWEBKITTARGA = $$replace(COPYWEBKITTARGA, "/", "\\") + COPYWEBKITTARGB = $$replace(COPYWEBKITTARGB, "/", "\\") } ADP_DOCS_QDOCCONF_FILE = qt-build-docs-online.qdocconf QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ linguist.qdocconf qmake.qdocconf qdeclarative.qdocconf) && \ (cd $$QT_BUILD_TREE && \ - $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$QT_BUILD_TREE/doc-build/html-qt && \ + $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$COPYWEBKITTARGA && \ $$GENERATOR doc-build/html-qt/qt.qhp -o doc/qch/qt.qch && \ $$GENERATOR doc-build/html-assistant/assistant.qhp -o doc/qch/assistant.qch && \ $$GENERATOR doc-build/html-designer/designer.qhp -o doc/qch/designer.qch && \ @@ -52,7 +56,7 @@ win32-g++*:isEmpty(QMAKE_SH) { } # Build rules: -adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE && $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$QT_BUILD_TREE/doc/html) +adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE && $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$COPYWEBKITTARGB) adp_docs.depends += sub-qdoc3 # qdoc3 qch_docs.commands = $$QT_DOCUMENTATION qch_docs.depends += sub-qdoc3 -- cgit v0.12 From c2e8af87b10eaf57d397d467a79fcc24fa23bacf Mon Sep 17 00:00:00 2001 From: Keith Isdale Date: Thu, 18 Aug 2011 14:25:27 +1000 Subject: Improve documentation for QDeclarativeView::setSource() Add reference to tutorial on setting source file for QDeclarativeView. Make use of compiled example code that demonstrate using Qt Resources in calls to QDeclarativeView::setSource() . Task-number: QTBUG-20985 Reviewed-by: Alan Alpert --- doc/src/declarative/network.qdoc | 7 +++---- src/declarative/util/qdeclarativeview.cpp | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc index cb83542..0ebf8ae 100644 --- a/doc/src/declarative/network.qdoc +++ b/doc/src/declarative/network.qdoc @@ -134,10 +134,9 @@ One of the URL schemes built into Qt is the "qrc" scheme. This allows content to the executable using \l{The Qt Resource System}. Using this, an executable can reference QML content that is compiled into the executable: -\code - QDeclarativeView *canvas = new QDeclarativeView; - canvas->setUrl(QUrl("qrc:/dial.qml")); -\endcode +\quotefromfile snippets/declarative/qtbinding/resources/main.cpp +\skipto view +\printuntil setSource The content itself can then use relative URLs, and so be transparently unaware that the content is compiled into the executable. diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index bab991b..45995ce 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -319,6 +319,8 @@ QDeclarativeView::~QDeclarativeView() Ensure that the URL provided is full and correct, in particular, use \l QUrl::fromLocalFile() when loading a file from the local filesystem. + + \sa {Network Transparency}{Loading Resources in QML} */ /*! -- cgit v0.12 From 95df5be87b37da139dba33b06aaf6e2a251be698 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 18 Aug 2011 09:24:13 +0300 Subject: Compile fix for Symbian 5th and earlier Additional fix to enable compilation of Qt GUI to succeed on earlier Symbian SDKs. Task-number: QTBUG-20033 Reviewed-by: Kalle Lehtonen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index e22e27c..d545f2e 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -64,6 +64,8 @@ #define QT_EAknCursorPositionChanged MAknEdStateObserver::EAknEdwinStateEvent(6) // MAknEdStateObserver::EAknActivatePenInputRequest #define QT_EAknActivatePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(7) +// MAknEdStateObserver::EAknClosePenInputRequest +#define QT_EAknClosePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(10) // EAknEditorFlagSelectionVisible is only valid from 3.2 onwards. // Sym^3 AVKON FEP manager expects that this flag is used for FEP-aware editors @@ -315,8 +317,9 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) if (!needsInputPanel()) return false; - if (event->type() == QEvent::CloseSoftwareInputPanel) { - m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::EAknClosePenInputRequest); + if ((event->type() == QEvent::CloseSoftwareInputPanel) + && (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)) { + m_fepState->ReportAknEdStateEventL(QT_EAknClosePenInputRequest); return false; } -- cgit v0.12 From ad35bf83f9bd1d6b978243051e3d10a7fc61eec7 Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Thu, 18 Aug 2011 13:34:00 +0300 Subject: Fix non-ascii name issues in ICD. PMO Bug 275663. Developed by Aapo Makela, reviewed by me. --- src/plugins/bearer/icd/dbusdispatcher.cpp | 4 ++-- src/plugins/bearer/icd/iapconf.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/bearer/icd/dbusdispatcher.cpp b/src/plugins/bearer/icd/dbusdispatcher.cpp index 60e4640..62dec62 100644 --- a/src/plugins/bearer/icd/dbusdispatcher.cpp +++ b/src/plugins/bearer/icd/dbusdispatcher.cpp @@ -195,7 +195,7 @@ static bool appendVariantToDBusMessage(const QVariant& argument, break; case QVariant::String: { - QByteArray data = argument.toString().toLatin1(); + QByteArray data = argument.toString().toUtf8(); str_data = data.data(); dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_STRING, &str_data); @@ -363,7 +363,7 @@ static QVariant getVariantFromDBusMessage(DBusMessageIter *iter) { case DBUS_TYPE_STRING: { dbus_message_iter_get_basic(iter, &str_data); - QString str(str_data); + QString str(QString::fromUtf8(str_data)); QVariant variant(str); return variant; } diff --git a/src/plugins/bearer/icd/iapconf.cpp b/src/plugins/bearer/icd/iapconf.cpp index a29e326..e326edf 100644 --- a/src/plugins/bearer/icd/iapconf.cpp +++ b/src/plugins/bearer/icd/iapconf.cpp @@ -143,7 +143,7 @@ QVariant IAPConfPrivate::valueToVariant(ConnSettingsValue *value) return QVariant(value->value.bool_val ? true : false); case CONN_SETTINGS_VALUE_STRING: - return QVariant(QString(value->value.string_val)); + return QVariant(QString::fromUtf8(value->value.string_val)); case CONN_SETTINGS_VALUE_DOUBLE: return QVariant(value->value.double_val); -- cgit v0.12 From 1679b2d71f4f573699aad20aebf4eacc7605fdc8 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 18 Aug 2011 15:43:55 +0300 Subject: Exact word bubble doesn't disappear when screen is tapped Sync FEP-aware text editors state to native side. Thus, native side can then do various operations based on editor state - such as removing the user typed 'exact word bubble'. Task-number: QTBUG-20919 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index d545f2e..8bdaa22 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -1077,6 +1077,10 @@ void QCoeFepInputContext::CancelFepInlineEdit() if (m_hasTempPreeditString) return; + // Sync with native side editor state. Native side can then do various operations + // based on editor state, such as removing 'exact word bubble'. + ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState); + QList attributes; QInputMethodEvent event(QLatin1String(""), attributes); event.setCommitString(QLatin1String(""), 0, 0); -- cgit v0.12 From e58a402fbee2fc8af8cd651acafdc28525ed1314 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Aug 2011 17:48:35 +0200 Subject: Make the DBus timeout configurable in QDBusAbstractInterface. Merge-request: 1253 Reviewed-by: Thiago Reviewed-by: Frederik Gladhorn --- src/dbus/qdbusabstractinterface.cpp | 31 +++++++- src/dbus/qdbusabstractinterface.h | 3 + src/dbus/qdbusabstractinterface_p.h | 1 + .../com.trolltech.QtDBus.Pinger.xml | 4 + tests/auto/qdbusabstractinterface/interface.cpp | 14 ++++ tests/auto/qdbusabstractinterface/interface.h | 1 + tests/auto/qdbusabstractinterface/pinger.h | 7 ++ .../tst_qdbusabstractinterface.cpp | 92 ++++++++++++++++++++++ 8 files changed, 149 insertions(+), 4 deletions(-) diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 187ad67..9f68313 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -88,6 +88,7 @@ QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(const QString &serv : connection(con), service(serv), path(p), interface(iface), lastError(checkIfValid(serv, p, iface, isDynamic, (connectionPrivate() && connectionPrivate()->mode == QDBusConnectionPrivate::PeerMode))), + timeout(-1), isValid(!lastError.isValid()) { if (!isValid) @@ -144,7 +145,7 @@ void QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, QVariant & QLatin1String("Get")); QDBusMessagePrivate::setParametersValidated(msg, true); msg << interface << QString::fromUtf8(mp.name()); - QDBusMessage reply = connection.call(msg, QDBus::Block); + QDBusMessage reply = connection.call(msg, QDBus::Block, timeout); if (reply.type() != QDBusMessage::ReplyMessage) { lastError = reply; @@ -210,7 +211,7 @@ bool QDBusAbstractInterfacePrivate::setProperty(const QMetaProperty &mp, const Q QLatin1String("Set")); QDBusMessagePrivate::setParametersValidated(msg, true); msg << interface << QString::fromUtf8(mp.name()) << QVariant::fromValue(QDBusVariant(value)); - QDBusMessage reply = connection.call(msg, QDBus::Block); + QDBusMessage reply = connection.call(msg, QDBus::Block, timeout); if (reply.type() != QDBusMessage::ReplyMessage) { lastError = reply; @@ -384,6 +385,28 @@ QDBusError QDBusAbstractInterface::lastError() const } /*! + Sets the timeout in seconds for all future DBus calls to \a timeout. + -1 means the default DBus timeout (usually 25 seconds). + + \since 4.8 +*/ +void QDBusAbstractInterface::setTimeout(int timeout) +{ + d_func()->timeout = timeout; +} + +/*! + Returns the current value of the timeout in seconds. + -1 means the default DBus timeout (usually 25 seconds). + + \since 4.8 +*/ +int QDBusAbstractInterface::timeout() const +{ + return d_func()->timeout; +} + +/*! Places a call to the remote method specified by \a method on this interface, using \a args as arguments. This function returns the message that was received as a reply, which can be a normal QDBusMessage::ReplyMessage (indicating success) or QDBusMessage::ErrorMessage (if the call @@ -442,7 +465,7 @@ QDBusMessage QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode mode, QDBusMessagePrivate::setParametersValidated(msg, true); msg.setArguments(args); - QDBusMessage reply = d->connection.call(msg, mode); + QDBusMessage reply = d->connection.call(msg, mode, d->timeout); if (thread() == QThread::currentThread()) d->lastError = reply; // will clear if reply isn't an error @@ -475,7 +498,7 @@ QDBusPendingCall QDBusAbstractInterface::asyncCallWithArgumentList(const QString QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), method); QDBusMessagePrivate::setParametersValidated(msg, true); msg.setArguments(args); - return d->connection.asyncCall(msg); + return d->connection.asyncCall(msg, d->timeout); } /*! diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h index 72b922e..34ff410 100644 --- a/src/dbus/qdbusabstractinterface.h +++ b/src/dbus/qdbusabstractinterface.h @@ -95,6 +95,9 @@ public: QDBusError lastError() const; + void setTimeout(int timeout); + int timeout() const; + QDBusMessage call(const QString &method, const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), diff --git a/src/dbus/qdbusabstractinterface_p.h b/src/dbus/qdbusabstractinterface_p.h index a000daf..4f96165 100644 --- a/src/dbus/qdbusabstractinterface_p.h +++ b/src/dbus/qdbusabstractinterface_p.h @@ -77,6 +77,7 @@ public: QString path; QString interface; mutable QDBusError lastError; + int timeout; // this is set during creation and never changed // it can't be const because QDBusInterfacePrivate has one more check diff --git a/tests/auto/qdbusabstractinterface/com.trolltech.QtDBus.Pinger.xml b/tests/auto/qdbusabstractinterface/com.trolltech.QtDBus.Pinger.xml index 1667591..d945ec9 100644 --- a/tests/auto/qdbusabstractinterface/com.trolltech.QtDBus.Pinger.xml +++ b/tests/auto/qdbusabstractinterface/com.trolltech.QtDBus.Pinger.xml @@ -15,6 +15,10 @@ + + + + diff --git a/tests/auto/qdbusabstractinterface/interface.cpp b/tests/auto/qdbusabstractinterface/interface.cpp index 0326177..849db93 100644 --- a/tests/auto/qdbusabstractinterface/interface.cpp +++ b/tests/auto/qdbusabstractinterface/interface.cpp @@ -40,9 +40,23 @@ ****************************************************************************/ #include "interface.h" +#include Interface::Interface() { } +// Export the sleep function +// TODO QT5: remove this class, QThread::msleep is now public +class FriendlySleepyThread : public QThread { +public: + using QThread::msleep; +}; + +int Interface::sleepMethod(int msec) +{ + FriendlySleepyThread::msleep(msec); + return 42; +} + #include "moc_interface.cpp" diff --git a/tests/auto/qdbusabstractinterface/interface.h b/tests/auto/qdbusabstractinterface/interface.h index b840a38..0fb15fe 100644 --- a/tests/auto/qdbusabstractinterface/interface.h +++ b/tests/auto/qdbusabstractinterface/interface.h @@ -101,6 +101,7 @@ public: public slots: Q_SCRIPTABLE void voidMethod() {} + Q_SCRIPTABLE int sleepMethod(int); Q_SCRIPTABLE QString stringMethod() { return "Hello, world"; } Q_SCRIPTABLE RegisteredType complexMethod() { return RegisteredType("Hello, world"); } Q_SCRIPTABLE QString multiOutMethod(int &value) { value = 42; return "Hello, world"; } diff --git a/tests/auto/qdbusabstractinterface/pinger.h b/tests/auto/qdbusabstractinterface/pinger.h index 6245a5a..739a142 100644 --- a/tests/auto/qdbusabstractinterface/pinger.h +++ b/tests/auto/qdbusabstractinterface/pinger.h @@ -117,6 +117,13 @@ public Q_SLOTS: // METHODS return reply; } + inline QDBusPendingReply sleepMethod(int in0) + { + QList argumentList; + argumentList << qVariantFromValue(in0); + return asyncCallWithArgumentList(QLatin1String("sleepMethod"), argumentList); + } + inline QDBusPendingReply stringMethod() { QList argumentList; diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 00e3a76..994df05 100644 --- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -111,6 +111,8 @@ private slots: void makeAsyncComplexCallPeer(); void makeAsyncMultiOutCallPeer(); + void callWithTimeout(); + void stringPropRead(); void stringPropWrite(); void variantPropRead(); @@ -458,6 +460,96 @@ void tst_QDBusAbstractInterface::makeAsyncMultiOutCallPeer() QCoreApplication::instance()->processEvents(); } +static const char server_serviceName[] = "com.trolltech.autotests.dbusserver"; +static const char server_objectPath[] = "/com/trolltech/server"; +static const char server_interfaceName[] = "com.trolltech.QtDBus.Pinger"; + +class DBusServerThread : public QThread +{ +public: + DBusServerThread() { + start(); + m_ready.acquire(); + } + ~DBusServerThread() { + quit(); + wait(); + } + + void run() + { + QDBusConnection con = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "ThreadConnection"); + if (!con.isConnected()) + qWarning("Error registering to DBus"); + if (!con.registerService(server_serviceName)) + qWarning("Error registering service name"); + Interface targetObj; + con.registerObject(server_objectPath, &targetObj, QDBusConnection::ExportScriptableContents); + m_ready.release(); + exec(); + + QDBusConnection::disconnectFromBus( con.name() ); + } +private: + QSemaphore m_ready; +}; + +void tst_QDBusAbstractInterface::callWithTimeout() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY2(con.isConnected(), "Not connected to D-Bus"); + + DBusServerThread serverThread; + + QDBusMessage msg = QDBusMessage::createMethodCall(server_serviceName, + server_objectPath, server_interfaceName, "sleepMethod"); + msg << 100; + + { + // Call with no timeout -> works + QDBusMessage reply = con.call(msg); + QCOMPARE((int)reply.type(), (int)QDBusMessage::ReplyMessage); + QCOMPARE(reply.arguments().at(0).toInt(), 42); + } + + { + // Call with 1 sec timeout -> fails + QDBusMessage reply = con.call(msg, QDBus::Block, 1); + QCOMPARE(reply.type(), QDBusMessage::ErrorMessage); + } + + // Now using QDBusInterface + + QDBusInterface iface(server_serviceName, server_objectPath, server_interfaceName, con); + { + // Call with no timeout + QDBusMessage reply = iface.call("sleepMethod", 100); + QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); + QCOMPARE(reply.arguments().at(0).toInt(), 42); + } + { + // Call with 1 sec timeout -> fails + iface.setTimeout(1); + QDBusMessage reply = iface.call("sleepMethod", 100); + QCOMPARE(reply.type(), QDBusMessage::ErrorMessage); + } + + // Now using generated code + com::trolltech::QtDBus::Pinger p(server_serviceName, server_objectPath, QDBusConnection::sessionBus()); + { + // Call with no timeout + QDBusReply reply = p.sleepMethod(100); + QVERIFY(reply.isValid()); + QCOMPARE(int(reply), 42); + } + { + // Call with 1 sec timeout -> fails + p.setTimeout(1); + QDBusReply reply = p.sleepMethod(100); + QVERIFY(!reply.isValid()); + } +} + void tst_QDBusAbstractInterface::stringPropRead() { Pinger p = getPinger(); -- cgit v0.12 From 49409f612c47f30434aa809e4d2c963f1a6bb88a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 19 Aug 2011 11:58:18 +0200 Subject: Correctly position aliased lines with flat caps The code was mispositioning lines by half a pixel, as it added half a pixel offset and then rounded in addition. This submit fixes this and also removes certain artifacts when drawing rects at .5 pixel positions. Lance now doesn't show any significant differences to the 4.7 rendering anymore. Task-number: QTBUG-20199 Reviewed-by: Aavit --- src/gui/painting/qcosmeticstroker.cpp | 50 ++++++++++++++++++----------------- src/gui/painting/qcosmeticstroker_p.h | 10 ++++--- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index dbe957e..3528e6f 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -425,13 +425,12 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal swapped = true; qSwap(y1, y2); qSwap(x1, x2); - --x1; --x2; --y1; --y2; } int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); int x = x1 << 10; - int y = (y1+32) >> 6; - int ys = (y2+32) >> 6; + int y = y1 >> 6; + int ys = y2 >> 6; if (y != ys) { x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; @@ -457,13 +456,12 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal swapped = true; qSwap(x1, x2); qSwap(y1, y2); - --x1; --x2; --y1; --y2; } int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); int y = y1 << 10; - int x = (x1+32) >> 6; - int xs = (x2+32) >> 6; + int x = x1 >> 6; + int xs = x2 >> 6; if (x != xs) { y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; @@ -716,10 +714,11 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, QCosmeticStroker::Point last = stroker->lastPixel; -// qDebug() << "stroke" << x1/64. << y1/64. << x2/64. << y2/64. << capString(caps); +// qDebug() << "stroke" << x1/64. << y1/64. << x2/64. << y2/64.; if (dx < dy) { // vertical + QCosmeticStroker::Direction dir = QCosmeticStroker::TopToBottom; bool swapped = false; if (y1 > y2) { @@ -727,30 +726,31 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qSwap(y1, y2); qSwap(x1, x2); caps = swapCaps(caps); - --x1; --x2; --y1; --y2; + dir = QCosmeticStroker::BottomToTop; } int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); int x = x1 << 10; + if ((stroker->lastDir ^ QCosmeticStroker::VerticalMask) == dir) + caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin; + capAdjust(caps, y1, y2, x, xinc); - int y = (y1+32) >> 6; - int ys = (y2+32) >> 6; + int y = y1 >> 6; + int ys = y2 >> 6; if (y != ys) { x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; // calculate first and last pixel and perform dropout control - QCosmeticStroker::Direction dir = QCosmeticStroker::TopToBottom; QCosmeticStroker::Point first; first.x = x >> 16; first.y = y; last.x = (x + (ys - y - 1)*xinc) >> 16; last.y = ys - 1; - if (swapped) { + if (swapped) qSwap(first, last); - dir = QCosmeticStroker::BottomToTop; - } + bool axisAligned = qAbs(xinc) < (1 << 14); if (stroker->lastPixel.x >= 0) { if (first.x == stroker->lastPixel.x && @@ -765,7 +765,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else if (stroker->lastDir != dir && (((axisAligned && stroker->lastAxisAligned) && stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) || - (qAbs(stroker->lastPixel.x - first.x) > 1 && + (qAbs(stroker->lastPixel.x - first.x) > 1 || qAbs(stroker->lastPixel.y - first.y) > 1))) { // have a missing pixel, insert it if (swapped) { @@ -793,37 +793,39 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, if (!dx) return; + QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; + bool swapped = false; if (x1 > x2) { swapped = true; qSwap(x1, x2); qSwap(y1, y2); caps = swapCaps(caps); - --x1; --x2; --y1; --y2; + dir = QCosmeticStroker::RightToLeft; } int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); int y = y1 << 10; - capAdjust(caps, x1, x2, y, yinc); + if ((stroker->lastDir ^ QCosmeticStroker::HorizontalMask) == dir) + caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin; - int x = (x1+32) >> 6; - int xs = (x2+32) >> 6; + capAdjust(caps, x1, x2, y, yinc); + int x = x1 >> 6; + int xs = x2 >> 6; if (x != xs) { y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; // calculate first and last pixel to perform dropout control - QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; QCosmeticStroker::Point first; first.x = x; first.y = y >> 16; last.x = xs - 1; last.y = (y + (xs - x - 1)*yinc) >> 16; - if (swapped) { + if (swapped) qSwap(first, last); - dir = QCosmeticStroker::RightToLeft; - } + bool axisAligned = qAbs(yinc) < (1 << 14); if (stroker->lastPixel.x >= 0) { if (first.x == stroker->lastPixel.x && first.y == stroker->lastPixel.y) { @@ -837,7 +839,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else if (stroker->lastDir != dir && (((axisAligned && stroker->lastAxisAligned) && stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) || - (qAbs(stroker->lastPixel.x - first.x) > 1 && + (qAbs(stroker->lastPixel.x - first.x) > 1 || qAbs(stroker->lastPixel.y - first.y) > 1))) { // have a missing pixel, insert it if (swapped) { diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index d7bd79a..53cdf2c 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -78,10 +78,12 @@ public: // used to avoid drop outs or duplicated points enum Direction { - TopToBottom, - BottomToTop, - LeftToRight, - RightToLeft + TopToBottom = 0x1, + BottomToTop = 0x2, + LeftToRight = 0x4, + RightToLeft = 0x8, + VerticalMask = 0x3, + HorizontalMask = 0xc }; QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr) -- cgit v0.12 From 3a3b4a0aca8ca31bb135b456eb58763733cf047f Mon Sep 17 00:00:00 2001 From: Timo Turunen Date: Fri, 19 Aug 2011 13:19:01 +0300 Subject: Update 4.7.4 changes Reviewed-by: Trust Me --- dist/changes-4.7.4 | 304 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 304 insertions(+) diff --git a/dist/changes-4.7.4 b/dist/changes-4.7.4 index a37e66a..9a08d15 100644 --- a/dist/changes-4.7.4 +++ b/dist/changes-4.7.4 @@ -19,13 +19,317 @@ Merge Request: http://qt.gitorious.org * Library * **************************************************************************** +QtGui +----- + + - [QTBUG-20214] QRentBook: LSK and RSK of booking page will change + somethimes + - [QTBUG-19656] Spectrum: the Mode menu disappears after the device is + changed from portrait to landscape. + - [QTBUG-19260] Cursor cannot be placed between letters f and i - "fi" + is interpreted as one character + - [QTBUG-19157] Crash in QGLContextPrivate::bindTexture() when using + QPainter::fillRect() with a brush having a size > max_texture_size + - [QTBUG-19089] TextInput positionToRectangle doesn't return correct + coordinates for the cursor in pre-edit mode + - [QTBUG-19067] Font glyphs get clipped on the top + - [QTBUG-18500] QTextBlock crash + - [QTBUG-18303] Arabic multiline text is clipped on the right + - [QTBUG-18185] QStaticText: Wrong kerning and baselines when rotating a + QGraphicsView + - [QTBUG-17443] Feedreadercrash: when opening feed with unicode characters + - [QTBUG-17244] QGraphicsLayout Layouting should be done in one go. Ugly + layouting visible otherwise + - [QTBUG-17209] Bug-231 introduces an off-by-one error + - [QTBUG-17117] Arabic reordering problem when 2 fonts are used + - [QTBUG-11131] QAbstractScrollArea::setViewport() causes crash when used + from within event handler method + - [QTBUG-16422] Big coordinate values cause segfault on ARM when calling + QGraphicsEllipseItem::contains + - [QTBUG-18017] Regression: Text selection with shift-click stopped working + - [QTBUG-18192] Crash when invoking blockBoundingRect over a QTextDocument + documentLayout + - [QTBUG-17505] Inflexible focus handling in QGraphicsScene + - [QTBUG-17020] QPainter::drawText() fails to draw correct text in some + circumstances. Related to QTBUG-12950 + - [QTBUG-16401] QGraphicsScene returns focus incorrectly when QGraphicsView + is focused + - [QTBUG-17812] regression: qsortfilterproxymodel::reset doesn't invalidate + the model (Windows) + - [QTBUG-17230] QPlainTextEdit corruption/crash after scrolling + - [QTBUG-17536] qguistatemachine::cloneEvent doesn't clone + GraphicsSceneWheel Events correctly + - [QTBUG-17254] XPM files crash QImage (write) + - [QTBUG-16292] QTreeView crash in indexRowSizeHint/itemHeight + - [QTBUG-17390] Child widgets don't inherit their parent's input contexts + - [QTBUG-15910] setstylesheet on a QComboBox causes a segmentation fault + - [QTBUG-16652] Compilation of "4.7" branch fails: + private/qdrawhelper_arm_simd_p.h: No such file or directory + +QtNetwork +--------- + + - [QTBUG-17464] SIGBUS in fetchAndAddOrdered from + QlcdEngine::connectionStateSignalsSlot + - [QTBUG-16022] QHttpNetworkConnectionChannel::expand discards data if + gzip-stream has missing end-of-stream marker + - [QTBUG-17199] ICD Bearer management: Causes the main thread to hang + when ran on a different thread. + +QtCore +------ + + - [QTBUG-15421] QDirIterator returns hidden directories when it should only + return files and returns hidden files when it should only return + directories + +QtScript +-------- + + - [QTBUG-17815] Missing APIShims in obsoleted QScriptValue constructor + - [QTBUG-17788] Crash when calling collectGarbage() after requesting + arguments object of native context + +QtDBus +------ + + - [QTBUG-14228] Ensure Qt 4.7 doesn't crash when a D-Bus message with file + descriptors is received + +QtSql +----- + + - [QTBUG-14831] Dynamic sorting of a QSortFilterProxyModel on a + QSqlTableModel with OnManualSubmit is broken (4.7 regression) + +Declarative +----------- + + - [QTBUG-20159] No effect of setting color on a QStaticText or a + QML element + - [QTBUG-18428] Colored and underlined styled text are not underlined or + completely coloured on device + - [QTBUG-18362] wigglytext.qml does not behave correctly in qmlscene + - [QTBUG-18266] More than one XmlListModel - Lists randomly show data from + wrong model + - [QTBUG-15983] Cannot pass enum value as signal parameter from C++ to QML + - [QTBUG-14974] ListView and GridView + contentY performance + - [QTBUG-18412] Crash in sendPostedEvents() - QObject::isWidgetType() + (issue with QDeclarativePixmapReply) + - [QTBUG-15356] PathView doesn't update if preferredHighlightBegin and + preferredHighlightEnd changed + - [QTBUG-17562] TextInput text in echo mode PasswordEchoOnEdit revealed + on refocus + - [QTBUG-17775] Crash when using FolderListModel with a repeater + - [QTBUG-17361] Nested pressDelays crashes application + - [QTBUG-15705] QDeclarativeTextInput::mousePressEvent() doesn't call + QInputContext::mouseHandler() + - [QTBUG-17501] Focus: Tap any of the Rounded-cornered rectangle, the + context menu doesn't disappear. + - [QTBUG-17008] ListView + XmlListModel freeze application when change + language key combination + - [QTBUG-17324] incorrect 'version is not installed' error when importing + QML module + - [QTBUG-16999] QML TextInput doesn't scroll if writing preedit at the end + of the line + - [QTBUG-13451] Support property versioning in QML + - [QTBUG-16959] Crash when using Grid.TopToBottom flow with Repeater + inside Grid + - [QTBUG-16522] QML ListView Should Support Dynamic Headers and Footers + - [QTBUG-17114] QtQuick 1.1 alignment regression + - [QTBUG-16283] TextEdit and TextInput need text selection modes + - [QTBUG-16284] Disable drag and drop in TextEdit and TextInput + +OpenVG +------ + - [QTBUG-18682] QImage convertToFormat does not work with certain image + formats when default (OpenVG) rendering engine used. + +OpenGL +------ + - [QTBUG-14217] Unresolved symbol QGLWindowSurface::staticMetaObject when + building for Windows Mobile 5.0 with OpenGL ES 1.1 support + - [QTBUG-18184] mingw gcc 4 static build failed in tools/qml because of the + symbol export in libQtOpenGL + - [QTBUG-17256] Change QGLPixmapData load functions to use the + 'convertInPlace' versions of QImage to save memory + +3rdParty +-------- + + - Image formats + * [QTBUG-20425] Update bundled libpng to 1.5.4 (security) + **************************************************************************** * Platform Specific Changes * **************************************************************************** +Qt for Linux/X11 +---------------- + + - Declarative + * [QTBUG-19914] Segfault in QDeclarativeBinding::createBinding triggered + by QMultimediaKit + - gui + * [QTBUG-16175] REG: Qt 4.7/Linux Qt Designer / Qt Creator show multiple + warnings: "Application asked to unregister timer 0x17000002 which is + not registered in this thread. Fix application." + +Qt for Windows +-------------- + + - gui + * [QTBUG-19878] QImage constructor crash when opening some tiff images + - corelib + * [QTBUG-17014] Qt event delivery is unreliable on windows platforms + - declarative + * [QTBUG-19198] ListView lose items + * [QTBUG-18587] Roles are not removed in listmodel + - qmake + * [QTBUG-18537] Compiling Qt on Windows XP x64 using MinGW-w64 fails + +Qt for Mac OS X +--------------- + + - gui + * [QTBUG-20496] Qt does not compile under OSX Lion or llvm-gcc + * [QTBUG-18547] Buffer overrun in QMacPixmapData::macCreatePixels + (QPixmap_mac.cpp) + * [QTBUG-15474] Mac: Qt:Sheet dialog permanently loses focus after + moving the parent window + * [QTBUG-15897] QMainWindow crash in destructor when having a + QDockWidget of type Qt::Drawer containing a QTreeWidget + - corelib + * [QTBUG-11481] Floating Dock Widget behavior on Mac [REGRESSION] + - network + * [QTBUG-14520] SSL Isn't working with osx 10.5 + * [QTBUG-5645] SSL Memory leaks on Mac. + +Qt for Symbian +-------------- + + - general + * [QTBUG-20216] Update QtOpenGL section in Symbian platform notes + - examples + * [QTBUG-15176] Default heap/stack size might not be enough for symbian + - qmake & mkspecs + * [QTBUG-20669] Symbian: DEBUGGABLE_UDEBONLY keyword needed in + generated mmp files + * [QTBUG-20192] Qt sis can't be created on symbian^1 5.0 and + symbian^3 PS2 environments + * [QTBUG-18207] QMAKE_CLEAN items with wildcards in symbian-abld + builds will halt the build without obvious reason. + * [QTBUG-17927] Simplified Chinese language is not supported + in Qt 4.7.2 + - openvg + * [QTBUG-20339] when camera application is opened and closed, the qml + application in the background is getting closed + * [QTBUG-18027] Lazy conversion in fromSymbianCFbsBitmap for openVG + - opengl + * [QTBUG-19183] Enable multisampling if there's hw support for it + on Symbian + * [QTBUG-19180] Simplify texture pooling in GL graphics system + * [QTBUG-18850] Fix orientation change. Current behaviour results to + black screen + * [QTBUG-15254] Implement QPixmap::fromSymbianRSgImage() in the + OpenGL graphics system + * [QTBUG-18209] Native image handle provider support in QGLPixmapData + * [QTBUG-18270] Use destroyed swap behaviour in GL graphics system + on Symbian + * [QTBUG-15252] Implement CFbsBitmap backend for QPixmap in OpenGL + graphics system on Symbian + * [QTBUG-17850] Implement GL graphics system releaseCachedResources() + * [QTBUG-15253] Verify that applications using the OpenGL graphics + system on Symbian consume zero graphics memory when they are + not visible + * [QTBUG-16977] Symbian: Implement QPixmap::fromSymbianCFbsBitmap() in + the OpenGL graphics system + * [QTBUG-16949] Symbian: Recreate EGL surface on native window resize + - gui + * [QTBUG-20255] Regression: Some QMenus are shown completely transparent + in Symbian + * [QTBUG-20240] Regression: QS60Style - All standardIcons are drawn as + "small icons" + * [QTBUG-20813] Disabled splitscreen translation still moves screen + * [QTBUG-20034] Splitview - Auto-translation should translate as + little as possible to ensure visibility of the cursor + * [QTBUG-20007] Symbian: Do not add linked fonts to the QFontDatabase + * [QTBUG-19911] Orientation change causes unnecessary resizes to top + level window on Symbian + * [QTBUG-19880] Drawing a QPixmap to QImage causes a deep copy on + Symbian + * [QTBUG-19864] Predicted word is duplicated when doing an orientation + switch + * [QTBUG-19856] Doing an orientation change while in splitview mode + and closing VKB causes QGraphicsView to be incorrectly resized + * [QTBUG-19782] UI of the QWidget based applications those uses + QGroupBoxs are mess up in latest Symbian RND release + * [QTBUG-19734] KERN-EXEC 3 panic in + QCoeFepInputContext::translateInputWidget() method + * [QTBUG-19689] Textinput: last word inputted was duplicated after + press "Password" button + * [QTBUG-19578] Fix BCM2727 detection function on Symbian + * [QTBUG-19528] Opening symbol menu while typing with prediction on + causes issues + * [QTBUG-19471] Using QFileDialog crashes in Symbian + * [QTBUG-19104] while setting a softkey action in a qt application + on symbian, the icon specified only is shown partially + * [QTBUG-19043] Fullscreen main window with softkeys initially layouts + using full screen dimensions instead of client area dimensions + * [QTBUG-18863] QS60Style: compiling simulated style crashes due to + missing placeHolderTexture implementation + * [QTBUG-18493] Qt reserves graphics resources when launching application + directly to background + * [QTBUG-18486] Control pane (RSK Cancel) of the test note is covered by + "Options, Exit" when re-launching the application from Open applications + list + * [QTBUG-18409] If fullscreen application without softkeys opens a + fullscreen child dialog with softkeys, once the child dialog closes, + softkeys remain visible on applicaiton main screen. + * [QTBUG-17874] autotest failure between Qt 4.6.3 and Qt 4.7.2 in + QLinearGradient::setStops method on Symbian^3 platform + * [QTBUG-17844] Different point size for the font created using QFont + class and returned by QFontDialog + * [QTBUG-16857] Black corners around popup menu in Symbian^3 + * [QTBUG-16785] QML app: After layout switch the focused text input field + is not visible on Split view + * [QTBUG-15031] Predictive text is not committed when writing in a QLineEdit + * [QTBUG-14058] Wrong availableGeometry detected in Symbian + * [QTBUG-17576] GraphicsViews: Focused widget is not visible after + orientation change + * [QTBUG-17930] Regression: Theme background in style is incorrect + * [QTBUG-18024] Don't use EGL surfaces for translucency with 32MB GPU chip + * [QTBUG-17984] QML application: focused text input field is not visible + when split view is opened + - declarative + * [QTBUG-20218] Symbian 5.3: QML text edit components are sending + software input panel requests + * [QTBUG-19821] Flickr: There is gridding on picture + * [QTBUG-19669] All events that QDeclarativeDebugTrace shows on + Symbian are of duration '0' + * [QTBUG-18869] Compilation breakage for Symbian (qmltooling) + * [QTBUG-18549] Animation timer seems to take too long time to expire + during scrolling a qml list in Symbian device. + * [QTBUG-17592] qml.pri causes havoc on Symbian 3.2 and 5.0 + - network + * [QTBUG-18795] QNetworkConfigurationManager::allConfigurations + (QNetworkConfiguration::Active) not returning any active configuration + when instantiated and called from Secondary thread + * [QTBUG-18722] QDesktopServices::openUrl() doesn't handle URL encodings + correctly + * [QTBUG-18572] Crash with KERN-EXEC 0 when + QNetworkConfigurationManagerPrivate fails to connect + - corelib + * [QTBUG-17776] Qmlviewer: qmlviewer will crash after closing the + application "flickr demo" + **************************************************************************** * Tools * **************************************************************************** + - [QTBUG-18595] Enable remote debugging for qmlviewer + - [QTBUG-18063] qdoc3 depends on private header files from QML + - [QTBUG-16462] qdoc3 segfaults due to a uninitialized member variable + when using the WebXML output. -- cgit v0.12 From 1087a8101dbfd9baaabc5baf87696f0eaca61105 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 19 Aug 2011 13:26:53 +0200 Subject: uikit: Use correct pixmap data format. --- src/plugins/platforms/uikit/quikitscreen.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index d7d8207..3c1e360 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -56,7 +56,7 @@ QUIKitScreen::QUIKitScreen(int screenIndex) CGRect bounds = [uiScreen() bounds]; m_geometry = QRect(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height); - m_format = QImage::Format_ARGB32; + m_format = QImage::Format_ARGB32_Premultiplied; m_depth = 24; -- cgit v0.12 From aaf94776ce1034ec2b2402b9ca0e5cf7c7848b12 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 19 Aug 2011 13:46:51 +0200 Subject: Fix QPixmap::grabWindow() on Mac OS X Lion The old approach was not the recommended one and although it worked on Mac OS X 10.6 it did not work on 10.7. The new approach works correctly on 10.6 and 10.7, so the fix is applied for both versions. Task-number: QTBUG-19824 Merge-request: 1332 Reviewed-by: sroedal --- src/gui/image/qpixmap_mac.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 6872cfa..45f00a0 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -841,6 +841,31 @@ static void qt_mac_grabDisplayRect(CGDirectDisplayID display, const QRect &displ } // Returns a pixmap containing the screen contents at rect. +static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect) +{ + const int maxDisplays = 128; // 128 displays should be enough for everyone. + CGDirectDisplayID displays[maxDisplays]; + CGDisplayCount displayCount; + const CGRect cgRect = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()); + const CGDisplayErr err = CGGetDisplaysWithRect(cgRect, maxDisplays, displays, &displayCount); + + if (err && displayCount == 0) + return QPixmap(); + QPixmap windowPixmap(rect.size()); + for (uint i = 0; i < displayCount; ++i) { + const CGRect bounds = CGDisplayBounds(displays[i]); + // Translate to display-local coordinates + QRect displayRect = rect.translated(qRound(-bounds.origin.x), qRound(-bounds.origin.y)); + // Adjust for inverted y axis. + displayRect.moveTop(qRound(bounds.size.height) - displayRect.y() - rect.height()); + QCFType image = CGDisplayCreateImageForRect(displays[i], bounds); + QPixmap pix = QPixmap::fromMacCGImageRef(image); + QPainter painter(&windowPixmap); + painter.drawPixmap(-bounds.origin.x, -bounds.origin.y, pix); + } + return windowPixmap; +} + static QPixmap qt_mac_grabScreenRect(const QRect &rect) { if (!resolveOpenGLSymbols()) @@ -916,7 +941,8 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) QRect rect(globalCoord.x() + x, globalCoord.y() + y, w, h); #ifdef QT_MAC_USE_COCOA - return qt_mac_grabScreenRect(rect); + return (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) ? + qt_mac_grabScreenRect_10_6(rect) : qt_mac_grabScreenRect(rect); #else #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { -- cgit v0.12 From b186288cbf796be662f86ae4d5c70e39ba6afb67 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 19 Aug 2011 14:49:27 +0300 Subject: Exact word bubble doesn't disappear when screen is tapped (fix part 2) Prevent syncing with native side, if input capability changes are pending. Native side seems to be rather touchy about extra events, and might crash if syncing is requested while handling a capability change is on-going. Additionally, only cancel the transaction once. Otherwise cancellation might lead into loop (since we sync the state with native side) that eventually causes the application to crash. Task-number: QTBUG-20919 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_p.h | 1 + src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 9857015..8c30838 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -154,6 +154,7 @@ private: TUint m_textCapabilities; bool m_inDestruction; bool m_pendingInputCapabilitiesChanged; + bool m_pendingTransactionCancel; int m_cursorVisibility; int m_inlinePosition; MFepInlineTextFormatRetriever *m_formatRetriever; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 8bdaa22..9cf4212 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -109,6 +109,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_textCapabilities(TCoeInputCapabilities::EAllText), m_inDestruction(false), m_pendingInputCapabilitiesChanged(false), + m_pendingTransactionCancel(false), m_cursorVisibility(1), m_inlinePosition(0), m_formatRetriever(0), @@ -1074,12 +1075,10 @@ void QCoeFepInputContext::CancelFepInlineEdit() // We are not supposed to ever have a tempPreeditString and a real preedit string // from S60 at the same time, so it should be safe to rely on this test to determine // whether we should honor S60's request to clear the text or not. - if (m_hasTempPreeditString) + if (m_hasTempPreeditString || m_pendingTransactionCancel) return; - // Sync with native side editor state. Native side can then do various operations - // based on editor state, such as removing 'exact word bubble'. - ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState); + m_pendingTransactionCancel = true; QList attributes; QInputMethodEvent event(QLatin1String(""), attributes); @@ -1087,6 +1086,13 @@ void QCoeFepInputContext::CancelFepInlineEdit() m_preeditString.clear(); m_inlinePosition = 0; sendEvent(event); + + // Sync with native side editor state. Native side can then do various operations + // based on editor state, such as removing 'exact word bubble'. + if (!m_pendingInputCapabilitiesChanged) + ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState); + + m_pendingTransactionCancel = false; } TInt QCoeFepInputContext::DocumentLengthForFep() const -- cgit v0.12 From 564e6c02107a8b0db9a818c0a66affe94694ab39 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 19 Aug 2011 13:40:38 +0200 Subject: Fix compilation of qjpeg on MinGW with GCC 4.6 --- src/gui/image/qjpeghandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index 673a6d6..8fea456 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -74,6 +74,11 @@ extern "C" { #endif } +#if defined(JPEG_TRUE) && !defined(HAVE_BOOLEAN) +// this jpeglib.h uses JPEG_boolean +typedef JPEG_boolean boolean; +#endif + QT_BEGIN_NAMESPACE void QT_FASTCALL convert_rgb888_to_rgb32_C(quint32 *dst, const uchar *src, int len) -- cgit v0.12 From 090ff76845ca5b9c61319f359a94cc239b18846b Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Fri, 19 Aug 2011 17:16:35 +0300 Subject: Avoid calling QInputMethod update when adding or removing QGraphicsItems that don't have focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removing item from QGraphicsScene takes longer if focus is in item (and that item is not being removed) with ItemAcceptsInputMethod. update() in QInputContext or in subclasses could be expensive - usually requires inputMethodFocus and a sequence of inputMethodQuery calls to get the state. In MeeGo, additionally, dbus IPC in MInputContext makes it order of magnitude slower. Minor indentation issue in QGraphicsViewPrivate::updateInputMethodSensitivity() Reviewed-by: Samuel Rødal --- src/gui/graphicsview/qgraphicsscene.cpp | 14 ++++++++++---- src/gui/graphicsview/qgraphicsview.cpp | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 27639f9..7925c69 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2688,10 +2688,11 @@ void QGraphicsScene::addItem(QGraphicsItem *item) // Ensure that newly added items that have subfocus set, gain // focus automatically if there isn't a focus item already. - if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) + if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) { item->focusItem()->setFocus(); - - d->updateInputMethodSensitivityInViews(); + // Update input method only if added item got focus + d->updateInputMethodSensitivityInViews(); + } } /*! @@ -2942,6 +2943,9 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) { // ### Refactoring: This function shares much functionality with _q_removeItemLater() Q_D(QGraphicsScene); + + bool wasFocused(item == focusItem()); + if (!item) { qWarning("QGraphicsScene::removeItem: cannot remove 0-item"); return; @@ -2968,7 +2972,9 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) // Deliver post-change notification item->itemChange(QGraphicsItem::ItemSceneHasChanged, newSceneVariant); - d->updateInputMethodSensitivityInViews(); + // Avoid calling input method update if removed item wasn't focused + if (wasFocused) + d->updateInputMethodSensitivityInViews(); } /*! diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 41b07c4..4bfcbb2 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1101,8 +1101,8 @@ void QGraphicsViewPrivate::updateInputMethodSensitivity() if (!proxy) { q->setInputMethodHints(focusItem->inputMethodHints()); } else if (QWidget *widget = proxy->widget()) { - if (QWidget *fw = widget->focusWidget()) - widget = fw; + if (QWidget *fw = widget->focusWidget()) + widget = fw; q->setInputMethodHints(widget->inputMethodHints()); } else { q->setInputMethodHints(0); -- cgit v0.12 From a3f2ac29714744fb7a34aa7789ce89cb58c09de7 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 19 Aug 2011 16:15:57 +0200 Subject: Fix compile issue with Mac OS X 10.5 Reviewed-by: ossi --- src/gui/image/qpixmap_mac.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 45f00a0..8d72a59 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -840,6 +840,7 @@ static void qt_mac_grabDisplayRect(CGDirectDisplayID display, const QRect &displ ptrCGLDestroyContext(glContextObj); // and destroy the context } +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) // Returns a pixmap containing the screen contents at rect. static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect) { @@ -865,6 +866,7 @@ static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect) } return windowPixmap; } +#endif static QPixmap qt_mac_grabScreenRect(const QRect &rect) { @@ -941,8 +943,12 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) QRect rect(globalCoord.x() + x, globalCoord.y() + y, w, h); #ifdef QT_MAC_USE_COCOA - return (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) ? - qt_mac_grabScreenRect_10_6(rect) : qt_mac_grabScreenRect(rect); +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + return qt_mac_grabScreenRect_10_6(rect); + else +#endif + return qt_mac_grabScreenRect(rect); #else #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { -- cgit v0.12 From 71774c738ef466167bac36174948a3aabe0a6811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 22 Aug 2011 09:32:05 +0200 Subject: Fixed lost flushes in raster window surface. Occasionally we get regions with bounding rects outside the widget, so we need to take care to clip against both the native widget and the raster surface's image rect. Task-number: QTBUG-17813 Reviewed-by: Gunnar Sletta --- src/gui/painting/qwindowsurface_raster.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index d972384..15ff044 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -229,7 +229,6 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi QRegion wrgn(rgn); if (!wOffset.isNull()) wrgn.translate(-wOffset); - QRect wbr = wrgn.boundingRect(); if (wrgn.rectCount() != 1) { int num; @@ -237,23 +236,25 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi XSetClipRectangles(X11->display, d_ptr->gc, 0, 0, rects, num, YXBanded); } - QRect br = rgn.boundingRect().translated(offset); + QPoint widgetOffset = offset + wOffset; + QRect clipRect = widget->rect().translated(widgetOffset).intersected(d_ptr->image->image.rect()); + + QRect br = rgn.boundingRect().translated(offset).intersected(clipRect); + QPoint wpos = br.topLeft() - widgetOffset; + #ifndef QT_NO_MITSHM if (d_ptr->image->xshmpm) { XCopyArea(X11->display, d_ptr->image->xshmpm, widget->handle(), d_ptr->gc, - br.x(), br.y(), br.width(), br.height(), wbr.x(), wbr.y()); + br.x(), br.y(), br.width(), br.height(), wpos.x(), wpos.y()); d_ptr->needsSync = true; } else if (d_ptr->image->xshmimg) { - const QImage &src = d->image->image; - br = br.intersected(src.rect()); XShmPutImage(X11->display, widget->handle(), d_ptr->gc, d_ptr->image->xshmimg, - br.x(), br.y(), wbr.x(), wbr.y(), br.width(), br.height(), False); + br.x(), br.y(), wpos.x(), wpos.y(), br.width(), br.height(), False); d_ptr->needsSync = true; } else #endif { const QImage &src = d->image->image; - br = br.intersected(src.rect()); if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) { Q_ASSERT(src.depth() >= 16); const QImage sub_src(src.scanLine(br.y()) + br.x() * (uint(src.depth()) / 8), @@ -262,11 +263,11 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi data->xinfo = widget->x11Info(); data->fromImage(sub_src, Qt::NoOpaqueDetection); QPixmap pm = QPixmap(data); - XCopyArea(X11->display, pm.handle(), widget->handle(), d_ptr->gc, 0 , 0 , br.width(), br.height(), wbr.x(), wbr.y()); + XCopyArea(X11->display, pm.handle(), widget->handle(), d_ptr->gc, 0 , 0 , br.width(), br.height(), wpos.x(), wpos.y()); } else { // qpaintengine_x11.cpp extern void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const QImage &image, Drawable hd, GC gc, Display *dpy, Visual *visual, int depth); - qt_x11_drawImage(br, wbr.topLeft(), src, widget->handle(), d_ptr->gc, X11->display, (Visual *)widget->x11Info().visual(), widget->x11Info().depth()); + qt_x11_drawImage(br, wpos, src, widget->handle(), d_ptr->gc, X11->display, (Visual *)widget->x11Info().visual(), widget->x11Info().depth()); } } @@ -311,7 +312,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi } CGContextClip(context); - QRect r = rgn.boundingRect(); + QRect r = rgn.boundingRect().intersected(d->image->image.rect()); const CGRect area = CGRectMake(r.x(), r.y(), r.width(), r.height()); CGImageRef image = CGBitmapContextCreateImage(d->image->cg); CGImageRef subImage = CGImageCreateWithImageInRect(image, area); -- cgit v0.12 From e828368117ea34bbeac60e910dea170e868a82c3 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 21 Aug 2011 01:59:35 +0400 Subject: don't crash when destroying children this was uncovered by my don't-detach patch. Reviewed-by: ossi --- tools/qdoc3/node.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 683c210..56d76d3 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -545,7 +545,8 @@ void InnerNode::removeFromRelated() */ void InnerNode::deleteChildren() { - qDeleteAll(children); + NodeList childrenCopy = children; // `children` will be changed in ~Node() + qDeleteAll(childrenCopy); } /*! -- cgit v0.12 From d62bb74d329b6ee5f6c52ac26e11bfe9a27f56a0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Jun 2011 14:11:09 +0200 Subject: Added an additional check to workaround an issue on Windows. Reviewed-by: David Boddie Original-patch-by: Friedemann Kleint (cherry picked from commit 8b1654ec6a892e84c1654c9196e80461ee6e92fa) --- tools/qdoc3/cppcodemarker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 9591801..2067716 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -953,7 +953,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, ident += ch; finish = i; readChar(); - } while (isalnum(ch) || ch == '_'); + } while (ch >= 0 && isalnum(ch) || ch == '_'); if (classRegExp.exactMatch(ident)) { tag = QLatin1String("type"); -- cgit v0.12 From c5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 22 Aug 2011 15:16:34 +0200 Subject: Fix problem with grabWindow on Mac OS X 10.6 with Cocoa For some reason the test did not fail locally but fails in the CI system. A manual check of the images from the test shows it should have failed. Reason for this will be investigated separately Reviewed-by: Sergio Ahumada --- src/gui/image/qpixmap_mac.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 8d72a59..3afc724 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -857,9 +857,8 @@ static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect) const CGRect bounds = CGDisplayBounds(displays[i]); // Translate to display-local coordinates QRect displayRect = rect.translated(qRound(-bounds.origin.x), qRound(-bounds.origin.y)); - // Adjust for inverted y axis. - displayRect.moveTop(qRound(bounds.size.height) - displayRect.y() - rect.height()); - QCFType image = CGDisplayCreateImageForRect(displays[i], bounds); + QCFType image = CGDisplayCreateImageForRect(displays[i], + CGRectMake(displayRect.x(), displayRect.y(), displayRect.width(), displayRect.height())); QPixmap pix = QPixmap::fromMacCGImageRef(image); QPainter painter(&windowPixmap); painter.drawPixmap(-bounds.origin.x, -bounds.origin.y, pix); -- cgit v0.12 From 076ac0ee55b54ae3759af76cf5790e31fbd0f7e5 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 22 Aug 2011 17:09:01 +0300 Subject: Symbian: Not possible to catch RequestSoftwareInputPanel in eventFilter Do not consume QEvent::RequestSoftwareInputPanel in QCoeFepInputContext. Task-number: QTBUG-20155 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 9cf4212..bc27c1e 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -360,10 +360,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) if (sControl) { sControl->setIgnoreFocusChanged(false); } - //If m_pointerHandler has already been set, it means that fep inline editing is in progress. - //When this is happening, do not filter out pointer events. - if (!m_pointerHandler) - return true; } } -- cgit v0.12 From 130e906f38dfdbc5be59da3316da35a842a505de Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 23 Aug 2011 09:50:22 +0200 Subject: Spelling fix Reviewed-by: trustme --- tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp b/tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp index d14c75b..4e93663 100644 --- a/tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp +++ b/tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp @@ -154,7 +154,7 @@ void tst_QAbstractSpinBox::task228728_cssselector() { //QAbstractSpinBox does some call to stylehint into his constructor. //so while the stylesheet want to access property, it should not crash - qApp->setStyleSheet("[alignement=\"1\"], [text=\"foo\"] { color:black; }" ); + qApp->setStyleSheet("[alignment=\"1\"], [text=\"foo\"] { color:black; }" ); QSpinBox box; } -- cgit v0.12 From 4748be8f436e2bc13b5755f2ffe2428a338f7239 Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Tue, 23 Aug 2011 10:52:13 +0300 Subject: Revert "Avoid calling QInputMethod update when adding or removing QGraphicsItems that don't have focus" This reverts commit 090ff76845ca5b9c61319f359a94cc239b18846b ... due to failing unit tests. --- src/gui/graphicsview/qgraphicsscene.cpp | 14 ++++---------- src/gui/graphicsview/qgraphicsview.cpp | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 7925c69..27639f9 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2688,11 +2688,10 @@ void QGraphicsScene::addItem(QGraphicsItem *item) // Ensure that newly added items that have subfocus set, gain // focus automatically if there isn't a focus item already. - if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) { + if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) item->focusItem()->setFocus(); - // Update input method only if added item got focus - d->updateInputMethodSensitivityInViews(); - } + + d->updateInputMethodSensitivityInViews(); } /*! @@ -2943,9 +2942,6 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) { // ### Refactoring: This function shares much functionality with _q_removeItemLater() Q_D(QGraphicsScene); - - bool wasFocused(item == focusItem()); - if (!item) { qWarning("QGraphicsScene::removeItem: cannot remove 0-item"); return; @@ -2972,9 +2968,7 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) // Deliver post-change notification item->itemChange(QGraphicsItem::ItemSceneHasChanged, newSceneVariant); - // Avoid calling input method update if removed item wasn't focused - if (wasFocused) - d->updateInputMethodSensitivityInViews(); + d->updateInputMethodSensitivityInViews(); } /*! diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 4bfcbb2..41b07c4 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1101,8 +1101,8 @@ void QGraphicsViewPrivate::updateInputMethodSensitivity() if (!proxy) { q->setInputMethodHints(focusItem->inputMethodHints()); } else if (QWidget *widget = proxy->widget()) { - if (QWidget *fw = widget->focusWidget()) - widget = fw; + if (QWidget *fw = widget->focusWidget()) + widget = fw; q->setInputMethodHints(widget->inputMethodHints()); } else { q->setInputMethodHints(0); -- cgit v0.12