From 20d2b7312456435e5e1a98dba7c2cc96b44fe83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 19 Aug 2009 11:19:28 +0200 Subject: Fixed compile error Apparently I forgot one occurrence. --- examples/xml/streambookmarks/xbelreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/xml/streambookmarks/xbelreader.cpp b/examples/xml/streambookmarks/xbelreader.cpp index 4472f8a..2682d91 100644 --- a/examples/xml/streambookmarks/xbelreader.cpp +++ b/examples/xml/streambookmarks/xbelreader.cpp @@ -95,7 +95,7 @@ void XbelReader::readXBEL() else if (name() == "separator") readSeparator(0); else - readUnknownElement(); + skipCurrentElement(); } } //! [3] -- cgit v0.12 From 03f6459939d7ef0b0d6dedb688880fa36b7d7ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 19 Aug 2009 11:23:25 +0200 Subject: Revert re-adding of readUnknownElement Now that it is really no longer used. QXmlStreamReader::skipCurrentElement replaces it. --- examples/xml/streambookmarks/xbelreader.cpp | 9 --------- examples/xml/streambookmarks/xbelreader.h | 1 - 2 files changed, 10 deletions(-) diff --git a/examples/xml/streambookmarks/xbelreader.cpp b/examples/xml/streambookmarks/xbelreader.cpp index 2682d91..99a7f34 100644 --- a/examples/xml/streambookmarks/xbelreader.cpp +++ b/examples/xml/streambookmarks/xbelreader.cpp @@ -73,15 +73,6 @@ bool XbelReader::read(QIODevice *device) } //! [1] -//! [2] -void XbelReader::readUnknownElement() -{ - while (readNextStartElement()) { - readUnknownElement(); - } -} -//! [2] - //! [3] void XbelReader::readXBEL() { diff --git a/examples/xml/streambookmarks/xbelreader.h b/examples/xml/streambookmarks/xbelreader.h index 80f0a28..2debadc 100644 --- a/examples/xml/streambookmarks/xbelreader.h +++ b/examples/xml/streambookmarks/xbelreader.h @@ -62,7 +62,6 @@ public: private: //! [2] - void readUnknownElement(); void readXBEL(); void readTitle(QTreeWidgetItem *item); void readSeparator(QTreeWidgetItem *item); -- cgit v0.12 From 215969ea20466a6a7eb78cb94723ed6c9d72a08d Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 19 Aug 2009 12:54:11 +0200 Subject: Generate proper license header. --- src/xmlpatterns/parser/createTokenLookup.sh | 47 +++++- src/xmlpatterns/parser/qtokenlookup.cpp | 246 ++++++++++++++++------------ 2 files changed, 189 insertions(+), 104 deletions(-) diff --git a/src/xmlpatterns/parser/createTokenLookup.sh b/src/xmlpatterns/parser/createTokenLookup.sh index a4e1eff..f84ee72 100755 --- a/src/xmlpatterns/parser/createTokenLookup.sh +++ b/src/xmlpatterns/parser/createTokenLookup.sh @@ -1,5 +1,50 @@ +#!/bin/sh outFile="qtokenlookup.cpp" +license=`cat < $outFile + # Watch out, the --output option is not supported in the # gperf version that apt-get pulls in on Mac OS X. -gperf TokenLookup.gperf > $outFile +gperf TokenLookup.gperf >> $outFile diff --git a/src/xmlpatterns/parser/qtokenlookup.cpp b/src/xmlpatterns/parser/qtokenlookup.cpp index 6e9c343..6bd1121 100644 --- a/src/xmlpatterns/parser/qtokenlookup.cpp +++ b/src/xmlpatterns/parser/qtokenlookup.cpp @@ -1,4 +1,44 @@ -/* C++ code produced by gperf version 3.0.2 */ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/* C++ code produced by gperf version 3.0.3 */ /* Command-line: gperf TokenLookup.gperf */ /* Computed positions: -k'1,3,$' */ @@ -29,7 +69,7 @@ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif -#line 80 "TokenLookup.gperf" +#line 107 "TokenLookup.gperf" QT_BEGIN_NAMESPACE @@ -37,7 +77,7 @@ QT_BEGIN_NAMESPACE namespace QPatternist { -#line 74 "TokenLookup.gperf" +#line 101 "TokenLookup.gperf" struct TokenMap { const char *name; @@ -120,255 +160,255 @@ TokenLookup::value (register const char *str, register unsigned int len) static const struct TokenMap wordlist[] = { {"",ERROR}, {"",ERROR}, -#line 125 "TokenLookup.gperf" +#line 152 "TokenLookup.gperf" {"eq", EQ}, {"",ERROR}, -#line 103 "TokenLookup.gperf" +#line 130 "TokenLookup.gperf" {"by", BY}, -#line 126 "TokenLookup.gperf" +#line 153 "TokenLookup.gperf" {"every", EVERY}, {"",ERROR}, -#line 96 "TokenLookup.gperf" +#line 123 "TokenLookup.gperf" {"as", AS}, {"",ERROR}, -#line 121 "TokenLookup.gperf" +#line 148 "TokenLookup.gperf" {"else", ELSE}, -#line 190 "TokenLookup.gperf" +#line 217 "TokenLookup.gperf" {"where", WHERE}, -#line 177 "TokenLookup.gperf" +#line 204 "TokenLookup.gperf" {"stable", STABLE}, -#line 99 "TokenLookup.gperf" +#line 126 "TokenLookup.gperf" {"at", AT}, {"",ERROR}, -#line 104 "TokenLookup.gperf" +#line 131 "TokenLookup.gperf" {"case", CASE}, {"",ERROR}, -#line 102 "TokenLookup.gperf" +#line 129 "TokenLookup.gperf" {"boundary-space", BOUNDARY_SPACE}, -#line 120 "TokenLookup.gperf" +#line 147 "TokenLookup.gperf" {"element", ELEMENT}, -#line 105 "TokenLookup.gperf" +#line 132 "TokenLookup.gperf" {"castable", CASTABLE}, -#line 100 "TokenLookup.gperf" +#line 127 "TokenLookup.gperf" {"attribute", ATTRIBUTE}, {"",ERROR}, -#line 127 "TokenLookup.gperf" +#line 154 "TokenLookup.gperf" {"except", EXCEPT}, -#line 134 "TokenLookup.gperf" +#line 161 "TokenLookup.gperf" {"ge", GE}, {"",ERROR}, -#line 106 "TokenLookup.gperf" +#line 133 "TokenLookup.gperf" {"cast", CAST}, -#line 183 "TokenLookup.gperf" +#line 210 "TokenLookup.gperf" {"treat", TREAT}, -#line 191 "TokenLookup.gperf" +#line 218 "TokenLookup.gperf" {"xquery", XQUERY}, -#line 154 "TokenLookup.gperf" +#line 181 "TokenLookup.gperf" {"ne", NE}, {"",ERROR}, -#line 171 "TokenLookup.gperf" +#line 198 "TokenLookup.gperf" {"satisfies", SATISFIES}, {"",ERROR}, {"",ERROR}, -#line 136 "TokenLookup.gperf" +#line 163 "TokenLookup.gperf" {"gt", GT}, -#line 124 "TokenLookup.gperf" +#line 151 "TokenLookup.gperf" {"encoding", ENCODING}, -#line 97 "TokenLookup.gperf" +#line 124 "TokenLookup.gperf" {"ascending", ASCENDING}, {"",ERROR}, -#line 98 "TokenLookup.gperf" +#line 125 "TokenLookup.gperf" {"assign", ASSIGN}, -#line 112 "TokenLookup.gperf" +#line 139 "TokenLookup.gperf" {"declare", DECLARE}, -#line 135 "TokenLookup.gperf" +#line 162 "TokenLookup.gperf" {"greatest", GREATEST}, -#line 181 "TokenLookup.gperf" +#line 208 "TokenLookup.gperf" {"then", THEN}, {"",ERROR}, -#line 94 "TokenLookup.gperf" +#line 121 "TokenLookup.gperf" {"ancestor-or-self", ANCESTOR_OR_SELF}, -#line 148 "TokenLookup.gperf" +#line 175 "TokenLookup.gperf" {"le", LE}, -#line 119 "TokenLookup.gperf" +#line 146 "TokenLookup.gperf" {"document-node", DOCUMENT_NODE}, -#line 180 "TokenLookup.gperf" +#line 207 "TokenLookup.gperf" {"text", TEXT}, {"",ERROR}, -#line 174 "TokenLookup.gperf" +#line 201 "TokenLookup.gperf" {"schema", SCHEMA}, {"",ERROR}, -#line 118 "TokenLookup.gperf" +#line 145 "TokenLookup.gperf" {"document", DOCUMENT}, {"",ERROR}, -#line 114 "TokenLookup.gperf" +#line 141 "TokenLookup.gperf" {"descendant", DESCENDANT}, {"",ERROR}, -#line 150 "TokenLookup.gperf" +#line 177 "TokenLookup.gperf" {"lt", LT}, -#line 95 "TokenLookup.gperf" +#line 122 "TokenLookup.gperf" {"and", AND}, -#line 155 "TokenLookup.gperf" +#line 182 "TokenLookup.gperf" {"node", NODE}, -#line 147 "TokenLookup.gperf" +#line 174 "TokenLookup.gperf" {"least", LEAST}, -#line 172 "TokenLookup.gperf" +#line 199 "TokenLookup.gperf" {"schema-attribute", SCHEMA_ATTRIBUTE}, {"",ERROR}, -#line 128 "TokenLookup.gperf" +#line 155 "TokenLookup.gperf" {"external", EXTERNAL}, {"",ERROR}, -#line 116 "TokenLookup.gperf" +#line 143 "TokenLookup.gperf" {"descending", DESCENDING}, -#line 157 "TokenLookup.gperf" +#line 184 "TokenLookup.gperf" {"no-preserve", NO_PRESERVE}, -#line 113 "TokenLookup.gperf" +#line 140 "TokenLookup.gperf" {"default", DEFAULT}, -#line 149 "TokenLookup.gperf" +#line 176 "TokenLookup.gperf" {"let", LET}, -#line 173 "TokenLookup.gperf" +#line 200 "TokenLookup.gperf" {"schema-element", SCHEMA_ELEMENT}, {"",ERROR}, {"",ERROR}, -#line 110 "TokenLookup.gperf" +#line 137 "TokenLookup.gperf" {"construction", CONSTRUCTION}, -#line 115 "TokenLookup.gperf" +#line 142 "TokenLookup.gperf" {"descendant-or-self", DESCENDANT_OR_SELF}, -#line 175 "TokenLookup.gperf" +#line 202 "TokenLookup.gperf" {"self", SELF}, -#line 156 "TokenLookup.gperf" +#line 183 "TokenLookup.gperf" {"no-inherit", NO_INHERIT}, {"",ERROR}, -#line 131 "TokenLookup.gperf" +#line 158 "TokenLookup.gperf" {"follows", FOLLOWS}, -#line 93 "TokenLookup.gperf" +#line 120 "TokenLookup.gperf" {"ancestor", ANCESTOR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 182 "TokenLookup.gperf" +#line 209 "TokenLookup.gperf" {"to", TO}, -#line 133 "TokenLookup.gperf" +#line 160 "TokenLookup.gperf" {"function", FUNCTION}, -#line 108 "TokenLookup.gperf" +#line 135 "TokenLookup.gperf" {"collation", COLLATION}, {"",ERROR}, -#line 178 "TokenLookup.gperf" +#line 205 "TokenLookup.gperf" {"strict", STRICT}, {"",ERROR}, -#line 146 "TokenLookup.gperf" +#line 173 "TokenLookup.gperf" {"lax", LAX}, {"",ERROR}, -#line 122 "TokenLookup.gperf" +#line 149 "TokenLookup.gperf" {"empty", EMPTY}, {"",ERROR}, -#line 158 "TokenLookup.gperf" +#line 185 "TokenLookup.gperf" {"of", OF}, -#line 168 "TokenLookup.gperf" +#line 195 "TokenLookup.gperf" {"preserve", PRESERVE}, -#line 129 "TokenLookup.gperf" +#line 156 "TokenLookup.gperf" {"following", FOLLOWING}, {"",ERROR}, {"",ERROR}, -#line 144 "TokenLookup.gperf" +#line 171 "TokenLookup.gperf" {"is", IS}, -#line 165 "TokenLookup.gperf" +#line 192 "TokenLookup.gperf" {"precedes", PRECEDES}, -#line 123 "TokenLookup.gperf" +#line 150 "TokenLookup.gperf" {"empty-sequence", EMPTY_SEQUENCE}, {"",ERROR}, {"",ERROR}, -#line 130 "TokenLookup.gperf" +#line 157 "TokenLookup.gperf" {"following-sibling", FOLLOWING_SIBLING}, -#line 142 "TokenLookup.gperf" +#line 169 "TokenLookup.gperf" {"instance", INSTANCE}, -#line 186 "TokenLookup.gperf" +#line 213 "TokenLookup.gperf" {"unordered", UNORDERED}, -#line 101 "TokenLookup.gperf" +#line 128 "TokenLookup.gperf" {"base-uri", BASEURI}, -#line 170 "TokenLookup.gperf" +#line 197 "TokenLookup.gperf" {"return", RETURN}, {"",ERROR}, -#line 187 "TokenLookup.gperf" +#line 214 "TokenLookup.gperf" {"validate", VALIDATE}, {"",ERROR}, -#line 111 "TokenLookup.gperf" +#line 138 "TokenLookup.gperf" {"copy-namespaces", COPY_NAMESPACES}, -#line 159 "TokenLookup.gperf" +#line 186 "TokenLookup.gperf" {"option", OPTION}, -#line 138 "TokenLookup.gperf" +#line 165 "TokenLookup.gperf" {"if", IF}, {"",ERROR}, -#line 166 "TokenLookup.gperf" +#line 193 "TokenLookup.gperf" {"preceding", PRECEDING}, {"",ERROR}, {"",ERROR}, -#line 141 "TokenLookup.gperf" +#line 168 "TokenLookup.gperf" {"in", IN}, {"",ERROR}, -#line 143 "TokenLookup.gperf" +#line 170 "TokenLookup.gperf" {"intersect", INTERSECT}, -#line 185 "TokenLookup.gperf" +#line 212 "TokenLookup.gperf" {"union", UNION}, {"",ERROR}, -#line 167 "TokenLookup.gperf" +#line 194 "TokenLookup.gperf" {"preceding-sibling", PRECEDING_SIBLING}, -#line 161 "TokenLookup.gperf" +#line 188 "TokenLookup.gperf" {"ordering", ORDERING}, -#line 176 "TokenLookup.gperf" +#line 203 "TokenLookup.gperf" {"some", SOME}, -#line 107 "TokenLookup.gperf" +#line 134 "TokenLookup.gperf" {"child", CHILD}, {"",ERROR}, -#line 160 "TokenLookup.gperf" +#line 187 "TokenLookup.gperf" {"ordered", ORDERED}, -#line 188 "TokenLookup.gperf" +#line 215 "TokenLookup.gperf" {"variable", VARIABLE}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 163 "TokenLookup.gperf" +#line 190 "TokenLookup.gperf" {"or", OR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 109 "TokenLookup.gperf" +#line 136 "TokenLookup.gperf" {"comment", COMMENT}, {"",ERROR}, {"",ERROR}, -#line 184 "TokenLookup.gperf" +#line 211 "TokenLookup.gperf" {"typeswitch", TYPESWITCH}, {"",ERROR}, -#line 140 "TokenLookup.gperf" +#line 167 "TokenLookup.gperf" {"inherit", INHERIT}, -#line 117 "TokenLookup.gperf" +#line 144 "TokenLookup.gperf" {"div", DIV}, {"",ERROR}, {"",ERROR}, -#line 152 "TokenLookup.gperf" +#line 179 "TokenLookup.gperf" {"module", MODULE}, {"",ERROR}, -#line 132 "TokenLookup.gperf" +#line 159 "TokenLookup.gperf" {"for", FOR}, -#line 153 "TokenLookup.gperf" +#line 180 "TokenLookup.gperf" {"namespace", NAMESPACE}, {"",ERROR}, {"",ERROR}, -#line 189 "TokenLookup.gperf" +#line 216 "TokenLookup.gperf" {"version", VERSION}, {"",ERROR}, {"",ERROR}, -#line 179 "TokenLookup.gperf" +#line 206 "TokenLookup.gperf" {"strip", STRIP}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 162 "TokenLookup.gperf" +#line 189 "TokenLookup.gperf" {"order", ORDER}, -#line 164 "TokenLookup.gperf" +#line 191 "TokenLookup.gperf" {"parent", PARENT}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 151 "TokenLookup.gperf" +#line 178 "TokenLookup.gperf" {"mod", MOD}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 139 "TokenLookup.gperf" +#line 166 "TokenLookup.gperf" {"import", IMPORT}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 169 "TokenLookup.gperf" +#line 196 "TokenLookup.gperf" {"processing-instruction", PROCESSING_INSTRUCTION}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 145 "TokenLookup.gperf" +#line 172 "TokenLookup.gperf" {"item", ITEM}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, @@ -378,7 +418,7 @@ TokenLookup::value (register const char *str, register unsigned int len) {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR}, -#line 137 "TokenLookup.gperf" +#line 164 "TokenLookup.gperf" {"idiv", IDIV} }; @@ -396,7 +436,7 @@ TokenLookup::value (register const char *str, register unsigned int len) } return 0; } -#line 192 "TokenLookup.gperf" +#line 219 "TokenLookup.gperf" } /* Close the QPatternist namespace. */ -- cgit v0.12 From f50439ac2bd701f88eb7843fccbbf885c3528a54 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 19 Aug 2009 13:30:18 +0200 Subject: Make the license test pass. This is partly done to address a review comment for S60. Reviewed-by: Marius SO Reviewed-by: Paul --- demos/embedded/fluidlauncher/pictureflow.cpp | 2 + examples/qws/dbscreen/dbscreen.cpp | 21 +++++----- examples/qws/dbscreen/dbscreendriverplugin.cpp | 23 +++++------ qmake/generators/unix/unixmake.cpp | 19 ++++----- src/corelib/concurrent/qtconcurrentmap.cpp | 2 +- src/gui/itemviews/qlistview.cpp | 2 +- src/gui/kernel/qt_mac.cpp | 19 ++++----- src/gui/widgets/qdatetimeedit.cpp | 2 +- tests/auto/gestures/customgesturerecognizer.cpp | 41 +++++++++++++++++++ tests/auto/headers/tst_headers.cpp | 3 ++ tests/auto/mediaobject/dummy/audiooutput.cpp | 41 +++++++++++++++++++ tests/auto/mediaobject/dummy/backend.cpp | 41 +++++++++++++++++++ tests/auto/mediaobject/dummy/mediaobject.cpp | 41 +++++++++++++++++++ tests/auto/mediaobject/dummy/videowidget.cpp | 41 +++++++++++++++++++ tests/auto/qstate/tst_qstate.cpp | 34 ++++++++++++++++ tests/auto/qstringbuilder/scenario1.cpp | 41 +++++++++++++++++++ tests/auto/qstringbuilder/scenario2.cpp | 41 +++++++++++++++++++ tests/auto/qstringbuilder/scenario3.cpp | 41 +++++++++++++++++++ tests/auto/qstringbuilder/scenario4.cpp | 41 +++++++++++++++++++ tests/auto/qxmlschema/tst_qxmlschema.cpp | 36 ++++++++++++++++- .../tst_qxmlschemavalidator.cpp | 36 ++++++++++++++++- tests/auto/windowsmobile/test/ddhelper.cpp | 40 +++++++++++++++++++ tests/auto/windowsmobile/testQMenuBar/main.cpp | 41 +++++++++++++++++++ .../xmlpatternsschema/tst_xmlpatternsschema.cpp | 42 +++++++++++++++++++- .../tst_xmlpatternsschemats.cpp | 36 ++++++++++++++++- .../tst_xmlpatternsvalidator.cpp | 34 ++++++++++++++++ tests/benchmarks/qanimation/dummyanimation.cpp | 41 +++++++++++++++++++ tests/benchmarks/qanimation/dummyobject.cpp | 43 +++++++++++++++++++- tests/benchmarks/qanimation/main.cpp | 41 +++++++++++++++++++ tests/benchmarks/qanimation/rectanimation.cpp | 41 +++++++++++++++++++ tests/benchmarks/qdir/tst_qdir.cpp | 41 +++++++++++++++++++ .../benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp | 34 ++++++++++++++++ .../qgraphicswidget/tst_qgraphicswidget.cpp | 34 ++++++++++++++++ tests/benchmarks/qstringbuilder/main.cpp | 40 +++++++++++++++++++ tests/manual/qtabletevent/main.cpp | 41 +++++++++++++++++++ tests/manual/qtabletevent/tabletwidget.cpp | 41 +++++++++++++++++++ tests/manual/qtouchevent/main.cpp | 41 +++++++++++++++++++ tests/manual/qtouchevent/touchwidget.cpp | 41 +++++++++++++++++++ tools/linguist/tests/data/main.cpp | 40 +++++++++++++++++++ tools/linguist/tests/tst_linguist.cpp | 41 +++++++++++++++++++ tools/linguist/tests/tst_lupdate.cpp | 46 ++++++++++++++++++---- tools/linguist/tests/tst_simtexth.cpp | 46 ++++++++++++++++++---- tools/xmlpatterns/main.cpp | 2 +- tools/xmlpatterns/qcoloroutput.cpp | 18 ++++----- tools/xmlpatternsvalidator/main.cpp | 2 +- util/qlalr/compress.cpp | 2 +- util/qlalr/dotgraph.cpp | 2 +- util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp | 40 +++++++++++++++++++ util/qlalr/examples/lambda/main.cpp | 40 +++++++++++++++++++ util/qlalr/examples/qparser/qparser.cpp | 40 +++++++++++++++++++ util/qlalr/grammar.cpp | 2 +- util/qlalr/lalr.cpp | 2 +- util/qlalr/main.cpp | 2 +- util/qlalr/parsetable.cpp | 2 +- util/qlalr/recognizer.cpp | 3 +- 55 files changed, 1479 insertions(+), 91 deletions(-) diff --git a/demos/embedded/fluidlauncher/pictureflow.cpp b/demos/embedded/fluidlauncher/pictureflow.cpp index f0fedf4..2173b28 100644 --- a/demos/embedded/fluidlauncher/pictureflow.cpp +++ b/demos/embedded/fluidlauncher/pictureflow.cpp @@ -3,6 +3,8 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the QtGui module of the Qt Toolkit. +** ** This is a version of the Pictureflow animated image show widget modified by Nokia. ** ** $QT_BEGIN_LICENSE:LGPL$ diff --git a/examples/qws/dbscreen/dbscreen.cpp b/examples/qws/dbscreen/dbscreen.cpp index 86c34cd..fb6897c 100644 --- a/examples/qws/dbscreen/dbscreen.cpp +++ b/examples/qws/dbscreen/dbscreen.cpp @@ -1,11 +1,11 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions @@ -36,11 +36,8 @@ ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include "dbscreen.h" #include diff --git a/examples/qws/dbscreen/dbscreendriverplugin.cpp b/examples/qws/dbscreen/dbscreendriverplugin.cpp index 6f11198..9190753 100644 --- a/examples/qws/dbscreen/dbscreendriverplugin.cpp +++ b/examples/qws/dbscreen/dbscreendriverplugin.cpp @@ -1,11 +1,11 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions @@ -36,12 +36,9 @@ ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ - +** +****************************************************************************/ + #include #include "dbscreen.h" diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 626b955a5..dfbf8ee 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -1,11 +1,11 @@ /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the qmake application of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions @@ -36,11 +36,8 @@ ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include "unixmake.h" #include "option.h" diff --git a/src/corelib/concurrent/qtconcurrentmap.cpp b/src/corelib/concurrent/qtconcurrentmap.cpp index 3fd044d..243921a 100644 --- a/src/corelib/concurrent/qtconcurrentmap.cpp +++ b/src/corelib/concurrent/qtconcurrentmap.cpp @@ -1,4 +1,4 @@ - /**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index e9e365f..cc9d643 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) diff --git a/src/gui/kernel/qt_mac.cpp b/src/gui/kernel/qt_mac.cpp index 642aa5c..bef3449 100644 --- a/src/gui/kernel/qt_mac.cpp +++ b/src/gui/kernel/qt_mac.cpp @@ -1,11 +1,11 @@ /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the QtGui module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions @@ -36,11 +36,8 @@ ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include #include diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index 0fca0b7..7eb9eb5 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -1,4 +1,4 @@ -/****************************************************************************) +/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) diff --git a/tests/auto/gestures/customgesturerecognizer.cpp b/tests/auto/gestures/customgesturerecognizer.cpp index 12d07b1..6c2389c 100644 --- a/tests/auto/gestures/customgesturerecognizer.cpp +++ b/tests/auto/gestures/customgesturerecognizer.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "customgesturerecognizer.h" #include "qgesture.h" diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp index f5a11f4..05cb205 100644 --- a/tests/auto/headers/tst_headers.cpp +++ b/tests/auto/headers/tst_headers.cpp @@ -139,6 +139,9 @@ void tst_Headers::allSourceFilesData() || sourceFile.contains("/config.tests/") || sourceFile.contains("/snippets/") || sourceFile.contains("linguist/lupdate/testdata") + || sourceFile.contains("testdata/bundle-spaces/main.cpp") + || sourceFile.contains("demos/embedded/fluidlauncher/pictureflow.cpp") + || sourceFile.contains("tools/porting/src/") || sourceFile.contains("/fulltextsearch/")) continue; diff --git a/tests/auto/mediaobject/dummy/audiooutput.cpp b/tests/auto/mediaobject/dummy/audiooutput.cpp index 41b473d..cb59eea 100644 --- a/tests/auto/mediaobject/dummy/audiooutput.cpp +++ b/tests/auto/mediaobject/dummy/audiooutput.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "audiooutput.h" #include "backend.h" #include diff --git a/tests/auto/mediaobject/dummy/backend.cpp b/tests/auto/mediaobject/dummy/backend.cpp index 53f3896..44a867d 100644 --- a/tests/auto/mediaobject/dummy/backend.cpp +++ b/tests/auto/mediaobject/dummy/backend.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "audiooutput.h" #include "mediaobject.h" #include "videowidget.h" diff --git a/tests/auto/mediaobject/dummy/mediaobject.cpp b/tests/auto/mediaobject/dummy/mediaobject.cpp index 521e3a6..d2ed7af 100644 --- a/tests/auto/mediaobject/dummy/mediaobject.cpp +++ b/tests/auto/mediaobject/dummy/mediaobject.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "mediaobject.h" #include "backend.h" diff --git a/tests/auto/mediaobject/dummy/videowidget.cpp b/tests/auto/mediaobject/dummy/videowidget.cpp index 890363f..2e26bda 100644 --- a/tests/auto/mediaobject/dummy/videowidget.cpp +++ b/tests/auto/mediaobject/dummy/videowidget.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "videowidget.h" #include #include diff --git a/tests/auto/qstate/tst_qstate.cpp b/tests/auto/qstate/tst_qstate.cpp index 43ea7fe..141e1aa 100644 --- a/tests/auto/qstate/tst_qstate.cpp +++ b/tests/auto/qstate/tst_qstate.cpp @@ -3,6 +3,40 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/auto/qstringbuilder/scenario1.cpp b/tests/auto/qstringbuilder/scenario1.cpp index 26b4ed3..9159649 100644 --- a/tests/auto/qstringbuilder/scenario1.cpp +++ b/tests/auto/qstringbuilder/scenario1.cpp @@ -1 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario2.cpp b/tests/auto/qstringbuilder/scenario2.cpp index 26b4ed3..9159649 100644 --- a/tests/auto/qstringbuilder/scenario2.cpp +++ b/tests/auto/qstringbuilder/scenario2.cpp @@ -1 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario3.cpp b/tests/auto/qstringbuilder/scenario3.cpp index 26b4ed3..9159649 100644 --- a/tests/auto/qstringbuilder/scenario3.cpp +++ b/tests/auto/qstringbuilder/scenario3.cpp @@ -1 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario4.cpp b/tests/auto/qstringbuilder/scenario4.cpp index 26b4ed3..25f7932 100644 --- a/tests/auto/qstringbuilder/scenario4.cpp +++ b/tests/auto/qstringbuilder/scenario4.cpp @@ -1 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qxmlschema/tst_qxmlschema.cpp b/tests/auto/qxmlschema/tst_qxmlschema.cpp index b681737..95a130d 100644 --- a/tests/auto/qxmlschema/tst_qxmlschema.cpp +++ b/tests/auto/qxmlschema/tst_qxmlschema.cpp @@ -1,8 +1,42 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp index 4edb6a3..0a0248c 100644 --- a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp +++ b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp @@ -1,8 +1,42 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/auto/windowsmobile/test/ddhelper.cpp b/tests/auto/windowsmobile/test/ddhelper.cpp index 5955cd3..482f8dd 100644 --- a/tests/auto/windowsmobile/test/ddhelper.cpp +++ b/tests/auto/windowsmobile/test/ddhelper.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #ifdef Q_OS_WINCE_WM diff --git a/tests/auto/windowsmobile/testQMenuBar/main.cpp b/tests/auto/windowsmobile/testQMenuBar/main.cpp index 4a3b3b2..4949dbb 100644 --- a/tests/auto/windowsmobile/testQMenuBar/main.cpp +++ b/tests/auto/windowsmobile/testQMenuBar/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include #include diff --git a/tests/auto/xmlpatternsschema/tst_xmlpatternsschema.cpp b/tests/auto/xmlpatternsschema/tst_xmlpatternsschema.cpp index 030e9c0..d67db76 100644 --- a/tests/auto/xmlpatternsschema/tst_xmlpatternsschema.cpp +++ b/tests/auto/xmlpatternsschema/tst_xmlpatternsschema.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include @@ -51,7 +91,7 @@ bool tst_XMLPatternsSchema::runTest(const QVector &lis { machine.reset(); for (int i = 0; i < list.count(); ++i) { - if (!machine.proceed(list.at(i))) + if (!machine.proceed(list.at(i))) return false; } if (!machine.inEndState()) diff --git a/tests/auto/xmlpatternsschemats/tst_xmlpatternsschemats.cpp b/tests/auto/xmlpatternsschemats/tst_xmlpatternsschemats.cpp index 2747ae3..069d2b2 100644 --- a/tests/auto/xmlpatternsschemats/tst_xmlpatternsschemats.cpp +++ b/tests/auto/xmlpatternsschemats/tst_xmlpatternsschemats.cpp @@ -1,8 +1,42 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp index 7d9f638..1775fea 100644 --- a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp +++ b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp @@ -3,6 +3,40 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/benchmarks/qanimation/dummyanimation.cpp b/tests/benchmarks/qanimation/dummyanimation.cpp index 6fb1d0a..53c42b0 100644 --- a/tests/benchmarks/qanimation/dummyanimation.cpp +++ b/tests/benchmarks/qanimation/dummyanimation.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "dummyanimation.h" #include "dummyobject.h" diff --git a/tests/benchmarks/qanimation/dummyobject.cpp b/tests/benchmarks/qanimation/dummyobject.cpp index bd76388..10b24e2 100644 --- a/tests/benchmarks/qanimation/dummyobject.cpp +++ b/tests/benchmarks/qanimation/dummyobject.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "dummyobject.h" DummyObject::DummyObject() @@ -9,7 +50,7 @@ QRect DummyObject::rect() const return m_rect; } -void DummyObject::setRect(const QRect &r) +void DummyObject::setRect(const QRect &r) { m_rect = r; } diff --git a/tests/benchmarks/qanimation/main.cpp b/tests/benchmarks/qanimation/main.cpp index 7bb770f..5c9fa41 100644 --- a/tests/benchmarks/qanimation/main.cpp +++ b/tests/benchmarks/qanimation/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include diff --git a/tests/benchmarks/qanimation/rectanimation.cpp b/tests/benchmarks/qanimation/rectanimation.cpp index d60a943..75ba476 100644 --- a/tests/benchmarks/qanimation/rectanimation.cpp +++ b/tests/benchmarks/qanimation/rectanimation.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "rectanimation.h" #include "dummyobject.h" diff --git a/tests/benchmarks/qdir/tst_qdir.cpp b/tests/benchmarks/qdir/tst_qdir.cpp index 7977e28..474848d 100644 --- a/tests/benchmarks/qdir/tst_qdir.cpp +++ b/tests/benchmarks/qdir/tst_qdir.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #ifdef Q_OS_WIN diff --git a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp index ee27ebe..923838a 100644 --- a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp @@ -3,6 +3,40 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp index 6f47181..07d8312 100644 --- a/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp @@ -3,6 +3,40 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** ****************************************************************************/ #include diff --git a/tests/benchmarks/qstringbuilder/main.cpp b/tests/benchmarks/qstringbuilder/main.cpp index 8b769a6..b1d4165 100644 --- a/tests/benchmarks/qstringbuilder/main.cpp +++ b/tests/benchmarks/qstringbuilder/main.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ // Select one of the scenarios below #define SCENARIO 1 diff --git a/tests/manual/qtabletevent/main.cpp b/tests/manual/qtabletevent/main.cpp index 4014d58..cc8003c 100644 --- a/tests/manual/qtabletevent/main.cpp +++ b/tests/manual/qtabletevent/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include "tabletwidget.h" diff --git a/tests/manual/qtabletevent/tabletwidget.cpp b/tests/manual/qtabletevent/tabletwidget.cpp index 4d6a365..0334706 100644 --- a/tests/manual/qtabletevent/tabletwidget.cpp +++ b/tests/manual/qtabletevent/tabletwidget.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tabletwidget.h" #include #include diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp index 8097ab0..6449b6d 100644 --- a/tests/manual/qtouchevent/main.cpp +++ b/tests/manual/qtouchevent/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include diff --git a/tests/manual/qtouchevent/touchwidget.cpp b/tests/manual/qtouchevent/touchwidget.cpp index a8141cc..62564a1 100644 --- a/tests/manual/qtouchevent/touchwidget.cpp +++ b/tests/manual/qtouchevent/touchwidget.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "touchwidget.h" #include diff --git a/tools/linguist/tests/data/main.cpp b/tools/linguist/tests/data/main.cpp index ebbda0a..6e09e3e 100644 --- a/tools/linguist/tests/data/main.cpp +++ b/tools/linguist/tests/data/main.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include diff --git a/tools/linguist/tests/tst_linguist.cpp b/tools/linguist/tests/tst_linguist.cpp index 199ddbb..c3f4eb6 100644 --- a/tools/linguist/tests/tst_linguist.cpp +++ b/tools/linguist/tests/tst_linguist.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_linguist.h" #include "moc_tst_linguist.cpp" diff --git a/tools/linguist/tests/tst_lupdate.cpp b/tools/linguist/tests/tst_lupdate.cpp index d3b7a1c..4114bf9 100644 --- a/tools/linguist/tests/tst_lupdate.cpp +++ b/tools/linguist/tests/tst_lupdate.cpp @@ -1,13 +1,43 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include diff --git a/tools/linguist/tests/tst_simtexth.cpp b/tools/linguist/tests/tst_simtexth.cpp index d8315ad..b71896c 100644 --- a/tools/linguist/tests/tst_simtexth.cpp +++ b/tools/linguist/tests/tst_simtexth.cpp @@ -1,13 +1,43 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include diff --git a/tools/xmlpatterns/main.cpp b/tools/xmlpatterns/main.cpp index 1bef118..31b2b6c 100644 --- a/tools/xmlpatterns/main.cpp +++ b/tools/xmlpatterns/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Patternist project on Qt Labs. +** This file is part of the QtXmlPatterns module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/tools/xmlpatterns/qcoloroutput.cpp b/tools/xmlpatterns/qcoloroutput.cpp index d715e71..084a84d 100644 --- a/tools/xmlpatterns/qcoloroutput.cpp +++ b/tools/xmlpatterns/qcoloroutput.cpp @@ -1,10 +1,11 @@ /**************************************************************************** - * ** * ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - * ** - * ** This file is part of the Patternist project on Qt Labs. - * ** - * ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions @@ -35,11 +36,8 @@ ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ - * ** - * ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * ** - * ****************************************************************************/ +** +****************************************************************************/ #include #include diff --git a/tools/xmlpatternsvalidator/main.cpp b/tools/xmlpatternsvalidator/main.cpp index 5a2877f..e6793c1 100644 --- a/tools/xmlpatternsvalidator/main.cpp +++ b/tools/xmlpatternsvalidator/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Patternist project on Qt Labs. +** This file is part of the QtXmlPatterns module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/compress.cpp b/util/qlalr/compress.cpp index efa4fea..3fcd6bf 100644 --- a/util/qlalr/compress.cpp +++ b/util/qlalr/compress.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the test suite module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/dotgraph.cpp b/util/qlalr/dotgraph.cpp index 5f847a9..67359d4 100644 --- a/util/qlalr/dotgraph.cpp +++ b/util/qlalr/dotgraph.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp b/util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp index 54f5e0e..b60e7e2 100644 --- a/util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp +++ b/util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include diff --git a/util/qlalr/examples/lambda/main.cpp b/util/qlalr/examples/lambda/main.cpp index c70f9a5..bfae333 100644 --- a/util/qlalr/examples/lambda/main.cpp +++ b/util/qlalr/examples/lambda/main.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include "lambda.h" diff --git a/util/qlalr/examples/qparser/qparser.cpp b/util/qlalr/examples/qparser/qparser.cpp index 5a18ee2..4e58e14 100644 --- a/util/qlalr/examples/qparser/qparser.cpp +++ b/util/qlalr/examples/qparser/qparser.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the utils module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include "qparser.h" diff --git a/util/qlalr/grammar.cpp b/util/qlalr/grammar.cpp index 26f8378..e5e5618 100644 --- a/util/qlalr/grammar.cpp +++ b/util/qlalr/grammar.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/lalr.cpp b/util/qlalr/lalr.cpp index 797750c..5c4eac2 100644 --- a/util/qlalr/lalr.cpp +++ b/util/qlalr/lalr.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/main.cpp b/util/qlalr/main.cpp index d3a9c7f..acfb7a5 100644 --- a/util/qlalr/main.cpp +++ b/util/qlalr/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/parsetable.cpp b/util/qlalr/parsetable.cpp index bb78d2d..e4eb684 100644 --- a/util/qlalr/parsetable.cpp +++ b/util/qlalr/parsetable.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/util/qlalr/recognizer.cpp b/util/qlalr/recognizer.cpp index 3a590ba..daf371b 100644 --- a/util/qlalr/recognizer.cpp +++ b/util/qlalr/recognizer.cpp @@ -1,10 +1,9 @@ - /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QLALR project on Qt Labs. +** This file is part of the utils of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage -- cgit v0.12 From b26af959573407b3bb4cb657f08b76023554607f Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 18 Aug 2009 15:57:17 +0200 Subject: Don't use pointers to temporary vars that go out of scope. Moved the dummy variable to the same scope as the 'motion' variable. This fixes Coverity defect CID 1528. Reviewed-by: Olivier Goffart Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qapplication_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index d942519..0d07a02 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -4572,6 +4572,7 @@ bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet int deviceType = QTabletEvent::NoDevice; int pointerType = QTabletEvent::UnknownPointer; XEvent mouseMotionEvent; + XEvent dummy; const XDeviceMotionEvent *motion = 0; XDeviceButtonEvent *button = 0; const XProximityNotifyEvent *proximity = 0; @@ -4589,7 +4590,6 @@ bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet // Do event compression. Skip over tablet+mouse move events if there are newer ones. qt_tablet_motion_data tabletMotionData; tabletMotionData.tabletMotionType = tablet->xinput_motion; - XEvent dummy; while (true) { // Find first mouse event since we expect them in pairs inside Qt tabletMotionData.error =false; -- cgit v0.12 From 774543a3336841df4a13d3e283af83cf4b53b966 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 19 Aug 2009 11:35:24 +0200 Subject: Improved the documentation of saving and restoring window geometry. Mentioned in the doc that the preferred way to save/restore a geometry of a QMainWindow is to use both saveGeometry() and saveState(). Reviewed-by: Kavindra Devi Palaraja --- doc/src/howtos/restoring-geometry.qdoc | 39 ++++++++++------------ .../snippets/code/src_gui_widgets_qmainwindow.cpp | 19 +++++++++++ src/gui/widgets/qmainwindow.cpp | 15 ++++++++- 3 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp diff --git a/doc/src/howtos/restoring-geometry.qdoc b/doc/src/howtos/restoring-geometry.qdoc index c9e6f4f..cc6f3e1 100644 --- a/doc/src/howtos/restoring-geometry.qdoc +++ b/doc/src/howtos/restoring-geometry.qdoc @@ -45,25 +45,28 @@ \ingroup best-practices - This document describes how to save and restore a window's - geometry using the geometry properties. On Windows, this is - basically storing the result of QWidget::geometry() and calling - QWidget::setGeometry() in the next session before calling - \l{QWidget::show()}{show()}. + This document describes how to save and restore a \l{Window + Geometry}{window's geometry} using the geometry properties. On + Windows, this is basically storing the result of + QWidget::geometry() and calling QWidget::setGeometry() in the next + session before calling \l{QWidget::show()}{show()}. - On X11, this won't work because an invisible window doesn't have - a frame yet. The window manager will decorate the window later. - When this happens, the window shifts towards the bottom/right - corner of the screen depending on the size of the decoration frame. - Although X provides a way to avoid this shift, most window managers - fail to implement this feature. + On X11, this might not work because an invisible window does not + have a frame yet. The window manager will decorate the window + later. When this happens, the window shifts towards the + bottom/right corner of the screen depending on the size of the + decoration frame. Although X provides a way to avoid this shift, + some window managers fail to implement this feature. Since version 4.2, Qt provides functions that saves and restores a window's geometry and state for you. QWidget::saveGeometry() saves the window geometry and maximized/fullscreen state, while QWidget::restoreGeometry() restores it. The restore function also checks if the restored geometry is outside the available screen - geometry, and modifies it as appropriate if it is. + geometry, and modifies it as appropriate if it is: + + \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 0 + \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 1 If those functions are not available or cannot be used, then a workaround is to call \l{QWidget::setGeometry()}{setGeometry()} @@ -74,14 +77,6 @@ \l{QWidget::pos()}{pos()} and \l{QWidget::size()}{size()} and to restore the geometry using \l{QWidget::resize()} and \l{QWidget::move()}{move()} before calling - \l{QWidget::show()}{show()}, as demonstrated in the following - code snippets (from the \l{mainwindows/application}{Application} - example): - - \snippet examples/mainwindows/application/mainwindow.cpp 35 - \codeline - \snippet examples/mainwindows/application/mainwindow.cpp 38 - - This method works on Windows, Mac OS X, and most X11 window - managers. + \l{QWidget::show()}{show()}, as demonstrated in the + \l{mainwindows/application}{Application} example. */ diff --git a/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp b/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp new file mode 100644 index 0000000..0e4040a --- /dev/null +++ b/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp @@ -0,0 +1,19 @@ +//! [0] +void MyMainWindow::closeEvent(QCloseEvent *event) +{ + QSettings settings("MyCompany", "MyApp"); + settings.setValue("geometry", saveGeometry()); + settings.setValue("windowState", saveState()); + QMainWindow::closeEvent(event); +} +//! [0] + + +//! [1] +void MainWindow::readSettings() +{ + QSettings settings("MyCompany", "MyApp"); + restoreGeometry(settings.value("myWidget/geometry").toByteArray()); + restoreState(settings.value("myWidget/windowState").toByteArray()); +} +//! [1] diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index e19961f..ebf01d4 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1027,6 +1027,8 @@ void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget Restores the state of \a dockwidget if it is created after the call to restoreState(). Returns true if the state was restored; otherwise returns false. + + \sa restoreState(), saveState() */ bool QMainWindow::restoreDockWidget(QDockWidget *dockwidget) @@ -1158,6 +1160,11 @@ Qt::DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget) const To restore the saved state, pass the return value and \a version number to restoreState(). + To save the geometry when the window closes, you can + implement a close event like this: + + \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 0 + \sa restoreState(), QWidget::saveGeometry(), QWidget::restoreGeometry() */ QByteArray QMainWindow::saveState(int version) const @@ -1177,7 +1184,13 @@ QByteArray QMainWindow::saveState(int version) const unchanged, and this function returns \c false; otherwise, the state is restored, and this function returns \c true. - \sa saveState(), QWidget::saveGeometry(), QWidget::restoreGeometry() + To restore geometry saved using QSettings, you can use code like + this: + + \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 1 + + \sa saveState(), QWidget::saveGeometry(), + QWidget::restoreGeometry(), restoreDockWidget() */ bool QMainWindow::restoreState(const QByteArray &state, int version) { -- cgit v0.12 From 8db1aedc017bf0f9a96728bf6e354dc37d8d13e4 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 19 Aug 2009 13:32:23 +0200 Subject: Carbon and Cocoa: Adding support for standard gestures. --- src/gui/kernel/qstandardgestures.cpp | 18 +++++++++++++++--- src/gui/kernel/qwidget_mac.mm | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index 47f3146..10689ba 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -172,8 +172,6 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event) bool QPanGesture::filterEvent(QEvent *event) { Q_D(QPanGesture); - if (!event->spontaneous()) - return false; const QTouchEvent *ev = static_cast(event); if (event->type() == QEvent::TouchBegin) { QTouchEvent::TouchPoint p = ev->touchPoints().at(0); @@ -329,10 +327,11 @@ bool QPinchGesture::event(QEvent *event) bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) { -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) Q_D(QPinchGesture); if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) { QNativeGestureEvent *ev = static_cast(event); +#if defined(Q_WS_WIN) QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); QApplicationPrivate::WidgetStandardGesturesMap::iterator it; it = qAppPriv->widgetGestures.find(static_cast(receiver)); @@ -340,7 +339,9 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) return false; if (this != it.value().pinch) return false; +#endif Qt::GestureState nextState = Qt::NoGesture; + switch(ev->gestureType) { case QNativeGestureEvent::GestureBegin: // next we might receive the first gesture update event, so we @@ -349,15 +350,22 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) d->scaleFactor = d->lastScaleFactor = 1; d->rotationAngle = d->lastRotationAngle = 0; d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint(); +#if defined(Q_WS_WIN) d->initialDistance = 0; +#endif return false; case QNativeGestureEvent::Rotate: d->lastRotationAngle = d->rotationAngle; +#if defined(Q_WS_WIN) d->rotationAngle = -1 * GID_ROTATE_ANGLE_FROM_ARGUMENT(ev->argument); +#elif defined(Q_WS_MAC) + d->rotationAngle = ev->percentage; +#endif nextState = Qt::GestureUpdated; event->accept(); break; case QNativeGestureEvent::Zoom: +#if defined(Q_WS_WIN) if (d->initialDistance != 0) { d->lastScaleFactor = d->scaleFactor; int distance = int(qint64(ev->argument)); @@ -365,6 +373,10 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) } else { d->initialDistance = int(qint64(ev->argument)); } +#elif defined(Q_WS_MAC) + d->lastScaleFactor = d->scaleFactor; + d->scaleFactor = ev->percentage; +#endif nextState = Qt::GestureUpdated; event->accept(); break; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 999faeb..71571e4 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1055,7 +1055,7 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, handled_event = false; break; } - qNGEvent.gestureType = QNativeGestureEvent::Zoom; + qNGEvent.gestureType = QNativeGestureEvent::Rotate; qNGEvent.percentage = float(amount); break; } case kEventGestureSwipe: { -- cgit v0.12 From 9281ec0a69a1426d764f0f3a044ee6e89ae6f639 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 19 Aug 2009 15:46:29 +0200 Subject: Doc - Cleanups on QAbstractTableModel, QAbstractItemModel, etc. Reviewed-By: TrustMe --- src/corelib/kernel/qabstractitemmodel.cpp | 821 ++++++++++++++++-------------- 1 file changed, 433 insertions(+), 388 deletions(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index d6d1bcf..fd2611b 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -251,8 +251,9 @@ QPersistentModelIndex::operator const QModelIndex&() const Returns true if this persistent model index refers to the same location as the \a other model index; otherwise returns false. - Note that all values in the persistent model index are used when comparing - with another model index. + + All values in the persistent model index are used when comparing with + another model index. */ bool QPersistentModelIndex::operator==(const QModelIndex &other) const @@ -335,10 +336,10 @@ qint64 QPersistentModelIndex::internalId() const } /*! - Returns the parent QModelIndex for this persistent index, or - QModelIndex() if it has no parent. + Returns the parent QModelIndex for this persistent index, or an invalid + QModelIndex if it has no parent. - \sa child() sibling() model() + \sa child() sibling() model() */ QModelIndex QPersistentModelIndex::parent() const { @@ -348,10 +349,10 @@ QModelIndex QPersistentModelIndex::parent() const } /*! - Returns the sibling at \a row and \a column or an invalid - QModelIndex if there is no sibling at this position. + Returns the sibling at \a row and \a column or an invalid QModelIndex if + there is no sibling at this position. - \sa parent() child() + \sa parent() child() */ QModelIndex QPersistentModelIndex::sibling(int row, int column) const @@ -362,10 +363,10 @@ QModelIndex QPersistentModelIndex::sibling(int row, int column) const } /*! - Returns the child of the model index that is stored in the given - \a row and \a column. + Returns the child of the model index that is stored in the given \a row + and \a column. - \sa parent() sibling() + \sa parent() sibling() */ QModelIndex QPersistentModelIndex::child(int row, int column) const @@ -376,9 +377,10 @@ QModelIndex QPersistentModelIndex::child(int row, int column) const } /*! - Returns the data for the given \a role for the item referred to by the index. + Returns the data for the given \a role for the item referred to by the + index. - \sa Qt::ItemDataRole, QAbstractItemModel::setData() + \sa Qt::ItemDataRole, QAbstractItemModel::setData() */ QVariant QPersistentModelIndex::data(int role) const { @@ -388,9 +390,9 @@ QVariant QPersistentModelIndex::data(int role) const } /*! - \since 4.2 + \since 4.2 - Returns the flags for the item referred to by the index. + Returns the flags for the item referred to by the index. */ Qt::ItemFlags QPersistentModelIndex::flags() const { @@ -400,7 +402,7 @@ Qt::ItemFlags QPersistentModelIndex::flags() const } /*! - Returns the model that the index belongs to. + Returns the model that the index belongs to. */ const QAbstractItemModel *QPersistentModelIndex::model() const { @@ -414,7 +416,9 @@ const QAbstractItemModel *QPersistentModelIndex::model() const Returns true if this persistent model index is valid; otherwise returns false. - A valid index belongs to a model, and has non-negative row and column numbers. + + A valid index belongs to a model, and has non-negative row and column + numbers. \sa model(), row(), column() */ @@ -760,44 +764,42 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, selection models to locate an item in the model. New QModelIndex objects are created by the model using the - QAbstractItemModel::createIndex() function. An \e invalid model index - can be constructed with the QModelIndex constructor. Invalid indexes are - often used as parent indexes when referring to top-level items in a model. + QAbstractItemModel::createIndex() function. An \e invalid model index can + be constructed with the QModelIndex constructor. Invalid indexes are often + used as parent indexes when referring to top-level items in a model. Model indexes refer to items in models, and contain all the information required to specify their locations in those models. Each index is located - in a given row and column, and may have a parent index; use row(), column(), - and parent() to obtain this information. Each top-level item in a model is - represented by a model index that does not have a parent index - in this - case, parent() will return an invalid model index, equivalent to an index - constructed with the zero argument form of the QModelIndex() constructor. + in a given row and column, and may have a parent index; use row(), + column(), and parent() to obtain this information. Each top-level item in a + model is represented by a model index that does not have a parent index - + in this case, parent() will return an invalid model index, equivalent to an + index constructed with the zero argument form of the QModelIndex() + constructor. To obtain a model index that refers to an existing item in a model, call - QAbstractItemModel::index() with the required row and column - values, and the model index of the parent. When referring to - top-level items in a model, supply QModelIndex() as the parent index. + QAbstractItemModel::index() with the required row and column values, and + the model index of the parent. When referring to top-level items in a + model, supply QModelIndex() as the parent index. The model() function returns the model that the index references as a - QAbstractItemModel. - The child() function is used to examine the items held beneath the index - in the model. - The sibling() function allows you to traverse items in the model on the - same level as the index. + QAbstractItemModel. The child() function is used to examine items held + under the index in the model. The sibling() function allows you to traverse + items in the model on the same level as the index. \note Model indexes should be used immediately and then discarded. You should not rely on indexes to remain valid after calling model functions that change the structure of the model or delete items. If you need to keep a model index over time use a QPersistentModelIndex. - \sa \link model-view-programming.html Model/View Programming\endlink QPersistentModelIndex QAbstractItemModel + \sa {Model/View Programming}, QPersistentModelIndex, QAbstractItemModel */ /*! \fn QModelIndex::QModelIndex() - Creates a new empty model index. - This type of model index is used to indicate - that the position in the model is invalid. + Creates a new empty model index. This type of model index is used to + indicate that the position in the model is invalid. \sa isValid() QAbstractItemModel */ @@ -860,7 +862,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn bool QModelIndex::isValid() const Returns true if this model index is valid; otherwise returns false. - A valid index belongs to a model, and has non-negative row and column numbers. + + A valid index belongs to a model, and has non-negative row and column + numbers. \sa model(), row(), column() */ @@ -871,33 +875,34 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Returns a pointer to the model containing the item that this index refers to. - You receive a const pointer to the model because calls to - non-const functions of the model might invalidate the model index - - and possibly crash your application. + A const pointer to the model is returned because calls to non-const + functions of the model might invalidate the model index and possibly + crash your application. */ /*! \fn QModelIndex QModelIndex::sibling(int row, int column) const - Returns the sibling at \a row and \a column or an invalid - QModelIndex if there is no sibling at this position. + Returns the sibling at \a row and \a column. If there is no sibling at this + position, an invalid QModelIndex is returned. - \sa parent() child() + \sa parent(), child() */ /*! \fn QModelIndex QModelIndex::child(int row, int column) const - Returns the child of the model index that is stored in the given - \a row and \a column. + Returns the child of the model index that is stored in the given \a row and + \a column. - \sa parent() sibling() + \sa parent(), sibling() */ /*! \fn QVariant QModelIndex::data(int role) const - Returns the data for the given \a role for the item referred to by the index. + Returns the data for the given \a role for the item referred to by the + index. */ /*! @@ -910,28 +915,29 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! \fn bool QModelIndex::operator==(const QModelIndex &other) const - Returns true if this model index refers to the same location as - the \a other model index; otherwise returns false. - Note that all values in the model index are used when comparing - with another model index. + Returns true if this model index refers to the same location as the + \a other model index; otherwise returns false. + + All values in the model index are used when comparing with another model + index. */ /*! \fn bool QModelIndex::operator!=(const QModelIndex &other) const - Returns true if this model index does not refer to the same - location as the \a other model index; otherwise returns false. + Returns true if this model index does not refer to the same location as + the \a other model index; otherwise returns false. */ /*! - \fn QModelIndex QModelIndex::parent() const + \fn QModelIndex QModelIndex::parent() const - Returns the parent of the model index, or QModelIndex() if it has no - parent. + Returns the parent of the model index, or QModelIndex() if it has no + parent. - \sa child() sibling() model() + \sa child(), sibling(), model() */ /*! @@ -960,7 +966,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, simple table of rows and columns. Each item has a unique index specified by a QModelIndex. - \img modelindex-no-parent.png + \image modelindex-no-parent.png Every item of data that can be accessed via a model has an associated model index. You can obtain this model index using the index() function. Each @@ -1078,9 +1084,8 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \sa {Model Classes}, {Model Subclassing Reference}, QModelIndex, QAbstractItemView, {Using Drag and Drop with Item Views}, - {Simple DOM Model Example}, - {Simple Tree Model Example}, {Editable Tree Model Example}, - {Fetch More Example} + {Simple DOM Model Example}, {Simple Tree Model Example}, + {Editable Tree Model Example}, {Fetch More Example} */ /*! @@ -1089,8 +1094,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Returns the index of the item in the model specified by the given \a row, \a column and \a parent index. - When reimplementing this function in a subclass, call createIndex() to generate - model indexes that other components can use to refer to items in your model. + When reimplementing this function in a subclass, call createIndex() to + generate model indexes that other components can use to refer to items in + your model. \sa createIndex() */ @@ -1099,8 +1105,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn bool QAbstractItemModel::insertColumn(int column, const QModelIndex &parent) Inserts a single column before the given \a column in the child items of - the \a parent specified. Returns true if the column is inserted; otherwise - returns false. + the \a parent specified. + + Returns true if the column is inserted; otherwise returns false. \sa insertColumns() insertRow() removeColumn() */ @@ -1109,8 +1116,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent) Inserts a single row before the given \a row in the child items of the - \a parent specified. Returns true if the row is inserted; otherwise - returns false. + \a parent specified. + + Returns true if the row is inserted; otherwise returns false. \sa insertRows() insertColumn() removeRow() */ @@ -1123,17 +1131,18 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! \fn QModelIndex QAbstractItemModel::parent(const QModelIndex &index) const = 0 - Returns the parent of the model item with the given \a index, or QModelIndex() - if it has no parent. + Returns the parent of the model item with the given \a index. If the model + has no parent, an invalid QModelIndex is returned. A common convention used in models that expose tree data structures is that - only items in the first column have children. For that case, when reimplementing - this function in a subclass the column of the returned QModelIndex would be 0. + only items in the first column have children. For that case, when + reimplementing this function in a subclass the column of the returned + QModelIndex would be 0. - \note When reimplementing this function in a subclass, be careful to avoid + When reimplementing this function in a subclass, be careful to avoid calling QModelIndex member functions, such as QModelIndex::parent(), since - indexes belonging to your model will simply call your implementation, leading - to infinite recursion. + indexes belonging to your model will simply call your implementation, + leading to infinite recursion. \sa createIndex() */ @@ -1141,7 +1150,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! \fn bool QAbstractItemModel::removeColumn(int column, const QModelIndex &parent) - Removes the given \a column from the child items of the \a parent specified. + Removes the given \a column from the child items of the \a parent + specified. + Returns true if the column is removed; otherwise returns false. \sa removeColumns(), removeRow(), insertColumn() @@ -1151,10 +1162,11 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn bool QAbstractItemModel::removeRow(int row, const QModelIndex &parent) Removes the given \a row from the child items of the \a parent specified. + Returns true if the row is removed; otherwise returns false. - The removeRow() is a convenience function that calls removeRows(). - The QAbstractItemModel implementation of removeRows does nothing. + This is a convenience function that calls removeRows(). The + QAbstractItemModel implementation of removeRows() does nothing. \sa removeRows(), removeColumn(), insertRow() */ @@ -1166,13 +1178,12 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, indicates whether the horizontal or vertical header has changed. The sections in the header from the \a first to the \a last need to be updated. - Note that this signal must be emitted explicitly when - reimplementing the setHeaderData() function. + When reimplementing the setHeaderData() function, this signal must be + emitted explicitly. - If you are changing the number of columns or rows you don't need - to emit this signal, but use the begin/end functions (see the - section on subclassing in the QAbstractItemModel class description - for details). + If you are changing the number of columns or rows you do not need to emit + this signal, but use the begin/end functions (refer to the section on + subclassing in the QAbstractItemModel class description for details). \sa headerData(), setHeaderData(), dataChanged() */ @@ -1182,8 +1193,8 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \since 4.2 This signal is emitted just before the layout of a model is changed. - Components connected to this signal use it to adapt to changes - in the model's layout. + Components connected to this signal use it to adapt to changes in the + model's layout. Subclasses should update any persistent model indexes after emitting layoutAboutToBeChanged(). @@ -1195,19 +1206,20 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn void QAbstractItemModel::layoutChanged() This signal is emitted whenever the layout of items exposed by the model - has changed; for example, when the model has been sorted. When this signal is - received by a view, it should update the layout of items to reflect this + has changed; for example, when the model has been sorted. When this signal + is received by a view, it should update the layout of items to reflect this change. - When subclassing QAbstractItemModel or QAbstractProxyModel, ensure that - you emit layoutAboutToBeChanged() before changing the order of items or + When subclassing QAbstractItemModel or QAbstractProxyModel, ensure that you + emit layoutAboutToBeChanged() before changing the order of items or altering the structure of the data you expose to views, and emit layoutChanged() after changing the layout. - Subclasses should update any persistent model indexes before - emitting layoutChanged(). + Subclasses should update any persistent model indexes before emitting + layoutChanged(). - \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), reset(), changePersistentIndex() + \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), reset(), + changePersistentIndex() */ /*! @@ -1237,12 +1249,12 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn QModelIndex QAbstractItemModel::sibling(int row, int column, const QModelIndex &index) const - Returns the sibling at \a row and \a column for the item at \a index, or - an invalid QModelIndex if there is no sibling at that location. + Returns the sibling at \a row and \a column for the item at \a index, or an + invalid QModelIndex if there is no sibling at that location. sibling() is just a convenience function that finds the item's parent, and - uses it to retrieve the index of the child item in the specified \a row - and \a column. + uses it to retrieve the index of the child item in the specified \a row and + \a column. \sa index(), QModelIndex::row(), QModelIndex::column() */ @@ -1251,11 +1263,11 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn int QAbstractItemModel::rowCount(const QModelIndex &parent) const - Returns the number of rows under the given \a parent. When the parent - is valid it means that rowCount is returning the number of children of parent. + Returns the number of rows under the given \a parent. When the parent is + valid it means that rowCount is returning the number of children of parent. - \bold{Tip:} When implementing a table based model, rowCount() should return 0 when - the parent is valid. + \note When implementing a table based model, rowCount() should return 0 + when the parent is valid. \sa columnCount() */ @@ -1265,13 +1277,14 @@ QAbstractItemModel::~QAbstractItemModel() Returns the number of columns for the children of the given \a parent. - In most subclasses, the number of columns is independent of the - \a parent. For example: + In most subclasses, the number of columns is independent of the \a parent. + + For example: \snippet examples/itemviews/simpledommodel/dommodel.cpp 2 - \bold{Tip:} When implementing a table based model, columnCount() should return 0 when - the parent is valid. + \note When implementing a table based model, columnCount() should return 0 + when the parent is valid. \sa rowCount() */ @@ -1298,8 +1311,8 @@ QAbstractItemModel::~QAbstractItemModel() model. The new items are those between \a start and \a end inclusive, under the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes - in the model's dimensions. It can only be emitted by the QAbstractItemModel + \note Components connected to this signal use it to adapt to changes in the + model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. \sa insertRows(), beginInsertRows() @@ -1308,11 +1321,11 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::rowsAboutToBeInserted(const QModelIndex &parent, int start, int end) - This signal is emitted just before rows are inserted into the - model. The new items will be positioned between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted just before rows are inserted into the model. The + new items will be positioned between \a start and \a end inclusive, under + the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes + \note Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. @@ -1322,11 +1335,11 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int start, int end) - This signal is emitted after rows have been removed from the - model. The removed items are those between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted after rows have been removed from the model. The + removed items are those between \a start and \a end inclusive, under the + given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes + \note Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. @@ -1336,11 +1349,11 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) - This signal is emitted just before rows are removed from the - model. The items that will be removed are those between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted just before rows are removed from the model. The + items that will be removed are those between \a start and \a end inclusive, + under the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes + \note Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. @@ -1350,12 +1363,12 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int start, int end) - This signal is emitted after columns have been inserted into the - model. The new items are those between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted after columns have been inserted into the model. The + new items are those between \a start and \a end inclusive, under the given + \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes - in the model's dimensions. It can only be emitted by the QAbstractItemModel + \note Components connected to this signal use it to adapt to changes in the + model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. \sa insertColumns(), beginInsertColumns() @@ -1364,12 +1377,12 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int start, int end) - This signal is emitted just before columns are inserted into the - model. The new items will be positioned between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted just before columns are inserted into the model. The + new items will be positioned between \a start and \a end inclusive, under + the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes - in the model's dimensions. It can only be emitted by the QAbstractItemModel + \note Components connected to this signal use it to adapt to changes in the + model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. \sa insertColumns(), beginInsertColumns() @@ -1378,12 +1391,12 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int start, int end) - This signal is emitted after columns have been removed from the - model. The removed items are those between \a start and \a end - inclusive, under the given \a parent item. + This signal is emitted after columns have been removed from the model. + The removed items are those between \a start and \a end inclusive, + under the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes - in the model's dimensions. It can only be emitted by the QAbstractItemModel + \note Components connected to this signal use it to adapt to changes in + the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. \sa removeColumns(), beginRemoveColumns() @@ -1392,20 +1405,20 @@ QAbstractItemModel::~QAbstractItemModel() /*! \fn void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end) - This signal is emitted just before columns are removed - from the model. The items to be removed are those between \a start and - \a end inclusive, under the given \a parent item. + This signal is emitted just before columns are removed from the model. The + items to be removed are those between \a start and \a end inclusive, under + the given \a parent item. - \bold{Note:} Components connected to this signal use it to adapt to changes - in the model's dimensions. It can only be emitted by the QAbstractItemModel + \note Components connected to this signal use it to adapt to changes in the + model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code. \sa removeColumns(), beginRemoveColumns() */ /*! - Returns true if the model returns a valid QModelIndex for \a row and - \a column with \a parent, otherwise returns false. + Returns true if the model returns a valid QModelIndex for \a row and + \a column with \a parent, otherwise returns false. */ bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent) const { @@ -1416,10 +1429,11 @@ bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent /*! - Returns true if \a parent has any children; otherwise returns false. - Use rowCount() on the parent to find out the number of children. + Returns true if \a parent has any children; otherwise returns false. + + Use rowCount() on the parent to find out the number of children. - \sa parent() index() + \sa parent() index() */ bool QAbstractItemModel::hasChildren(const QModelIndex &parent) const { @@ -1428,11 +1442,11 @@ bool QAbstractItemModel::hasChildren(const QModelIndex &parent) const /*! - Returns a map with values for all predefined roles in the model - for the item at the given \a index. + Returns a map with values for all predefined roles in the model for the + item at the given \a index. - Reimplemented this function if you want to extend the default behavior - of this function to include custom roles in the map. + Reimplement this function if you want to extend the default behavior of + this function to include custom roles in the map. \sa Qt::ItemDataRole, data() */ @@ -1449,14 +1463,14 @@ QMap QAbstractItemModel::itemData(const QModelIndex &index) const /*! Sets the \a role data for the item at \a index to \a value. + Returns true if successful; otherwise returns false. - The dataChanged() signal should be emitted if the data was successfully set. + The dataChanged() signal should be emitted if the data was successfully + set. - The base class implementation returns false. This function and - data() must be reimplemented for editable models. Note that the - dataChanged() signal must be emitted explicitly when - reimplementing this function. + The base class implementation returns false. This function and data() must + be reimplemented for editable models. \sa Qt::ItemDataRole, data(), itemData() */ @@ -1475,15 +1489,16 @@ bool QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value by the \a index. \note If you do not have a value to return, return an \bold invalid - QVariant() instead of returning 0. + QVariant instead of returning 0. \sa Qt::ItemDataRole, setData(), headerData() */ /*! Sets the role data for the item at \a index to the associated value in - \a roles, for every Qt::ItemDataRole. Returns true if successful; otherwise - returns false. + \a roles, for every Qt::ItemDataRole. + + Returns true if successful; otherwise returns false. Roles that are not in \a roles will not be modified. @@ -1498,8 +1513,8 @@ bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap &roleNames) { @@ -1915,11 +1944,11 @@ void QAbstractItemModel::setRoleNames(const QHash &roleNames) } /*! - \since 4.6 + \since 4.6 - Returns the model's role names. + Returns the model's role names. - \sa setRoleNames() + \sa setRoleNames() */ const QHash &QAbstractItemModel::roleNames() const { @@ -1928,10 +1957,12 @@ const QHash &QAbstractItemModel::roleNames() const } /*! - Called to let the model know that it should submit whatever it has cached - to the permanent storage. Typically used for row editing. + Lets the model know that it should submit cached information to permanent + storage. This function is typically used for row editing. + + Returns true if there is no error; otherwise returns false. - Returns false on error, otherwise true. + \sa revert() */ bool QAbstractItemModel::submit() @@ -1940,8 +1971,10 @@ bool QAbstractItemModel::submit() } /*! - Called to let the model know that it should discard whatever it has cached. - Typically used for row editing. + Lets the model know that it should discard cached information. This + function is typically used for row editing. + + \sa submit() */ void QAbstractItemModel::revert() @@ -1950,14 +1983,14 @@ void QAbstractItemModel::revert() } /*! - Returns the data for the given \a role and \a section in the header - with the specified \a orientation. + Returns the data for the given \a role and \a section in the header with + the specified \a orientation. - For horizontal headers, the section number corresponds to the column - number of items shown beneath it. For vertical headers, the section - number typically to the row number of items shown alongside it. + For horizontal headers, the section number corresponds to the column + number. Similarly, for vertical headers, the section number corresponds to + the row number. - \sa Qt::ItemDataRole, setHeaderData(), QHeaderView + \sa Qt::ItemDataRole, setHeaderData(), QHeaderView */ QVariant QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -1969,14 +2002,15 @@ QVariant QAbstractItemModel::headerData(int section, Qt::Orientation orientation } /*! - Sets the data for the given \a role and \a section in the header with - the specified \a orientation to the \a value supplied. - Returns true if the header's data was updated; otherwise returns false. + Sets the data for the given \a role and \a section in the header with the + specified \a orientation to the \a value supplied. - Note that the headerDataChanged() signal must be emitted explicitly - when reimplementing this function. + Returns true if the header's data was updated; otherwise returns false. - \sa Qt::ItemDataRole, headerData() + When reimplementing this function, the headerDataChanged() signal must be + emitted explicitly. + + \sa Qt::ItemDataRole, headerData() */ bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation, @@ -1992,11 +2026,12 @@ bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation, /*! \fn QModelIndex QAbstractItemModel::createIndex(int row, int column, void *ptr) const - Creates a model index for the given \a row and \a column with the internal pointer \a ptr. + Creates a model index for the given \a row and \a column with the internal + pointer \a ptr. - Note that when you are using a QSortFilterProxyModel its indexes have their own - internal pointer. It is not advisable to access the internal pointer in the index - outside of the model. Use the data() function instead. + When using a QSortFilterProxyModel, its indexes have their own internal + pointer. It is not advisable to access this internal pointer outside of the + model. Use the data() function instead. This function provides a consistent interface that model subclasses must use to create model indexes. @@ -2006,7 +2041,8 @@ bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation, \fn QModelIndex QAbstractItemModel::createIndex(int row, int column, int id) const \obsolete - Use QModelIndex QAbstractItemModel::createIndex(int row, int column, quint32 id) instead. + Use QModelIndex + QAbstractItemModel::createIndex(int row, int column, quint32 id) instead. */ /*! @@ -2017,6 +2053,7 @@ bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation, This function provides a consistent interface that model subclasses must use to create model indexes. + \sa QModelIndex::internalId() */ @@ -2120,32 +2157,36 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare /*! Begins a row insertion operation. - When reimplementing insertRows() in a subclass, you must call this - function \e before inserting data into the model's underlying data - store. + When reimplementing insertRows() in a subclass, you must call this function + \e before inserting data into the model's underlying data store. - The \a parent index corresponds to the parent into which the new - rows are inserted; \a first and \a last are the row numbers that the - new rows will have after they have been inserted. + The \a parent index corresponds to the parent into which the new rows are + inserted; \a first and \a last are the row numbers that the new rows will + have after they have been inserted. \table 80% - \row \o \inlineimage modelview-begin-insert-rows.png Inserting rows - \o Specify the first and last row numbers for the span of rows - you want to insert into an item in a model. - - For example, as shown in the diagram, we insert three rows before - row 2, so \a first is 2 and \a last is 4: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 0 - This inserts the three new rows as rows 2, 3, and 4. \row - \o \inlineimage modelview-begin-append-rows.png Appending rows - \o To append rows, insert them after the last row. - - For example, as shown in the diagram, we append two rows to a - collection of 4 existing rows (ending in row 3), so \a first is 4 - and \a last is 5: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 1 - This appends the two new rows as rows 4 and 5. + \o \inlineimage modelview-begin-insert-rows.png Inserting rows + \o Specify the first and last row numbers for the span of rows you + want to insert into an item in a model. + + For example, as shown in the diagram, we insert three rows before + row 2, so \a first is 2 and \a last is 4: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 0 + + This inserts the three new rows as rows 2, 3, and 4. + \row + \o \inlineimage modelview-begin-append-rows.png Appending rows + \o To append rows, insert them after the last row. + + For example, as shown in the diagram, we append two rows to a + collection of 4 existing rows (ending in row 3), so \a first is 4 + and \a last is 5: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 1 + + This appends the two new rows as rows 4 and 5. \endtable \sa endInsertRows() @@ -2163,9 +2204,8 @@ void QAbstractItemModel::beginInsertRows(const QModelIndex &parent, int first, i /*! Ends a row insertion operation. - When reimplementing insertRows() in a subclass, you must call this - function \e after inserting data into the model's underlying data - store. + When reimplementing insertRows() in a subclass, you must call this function + \e after inserting data into the model's underlying data store. \sa beginInsertRows() */ @@ -2181,21 +2221,22 @@ void QAbstractItemModel::endInsertRows() Begins a row removal operation. When reimplementing removeRows() in a subclass, you must call this - function \e before removing data from the model's underlying data - store. + function \e before removing data from the model's underlying data store. - The \a parent index corresponds to the parent from which the new - rows are removed; \a first and \a last are the row numbers of the - rows to be removed. + The \a parent index corresponds to the parent from which the new rows are + removed; \a first and \a last are the row numbers of the rows to be + removed. \table 80% - \row \o \inlineimage modelview-begin-remove-rows.png Removing rows - \o Specify the first and last row numbers for the span of rows - you want to remove from an item in a model. - - For example, as shown in the diagram, we remove the two rows from - row 2 to row 3, so \a first is 2 and \a last is 3: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 2 + \row + \o \inlineimage modelview-begin-remove-rows.png Removing rows + \o Specify the first and last row numbers for the span of rows you + want to remove from an item in a model. + + For example, as shown in the diagram, we remove the two rows from + row 2 to row 3, so \a first is 2 and \a last is 3: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 2 \endtable \sa endRemoveRows() @@ -2213,9 +2254,8 @@ void QAbstractItemModel::beginRemoveRows(const QModelIndex &parent, int first, i /*! Ends a row removal operation. - When reimplementing removeRows() in a subclass, you must call this - function \e after removing data from the model's underlying data - store. + When reimplementing removeRows() in a subclass, you must call this function + \e after removing data from the model's underlying data store. \sa beginRemoveRows() */ @@ -2231,31 +2271,35 @@ void QAbstractItemModel::endRemoveRows() Begins a column insertion operation. When reimplementing insertColumns() in a subclass, you must call this - function \e before inserting data into the model's underlying data - store. + function \e before inserting data into the model's underlying data store. - The \a parent index corresponds to the parent into which the new - columns are inserted; \a first and \a last are the column numbers of - the new columns will have after they have been inserted. + The \a parent index corresponds to the parent into which the new columns + are inserted; \a first and \a last are the column numbers of the new + columns will have after they have been inserted. \table 80% - \row \o \inlineimage modelview-begin-insert-columns.png Inserting columns - \o Specify the first and last column numbers for the span of columns - you want to insert into an item in a model. - - For example, as shown in the diagram, we insert three columns before - column 4, so \a first is 4 and \a last is 6: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 3 - This inserts the three new columns as columns 4, 5, and 6. \row - \o \inlineimage modelview-begin-append-columns.png Appending columns - \o To append columns, insert them after the last column. - - For example, as shown in the diagram, we append three columns to a - collection of six existing columns (ending in column 5), so \a first - is 6 and \a last is 8: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 4 - This appends the two new columns as columns 6, 7, and 8. + \o \inlineimage modelview-begin-insert-columns.png Inserting columns + \o Specify the first and last column numbers for the span of columns + you want to insert into an item in a model. + + For example, as shown in the diagram, we insert three columns + before column 4, so \a first is 4 and \a last is 6: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 3 + + This inserts the three new columns as columns 4, 5, and 6. + \row + \o \inlineimage modelview-begin-append-columns.png Appending columns + \o To append columns, insert them after the last column. + + For example, as shown in the diagram, we append three columns to a + collection of six existing columns (ending in column 5), so + \a first is 6 and \a last is 8: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 4 + + This appends the two new columns as columns 6, 7, and 8. \endtable \sa endInsertColumns() @@ -2291,21 +2335,22 @@ void QAbstractItemModel::endInsertColumns() Begins a column removal operation. When reimplementing removeColumns() in a subclass, you must call this - function \e before removing data from the model's underlying data - store. + function \e before removing data from the model's underlying data store. - The \a parent index corresponds to the parent from which the new - columns are removed; \a first and \a last are the column numbers of - the first and last columns to be removed. + The \a parent index corresponds to the parent from which the new columns + are removed; \a first and \a last are the column numbers of the first and + last columns to be removed. \table 80% - \row \o \inlineimage modelview-begin-remove-columns.png Removing columns - \o Specify the first and last column numbers for the span of columns - you want to remove from an item in a model. - - For example, as shown in the diagram, we remove the three columns - from column 4 to column 6, so \a first is 4 and \a last is 6: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 5 + \row + \o \inlineimage modelview-begin-remove-columns.png Removing columns + \o Specify the first and last column numbers for the span of columns + you want to remove from an item in a model. + + For example, as shown in the diagram, we remove the three columns + from column 4 to column 6, so \a first is 4 and \a last is 6: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 5 \endtable \sa endRemoveColumns() @@ -2324,8 +2369,7 @@ void QAbstractItemModel::beginRemoveColumns(const QModelIndex &parent, int first Ends a column removal operation. When reimplementing removeColumns() in a subclass, you must call this - function \e after removing data from the model's underlying data - store. + function \e after removing data from the model's underlying data store. \sa beginRemoveColumns() */ @@ -2340,11 +2384,11 @@ void QAbstractItemModel::endRemoveColumns() /*! Resets the model to its original state in any attached views. - \note The view to which the model is attached to will be reset as well. + The view to which the model is attached to will be reset as well. When a model is reset it means that any previous data reported from the - model is now invalid and has to be queried for again. This also means - that the current item and any selected items will become invalid. + model is now invalid and has to be queried for again. This also means that + the current item and any selected items will become invalid. When a model radically changes its data it can sometimes be easier to just call this function rather than emit dataChanged() to inform other @@ -2361,13 +2405,13 @@ void QAbstractItemModel::reset() } /*! - Changes the QPersistentModelIndex that is equal to the given \a from - model index to the given \a to model index. + Changes the QPersistentModelIndex that is equal to the given \a from model + index to the given \a to model index. - If no persistent model index equal to the given \a from model index was - found, nothing is changed. + If no persistent model index equal to the given \a from model index was + found, nothing is changed. - \sa persistentIndexList(), changePersistentIndexList() + \sa persistentIndexList(), changePersistentIndexList() */ void QAbstractItemModel::changePersistentIndex(const QModelIndex &from, const QModelIndex &to) { @@ -2388,15 +2432,15 @@ void QAbstractItemModel::changePersistentIndex(const QModelIndex &from, const QM } /*! - \since 4.1 + \since 4.1 - Changes the QPersistentModelIndexes that is equal to the indexes in the given \a from - model index list to the given \a to model index list. + Changes the QPersistentModelIndexes that is equal to the indexes in the + given \a from model index list to the given \a to model index list. - If no persistent model indexes equal to the indexes in the given \a from model index list - was found, nothing is changed. + If no persistent model indexes equal to the indexes in the given \a from + model index list was found, nothing is changed. - \sa persistentIndexList(), changePersistentIndex() + \sa persistentIndexList(), changePersistentIndex() */ void QAbstractItemModel::changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to) @@ -2429,9 +2473,9 @@ void QAbstractItemModel::changePersistentIndexList(const QModelIndexList &from, } /*! - \since 4.2 + \since 4.2 - Returns the list of indexes stored as persistent indexes in the model. + Returns the list of indexes stored as persistent indexes in the model. */ QModelIndexList QAbstractItemModel::persistentIndexList() const { @@ -2458,10 +2502,10 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const but must be subclassed. Since the model provides a more specialized interface than - QAbstractItemModel, it is not suitable for use with tree views, although - it can be used to provide data to a QListView. If you need to represent - a simple list of items, and only need a model to contain a single column - of data, subclassing the QAbstractListModel may be more appropriate. + QAbstractItemModel, it is not suitable for use with tree views, although it + can be used to provide data to a QListView. If you need to represent a + simple list of items, and only need a model to contain a single column of + data, subclassing the QAbstractListModel may be more appropriate. The rowCount() and columnCount() functions return the dimensions of the table. To retrieve a model index corresponding to an item in the model, use @@ -2469,9 +2513,6 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const \section1 Subclassing - \bold{Note:} Some general guidelines for subclassing models are - available in the \l{Model Subclassing Reference}. - When subclassing QAbstractTableModel, you must implement rowCount(), columnCount(), and data(). Default implementations of the index() and parent() functions are provided by QAbstractTableModel. @@ -2502,9 +2543,13 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const call endRemoveColumns() \e{immediately afterwards}. \endlist - \sa {Model Classes}, {Model Subclassing Reference}, QAbstractItemModel, - QAbstractListModel, - {Pixelator Example} + \note Some general guidelines for subclassing models are available in the + \l{Model Subclassing Reference}. + + \note + + \sa {Model Classes}, QAbstractItemModel, QAbstractListModel, + {Pixelator Example} */ /*! @@ -2602,9 +2647,6 @@ bool QAbstractTableModel::hasChildren(const QModelIndex &parent) const \section1 Subclassing - \bold{Note:} Some general guidelines for subclassing models are - available in the \l{Model Subclassing Reference}. - When subclassing QAbstractListModel, you must provide implementations of the rowCount() and data() functions. Well behaved models also provide a headerData() implementation. @@ -2631,6 +2673,9 @@ bool QAbstractTableModel::hasChildren(const QModelIndex &parent) const call endRemoveRows() \e{immediately afterwards}. \endlist + \note Some general guidelines for subclassing models are available in the + \l{Model Subclassing Reference}. + \sa {Model Classes}, {Model Subclassing Reference}, QAbstractItemView, QAbstractTableModel, {Item Views Puzzle Example} */ -- cgit v0.12 From 332ca73378043970087f843036d02192e3fef50d Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 19 Aug 2009 15:48:55 +0200 Subject: Doc - Fixed whitespace issues Reviewed-By: TrustMe --- src/corelib/kernel/qabstractitemmodel.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index fd2611b..8761ec1 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -862,7 +862,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, \fn bool QModelIndex::isValid() const Returns true if this model index is valid; otherwise returns false. - + A valid index belongs to a model, and has non-negative row and column numbers. @@ -1767,7 +1767,7 @@ void QAbstractItemModel::fetchMore(const QModelIndex &) /*! Returns true if there is more data available for \a parent; otherwise returns false. - + The default implementation always returns false. If canFetchMore() returns true, QAbstractItemView will call fetchMore(). @@ -1840,7 +1840,7 @@ QModelIndex QAbstractItemModel::buddy(const QModelIndex &index) const By default, this function will perform a wrapping, string-based comparison on all items, searching for items that begin with the search term specified by \a value. - + \note The default implementation of this function only searches columns. Reimplement this function to include a different search behavior. */ @@ -1931,7 +1931,7 @@ QSize QAbstractItemModel::span(const QModelIndex &) const Sets the model's role names to \a roleNames. This function allows mapping of role identifiers to role property names in - Declarative UI. This function must be called before the model is used. + Declarative UI. This function must be called before the model is used. Modifying the role names after the model has been set may result in undefined behaviour. @@ -2172,20 +2172,20 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare For example, as shown in the diagram, we insert three rows before row 2, so \a first is 2 and \a last is 4: - + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 0 - + This inserts the three new rows as rows 2, 3, and 4. \row \o \inlineimage modelview-begin-append-rows.png Appending rows \o To append rows, insert them after the last row. - + For example, as shown in the diagram, we append two rows to a collection of 4 existing rows (ending in row 3), so \a first is 4 and \a last is 5: \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 1 - + This appends the two new rows as rows 4 and 5. \endtable @@ -2235,7 +2235,7 @@ void QAbstractItemModel::endInsertRows() For example, as shown in the diagram, we remove the two rows from row 2 to row 3, so \a first is 2 and \a last is 3: - + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 2 \endtable @@ -2287,7 +2287,7 @@ void QAbstractItemModel::endRemoveRows() before column 4, so \a first is 4 and \a last is 6: \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 3 - + This inserts the three new columns as columns 4, 5, and 6. \row \o \inlineimage modelview-begin-append-columns.png Appending columns @@ -2296,9 +2296,9 @@ void QAbstractItemModel::endRemoveRows() For example, as shown in the diagram, we append three columns to a collection of six existing columns (ending in column 5), so \a first is 6 and \a last is 8: - + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 4 - + This appends the two new columns as columns 6, 7, and 8. \endtable @@ -2346,10 +2346,10 @@ void QAbstractItemModel::endInsertColumns() \o \inlineimage modelview-begin-remove-columns.png Removing columns \o Specify the first and last column numbers for the span of columns you want to remove from an item in a model. - + For example, as shown in the diagram, we remove the three columns from column 4 to column 6, so \a first is 4 and \a last is 6: - + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 5 \endtable @@ -2546,7 +2546,7 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const \note Some general guidelines for subclassing models are available in the \l{Model Subclassing Reference}. - \note + \note \sa {Model Classes}, QAbstractItemModel, QAbstractListModel, {Pixelator Example} -- cgit v0.12 From 0d9cc367b72d74d709b9a03748db6dd48e126472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 19 Aug 2009 15:06:15 +0200 Subject: Changed the streambookmarks example to use aggregation QXmlStreamReader and QXmlStreamWriter can be used conveniently without subclassing, which the example now demonstrates. Reviewed-by: mae Reviewed-by: David Boddie --- doc/src/examples/qxmlstreambookmarks.qdoc | 42 ++++++++++-------- examples/xml/streambookmarks/mainwindow.cpp | 4 +- examples/xml/streambookmarks/xbelreader.cpp | 68 +++++++++++++++++------------ examples/xml/streambookmarks/xbelreader.h | 5 ++- examples/xml/streambookmarks/xbelwriter.cpp | 32 +++++++------- examples/xml/streambookmarks/xbelwriter.h | 3 +- src/corelib/xml/qxmlstream.cpp | 6 +-- 7 files changed, 89 insertions(+), 71 deletions(-) diff --git a/doc/src/examples/qxmlstreambookmarks.qdoc b/doc/src/examples/qxmlstreambookmarks.qdoc index 26964c4..904cd6d 100644 --- a/doc/src/examples/qxmlstreambookmarks.qdoc +++ b/doc/src/examples/qxmlstreambookmarks.qdoc @@ -51,10 +51,10 @@ \section1 XbelWriter Class Definition - The \c XbelWriter class is a subclass of QXmlStreamReader, which provides - an XML parser with a streaming API. \c XbelWriter also contains a private - instance of QTreeWidget in order to display the bookmarks according to - hierarchies. + The \c XbelWriter class contains a private instance of QXmlStreamWriter, + which provides an XML writer with a streaming API. \c XbelWriter also + has a reference to the QTreeWidget instance where the bookmark hierarchy + is stored. \snippet examples/xml/streambookmarks/xbelwriter.h 0 @@ -75,7 +75,7 @@ \snippet examples/xml/streambookmarks/xbelwriter.cpp 1 - The \c writeItem() function accepts a QTreeWidget object and writes it + The \c writeItem() function accepts a QTreeWidgetItem object and writes it to the stream, depending on its \c tagName, which can either be a "folder", "bookmark", or "separator". @@ -83,9 +83,10 @@ \section1 XbelReader Class Definition - The \c XbelReader class is a subclass of QXmlStreamReader, the pendent - class for QXmlStreamWriter. \c XbelReader contains a private instance - of QTreeWidget to group bookmarks according to their hierarchies. + The \c XbelReader contains a private instance of QXmlStreamReader, the + companion class to QXmlStreamWriter. \c XbelReader also contains a + reference to the QTreeWidget that is used to group the bookmarks according + to their hierarchy. \snippet examples/xml/streambookmarks/xbelreader.h 0 @@ -102,21 +103,26 @@ \snippet examples/xml/streambookmarks/xbelreader.cpp 0 The \c read() function accepts a QIODevice and sets it using - \l{QXmlStreamReader::setDevice()}{setDevice()}. The actual process - of reading only takes place if the file is a valid XBEL 1.0 file. - Note that the XML input needs to be well-formed to be accepted by - QXmlStreamReader. Otherwise, the \l{QXmlStreamReader::raiseError()} - {raiseError()} function is used to display an error message. Since the - XBEL reader is only concerned with reading XML elements, it makes - extensive use of the \l{QXmlStreamReader::readNextStartElement()} + \l{QXmlStreamReader::}{setDevice()}. The actual process of reading only + takes place if the file is a valid XBEL 1.0 file. Note that the XML input + needs to be well-formed to be accepted by QXmlStreamReader. Otherwise, the + \l{QXmlStreamReader::}{raiseError()} function is used to display an error + message. Since the XBEL reader is only concerned with reading XML elements, + it makes extensive use of the \l{QXmlStreamReader::}{readNextStartElement()} convenience function. \snippet examples/xml/streambookmarks/xbelreader.cpp 1 + The \c errorString() function is used if an error occurred, in order to + obtain a description of the error complete with line and column number + information. + + \snippet examples/xml/streambookmarks/xbelreader.cpp 2 + The \c readXBEL() function reads the name of a startElement and calls the appropriate function to read it, depending on whether if its a "folder", "bookmark" or "separator". Otherwise, it calls - \l{QXmlStreamReader::skipCurrentElement()}. The Q_ASSERT() macro is used + \l{QXmlStreamReader::}{skipCurrentElement()}. The Q_ASSERT() macro is used to provide a pre-condition for the function. \snippet examples/xml/streambookmarks/xbelreader.cpp 3 @@ -126,8 +132,8 @@ \snippet examples/xml/streambookmarks/xbelreader.cpp 4 The \c readSeparator() function creates a separator and sets its flags. - The text is set to 30 "0xB7", the HEX equivalent for period, and then - read using \c readElementText(). + The text is set to 30 "0xB7", the HEX equivalent for period. The element + is then skipped using \l{QXmlStreamReader::}{skipCurrentElement()}. \snippet examples/xml/streambookmarks/xbelreader.cpp 5 diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp index 183143d..5aef327 100644 --- a/examples/xml/streambookmarks/mainwindow.cpp +++ b/examples/xml/streambookmarks/mainwindow.cpp @@ -91,10 +91,8 @@ void MainWindow::open() XbelReader reader(treeWidget); if (!reader.read(&file)) { QMessageBox::warning(this, tr("QXmlStream Bookmarks"), - tr("Parse error in file %1 at line %2, column %3:\n%4") + tr("Parse error in file %1:\n\n%2") .arg(fileName) - .arg(reader.lineNumber()) - .arg(reader.columnNumber()) .arg(reader.errorString())); } else { statusBar()->showMessage(tr("File loaded"), 2000); diff --git a/examples/xml/streambookmarks/xbelreader.cpp b/examples/xml/streambookmarks/xbelreader.cpp index 99a7f34..0770643 100644 --- a/examples/xml/streambookmarks/xbelreader.cpp +++ b/examples/xml/streambookmarks/xbelreader.cpp @@ -60,33 +60,43 @@ XbelReader::XbelReader(QTreeWidget *treeWidget) //! [1] bool XbelReader::read(QIODevice *device) { - setDevice(device); + xml.setDevice(device); - if (readNextStartElement()) { - if (name() == "xbel" && attributes().value("version") == "1.0") + if (xml.readNextStartElement()) { + if (xml.name() == "xbel" && xml.attributes().value("version") == "1.0") readXBEL(); else - raiseError(QObject::tr("The file is not an XBEL version 1.0 file.")); + xml.raiseError(QObject::tr("The file is not an XBEL version 1.0 file.")); } - return !error(); + return !xml.error(); } //! [1] +//! [2] +QString XbelReader::errorString() const +{ + return QObject::tr("%1\nLine %2, column %3") + .arg(xml.errorString()) + .arg(xml.lineNumber()) + .arg(xml.columnNumber()); +} +//! [2] + //! [3] void XbelReader::readXBEL() { - Q_ASSERT(isStartElement() && name() == "xbel"); + Q_ASSERT(xml.isStartElement() && xml.name() == "xbel"); - while (readNextStartElement()) { - if (name() == "folder") + while (xml.readNextStartElement()) { + if (xml.name() == "folder") readFolder(0); - else if (name() == "bookmark") + else if (xml.name() == "bookmark") readBookmark(0); - else if (name() == "separator") + else if (xml.name() == "separator") readSeparator(0); else - skipCurrentElement(); + xml.skipCurrentElement(); } } //! [3] @@ -94,9 +104,9 @@ void XbelReader::readXBEL() //! [4] void XbelReader::readTitle(QTreeWidgetItem *item) { - Q_ASSERT(isStartElement() && name() == "title"); + Q_ASSERT(xml.isStartElement() && xml.name() == "title"); - QString title = readElementText(); + QString title = xml.readElementText(); item->setText(0, title); } //! [4] @@ -104,52 +114,52 @@ void XbelReader::readTitle(QTreeWidgetItem *item) //! [5] void XbelReader::readSeparator(QTreeWidgetItem *item) { - Q_ASSERT(isStartElement() && name() == "separator"); + Q_ASSERT(xml.isStartElement() && xml.name() == "separator"); QTreeWidgetItem *separator = createChildItem(item); separator->setFlags(item->flags() & ~Qt::ItemIsSelectable); separator->setText(0, QString(30, 0xB7)); - skipCurrentElement(); + xml.skipCurrentElement(); } //! [5] void XbelReader::readFolder(QTreeWidgetItem *item) { - Q_ASSERT(isStartElement() && name() == "folder"); + Q_ASSERT(xml.isStartElement() && xml.name() == "folder"); QTreeWidgetItem *folder = createChildItem(item); - bool folded = (attributes().value("folded") != "no"); + bool folded = (xml.attributes().value("folded") != "no"); treeWidget->setItemExpanded(folder, !folded); - while (readNextStartElement()) { - if (name() == "title") + while (xml.readNextStartElement()) { + if (xml.name() == "title") readTitle(folder); - else if (name() == "folder") + else if (xml.name() == "folder") readFolder(folder); - else if (name() == "bookmark") + else if (xml.name() == "bookmark") readBookmark(folder); - else if (name() == "separator") + else if (xml.name() == "separator") readSeparator(folder); else - skipCurrentElement(); + xml.skipCurrentElement(); } } void XbelReader::readBookmark(QTreeWidgetItem *item) { - Q_ASSERT(isStartElement() && name() == "bookmark"); + Q_ASSERT(xml.isStartElement() && xml.name() == "bookmark"); QTreeWidgetItem *bookmark = createChildItem(item); bookmark->setFlags(bookmark->flags() | Qt::ItemIsEditable); bookmark->setIcon(0, bookmarkIcon); bookmark->setText(0, QObject::tr("Unknown title")); - bookmark->setText(1, attributes().value("href").toString()); + bookmark->setText(1, xml.attributes().value("href").toString()); - while (readNextStartElement()) { - if (name() == "title") + while (xml.readNextStartElement()) { + if (xml.name() == "title") readTitle(bookmark); else - skipCurrentElement(); + xml.skipCurrentElement(); } } @@ -161,6 +171,6 @@ QTreeWidgetItem *XbelReader::createChildItem(QTreeWidgetItem *item) } else { childItem = new QTreeWidgetItem(treeWidget); } - childItem->setData(0, Qt::UserRole, name().toString()); + childItem->setData(0, Qt::UserRole, xml.name().toString()); return childItem; } diff --git a/examples/xml/streambookmarks/xbelreader.h b/examples/xml/streambookmarks/xbelreader.h index 2debadc..00d5850 100644 --- a/examples/xml/streambookmarks/xbelreader.h +++ b/examples/xml/streambookmarks/xbelreader.h @@ -51,7 +51,7 @@ class QTreeWidgetItem; QT_END_NAMESPACE //! [0] -class XbelReader : public QXmlStreamReader +class XbelReader { public: //! [1] @@ -60,6 +60,8 @@ public: bool read(QIODevice *device); + QString errorString() const; + private: //! [2] void readXBEL(); @@ -70,6 +72,7 @@ private: QTreeWidgetItem *createChildItem(QTreeWidgetItem *item); + QXmlStreamReader xml; QTreeWidget *treeWidget; //! [2] diff --git a/examples/xml/streambookmarks/xbelwriter.cpp b/examples/xml/streambookmarks/xbelwriter.cpp index 3a2862a..58757f5 100644 --- a/examples/xml/streambookmarks/xbelwriter.cpp +++ b/examples/xml/streambookmarks/xbelwriter.cpp @@ -47,23 +47,23 @@ XbelWriter::XbelWriter(QTreeWidget *treeWidget) : treeWidget(treeWidget) { - setAutoFormatting(true); + xml.setAutoFormatting(true); } //! [0] //! [1] bool XbelWriter::writeFile(QIODevice *device) { - setDevice(device); + xml.setDevice(device); - writeStartDocument(); - writeDTD(""); - writeStartElement("xbel"); - writeAttribute("version", "1.0"); + xml.writeStartDocument(); + xml.writeDTD(""); + xml.writeStartElement("xbel"); + xml.writeAttribute("version", "1.0"); for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) writeItem(treeWidget->topLevelItem(i)); - writeEndDocument(); + xml.writeEndDocument(); return true; } //! [1] @@ -74,20 +74,20 @@ void XbelWriter::writeItem(QTreeWidgetItem *item) QString tagName = item->data(0, Qt::UserRole).toString(); if (tagName == "folder") { bool folded = !treeWidget->isItemExpanded(item); - writeStartElement(tagName); - writeAttribute("folded", folded ? "yes" : "no"); - writeTextElement("title", item->text(0)); + xml.writeStartElement(tagName); + xml.writeAttribute("folded", folded ? "yes" : "no"); + xml.writeTextElement("title", item->text(0)); for (int i = 0; i < item->childCount(); ++i) writeItem(item->child(i)); - writeEndElement(); + xml.writeEndElement(); } else if (tagName == "bookmark") { - writeStartElement(tagName); + xml.writeStartElement(tagName); if (!item->text(1).isEmpty()) - writeAttribute("href", item->text(1)); - writeTextElement("title", item->text(0)); - writeEndElement(); + xml.writeAttribute("href", item->text(1)); + xml.writeTextElement("title", item->text(0)); + xml.writeEndElement(); } else if (tagName == "separator") { - writeEmptyElement(tagName); + xml.writeEmptyElement(tagName); } } //! [2] diff --git a/examples/xml/streambookmarks/xbelwriter.h b/examples/xml/streambookmarks/xbelwriter.h index 29a8b04..b74d015 100644 --- a/examples/xml/streambookmarks/xbelwriter.h +++ b/examples/xml/streambookmarks/xbelwriter.h @@ -50,7 +50,7 @@ class QTreeWidgetItem; QT_END_NAMESPACE //! [0] -class XbelWriter : public QXmlStreamWriter +class XbelWriter { public: XbelWriter(QTreeWidget *treeWidget); @@ -58,6 +58,7 @@ public: private: void writeItem(QTreeWidgetItem *item); + QXmlStreamWriter xml; QTreeWidget *treeWidget; }; //! [0] diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index a311b99..4cd8965 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -313,8 +313,8 @@ QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const error handling described. The \l{QXmlStream Bookmarks Example} illustrates how to use the - recursive descent technique with a subclassed stream reader to read - an XML bookmark file (XBEL). + recursive descent technique to read an XML bookmark file (XBEL) with + a stream reader. \section1 Namespaces @@ -2943,7 +2943,7 @@ QStringRef QXmlStreamReader::documentEncoding() const encodings can be enforced using setCodec(). The \l{QXmlStream Bookmarks Example} illustrates how to use a - subclassed stream writer to write an XML bookmark file (XBEL) that + stream writer to write an XML bookmark file (XBEL) that was previously read in by a QXmlStreamReader. */ -- cgit v0.12 From d0bf6b569eefef47891d851161f610bf34d28bfb Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 19 Aug 2009 16:14:27 +0200 Subject: Document more of the behavior of QTouchEvent This includes docs on the default QWidget::event() behavior, how to use touch with QAbstractScrollArea subclasses, how the propagation and grouping works, as well as some caveats. Reviewed-by: David Boddie --- src/gui/kernel/qevent.cpp | 158 +++++++++++++++++++++++++++++++++------------- 1 file changed, 115 insertions(+), 43 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 7365820..3e1d12d 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3538,38 +3538,108 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar) \since 4.6 \ingroup events - Touch events occur when pressing, releasing, or moving one or more - touch points on a touch device (such as a touch-screen or - track-pad). To receive touch events, widgets have to have the - Qt::WA_AcceptTouchEvents attribute set and graphics items need to have - the \l{QGraphicsItem::setAcceptTouchEvents()}{acceptTouchEvents} - attribute set to true. - - All touch events are of type QEvent::TouchBegin, - QEvent::TouchUpdate, or QEvent::TouchEnd. The touchPoints() - function returns a list of all touch points contained in the event. - Information about each touch point can be retrieved using the - QTouchEvent::TouchPoint class. The Qt::TouchPointState enum - describes the different states that a touch point may have. - - Similar to QMouseEvent, Qt automatically grabs each touch point on - the first press inside a widget; the widget will receive all - updates for the touch point until it is released. Note that it is - possible for a widget to receive events for multiple touch points, - and that multiple widgets may be receiving touch events at the same - time. - - A touch event contains a special accept flag that indicates - whether the receiver wants the event. By default, the event is - accepted. You should call ignore() if the touch event is not handled by - your widget. A QEvent::TouchBegin event is propagated up the parent widget - chain until a widget accepts it with accept(), or an event filter - consumes it. If the QEvent::TouchBegin event is neither accepted nor consumed, - then mouse events are simulated from the state of the first touch - point. - - Reimplement QWidget::event() for widgets and QGraphicsItem::sceneEvent() - for items in a graphics view to receive touch events. + \section1 Enabling Touch Events + + Touch events occur when pressing, releasing, or moving one or more touch points on a touch + device (such as a touch-screen or track-pad). To receive touch events, widgets have to have the + Qt::WA_AcceptTouchEvents attribute set and graphics items need to have the + \l{QGraphicsItem::setAcceptTouchEvents()}{acceptTouchEvents} attribute set to true. + + Note: when using QAbstractScrollArea based widgets, you should enabled the + Qt::WA_AcceptTouchEvents attribute on the scroll area's + \l{QAbstractScrollArea::viewport()}{viewport}. + + \section1 Event Delivery and Propagation + + All touch events are of type QEvent::TouchBegin, QEvent::TouchUpdate, or QEvent::TouchEnd. + Reimplement QWidget::event() or QAbstractScrollArea::viewportEvent() for widgets and + QGraphicsItem::sceneEvent() for items in a graphics view to receive touch events. By default, + QWidget::event() translates the first non-primary touch point in a QTouchEvent into a + QMouseEvent. This makes it possible to enable touch events on existing widgets that do not + normally handle QTouchEvent. See below for information on some special considerations needed + when doing this. + + QEvent::TouchBegin is the first touch event sent to a widget. The QEvent::TouchBegin event + contains a special accept flag that indicates whether the receiver wants the event. By default, + the event is accepted. You should call ignore() if the touch event is not handled by your + widget. The QEvent::TouchBegin event is propagated up the parent widget chain until a widget + accepts it with accept(), or an event filter consumes it. For QGraphicsItems, the + QEvent::TouchBegin event is propagated to items under the mouse (similar to mouse event + propagation for QGraphicsItems). + + The QEvent::TouchUpdate and QEvent::TouchEnd events are sent to the widget or item that + accepted the QEvent::TouchBegin event. If the QEvent::TouchBegin event is not accepted and not + filtered by an event filter, then no further touch events are sent until the next + QEvent::TouchBegin. + + The touchPoints() function returns a list of all touch points contained in the event. + Information about each touch point can be retrieved using the QTouchEvent::TouchPoint class. + The Qt::TouchPointState enum describes the different states that a touch point may have. + + Similar to QMouseEvent, Qt automatically grabs each touch point on the first press inside a + widget; the widget will receive all updates for the touch point until it is released. Note that + it is possible for a widget to receive events for multiple touch points, and that multiple + widgets may be receiving touch events at the same time. + + \section1 Touch Point Grouping + + As mentioned above, it is possible that several widgets can be receiving QTouchEvents at the + same time. However, Qt makes sure to never send duplicate QEvent::TouchBegin events to the same + widget, which could theoretically happen during propagation if, for example, the user touched 2 + separate widgets in a QGroupBox and both widgets ignored the QEvent::TouchBegin event. + + To avoid this, Qt will group new touch points together using the following rules: + + \list + + \i When the first touch point is detected, the destination widget is determined firstly by the + location on screen first and secondly by the propagation rules. + + \i When additional touch points are detected, Qt first looks to see if there are any active + touch points on any ancestor or descendent of the widget under the new touch point. If there + are, the new touch point is grouped with the first, and the new touch point will be sent in a + single QTouchEvent to the widget that handled the first touch point. (The widget under the new + touch point will not receive an event). + + \endlist + + This makes it possible for sibling widgets to handle touch events independently while making + sure that the sequence of QTouchEvents is always correct. + + \section1 Mouse Events and the Primary Touch Point + + QTouchEvent delivery is independent from that of QMouseEvent. On some windowing systems, mouse + events are also sent for the \l{QTouchEvent::TouchPoint::isPrimary()}{primary touch point}. + This means it is possible for your widget to receive both QTouchEvent and QMouseEvent for the + same user interaction point. You can use the QTouchEvent::TouchPoint::isPrimary() function to + identify the primary touch point. + + Note that on some systems, it is possible to receive touch events without a primary touch + point. All this means is that there will be no mouse event generated for the touch points in + the QTouchEvent. + + \section1 Caveats + + \list + + \i As mentioned above, enabling touch events means multiple widgets can be receiving touch + events simultaneously. Combined with the default QWidget::event() handling for QTouchEvents, + this gives you great flexibility in designing multi-touch user interfaces. Be aware of the + implications. For example, is is possible that the user is moving a QSlider with one finger and + pressing a QPushButton with another. The signals are emitted from these widgets will be + interleaved. + + \i Recursion into the event loop using one of the exec() methods (e.g. QDialog::exec() or + QMenu::exec()) in a QTouchEvent event handler is not supported. Since there are multiple event + recipients, unexpected recursion may cause problems, including but not limited to lost events + and unexpected infinite recursion. + + \i QTouchEvents are not affected by a \l{QWidget::grabMouse()}{mouse grab} or an + \l{QApplication::activePopupWidget()}{active popup widget}. The behavior of QTouchEvents is + undefined when opening a popup or grabbing the mouse while there are multiple active touch + points. + + \endlist \sa QTouchEvent::TouchPoint, Qt::TouchPointState, Qt::WA_AcceptTouchEvents, QGraphicsItem::acceptTouchEvents() @@ -3648,6 +3718,11 @@ QTouchEvent::~QTouchEvent() Returns the list of touch points contained in the touch event. */ +/*! \fn QTouchEvent::DeviceType QTouchEvent::deviceType() const + + Returns the touch device Type, which is of type \l {QTouchEvent::DeviceType} {DeviceType}. +*/ + /*! \fn void QTouchEvent::setWidget(QWidget *widget) \internal @@ -3669,6 +3744,14 @@ QTouchEvent::~QTouchEvent() Sets the list of touch points for this event. */ +/*! \fn void QTouchEvent::setDeviceType(DeviceType deviceType) + + \internal + + Sets the device type to \a deviceType, which is of type \l {QTouchEvent::DeviceType} + {DeviceType}. +*/ + /*! \class QTouchEvent::TouchPoint \brief The QTouchEvent::TouchPoint class provides information about a touch point in a QTouchEvent. \since 4.6 @@ -4080,15 +4163,4 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T return *this; } -/*! \fn QTouchEvent::DeviceType QTouchEvent::deviceType() const - Returns the touch device Type, which is of type - \l {QTouchEvent::DeviceType} {DeviceType}. - */ - -/*! \fn void QTouchEvent::setDeviceType(DeviceType deviceType) - Sets the device type to \a deviceType, which is of type - \l {QTouchEvent::DeviceType} {DeviceType}. - */ - - QT_END_NAMESPACE -- cgit v0.12 From 555fafe46e26b352e9d8ab5586910591761ab5ad Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 19 Aug 2009 16:20:45 +0200 Subject: Doc - mentioning that the begin...() functions emit a signal that must be handled by connected views/proxies. Otherwise, the views/proxies may end up in an invalid state. Task: 227718 Reviewed-By: Olivier Goffart --- src/corelib/kernel/qabstractitemmodel.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index 8761ec1..17af60d 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -2189,6 +2189,9 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare This appends the two new rows as rows 4 and 5. \endtable + \note This function emits the rowsAboutToBeInserted() signal which + connected views (or proxies) must handle before the data is inserted. + Otherwise, the views may end up in an invalid state. \sa endInsertRows() */ void QAbstractItemModel::beginInsertRows(const QModelIndex &parent, int first, int last) @@ -2239,6 +2242,10 @@ void QAbstractItemModel::endInsertRows() \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 2 \endtable + \note This function emits the rowsAboutToBeRemoved() signal which connected + views (or proxies) must handle before the data is removed. Otherwise, the + views may end up in an invalid state. + \sa endRemoveRows() */ void QAbstractItemModel::beginRemoveRows(const QModelIndex &parent, int first, int last) @@ -2302,6 +2309,10 @@ void QAbstractItemModel::endRemoveRows() This appends the two new columns as columns 6, 7, and 8. \endtable + \note This function emits the columnsAboutToBeInserted() signal which + connected views (or proxies) must handle before the data is inserted. + Otherwise, the views may end up in an invalid state. + \sa endInsertColumns() */ void QAbstractItemModel::beginInsertColumns(const QModelIndex &parent, int first, int last) @@ -2353,6 +2364,10 @@ void QAbstractItemModel::endInsertColumns() \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 5 \endtable + \note This function emits the columnsAboutToBeRemoved() signal which + connected views (or proxies) must handle before the data is removed. + Otherwise, the views may end up in an invalid state. + \sa endRemoveColumns() */ void QAbstractItemModel::beginRemoveColumns(const QModelIndex &parent, int first, int last) -- cgit v0.12 From 919b723088b8617b202b92d80b8d0983e4fd9500 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 17 Aug 2009 10:17:27 +0200 Subject: Improve memory usage of the connectionlists inside QObject ... by not allocating space for slots in the vector. Before, the vector uses the signal index as index. The problem is that the slots and signal are mixed in the same index space. We solve the problem by having a different index space for the signal in the connectionlists vector. All we need to do is to add the information about the number of signals in the moc. Also, we are not connecting to cloned signal but only to the orginial ones. For example, destroyed(QObject * = 0) would generate two signal, we now only connect to the first one. This also improve a little bit the performence while activating signals since it removed one call to indexOfMethod. Reviewed-by: Brad --- src/corelib/animation/qvariantanimation.cpp | 15 +- src/corelib/animation/qvariantanimation_p.h | 2 - src/corelib/kernel/qmetaobject.cpp | 102 ++++----- src/corelib/kernel/qmetaobject_p.h | 74 ++++++ src/corelib/kernel/qobject.cpp | 335 +++++++++++++++++----------- src/corelib/kernel/qobject_p.h | 3 + src/corelib/kernel/qobjectdefs.h | 8 +- src/gui/graphicsview/qgraphicsitem.cpp | 2 +- src/gui/graphicsview/qgraphicsscene.cpp | 17 +- src/gui/graphicsview/qgraphicsscene_p.h | 2 +- src/tools/moc/generator.cpp | 53 +---- 11 files changed, 353 insertions(+), 260 deletions(-) diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index fc11815..696a95a 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -137,7 +137,6 @@ QT_BEGIN_NAMESPACE \sa currentValue */ - static bool animationValueLessThan(const QVariantAnimation::KeyValue &p1, const QVariantAnimation::KeyValue &p2) { return p1.first < p2.first; @@ -178,11 +177,8 @@ template<> Q_INLINE_TEMPLATE QLineF _q_interpolate(const QLineF &f, const QLineF return QLineF( _q_interpolate(f.p1(), t.p1(), progress), _q_interpolate(f.p2(), t.p2(), progress)); } -QVariantAnimationPrivate::QVariantAnimationPrivate() : duration(250), interpolator(&defaultInterpolator), - changedSignalMask(1 << QVariantAnimation::staticMetaObject.indexOfSignal("valueChanged(QVariant)")) -{ - //we keep the mask so that we emit valueChanged only when needed (for performance reasons) -} +QVariantAnimationPrivate::QVariantAnimationPrivate() : duration(250), interpolator(&defaultInterpolator) +{ } void QVariantAnimationPrivate::convertValues(int t) { @@ -278,7 +274,12 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress) localProgress); qSwap(currentValue, ret); q->updateCurrentValue(currentValue); - if ((connectedSignals[0] & changedSignalMask) && currentValue != ret) { + static QBasicAtomicInt changedSignalIndex = Q_BASIC_ATOMIC_INITIALIZER(0); + if (!changedSignalIndex) { + //we keep the mask so that we emit valueChanged only when needed (for performance reasons) + changedSignalIndex.testAndSetRelaxed(0, signalIndex("valueChanged(QVariant)")); + } + if (isSignalConnected(changedSignalIndex) && currentValue != ret) { //the value has changed emit q->valueChanged(currentValue); } diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h index ef57a4c..ce625f1 100644 --- a/src/corelib/animation/qvariantanimation_p.h +++ b/src/corelib/animation/qvariantanimation_p.h @@ -93,8 +93,6 @@ public: QVariantAnimation::Interpolator interpolator; - const quint32 changedSignalMask; - void setCurrentValueForProgress(const qreal progress); void recalculateCurrentInterval(bool force=false); void setValueAt(qreal, const QVariant &); diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 522f0dc..847938f 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -140,63 +140,6 @@ QT_BEGIN_NAMESPACE \value Public */ -// do not touch without touching the moc as well -enum PropertyFlags { - Invalid = 0x00000000, - Readable = 0x00000001, - Writable = 0x00000002, - Resettable = 0x00000004, - EnumOrFlag = 0x00000008, - StdCppSet = 0x00000100, -// Override = 0x00000200, - Constant = 0x00000400, - Final = 0x00000800, - Designable = 0x00001000, - ResolveDesignable = 0x00002000, - Scriptable = 0x00004000, - ResolveScriptable = 0x00008000, - Stored = 0x00010000, - ResolveStored = 0x00020000, - Editable = 0x00040000, - ResolveEditable = 0x00080000, - User = 0x00100000, - ResolveUser = 0x00200000, - Notify = 0x00400000 -}; - -enum MethodFlags { - AccessPrivate = 0x00, - AccessProtected = 0x01, - AccessPublic = 0x02, - AccessMask = 0x03, //mask - - MethodMethod = 0x00, - MethodSignal = 0x04, - MethodSlot = 0x08, - MethodConstructor = 0x0c, - MethodTypeMask = 0x0c, - - MethodCompatibility = 0x10, - MethodCloned = 0x20, - MethodScriptable = 0x40 -}; - -enum MetaObjectFlags { - DynamicMetaObject = 0x01 -}; - -struct QMetaObjectPrivate -{ - int revision; - int className; - int classInfoCount, classInfoData; - int methodCount, methodData; - int propertyCount, propertyData; - int enumeratorCount, enumeratorData; - int constructorCount, constructorData; - int flags; -}; - static inline const QMetaObjectPrivate *priv(const uint* data) { return reinterpret_cast(data); } @@ -599,29 +542,46 @@ int QMetaObject::indexOfMethod(const char *method) const */ int QMetaObject::indexOfSignal(const char *signal) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { + int i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal); + if (i >= 0) + i += m->methodOffset(); + return i; +} + +/*! \internal + Same as QMetaObject::indexOfSignal, but the result is the local offset to the base object. + + \a baseObject will be adjusted to the enclosing QMetaObject, or 0 if the signal is not found +*/ +int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, const char *signal) +{ + int i = -1; + while (*baseObject) { + const QMetaObject *const m = *baseObject; for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) if ((m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodSignal && strcmp(signal, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - i += m->methodOffset(); + + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { break; } - m = m->d.superdata; + if (i >= 0) + break; + *baseObject = m->d.superdata; } #ifndef QT_NO_DEBUG + const QMetaObject *m = *baseObject; if (i >= 0 && m && m->d.superdata) { int conflict = m->d.superdata->indexOfMethod(signal); if (conflict >= 0) qWarning("QMetaObject::indexOfSignal:%s: Conflict with %s::%s", - m->d.stringdata, m->d.superdata->d.stringdata, signal); + m->d.stringdata, m->d.superdata->d.stringdata, signal); } #endif return i; } + /*! Finds \a slot and returns its index; otherwise returns -1. @@ -2669,4 +2629,20 @@ const char* QMetaClassInfo::value() const and \a data. */ +/*! \internal + If the local_method_index is a cloned method, return the index of the original. + + Example: if the index of "destroyed()" is passed, the index of "destroyed(QObject*)" is returned + */ +int QMetaObjectPrivate::originalClone(const QMetaObject *mobj, int local_method_index) +{ + int handle = get(mobj)->methodData + 5 * local_method_index; + while (mobj->d.data[handle + 4] & MethodCloned) { + Q_ASSERT(local_method_index > 0); + handle -= 5; + local_method_index--; + } + return local_method_index; +} + QT_END_NAMESPACE diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 66ed55c..d843deb 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -54,9 +54,82 @@ // #include +#include QT_BEGIN_NAMESPACE +enum PropertyFlags { + Invalid = 0x00000000, + Readable = 0x00000001, + Writable = 0x00000002, + Resettable = 0x00000004, + EnumOrFlag = 0x00000008, + StdCppSet = 0x00000100, +// Override = 0x00000200, + Constant = 0x00000400, + Final = 0x00000800, + Designable = 0x00001000, + ResolveDesignable = 0x00002000, + Scriptable = 0x00004000, + ResolveScriptable = 0x00008000, + Stored = 0x00010000, + ResolveStored = 0x00020000, + Editable = 0x00040000, + ResolveEditable = 0x00080000, + User = 0x00100000, + ResolveUser = 0x00200000, + Notify = 0x00400000 +}; + +enum MethodFlags { + AccessPrivate = 0x00, + AccessProtected = 0x01, + AccessPublic = 0x02, + AccessMask = 0x03, //mask + + MethodMethod = 0x00, + MethodSignal = 0x04, + MethodSlot = 0x08, + MethodConstructor = 0x0c, + MethodTypeMask = 0x0c, + + MethodCompatibility = 0x10, + MethodCloned = 0x20, + MethodScriptable = 0x40 +}; + +enum MetaObjectFlags { + DynamicMetaObject = 0x01 +}; + + +struct QMetaObjectPrivate +{ + int revision; + int className; + int classInfoCount, classInfoData; + int methodCount, methodData; + int propertyCount, propertyData; + int enumeratorCount, enumeratorData; + int constructorCount, constructorData; //since revision 2 + int flags; //since revision 3 + int signalCount; //since revision 4 + + static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject) + { return reinterpret_cast(metaobject->d.data); } + + static int indexOfSignalRelative(const QMetaObject **baseObject, const char* name); + static int originalClone(const QMetaObject *obj, int local_method_index); + + //defined in qobject.cpp + static bool connect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index, + int type = 0, int *types = 0); + static bool disconnect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index); + +}; + #ifndef UTILS_H // mirrored in moc's utils.h static inline bool is_ident_char(char s) @@ -202,6 +275,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc return result; } + QT_END_NAMESPACE #endif diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 0e75867..022ae13 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -41,6 +41,7 @@ #include "qobject.h" #include "qobject_p.h" +#include "qmetaobject_p.h" #include "qabstracteventdispatcher.h" #include "qcoreapplication.h" @@ -221,12 +222,42 @@ void QObjectPrivate::removePendingChildInsertedEvents(QObject *child) #endif +/*!\internal + For a given metaobject, compute the signal offset, and the method offset (including signals) +*/ +static void computeOffsets(const QMetaObject *metaobject, int *signalOffset, int *methodOffset) +{ + *signalOffset = *methodOffset = 0; + const QMetaObject *m = metaobject->d.superdata; + while (m) { + const QMetaObjectPrivate *d = QMetaObjectPrivate::get(m); + *methodOffset += d->methodCount; + *signalOffset += (d->revision >= 4) ? d->signalCount : d->methodCount; + /*Before Qt 4.6 (revision 4), the signalCount information was not generated by moc. + so for compatibility we consider all the method as slot for old moc output*/ + m = m->d.superdata; + } +} + +/*! \internal + This vector contains the all connections from an object. + + Each object may have one vector containing the lists of connections for a given signal. + The index in the vector correspond to the signal index. + The signal index is the one returned by QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal). + Negative index means connections to all signals. + + This vector is protected by the object mutex (signalSlotMutexes()) + + Each Connection is also part of a 'senders' linked list. The mutex of the receiver must be locked when touching + the pointers of this linked list. +*/ class QObjectConnectionListVector : public QVector { public: - bool orphaned; - bool dirty; - int inUse; + bool orphaned; //the QObject owner of this vector has been destroyed while the vector was inUse + bool dirty; //some Connection have been disconnected (their receiver is 0) but not removed from the list yet + int inUse; //number of functions that are currently accessing this object or its connections QObjectPrivate::ConnectionList allsignals; QObjectConnectionListVector() @@ -251,7 +282,7 @@ public: bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const { Q_Q(const QObject); - int signal_index = q->metaObject()->indexOfSignal(signal); + int signal_index = signalIndex(signal); if (signal_index < 0) return false; QMutexLocker locker(signalSlotLock(q)); @@ -275,7 +306,7 @@ QObjectList QObjectPrivate::receiverList(const char *signal) const { Q_Q(const QObject); QObjectList returnValue; - int signal_index = q->metaObject()->indexOfSignal(signal); + int signal_index = signalIndex(signal); if (signal_index < 0) return returnValue; QMutexLocker locker(signalSlotLock(q)); @@ -2417,6 +2448,7 @@ QObject *QObject::sender() const int QObject::receivers(const char *signal) const { + Q_D(const QObject); int receivers = 0; if (signal) { QByteArray signal_name = QMetaObject::normalizedSignature(signal); @@ -2426,8 +2458,7 @@ int QObject::receivers(const char *signal) const return 0; #endif signal++; // skip code - const QMetaObject *smeta = this->metaObject(); - int signal_index = smeta->indexOfSignal(signal); + int signal_index = d->signalIndex(signal); if (signal_index < 0) { #ifndef QT_NO_DEBUG err_method_notfound(this, signal-1, "receivers"); @@ -2551,19 +2582,26 @@ bool QObject::connect(const QObject *sender, const char *signal, const QMetaObject *smeta = sender->metaObject(); const char *signal_arg = signal; ++signal; //skip code - int signal_index = smeta->indexOfSignal(signal); + int signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); if (signal_index < 0) { // check for normalized signatures tmp_signal_name = QMetaObject::normalizedSignature(signal - 1); signal = tmp_signal_name.constData() + 1; - signal_index = smeta->indexOfSignal(signal); + smeta = sender->metaObject(); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + if (signal_index < 0) { err_method_notfound(sender, signal_arg, "connect"); err_info_about_objects("connect", sender, receiver); return false; } } + signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); + int signalOffset, methodOffset; + computeOffsets(smeta, &signalOffset, &methodOffset); + int signal_absolute_index = signal_index + methodOffset; + signal_index += signalOffset; QByteArray tmp_method_name; int membcode = extract_code(method); @@ -2612,12 +2650,12 @@ bool QObject::connect(const QObject *sender, const char *signal, int *types = 0; if ((type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection) - && !(types = queuedConnectionTypes(smeta->method(signal_index).parameterTypes()))) + && !(types = queuedConnectionTypes(smeta->method(signal_absolute_index).parameterTypes()))) return false; #ifndef QT_NO_DEBUG { - QMetaMethod smethod = smeta->method(signal_index); + QMetaMethod smethod = smeta->method(signal_absolute_index); QMetaMethod rmethod = rmeta->method(method_index); if (warnCompat) { if(smethod.attributes() & QMetaMethod::Compatibility) { @@ -2630,7 +2668,7 @@ bool QObject::connect(const QObject *sender, const char *signal, } } #endif - if (!QMetaObject::connect(sender, signal_index, receiver, method_index, type, types)) + if (!QMetaObjectPrivate::connect(sender, signal_index, receiver, method_index, type, types)) return false; const_cast(sender)->connectNotify(signal - 1); return true; @@ -2761,14 +2799,18 @@ bool QObject::disconnect(const QObject *sender, const char *signal, do { int signal_index = -1; if (signal) { - signal_index = smeta->indexOfSignal(signal); - if (signal_index < smeta->methodOffset()) - continue; + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + if (signal_index < 0) + break; + signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); + int signalOffset, methodOffset; + computeOffsets(smeta, &signalOffset, &methodOffset); + signal_index += signalOffset; signal_found = true; } if (!method) { - res |= QMetaObject::disconnect(sender, signal_index, receiver, -1); + res |= QMetaObjectPrivate::disconnect(sender, signal_index, receiver, -1); } else { const QMetaObject *rmeta = receiver->metaObject(); do { @@ -2778,7 +2820,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal, rmeta = rmeta->superClass(); if (method_index < 0) break; - res |= QMetaObject::disconnect(sender, signal_index, receiver, method_index); + res |= QMetaObjectPrivate::disconnect(sender, signal_index, receiver, method_index); method_found = true; } while ((rmeta = rmeta->superClass())); } @@ -2869,16 +2911,31 @@ void QObject::disconnectNotify(const char *) } /*!\internal + \a types is a 0-terminated vector of meta types for queued + connections. - \a types is a 0-terminated vector of meta types for queued - connections. - - if \a signal_index is -1, then we effectively connect *all* signals - from the sender to the receiver's slot -*/ + if \a signal_index is -1, then we effectively connect *all* signals + from the sender to the receiver's slot + */ bool QMetaObject::connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type, int *types) { + const QMetaObject *mo = sender->metaObject(); + while (mo && mo->methodOffset() > signal_index) + mo = mo->superClass(); + int signalOffset, methodOffset; + computeOffsets(mo, &signalOffset, &methodOffset); + signal_index = QMetaObjectPrivate::originalClone(mo, signal_index - methodOffset) + signalOffset; + return QMetaObjectPrivate::connect(sender, signal_index, + receiver, method_index, type, types); +} + +/*! \internal + Same as the QMetaObject::connect, but \a signal_index must be the result of QObjectPrivate::signalIndex + */ +bool QMetaObjectPrivate::connect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index, int type, int *types) +{ QObject *s = const_cast(sender); QObject *r = const_cast(receiver); @@ -2886,7 +2943,7 @@ bool QMetaObject::connect(const QObject *sender, int signal_index, signalSlotLock(receiver)); if (type & Qt::UniqueConnection) { - QObjectConnectionListVector *connectionLists = s->d_func()->connectionLists; + QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists; if (connectionLists && connectionLists->count() > signal_index) { const QObjectPrivate::Connection *c2 = (*connectionLists)[signal_index].first; @@ -2907,25 +2964,25 @@ bool QMetaObject::connect(const QObject *sender, int signal_index, c->connectionType = type; c->argumentTypes = types; c->nextConnectionList = 0; - c->prev = &r->d_func()->senders; + c->prev = &(QObjectPrivate::get(r)->senders); c->next = *c->prev; *c->prev = c; if (c->next) c->next->prev = &c->next; - s->d_func()->addConnection(signal_index, c); + QObjectPrivate::get(s)->addConnection(signal_index, c); + QObjectPrivate *const sender_d = QObjectPrivate::get(s); if (signal_index < 0) { - for (uint i = 0; i < (sizeof sender->d_func()->connectedSignals - / sizeof sender->d_func()->connectedSignals[0] ); ++i) - sender->d_func()->connectedSignals[i] = ~0u; - } else if (signal_index < (int)sizeof sender->d_func()->connectedSignals * 8) { - uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - sender->d_func()->connectedSignals[n] |= (1 << (signal_index - n * 8 - * sizeof sender->d_func()->connectedSignals[0])); + for (uint i = 0; i < (sizeof sender_d->connectedSignals + / sizeof sender_d->connectedSignals[0] ); ++i) + sender_d->connectedSignals[i] = ~0u; + } else if (signal_index < (int)sizeof sender_d->connectedSignals * 8) { + uint n = (signal_index / (8 * sizeof sender_d->connectedSignals[0])); + sender_d->connectedSignals[n] |= (1 << (signal_index - n * 8 + * sizeof sender_d->connectedSignals[0])); } - return true; } @@ -2935,6 +2992,22 @@ bool QMetaObject::connect(const QObject *sender, int signal_index, bool QMetaObject::disconnect(const QObject *sender, int signal_index, const QObject *receiver, int method_index) { + const QMetaObject *mo = sender->metaObject(); + while (mo && mo->methodOffset() > signal_index) + mo = mo->superClass(); + int signalOffset, methodOffset; + computeOffsets(mo, &signalOffset, &methodOffset); + signal_index = QMetaObjectPrivate::originalClone(mo, signal_index - methodOffset) + signalOffset; + return QMetaObjectPrivate::disconnect(sender, signal_index, + receiver, method_index); +} + +/*! \internal + Same as the QMetaObject::disconnect, but \a signal_index must be the result of QObjectPrivate::signalIndex + */ +bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index) +{ if (!sender) return false; @@ -2945,7 +3018,7 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, QMutex *receiverMutex = receiver ? signalSlotLock(receiver) : 0; QOrderedMutexLocker locker(senderMutex, receiverMutex); - QObjectConnectionListVector *connectionLists = s->d_func()->connectionLists; + QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists; if (!connectionLists) return false; @@ -3056,23 +3129,26 @@ void QMetaObject::connectSlotsByName(QObject *o) int len = objName.length(); if (!len || qstrncmp(slot + 3, objName.data(), len) || slot[len+3] != '_') continue; - const QMetaObject *smo = co->metaObject(); - int sigIndex = smo->indexOfMethod(slot + len + 4); + int sigIndex = co->d_func()->signalIndex(slot + len + 4); if (sigIndex < 0) { // search for compatible signals + const QMetaObject *smo = co->metaObject(); int slotlen = qstrlen(slot + len + 4) - 1; for (int k = 0; k < co->metaObject()->methodCount(); ++k) { - if (smo->method(k).methodType() != QMetaMethod::Signal) + QMetaMethod method = smo->method(k); + if (method.methodType() != QMetaMethod::Signal) continue; - if (!qstrncmp(smo->method(k).signature(), slot + len + 4, slotlen)) { - sigIndex = k; + if (!qstrncmp(method.signature(), slot + len + 4, slotlen)) { + int signalOffset, methodOffset; + computeOffsets(method.enclosingMetaObject(), &signalOffset, &methodOffset); + sigIndex = k + - methodOffset + signalOffset; break; } } } if (sigIndex < 0) continue; - if (QMetaObject::connect(co, sigIndex, o, i)) { + if (QMetaObjectPrivate::connect(co, sigIndex, o, i)) { foundIt = true; break; } @@ -3142,15 +3218,43 @@ static void blocking_activate(QObject *sender, int signal, QObjectPrivate::Conne } /*!\internal + \obsolete. + Used to be called from QMetaObject::activate(QObject *, QMetaObject *, int, int, void **) */ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv) { + int offset = sender->metaObject()->methodOffset(); + activate(sender, from_signal_index - offset, to_signal_index - offset, argv); +} + +/*!\internal + */ +void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index, + void **argv) +{ + int signalOffset; + int methodOffset; + computeOffsets(m, &signalOffset, &methodOffset); + + int signal_index = signalOffset + local_signal_index; + if (signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8 + && !qt_signal_spy_callback_set.signal_begin_callback + && !qt_signal_spy_callback_set.signal_end_callback) { + uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); + uint m = 1 << (signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); + if ((sender->d_func()->connectedSignals[n] & m) == 0) + // nothing connected to these signals, and no spy + return; + } + if (sender->d_func()->blockSig) return; + int signal_absolute_index = methodOffset + local_signal_index; + void *empty_argv[] = { 0 }; if (qt_signal_spy_callback_set.signal_begin_callback != 0) { - qt_signal_spy_callback_set.signal_begin_callback(sender, from_signal_index, + qt_signal_spy_callback_set.signal_begin_callback(sender, signal_absolute_index, argv ? argv : empty_argv); } @@ -3160,26 +3264,20 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal QObjectConnectionListVector *connectionLists = sender->d_func()->connectionLists; if (!connectionLists) { if (qt_signal_spy_callback_set.signal_end_callback != 0) - qt_signal_spy_callback_set.signal_end_callback(sender, from_signal_index); + qt_signal_spy_callback_set.signal_end_callback(sender, signal_absolute_index); return; } ++connectionLists->inUse; + if (signal_index >= connectionLists->count()) { + signal_index = -2; //for "all signals"; + } - // emit signals in the following order: from_signal_index <= signals <= to_signal_index, signal < 0 - for (int signal = from_signal_index; - (signal >= from_signal_index && signal <= to_signal_index) || (signal == -2); - (signal == to_signal_index ? signal = -2 : ++signal)) - { - if (signal >= connectionLists->count()) { - signal = to_signal_index; - continue; - } - - QObjectPrivate::Connection *c = connectionLists->at(signal).first; + do { + QObjectPrivate::Connection *c = connectionLists->at(signal_index).first; if (!c) continue; // We need to check against last here to ensure that signals added // during the signal emission are not emitted in this emission. - QObjectPrivate::Connection *last = connectionLists->at(signal).last; + QObjectPrivate::Connection *last = connectionLists->at(signal_index).last; do { if (!c->receiver) @@ -3193,17 +3291,17 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal && (currentThreadData != sender->d_func()->threadData || receiver->d_func()->threadData != sender->d_func()->threadData)) || (c->connectionType == Qt::QueuedConnection)) { - queued_activate(sender, signal, c, argv); + queued_activate(sender, signal_absolute_index, c, argv); continue; } else if (c->connectionType == Qt::BlockingQueuedConnection) { - blocking_activate(sender, signal, c, argv); + blocking_activate(sender, signal_absolute_index, c, argv); continue; } const int method = c->method; QObjectPrivate::Sender currentSender; currentSender.sender = sender; - currentSender.signal = signal < 0 ? from_signal_index : signal; + currentSender.signal = signal_absolute_index; currentSender.ref = 1; QObjectPrivate::Sender *previousSender = 0; if (currentThreadData == receiver->d_func()->threadData) @@ -3247,7 +3345,7 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal if (connectionLists->orphaned) break; - } + } while (signal_index >= 0 && (signal_index = -1)); //start over for -1 (all signal) --connectionLists->inUse; Q_ASSERT(connectionLists->inUse >= 0); @@ -3261,82 +3359,50 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal locker.unlock(); if (qt_signal_spy_callback_set.signal_end_callback != 0) - qt_signal_spy_callback_set.signal_end_callback(sender, from_signal_index); -} + qt_signal_spy_callback_set.signal_end_callback(sender, signal_absolute_index); +} /*!\internal - */ + Obsolete. (signal_index comes from indexOfMethod()) +*/ void QMetaObject::activate(QObject *sender, int signal_index, void **argv) { - if (signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8 - && !qt_signal_spy_callback_set.signal_begin_callback - && !qt_signal_spy_callback_set.signal_end_callback) { - uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - uint m = 1 << (signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); - if ((sender->d_func()->connectedSignals[n] & m) == 0) - // nothing connected to these signals, and no spy - return; - } - activate(sender, signal_index, signal_index, argv); -} - -/*!\internal - */ -void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index, - void **argv) -{ - int signal_index = m->methodOffset() + local_signal_index; - if (signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8 - && !qt_signal_spy_callback_set.signal_begin_callback - && !qt_signal_spy_callback_set.signal_end_callback) { - uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - uint m = 1 << (signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); - if ((sender->d_func()->connectedSignals[n] & m) == 0) - // nothing connected to these signals, and no spy - return; - } - activate(sender, signal_index, signal_index, argv); + const QMetaObject *mo = sender->metaObject(); + while (mo && mo->methodOffset() > signal_index) + mo = mo->superClass(); + activate(sender, signal_index - mo->methodOffset(), argv); } /*!\internal + Obsolete, called by moc generated code before Qt 4.6 for cloned signals + But since Qt 4.6, all clones are connected to their original */ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int from_local_signal_index, int to_local_signal_index, void **argv) { - Q_ASSERT(from_local_signal_index <= to_local_signal_index); - int offset = m->methodOffset(); - int from_signal_index = offset + from_local_signal_index; - int to_signal_index = offset + to_local_signal_index; + Q_UNUSED(to_local_signal_index); + Q_ASSERT(from_local_signal_index == QMetaObjectPrivate::originalClone(m, to_local_signal_index)); + activate(sender, m, from_local_signal_index, argv); +} - if (to_signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8 - && !qt_signal_spy_callback_set.signal_begin_callback - && !qt_signal_spy_callback_set.signal_end_callback) { +/*! \internal + Returns the signal index used in the internal connectionLists vector. - uint n = (from_signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - uint m = 1 << (from_signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); - uint nt = (to_signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - uint mt = 1 << (to_signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); - bool connected = false; - quint32 *connectedSignals = sender->d_func()->connectedSignals; - for (uint i = 0; !connected && i < (sizeof sender->d_func()->connectedSignals - / sizeof sender->d_func()->connectedSignals[0]); ++i) { - uint mask = 0; - if (i > n) - mask = ~0u; - else if (i == n) - mask = ~(m -1); - if (i > nt) - mask = 0; - else if (i == nt) - mask &= (mt << 1) - 1; - connected = connectedSignals[i] & mask; - } - if (!connected) - // nothing connected to these signals, and no spy - return; - } - activate(sender, from_signal_index, to_signal_index, argv); + It is different from QMetaObject::indexOfSignal(): indexOfSignal is the same as indexOfMethod + while QObjectPrivate::signalIndex is smaller because it doesn't give index to slots. +*/ +int QObjectPrivate::signalIndex(const char *signalName) const +{ + Q_Q(const QObject); + const QMetaObject *base = q->metaObject(); + int relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName); + if (relative_index < 0) + return relative_index; + relative_index = QMetaObjectPrivate::originalClone(base, relative_index); + int signalOffset, methodOffset; + computeOffsets(base, &signalOffset, &methodOffset); + return relative_index + signalOffset; } /*! \internal @@ -3344,14 +3410,16 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, Returns true if the signal with index \a signal_index from object \a sender is connected. Signals with indices above a certain range are always considered connected (see connectedSignals in QObjectPrivate). If a signal spy is installed, all signals are considered connected. + + \a signal_index must be the index returned by QObjectPrivate::signalIndex; */ -bool QMetaObject::isConnected(QObject *sender, int signal_index) { - if (signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8 +bool QObjectPrivate::isSignalConnected(int signal_index) const { + if (signal_index < (int)sizeof(connectedSignals) * 8 && !qt_signal_spy_callback_set.signal_begin_callback && !qt_signal_spy_callback_set.signal_end_callback) { - uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0])); - uint m = 1 << (signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]); - if ((sender->d_func()->connectedSignals[n] & m) == 0) + uint n = (signal_index / (8 * sizeof connectedSignals[0])); + uint m = 1 << (signal_index - n * 8 * sizeof connectedSignals[0]); + if ((connectedSignals[n] & m) == 0) // nothing connected to these signals, and no spy return false; } @@ -3557,8 +3625,21 @@ void QObject::dumpObjectInfo() qDebug(" SIGNALS OUT"); if (d->connectionLists) { + int offset = 0; + int offsetToNextMetaObject = 0; for (int signal_index = 0; signal_index < d->connectionLists->count(); ++signal_index) { - const QMetaMethod signal = metaObject()->method(signal_index); + if (signal_index >= offsetToNextMetaObject) { + const QMetaObject *mo = metaObject(); + int signalOffset, methodOffset; + computeOffsets(mo, &signalOffset, &methodOffset); + while (mo && signalOffset > signal_index) { + mo = mo->superClass(); + offsetToNextMetaObject = signalOffset; + computeOffsets(mo, &signalOffset, &methodOffset); + } + offset = offset - signalOffset + methodOffset; + } + const QMetaMethod signal = metaObject()->method(signal_index + offset); qDebug(" signal: %s", signal.signature()); // receivers diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 49d8b63..9721ef8 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -169,6 +169,9 @@ public: return o->d_func(); } + int signalIndex(const char *signalName) const; + bool isSignalConnected(int signalIdx) const; + public: QString objectName; ExtraData *extraData; // extra data set by the user diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index befd596..421617a 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -330,12 +330,10 @@ struct Q_CORE_EXPORT QMetaObject static void connectSlotsByName(QObject *o); // internal index-based signal activation - static void activate(QObject *sender, int signal_index, void **argv); - static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv); + static void activate(QObject *sender, int signal_index, void **argv); //obsolete + static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv); //obsolete static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv); - static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv); - - static bool isConnected(QObject *sender, int signal_index); + static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv); //obsolete // internal guarded pointers static void addGuard(QObject **ptr); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 675fc0d..708ba09 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -6589,7 +6589,7 @@ void QGraphicsItem::prepareGeometryChange() // if someone is connected to the changed signal or the scene has no views. // Note that this has to be done *after* markDirty to ensure that // _q_processDirtyItems is called before _q_emitUpdated. - if ((scenePrivate->connectedSignals[0] & scenePrivate->changedSignalMask) + if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex) || scenePrivate->views.isEmpty()) { if (d_ptr->hasTranslateOnlySceneTransform()) { d_ptr->scene->update(boundingRect().translated(d_ptr->sceneTransform.dx(), diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 3f13a86..7fa565d 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -265,12 +265,13 @@ static void _q_hoverFromMouseEvent(QGraphicsSceneHoverEvent *hover, const QGraph hover->setAccepted(mouseEvent->isAccepted()); } +int QGraphicsScenePrivate::changedSignalIndex; + /*! \internal */ QGraphicsScenePrivate::QGraphicsScenePrivate() - : changedSignalMask(0), - indexMethod(QGraphicsScene::BspTreeIndex), + : indexMethod(QGraphicsScene::BspTreeIndex), index(0), lastItemCount(0), hasSceneRect(false), @@ -311,7 +312,9 @@ void QGraphicsScenePrivate::init() index = new QGraphicsSceneBspTreeIndex(q); // Keep this index so we can check for connected slots later on. - changedSignalMask = (1 << q->metaObject()->indexOfSignal("changed(QList)")); + if (!changedSignalIndex) { + changedSignalIndex = signalIndex("changed(QList)"); + } qApp->d_func()->scene_list.append(q); q->update(); } @@ -343,7 +346,7 @@ void QGraphicsScenePrivate::_q_emitUpdated() // the optimization that items send updates directly to the views, but it // needs to happen in order to keep compatibility with the behavior from // Qt 4.4 and backward. - if (connectedSignals[0] & changedSignalMask) { + if (isSignalConnected(changedSignalIndex)) { for (int i = 0; i < views.size(); ++i) { QGraphicsView *view = views.at(i); if (!view->d_func()->connectedToScene) { @@ -2894,7 +2897,7 @@ void QGraphicsScene::update(const QRectF &rect) // Check if anyone's connected; if not, we can send updates directly to // the views. Otherwise or if there are no views, use old behavior. - bool directUpdates = !(d->connectedSignals[0] & d->changedSignalMask) && !d->views.isEmpty(); + bool directUpdates = !(d->isSignalConnected(d->changedSignalIndex)) && !d->views.isEmpty(); if (rect.isNull()) { d->updateAll = true; d->updatedRects.clear(); @@ -4473,7 +4476,7 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b if (removingItemFromScene) { // Note that this function can be called from the item's destructor, so // do NOT call any virtual functions on it within this block. - if ((connectedSignals[0] & changedSignalMask) || views.isEmpty()) { + if (isSignalConnected(changedSignalIndex) || views.isEmpty()) { // This block of code is kept for compatibility. Since 4.5, by default // QGraphicsView does not connect the signal and we use the below // method of delivering updates. @@ -4619,7 +4622,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool // Process item. if (item->d_ptr->dirty || item->d_ptr->paintedViewBoundingRectsNeedRepaint) { - const bool useCompatUpdate = views.isEmpty() || (connectedSignals[0] & changedSignalMask); + const bool useCompatUpdate = views.isEmpty() || isSignalConnected(changedSignalIndex); const QRectF itemBoundingRect = adjustedItemBoundingRect(item); if (useCompatUpdate && !itemIsUntransformable && qFuzzyIsNull(item->boundingRegionGranularity())) { diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 685f534..f1ddb5a 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -87,7 +87,7 @@ public: static QGraphicsScenePrivate *get(QGraphicsScene *q); - quint32 changedSignalMask; + static int changedSignalIndex; QGraphicsScene::ItemIndexMethod indexMethod; QGraphicsSceneIndex *index; diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index f19c94b..cc6fa88 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -45,44 +45,9 @@ #include #include -QT_BEGIN_NAMESPACE +#include //for the flags. -// if the flags change, you MUST to change it in qmetaobject.cpp too -enum PropertyFlags { - Invalid = 0x00000000, - Readable = 0x00000001, - Writable = 0x00000002, - Resettable = 0x00000004, - EnumOrFlag = 0x00000008, - StdCppSet = 0x00000100, -// Override = 0x00000200, - Constant = 0x00000400, - Final = 0x00000800, - Designable = 0x00001000, - ResolveDesignable = 0x00002000, - Scriptable = 0x00004000, - ResolveScriptable = 0x00008000, - Stored = 0x00010000, - ResolveStored = 0x00020000, - Editable = 0x00040000, - ResolveEditable = 0x00080000, - User = 0x00100000, - ResolveUser = 0x00200000, - Notify = 0x00400000 -}; - -enum MethodFlags { - AccessPrivate = 0x00, - AccessProtected = 0x01, - AccessPublic = 0x02, - MethodMethod = 0x00, - MethodSignal = 0x04, - MethodSlot = 0x08, - MethodConstructor = 0x0c, - MethodCompatibility = 0x10, - MethodCloned = 0x20, - MethodScriptable = 0x40 -}; +QT_BEGIN_NAMESPACE uint qvariant_nameToType(const char* name) { @@ -205,10 +170,10 @@ void Generator::generateCode() QByteArray qualifiedClassNameIdentifier = cdef->qualified; qualifiedClassNameIdentifier.replace(':', '_'); - int index = 13; + int index = 14; fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData()); fprintf(out, "\n // content:\n"); - fprintf(out, " %4d, // revision\n", 3); + fprintf(out, " %4d, // revision\n", 4); fprintf(out, " %4d, // classname\n", strreg(cdef->qualified)); fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0); index += cdef->classInfoList.count() * 2; @@ -229,6 +194,7 @@ void Generator::generateCode() isConstructible ? index : 0); fprintf(out, " %4d, // flags\n", 0); + fprintf(out, " %4d, // signalCount\n", cdef->signalList.count()); // @@ -1016,14 +982,7 @@ void Generator::generateSignal(FunctionDef *def,int index) else fprintf(out, ", const_cast(reinterpret_cast(&_t%d))", i); fprintf(out, " };\n"); - int n = 0; - for (i = 0; i < def->arguments.count(); ++i) - if (def->arguments.at(i).isDefault) - ++n; - if (n) - fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, %d, _a);\n", thisPtr.constData(), index, index + n); - else - fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, _a);\n", thisPtr.constData(), index); + fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, _a);\n", thisPtr.constData(), index); if (def->normalizedType.size()) fprintf(out, " return _t0;\n"); fprintf(out, "}\n"); -- cgit v0.12 From 0af5e650d2e4a776c4c60f6ac3819605054663df Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 20 Aug 2009 15:52:41 +1000 Subject: Add some more tests for QQuaternion multiplication Reviewed-by: trustme --- tests/auto/qquaternion/tst_qquaternion.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/qquaternion/tst_qquaternion.cpp b/tests/auto/qquaternion/tst_qquaternion.cpp index ba546f1..1fb2d6b 100644 --- a/tests/auto/qquaternion/tst_qquaternion.cpp +++ b/tests/auto/qquaternion/tst_qquaternion.cpp @@ -466,6 +466,15 @@ void tst_QQuaternion::multiply_data() QTest::newRow("complex") << (qreal)1.0f << (qreal)2.0f << (qreal)3.0f << (qreal)7.0f << (qreal)4.0f << (qreal)5.0f << (qreal)6.0f << (qreal)8.0f; + + for (qreal w = -1.0f; w <= 1.0f; w += 0.5f) + for (qreal x = -1.0f; x <= 1.0f; x += 0.5f) + for (qreal y = -1.0f; y <= 1.0f; y += 0.5f) + for (qreal z = -1.0f; z <= 1.0f; z += 0.5f) { + QTest::newRow("exhaustive") + << x << y << z << w + << z << w << y << x; + } } void tst_QQuaternion::multiply() { -- cgit v0.12 From e49f978b16f38bf51eb631e5bc04e46f4d8bdb9d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 20 Aug 2009 07:57:14 +0200 Subject: Instantiate the CP949 codec when building with -no-iconv Otherwise this codec would not be available. --- src/corelib/codecs/qtextcodec.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index b150e22..52c507d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -696,6 +696,7 @@ static void setup() (void)new QJisCodec; (void)new QSjisCodec; (void)new QEucKrCodec; + (void)new QCP949Codec; (void)new QBig5Codec; (void)new QBig5hkscsCodec; # endif // QT_NO_ICONV && !QT_BOOTSTRAPPED -- cgit v0.12 From 24f8cf971b330214f79757facc82d72981b7789e Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 20 Aug 2009 08:44:03 +0200 Subject: XdndLeave events have incorrect source id When sending XdndLeave events, we should use the effectiveWinId() of the drag source (just like we do when sending XdndEnter and XdndPosition events). Task-number: 255559 --- src/gui/kernel/qdnd_x11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index a4042c1..8f92fea 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1073,12 +1073,14 @@ void qt_xdnd_send_leave() if (!qt_xdnd_current_target) return; + QDragManager *manager = QDragManager::self(); + XClientMessageEvent leave; leave.type = ClientMessage; leave.window = qt_xdnd_current_target; leave.format = 32; leave.message_type = ATOM(XdndLeave); - leave.data.l[0] = qt_xdnd_dragsource_xid; + leave.data.l[0] = manager->dragPrivate()->source->effectiveWinId(); leave.data.l[1] = 0; // flags leave.data.l[2] = 0; // x, y leave.data.l[3] = 0; // w, h @@ -1094,8 +1096,8 @@ void qt_xdnd_send_leave() else XSendEvent(X11->display, qt_xdnd_current_proxy_target, False, NoEventMask, (XEvent*)&leave); + // reset the drag manager state - QDragManager *manager = QDragManager::self(); manager->willDrop = false; if (global_accepted_action != Qt::IgnoreAction) manager->emitActionChanged(Qt::IgnoreAction); -- cgit v0.12