summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2009-08-10 15:07:31 (GMT)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2009-08-10 15:07:31 (GMT)
commite67cd6560eea4e4b600d5e3586cd823347e101d2 (patch)
tree19e7a596b37c2da517b5d2d0dc0de4f7ee8f5b99
parent9a92aee8ff94a1b705e92f895831f9437762da75 (diff)
parentcbd8a54f8c55e1982430fc929e9d74f977699428 (diff)
downloadQt-e67cd6560eea4e4b600d5e3586cd823347e101d2.zip
Qt-e67cd6560eea4e4b600d5e3586cd823347e101d2.tar.gz
Qt-e67cd6560eea4e4b600d5e3586cd823347e101d2.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/kernel/qapplication_win.cpp
-rw-r--r--demos/qtdemo/xml/examples.xml1
-rw-r--r--doc/src/containers.qdoc2
-rw-r--r--doc/src/examples.qdoc1
-rw-r--r--doc/src/examples/rogue.qdoc222
-rw-r--r--doc/src/images/rogue-example.pngbin0 -> 10364 bytes
-rw-r--r--doc/src/images/rogue-statechart.pngbin0 -> 2490 bytes
-rw-r--r--examples/statemachine/rogue/main.cpp55
-rw-r--r--examples/statemachine/rogue/movementtransition.h108
-rw-r--r--examples/statemachine/rogue/rogue.pro11
-rw-r--r--examples/statemachine/rogue/window.cpp201
-rw-r--r--examples/statemachine/rogue/window.h91
-rw-r--r--examples/statemachine/statemachine.pro1
-rw-r--r--mkspecs/features/qt_config.prf2
-rw-r--r--qmake/project.cpp13
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp55
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.h1
-rw-r--r--src/3rdparty/phonon/phonon/mediasource.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro2
-rw-r--r--src/corelib/arch/arch.pri2
-rw-r--r--src/corelib/io/qdir.cpp15
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp4
-rw-r--r--src/corelib/statemachine/qstate_p.h2
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp1
-rw-r--r--src/corelib/tools/qsharedpointer.cpp10
-rw-r--r--src/corelib/tools/qtimeline.cpp16
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp19
-rw-r--r--src/gui/graphicsview/qgraphicstransform.cpp40
-rw-r--r--src/gui/graphicsview/qgraphicstransform_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp9
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp3
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp22
-rw-r--r--src/gui/itemviews/qitemselectionmodel_p.h2
-rw-r--r--src/gui/itemviews/qlistwidget.cpp454
-rw-r--r--src/gui/kernel/kernel.pri6
-rw-r--r--src/gui/kernel/qapplication.h4
-rw-r--r--src/gui/kernel/qapplication_p.h5
-rw-r--r--src/gui/kernel/qapplication_win.cpp32
-rw-r--r--src/gui/kernel/qapplication_x11.cpp202
-rw-r--r--src/gui/kernel/qevent_p.h5
-rw-r--r--src/gui/kernel/qgesture.cpp2
-rw-r--r--src/gui/kernel/qgesture.h3
-rw-r--r--src/gui/kernel/qkde.cpp159
-rw-r--r--src/gui/kernel/qkde_p.h76
-rw-r--r--src/gui/kernel/qstandardgestures.cpp210
-rw-r--r--src/gui/kernel/qstandardgestures.h43
-rw-r--r--src/gui/kernel/qstandardgestures_p.h25
-rw-r--r--src/gui/kernel/qt_x11_p.h3
-rw-r--r--src/gui/kernel/qwidget_win.cpp40
-rw-r--r--src/gui/kernel/qwidget_x11.cpp7
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp3
-rw-r--r--src/gui/styles/qcommonstyle.cpp39
-rw-r--r--src/gui/widgets/qdockarealayout.cpp2
-rw-r--r--src/gui/widgets/qdockwidget.cpp2
-rw-r--r--src/gui/widgets/qtoolbararealayout.cpp2
-rw-r--r--src/network/access/qhttp.cpp10
-rw-r--r--src/network/access/qnetworkcookie.h6
-rw-r--r--src/openvg/qpixmapdata_vg.cpp25
-rw-r--r--src/qbase.pri2
-rw-r--r--src/script/qscriptable.cpp4
-rw-r--r--src/script/qscriptable_p.h4
-rw-r--r--src/script/qscriptclassdata.cpp2
-rw-r--r--src/testlib/qabstracttestlogger.cpp49
-rw-r--r--src/testlib/qabstracttestlogger_p.h52
-rw-r--r--src/testlib/qbenchmark.cpp21
-rw-r--r--src/testlib/qbenchmark.h10
-rw-r--r--src/testlib/qbenchmark_p.h1
-rw-r--r--src/testlib/qplaintestlogger.cpp10
-rw-r--r--src/testlib/qtest_global.h1
-rw-r--r--src/testlib/qtestbasicstreamer.cpp40
-rw-r--r--src/testlib/qtestbasicstreamer.h11
-rw-r--r--src/testlib/qtestcase.cpp57
-rw-r--r--src/testlib/qtestlightxmlstreamer.cpp70
-rw-r--r--src/testlib/qtestlightxmlstreamer.h6
-rw-r--r--src/testlib/qtestxmlstreamer.cpp61
-rw-r--r--src/testlib/qtestxmlstreamer.h6
-rw-r--r--src/testlib/qtestxunitstreamer.cpp43
-rw-r--r--src/testlib/qtestxunitstreamer.h8
-rw-r--r--src/testlib/qxmltestlogger.cpp75
-rw-r--r--src/testlib/qxmltestlogger_p.h8
-rw-r--r--src/tools/uic/uic.cpp2
-rw-r--r--src/xmlpatterns/query.pri2
-rw-r--r--src/xmlpatterns/xmlpatterns.pro3
-rw-r--r--tests/arthur/lance/main.cpp2
-rw-r--r--tests/arthur/lance/widgets.h39
-rw-r--r--tests/auto/qaccessibility_mac/qaccessibility_mac.pro2
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp36
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp19
-rw-r--r--tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp22
-rw-r--r--tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp24
-rw-r--r--tests/auto/qmake/testdata/functions/functions.pro2
-rw-r--r--tests/auto/qstringbuilder/scenario1.pro1
-rw-r--r--tests/auto/qstringbuilder/scenario2.pro1
-rw-r--r--tests/auto/qstringbuilder/scenario3.pro1
-rw-r--r--tests/auto/qstringbuilder/scenario4.pro1
-rw-r--r--tests/auto/qstringbuilder/tst_qstringbuilder.cpp11
-rw-r--r--tests/auto/qstringbuilder/tst_qstringbuilder.h55
-rw-r--r--tests/auto/qtimeline/tst_qtimeline.cpp41
-rwxr-xr-xtests/auto/runQtXmlPatternsTests.sh61
-rw-r--r--tests/auto/selftests/benchlibwalltime/tst_benchlibwalltime.cpp11
-rw-r--r--tests/auto/selftests/expected_benchlibwalltime.txt5
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp134
-rw-r--r--tests/auto/xmlpatterns/xmlpatterns.pro6
-rw-r--r--tools/assistant/compat/lib/lib.pro2
-rw-r--r--tools/checksdk/main.cpp4
-rw-r--r--tools/designer/src/components/lib/lib.pro2
-rw-r--r--tools/designer/src/lib/lib.pro2
-rw-r--r--tools/designer/src/uitools/uitools.pro2
-rw-r--r--tools/linguist/linguist/mainwindow.cpp10
-rw-r--r--tools/linguist/linguist/mainwindow.ui6
-rw-r--r--tools/linguist/linguist/messageeditor.cpp2
-rw-r--r--tools/linguist/linguist/messageeditor.h2
-rw-r--r--tools/qdoc3/cppcodeparser.cpp3
-rw-r--r--tools/qdoc3/generator.cpp2
-rw-r--r--tools/qdoc3/htmlgenerator.cpp8
-rw-r--r--tools/qdoc3/node.h5
-rw-r--r--tools/qdoc3/tree.cpp3
-rw-r--r--translations/assistant_de.ts304
-rw-r--r--translations/linguist_de.ts1160
-rw-r--r--translations/qt_help_de.ts40
122 files changed, 2696 insertions, 2177 deletions
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 1b0b533..6c8ddb0 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -183,6 +183,7 @@
</category>
<category dirname="statemachine" name="State Machine">
<example filename="eventtransitions" name="Event Transitions" />
+ <example filename="rogue" name="Rogue" />
<example filename="tankgame" name="Tank Game" />
<example filename="trafficlight" name="Traffic Light" />
<example filename="twowaybutton" name="Two-way Button" />
diff --git a/doc/src/containers.qdoc b/doc/src/containers.qdoc
index 11a4b0b..2a34716 100644
--- a/doc/src/containers.qdoc
+++ b/doc/src/containers.qdoc
@@ -682,7 +682,7 @@
\header \o{1,2} \o{2,1} Key lookup \o{2,1} Insertion
\header \o Average \o Worst case \o Average \o Worst case
\row \o QMap<Key, T> \o O(log \e n) \o O(log \e n) \o O(log \e n) \o O(log \e n)
- \row \o QMultiMap<Key, T> \o O((log \e n) \o O(log \e n) \o O(log \e n) \o O(log \e n)
+ \row \o QMultiMap<Key, T> \o O(log \e n) \o O(log \e n) \o O(log \e n) \o O(log \e n)
\row \o QHash<Key, T> \o Amort. O(1) \o O(\e n) \o Amort. O(1) \o O(\e n)
\row \o QSet<Key> \o Amort. O(1) \o O(\e n) \o Amort. O(1) \o O(\e n)
\endtable
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index 74a9bd8..7f9264b 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -330,6 +330,7 @@
\o \l{statemachine/eventtransitions}{Event Transitions}\raisedaster
\o \l{statemachine/factorial}{Factorial States}\raisedaster
\o \l{statemachine/pingpong}{Ping Pong States}\raisedaster
+ \o \l{statemachine/rogue}{Rogue}\raisedaster
\o \l{statemachine/trafficlight}{Traffic Light}\raisedaster
\o \l{statemachine/twowaybutton}{Two-way Button}\raisedaster
\endlist
diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc
new file mode 100644
index 0000000..8fa2c69
--- /dev/null
+++ b/doc/src/examples/rogue.qdoc
@@ -0,0 +1,222 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example statemachine/rogue
+ \title Rogue Example
+
+ The Rogue example shows how to use the Qt state machine for event
+ handling.
+
+ \image rogue-example.png
+
+ This example implements a simple text based game. Do you see the
+ \c{@} in the screenshot? That's you, the rogue. The \c{#}
+ characters are walls, and the dots represent floor. In a real
+ game, other ASCII characters would represent all kinds of objects
+ and creatures. For instance, ancient dragons (\c{D}'s) or food
+ rations (\c{%}'s). But let's not get carried away. In this game,
+ the rogue is simply running around in an empty room.
+
+ The rogue is moved with the keypad (2, 4, 8, 6). That aside, we
+ have implemented a \c quit command that triggers if the player
+ types \c {q}. The player is then asked if he/she really wants to
+ quit.
+
+ Most games have commands that need more than one key press and
+ that may require a different sequence of keys based on questions
+ asked the user. In this game, only the \c quit command falls under
+ this category, but for the sake of argument, let's imagine a
+ fully-fledged game with a rich set of commands. If we were to
+ implement these by catching key events in
+ \l{QWidget::}{keyPressEvent()}, we would have to keep a lot of
+ class member variables to track the sequence of keys already typed
+ (or find some other way of deducing the current state of a
+ command). This can easily lead to spaghetti, which is--as we all
+ well know, I'm sure--unpleasant. With a state machine, on the
+ other hand, separate states can wait for a single key press, and
+ that makes our lives a lot simpler.
+
+ The example consists of two classes:
+
+ \list
+ \o \c Window draws the text display of the game and sets
+ up the state machine. The window also has a status bar
+ above the area in which the rouge moves.
+ \o \c MovementTransition is a transition that carries out
+ a single move of the rogue.
+ \endlist
+
+ Before we embark on a code walkthrough, it is necessary to take a
+ closer look at the design of the machine. Here is a state chart
+ that shows what we want to achieve:
+
+ \image rogue-statechart.png
+
+ The input state waits for a key press to start a new command.
+ When receiving a key it recognizes, it transitions to one of the
+ two commands of the game; though, as we will see, movement is
+ handled by the transition itself. The quit state waits for the
+ player to answer yes or no (by typing \c y or \c n) when asked
+ whether he/she really wants to quit the game.
+
+ The chart demonstrates how we use one state to wait for a single
+ key press. The press received may trigger one of the transitions
+ connected to the state.
+
+ \section1 Window Class Definition
+
+ The \c Window class is a widget that draws the text display of the
+ game. It also sets up the state machine, i.e., creates and
+ connects the states in the machine. It is the key events from this
+ widget that are used by the machine.
+
+ \snippet examples/statemachine/rogue/window.h 0
+
+ \c Direction specifies the direction in which the rogue is to
+ move. We use this in \c movePlayer(), which moves the rogue and
+ repaints the window. The game has a status line above the area in
+ which the rogue moves. The \c status property contains the text of
+ this line. We use a property because the QState class allows
+ setting any Qt \l{Qt's Property System}{property} when entered.
+ More on this later.
+
+ \snippet examples/statemachine/rogue/window.h 1
+
+ The \c map is an array with the characters that are currently
+ displayed. We set up the array in \c setupMap(), and update it
+ when the rogue is moved. \c pX and \c pY is the current position
+ of the rogue. \c WIDTH and \c HEIGHT are macros specifying the
+ dimensions of the map.
+
+ The \c paintEvent() function is left out of this walkthrough. We
+ also do not discuss other code that does not concern the state
+ machine (the \c setupMap(), \c status(), \c setStatus(), \c
+ movePlayer(), and \c sizeHint() functions). If you wish to take a
+ look at the code, click on the link for the \c window.cpp file at
+ the top of this page.
+
+ \section1 Window Class Implementation
+
+ Here is the constructor of \c Window:
+
+ \snippet examples/statemachine/rogue/window.cpp 0
+ \dots
+ \snippet examples/statemachine/rogue/window.cpp 1
+
+ The player starts off at position (5, 5). We then set up the map
+ and statemachine. Let's proceed with the \c buildMachine()
+ function:
+
+ \snippet examples/statemachine/rogue/window.cpp 2
+
+ We enter \c inputState when the machine is started and from the \c
+ quitState if the user wants to continue playing. We then set the
+ status to a helpful reminder of how to play the game.
+
+ First, the \c Movement transition is added to the input state.
+ This will enable the rogue to be moved with the keypad. Notice
+ that we don't set a target state for the movement transition. This
+ will cause the transition to be triggered (and the
+ \l{QAbstractTransition::}{onTransition()} function to be invoked),
+ but the machine will not leave the \c inputState. If we had set \c
+ inputState as the target state, we would first have left and then
+ entered the \c inputState again.
+
+ \snippet examples/statemachine/rogue/window.cpp 3
+
+ When we enter \c quitState, we update the status bar of the
+ window.
+
+ \c QKeyEventTransition is a utility class that removes the hassle
+ of implementing transitions for \l{QKeyEvent}s. We simply need to
+ specify the key on which the transition should trigger and the
+ target state of the transition.
+
+ \snippet examples/statemachine/rogue/window.cpp 4
+
+ The transition from \c inputState allows triggering the quit state
+ when the player types \c {q}.
+
+ \snippet examples/statemachine/rogue/window.cpp 5
+
+ The machine is set up, so it's time to start it.
+
+ \section1 The MovementTransition Class
+
+ \c MovementTransition is triggered when the player request the
+ rogue to be moved (by typing 2, 4, 6, or 8) when the machine is in
+ the \c inputState.
+
+ \snippet examples/statemachine/rogue/movementtransition.h 0
+
+ In the constructor, we tell QEventTransition to only send
+ \l{QEvent::}{KeyPress} events to the
+ \l{QAbstractTransition::}{eventTest()} function:
+
+ \snippet examples/statemachine/rogue/movementtransition.h 1
+
+ The KeyPress events come wrapped in \l{QWrappedEvent}s. \c event
+ must be confirmed to be a wrapped event because Qt uses other
+ events internally. After that, it is simply a matter of checking
+ which key has been pressed.
+
+ Let's move on to the \c onTransition() function:
+
+ \snippet examples/statemachine/rogue/movementtransition.h 2
+
+ When \c onTransition() is invoked, we know that we have a
+ \l{QEvent::}{KeyPress} event with 2, 4, 6, or 8, i.e., the event
+ is already unwrapped.
+
+ \section1 The Roguelike Tradition
+
+ You might have been wondering why the game features a rogue. Well,
+ these kinds of text based dungeon exploration games date back to a
+ game called, yes, "Rogue". Although outflanked by the technology
+ of modern 3D computer games, roguelikes have a solid community of
+ hard-core, devoted followers.
+
+ Playing these games can be surprisingly addictive (despite the
+ lack of graphics). Angband, the perhaps most well-known rougelike,
+ is found here: \l{http://rephial.org/}.
+*/
+
diff --git a/doc/src/images/rogue-example.png b/doc/src/images/rogue-example.png
new file mode 100644
index 0000000..7aeb0e5
--- /dev/null
+++ b/doc/src/images/rogue-example.png
Binary files differ
diff --git a/doc/src/images/rogue-statechart.png b/doc/src/images/rogue-statechart.png
new file mode 100644
index 0000000..c5f4048
--- /dev/null
+++ b/doc/src/images/rogue-statechart.png
Binary files differ
diff --git a/examples/statemachine/rogue/main.cpp b/examples/statemachine/rogue/main.cpp
new file mode 100644
index 0000000..0c2fb2d
--- /dev/null
+++ b/examples/statemachine/rogue/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "window.h"
+
+int main(int argv, char **args)
+{
+ QApplication app(argv, args);
+
+ Window window;
+ window.show();
+
+ return app.exec();
+}
+
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
new file mode 100644
index 0000000..929077d
--- /dev/null
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MOVEMENTTRANSITION_H
+#define MOVEMENTTRANSITION_H
+
+#include <QtGui>
+
+#include "window.h"
+
+//![0]
+class MovementTransition : public QEventTransition
+{
+ Q_OBJECT
+
+public:
+ MovementTransition(Window *window) :
+ QEventTransition(window, QEvent::KeyPress) {
+ this->window = window;
+ }
+//![0]
+
+//![1]
+protected:
+ bool eventTest(QEvent *event) {
+ if (event->type() == QEvent::Wrapped &&
+ static_cast<QWrappedEvent *>(event)->event()->type() == QEvent::KeyPress) {
+ QEvent *wrappedEvent = static_cast<QWrappedEvent *>(event)->event();
+
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(wrappedEvent);
+ int key = keyEvent->key();
+
+ return key == Qt::Key_2 || key == Qt::Key_8 || key == Qt::Key_6 ||
+ key == Qt::Key_4;
+ }
+ return false;
+ }
+//![1]
+
+//![2]
+ void onTransition(QEvent *event) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(
+ static_cast<QWrappedEvent *>(event)->event());
+
+ int key = keyEvent->key();
+ switch (key) {
+ case Qt::Key_4:
+ window->movePlayer(Window::Left);
+ break;
+ case Qt::Key_8:
+ window->movePlayer(Window::Up);
+ break;
+ case Qt::Key_6:
+ window->movePlayer(Window::Right);
+ break;
+ case Qt::Key_2:
+ window->movePlayer(Window::Down);
+ break;
+ default:
+ ;
+ }
+ }
+//![2]
+
+private:
+ Window *window;
+};
+
+#endif
+
diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro
new file mode 100644
index 0000000..1571854
--- /dev/null
+++ b/examples/statemachine/rogue/rogue.pro
@@ -0,0 +1,11 @@
+HEADERS = window.h \
+ movementtransition.h
+SOURCES = main.cpp \
+ window.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/rogue
+sources.files = $$SOURCES $$HEADERS *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/rogue
+INSTALLS += target sources
+
diff --git a/examples/statemachine/rogue/window.cpp b/examples/statemachine/rogue/window.cpp
new file mode 100644
index 0000000..39565a3
--- /dev/null
+++ b/examples/statemachine/rogue/window.cpp
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "window.h"
+#include "movementtransition.h"
+
+//![0]
+Window::Window()
+{
+ pX = 5;
+ pY = 5;
+//![0]
+
+ QFontDatabase database;
+ QFont font;
+ if (database.families().contains("Monospace"))
+ font = QFont("Monospace", 12);
+ else {
+ foreach (QString family, database.families()) {
+ if (database.isFixedPitch(family)) {
+ font = QFont(family, 12);
+ break;
+ }
+ }
+ }
+ setFont(font);
+
+//![1]
+ setupMap();
+ buildMachine();
+}
+//![1]
+
+void Window::setStatus(const QString &status)
+{
+ myStatus = status;
+ repaint();
+}
+
+QString Window::status() const
+{
+ return myStatus;
+}
+
+void Window::paintEvent(QPaintEvent * /* event */)
+{
+ QFontMetrics metrics(font());
+ QPainter painter(this);
+ int fontHeight = metrics.height();
+ int fontWidth = metrics.width('X');
+ int yPos = fontHeight;
+ int xPos;
+
+ painter.fillRect(rect(), Qt::black);
+ painter.setPen(Qt::white);
+
+ painter.drawText(QPoint(0, yPos), status());
+
+ for (int y = 0; y < HEIGHT; ++y) {
+ yPos += fontHeight;
+ xPos = 0;
+
+ for (int x = 0; x < WIDTH; ++x) {
+ if (y == pY && x == pX) {
+ xPos += fontWidth;
+ continue;
+ }
+
+ painter.drawText(QPoint(xPos, yPos), map[x][y]);
+ xPos += fontWidth;
+ }
+ }
+ painter.drawText(QPoint(pX * fontWidth, (pY + 2) * fontHeight), QChar('@'));
+}
+
+QSize Window::sizeHint() const
+{
+ QFontMetrics metrics(font());
+
+ return QSize(metrics.width('X') * WIDTH, metrics.height() * (HEIGHT + 1));
+}
+
+//![2]
+void Window::buildMachine()
+{
+ machine = new QStateMachine;
+
+ QState *inputState = new QState(machine);
+ inputState->assignProperty(this, "status", "Move the rogue with 2, 4, 6, and 8");
+
+ MovementTransition *transition = new MovementTransition(this);
+ inputState->addTransition(transition);
+//![2]
+
+//![3]
+ QState *quitState = new QState(machine);
+ quitState->assignProperty(this, "status", "Really quit(y/n)?");
+
+ QKeyEventTransition *yesTransition = new
+ QKeyEventTransition(this, QEvent::KeyPress, Qt::Key_Y);
+ yesTransition->setTargetState(new QFinalState(machine));
+ quitState->addTransition(yesTransition);
+
+ QKeyEventTransition *noTransition =
+ new QKeyEventTransition(this, QEvent::KeyPress, Qt::Key_N);
+ noTransition->setTargetState(inputState);
+ quitState->addTransition(noTransition);
+//![3]
+
+//![4]
+ QKeyEventTransition *quitTransition =
+ new QKeyEventTransition(this, QEvent::KeyPress, Qt::Key_Q);
+ quitTransition->setTargetState(quitState);
+ inputState->addTransition(quitTransition);
+//![4]
+
+//![5]
+ machine->setInitialState(inputState);
+
+ connect(machine, SIGNAL(finished()), qApp, SLOT(quit()));
+
+ machine->start();
+}
+//![5]
+
+void Window::movePlayer(Direction direction)
+{
+ switch (direction) {
+ case Left:
+ if (map[pX - 1][pY] != '#')
+ --pX;
+ break;
+ case Right:
+ if (map[pX + 1][pY] != '#')
+ ++pX;
+ break;
+ case Up:
+ if (map[pX][pY - 1] != '#')
+ --pY;
+ break;
+ case Down:
+ if (map[pX][pY + 1] != '#')
+ ++pY;
+ break;
+ }
+ repaint();
+}
+
+void Window::setupMap()
+{
+ qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+
+ for (int x = 0; x < WIDTH; ++x)
+ for (int y = 0; y < HEIGHT; ++y) {
+ if (x == 0 || x == WIDTH - 1 || y == 0 || y == HEIGHT - 1 || qrand() % 40 == 0)
+ map[x][y] = '#';
+ else
+ map[x][y] = '.';
+ }
+}
+
diff --git a/examples/statemachine/rogue/window.h b/examples/statemachine/rogue/window.h
new file mode 100644
index 0000000..1df566d
--- /dev/null
+++ b/examples/statemachine/rogue/window.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WINDOW_H
+#define WINDOW_H
+
+#include <QWidget>
+
+QT_BEGIN_NAMESPACE
+class QState;
+class QStateMachine;
+class QTransition;
+QT_END_NAMESPACE
+
+#define WIDTH 35
+#define HEIGHT 20
+
+//![0]
+class Window : public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(QString status READ status WRITE setStatus)
+
+public:
+ enum Direction { Up, Down, Left, Right };
+
+ Window();
+
+ void movePlayer(Direction direction);
+ void setStatus(const QString &status);
+ QString status() const;
+
+ QSize sizeHint() const;
+
+protected:
+ void paintEvent(QPaintEvent *event);
+//![0]
+
+//![1]
+private:
+ void buildMachine();
+ void setupMap();
+
+ QChar map[WIDTH][HEIGHT];
+ int pX, pY;
+
+ QStateMachine *machine;
+ QString myStatus;
+};
+//![1]
+
+#endif
+
diff --git a/examples/statemachine/statemachine.pro b/examples/statemachine/statemachine.pro
index ea3e7a8..298c0ae 100644
--- a/examples/statemachine/statemachine.pro
+++ b/examples/statemachine/statemachine.pro
@@ -3,6 +3,7 @@ SUBDIRS = \
eventtransitions \
factorial \
pingpong \
+ rogue \
trafficlight \
twowaybutton
diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf
index 779c2e5..0a2d985 100644
--- a/mkspecs/features/qt_config.prf
+++ b/mkspecs/features/qt_config.prf
@@ -4,7 +4,7 @@ isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) {
else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri
else:exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri
}
-!exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG) {
+!exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
debug(1, "Cannot load qconfig.pri!")
} else {
debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)")
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 4fefbab..6687e9a 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -2693,10 +2693,15 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt
case T_LOAD: {
QString parseInto;
const bool include_statement = (func_t == T_INCLUDE);
- bool ignore_error = include_statement;
- if(args.count() == 2) {
+ bool ignore_error = false;
+ if(args.count() >= 2) {
if(func_t == T_INCLUDE) {
parseInto = args[1];
+ if (args.count() == 3){
+ QString sarg = args[2];
+ if (sarg.toLower() == "true" || sarg.toInt())
+ ignore_error = true;
+ }
} else {
QString sarg = args[1];
ignore_error = (sarg.toLower() == "true" || sarg.toInt());
@@ -2738,8 +2743,8 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt
if(stat == IncludeFeatureAlreadyLoaded) {
warn_msg(WarnParser, "%s:%d: Duplicate of loaded feature %s",
parser.file.toLatin1().constData(), parser.line_no, file.toLatin1().constData());
- } else if(stat == IncludeNoExist && include_statement) {
- warn_msg(WarnParser, "%s:%d: Unable to find file for inclusion %s",
+ } else if(stat == IncludeNoExist && !ignore_error) {
+ warn_msg(WarnAll, "%s:%d: Unable to find file for inclusion %s",
parser.file.toLatin1().constData(), parser.line_no, file.toLatin1().constData());
return false;
} else if(stat >= IncludeFailure) {
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp
index 10782c2..b163ad4 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.cpp
+++ b/src/3rdparty/phonon/ds9/mediaobject.cpp
@@ -57,24 +57,6 @@ namespace Phonon
{
}
- WorkerThread::Work WorkerThread::dequeueWork()
- {
- QMutexLocker locker(&m_mutex);
- if (m_finished) {
- return Work();
- }
- Work ret = m_queue.dequeue();
-
- //we ensure to have the wait condition in the right state
- if (m_queue.isEmpty()) {
- m_waitCondition.reset();
- } else {
- m_waitCondition.set();
- }
-
- return ret;
- }
-
void WorkerThread::run()
{
while (m_finished == false) {
@@ -88,11 +70,6 @@ namespace Phonon
}
DWORD result = ::WaitForMultipleObjects(count, handles, FALSE, INFINITE);
if (result == WAIT_OBJECT_0) {
- if (m_finished) {
- //that's the end of the thread execution
- return;
- }
-
handleTask();
} else {
//this is the event management
@@ -199,22 +176,25 @@ namespace Phonon
void WorkerThread::handleTask()
{
- const Work w = dequeueWork();
-
- if (m_finished) {
+ QMutexLocker locker(&m_mutex);
+ if (m_finished || m_queue.isEmpty()) {
return;
}
- HRESULT hr = S_OK;
+ const Work w = m_queue.dequeue();
- {
- QMutexLocker locker(&m_mutex);
- m_currentRender = w.graph;
- m_currentRenderId = w.id;
+ //we ensure to have the wait condition in the right state
+ if (m_queue.isEmpty()) {
+ m_waitCondition.reset();
+ } else {
+ m_waitCondition.set();
}
+ HRESULT hr = S_OK;
+
+ m_currentRender = w.graph;
+ m_currentRenderId = w.id;
if (w.task == ReplaceGraph) {
- QMutexLocker locker(&m_mutex);
int index = -1;
for(int i = 0; i < FILTER_COUNT; ++i) {
if (m_graphHandle[i].graph == w.oldGraph) {
@@ -237,6 +217,9 @@ namespace Phonon
m_graphHandle[index].handle = h;
}
} else if (w.task == Render) {
+ //we need to unlock here because the use might trigger a call to abort
+ //which uses the same mutex
+ locker.unlock();
if (w.filter) {
//let's render pins
w.graph->AddFilter(w.filter, 0);
@@ -255,6 +238,7 @@ namespace Phonon
if (hr != E_ABORT) {
emit asyncRenderFinished(w.id, hr, w.graph);
}
+ locker.relock();
} else if (w.task == Seek) {
//that's a seekrequest
ComPointer<IMediaSeeking> mediaSeeking(w.graph, IID_IMediaSeeking);
@@ -327,11 +311,8 @@ namespace Phonon
}
}
- {
- QMutexLocker locker(&m_mutex);
- m_currentRender = Graph();
- m_currentRenderId = 0;
- }
+ m_currentRender = Graph();
+ m_currentRenderId = 0;
}
void WorkerThread::abortCurrentRender(qint16 renderId)
diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h
index 2c34ffc..fe52604 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.h
+++ b/src/3rdparty/phonon/ds9/mediaobject.h
@@ -135,7 +135,6 @@ namespace Phonon
};
QList<Filter> decoders; //for the state change requests
};
- Work dequeueWork();
void handleTask();
Graph m_currentRender;
diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index 0a21c87..c003af9 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -140,8 +140,12 @@ MediaSourcePrivate::~MediaSourcePrivate()
{
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
if (autoDelete) {
- delete stream;
- delete ioDevice;
+ //here we use deleteLater because this object
+ //might be destroyed from another thread
+ if (stream)
+ stream->deleteLater();
+ if (ioDevice)
+ ioDevice->deleteLater();
}
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
}
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index e49ab13..2eb7c08 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -3159,7 +3159,7 @@ xpathbison.dependency_type = TYPE_C
xpathbison.variable_out = GENERATED_SOURCES
addExtraCompilerWithHeader(xpathbison)
-include($$PWD/../WebKit/qt/Api/headers.pri)
+include($$PWD/../WebKit/qt/Api/headers.pri, "", true)
HEADERS += $$WEBKIT_API_HEADERS
!CONFIG(QTDIR_build) {
target.path = $$[QT_INSTALL_LIBS]
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index dd3141a..18f54ee 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -25,4 +25,4 @@ vxworks:HEADERS += arch/qatomic_vxworks.h
QT_ARCH_CPP = $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH
DEPENDPATH += $$QT_ARCH_CPP
-include($$QT_ARCH_CPP/arch.pri)
+include($$QT_ARCH_CPP/arch.pri, "", true)
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 072eb27..cb0fdeb 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1541,9 +1541,11 @@ bool QDir::isReadable() const
/*!
\overload
- Returns true if the \e directory exists; otherwise returns false.
- (If a file with the same name is found this function will return
- false).
+ Returns true if the directory exists; otherwise returns false.
+ (If a file with the same name is found this function will return false).
+
+ The overload of this function that accepts an argument is used to test
+ for the presence of files and directories within a directory.
\sa QFileInfo::exists(), QFile::exists()
*/
@@ -1773,8 +1775,11 @@ bool QDir::rename(const QString &oldName, const QString &newName)
/*!
Returns true if the file called \a name exists; otherwise returns
- false. Unless \a name contains an absolute file path, the file
- name is assumed to be relative to the current directory.
+ false.
+
+ Unless \a name contains an absolute file path, the file name is assumed
+ to be relative to the directory itself, so this function is typically used
+ to check for the presence of files within a directory.
\sa QFileInfo::exists(), QFile::exists()
*/
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 7982d4c..da15148 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -627,7 +627,7 @@ QEventDispatcherUNIX::~QEventDispatcherUNIX()
int QEventDispatcherUNIX::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
timeval *timeout)
{
- return ::qt_safe_select(nfds, readfds, writefds, exceptfds, timeout);
+ return qt_safe_select(nfds, readfds, writefds, exceptfds, timeout);
}
/*!
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index d43c5dd..f153c7e 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2488,6 +2488,7 @@ bool QMetaProperty::isUser(const QObject *object) const
}
/*!
+ \since 4.6
Returns true if the property is constant; otherwise returns false.
A property is constant if the \c{Q_PROPERTY()}'s \c CONSTANT attribute
@@ -2502,6 +2503,7 @@ bool QMetaProperty::isConstant() const
}
/*!
+ \since 4.6
Returns true if the property is final; otherwise returns false.
A property is final if the \c{Q_PROPERTY()}'s \c FINAL attribute
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index e5ca837..d21eee9 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -120,7 +120,7 @@ QT_BEGIN_NAMESPACE
*/
QHistoryStatePrivate::QHistoryStatePrivate()
- : defaultState(0)
+ : defaultState(0), historyType(QHistoryState::ShallowHistory)
{
}
@@ -135,8 +135,6 @@ QHistoryStatePrivate *QHistoryStatePrivate::get(QHistoryState *q)
QHistoryState::QHistoryState(QState *parent)
: QAbstractState(*new QHistoryStatePrivate, parent)
{
- Q_D(QHistoryState);
- d->historyType = ShallowHistory;
}
/*!
Constructs a new history state of the given \a type, with the given \a
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 20eb5ea..c43a26c 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
struct QPropertyAssignment
{
QPropertyAssignment()
- : object(0) {}
+ : object(0), explicitlySet(true) {}
QPropertyAssignment(QObject *o, const QByteArray &n,
const QVariant &v, bool es = true)
: object(o), propertyName(n), value(v), explicitlySet(es)
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 9cb1d4d..5926176 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -209,6 +209,7 @@ QStateMachinePrivate::QStateMachinePrivate()
processing = false;
processingScheduled = false;
stop = false;
+ stopProcessingReason = EventQueueEmpty;
error = QStateMachine::NoError;
globalRestorePolicy = QStateMachine::DoNotRestoreProperties;
signalEventGenerator = 0;
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index f18dee8..cdb7d1d 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -867,6 +867,8 @@
#if !defined(QT_NO_QOBJECT)
#include "../kernel/qobject_p.h"
+QT_BEGIN_NAMESPACE
+
/*!
\internal
This function is called for a just-created QObject \a obj, to enable
@@ -910,6 +912,9 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
}
return d->sharedRefcount;
}
+
+QT_END_NAMESPACE
+
#endif
@@ -932,6 +937,8 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
# include <unistd.h>
# include <sys/wait.h>
+QT_BEGIN_NAMESPACE
+
static inline QByteArray saveBacktrace() __attribute__((always_inline));
static inline QByteArray saveBacktrace()
{
@@ -992,6 +999,9 @@ static void printBacktrace(QByteArray stacktrace)
waitpid(child, 0, 0);
}
}
+
+QT_END_NAMESPACE
+
# endif // BACKTRACE_SUPPORTED
namespace {
diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp
index e32fc03..6dbad34 100644
--- a/src/corelib/tools/qtimeline.cpp
+++ b/src/corelib/tools/qtimeline.cpp
@@ -69,7 +69,6 @@ public:
int currentLoopCount;
int currentTime;
- int elapsedTime;
int timerId;
QTime timer;
@@ -212,7 +211,7 @@ void QTimeLinePrivate::setCurrentTime(int msecs)
applies an interpolation algorithm to generate these value. You can choose
from a set of predefined timeline algorithms by calling
setCurveShape().
-
+
Note that by default, QTimeLine uses the EaseInOut curve shape,
which provides a value that grows slowly, then grows steadily, and
finally grows slowly. For a custom timeline, you can reimplement
@@ -549,7 +548,7 @@ void QTimeLine::setCurveShape(CurveShape shape)
case CosineCurve:
setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
break;
- }
+ }
}
/*!
@@ -559,7 +558,7 @@ void QTimeLine::setCurveShape(CurveShape shape)
Specifies the easing curve that the timeline will use.
If both easing curve and curveShape are set, the last set property will
- override the previous one. (If valueForTime() is reimplemented it will
+ override the previous one. (If valueForTime() is reimplemented it will
override both)
*/
@@ -663,6 +662,7 @@ qreal QTimeLine::valueForTime(int msec) const
second). You can change the update interval by calling
setUpdateInterval().
+ The timeline will start from position 0, or the end if going backward.
If you want to resume a stopped timeline without restarting, you can call
resume() instead.
@@ -675,10 +675,8 @@ void QTimeLine::start()
qWarning("QTimeLine::start: already running");
return;
}
- int curTime = d->currentTime;
- if (curTime == d->duration && d->direction == Forward)
- curTime = 0;
- else if (curTime == 0 && d->direction == Backward)
+ int curTime = 0;
+ if (d->direction == Backward)
curTime = d->duration;
d->timerId = startTimer(d->updateInterval);
d->startTime = curTime;
@@ -694,7 +692,7 @@ void QTimeLine::start()
frame and value at regular intervals.
In contrast to start(), this function does not restart the timeline before
- is resumes.
+ it resumes.
\sa start(), updateInterval(), frameChanged(), valueChanged()
*/
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index beaf42b..8d9a1f8 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -9837,20 +9837,25 @@ void QGraphicsItemGroup::addToGroup(QGraphicsItem *item)
}
// COMBINE
- // ### Use itemTransform() instead.
- QTransform oldSceneMatrix = item->sceneTransform();
+ bool ok;
+ QTransform itemTransform = item->itemTransform(this, &ok);
+
+ if (!ok) {
+ qWarning("QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates");
+ return;
+ }
+
+ QTransform newItemTransform(itemTransform);
item->setPos(mapFromItem(item, 0, 0));
item->setParentItem(this);
- QTransform newItemTransform(oldSceneMatrix);
- newItemTransform *= sceneTransform().inverted();
+
+ // removing position from translation component of the new transform
if (!item->pos().isNull())
newItemTransform *= QTransform::fromTranslate(-item->x(), -item->y());
+
item->setTransform(newItemTransform);
item->d_func()->setIsMemberOfGroup(true);
prepareGeometryChange();
- QTransform itemTransform(item->transform());
- if (!item->pos().isNull())
- itemTransform *= QTransform::fromTranslate(item->x(), item->y());
d->itemsBoundingRect |= itemTransform.mapRect(item->boundingRect() | item->childrenBoundingRect());
update();
}
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp
index 778cd94..775a0d5 100644
--- a/src/gui/graphicsview/qgraphicstransform.cpp
+++ b/src/gui/graphicsview/qgraphicstransform.cpp
@@ -80,11 +80,7 @@
#include "qgraphicsitem_p.h"
#include "qgraphicstransform_p.h"
#include <QDebug>
-
-#include <math.h>
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
+#include <QtCore/qmath.h>
QT_BEGIN_NAMESPACE
@@ -355,7 +351,6 @@ public:
QGraphicsRotationPrivate()
: angle(0) {}
QPointF origin;
- qreal originY;
qreal angle;
};
@@ -475,13 +470,18 @@ void QGraphicsRotation::applyTo(QTransform *t) const
By default the axis is (0, 0, 1), giving QGraphicsRotation3D the same
default behavior as QGraphicsRotation (i.e., rotation around the Z axis).
+ Note: the final rotation is the combined effect of a rotation in
+ 3D space followed by a projection back to 2D. If several rotations
+ are performed in succession, they will not behave as expected unless
+ they were all around the Z axis.
+
\sa QGraphicsTransform, QGraphicsItem::setRotation(), QTransform::rotate()
*/
class QGraphicsRotation3DPrivate : public QGraphicsRotationPrivate
{
public:
- QGraphicsRotation3DPrivate() {}
+ QGraphicsRotation3DPrivate() : axis(0, 0, 1) {}
QVector3D axis;
};
@@ -522,10 +522,14 @@ QVector3D QGraphicsRotation3D::axis()
void QGraphicsRotation3D::setAxis(const QVector3D &axis)
{
Q_D(QGraphicsRotation3D);
+ if (d->axis == axis)
+ return;
d->axis = axis;
update();
+ emit axisChanged();
}
+const qreal deg2rad = qreal(0.017453292519943295769); // pi/180
static const qreal inv_dist_to_plane = 1. / 1024.;
/*!
@@ -535,13 +539,27 @@ void QGraphicsRotation3D::applyTo(QTransform *t) const
{
Q_D(const QGraphicsRotation3D);
- if (d->angle == 0. ||
+ qreal a = d->angle;
+
+ if (a == 0. ||
(d->axis.z() == 0. && d->axis.y() == 0 && d->axis.x() == 0))
return;
- qreal rad = d->angle * 2. * M_PI / 360.;
- qreal c = ::cos(rad);
- qreal s = ::sin(rad);
+ qreal c, s;
+ if (a == 90. || a == -270.) {
+ s = 1.;
+ c = 0.;
+ } else if (a == 270. || a == -90.) {
+ s = -1.;
+ c = 0.;
+ } else if (a == 180.) {
+ s = 0.;
+ c = -1.;
+ } else {
+ qreal b = deg2rad*a;
+ s = qSin(b);
+ c = qCos(b);
+ }
qreal x = d->axis.x();
qreal y = d->axis.y();
diff --git a/src/gui/graphicsview/qgraphicstransform_p.h b/src/gui/graphicsview/qgraphicstransform_p.h
index 2d36eda..467021f 100644
--- a/src/gui/graphicsview/qgraphicstransform_p.h
+++ b/src/gui/graphicsview/qgraphicstransform_p.h
@@ -55,6 +55,8 @@
#include "private/qobject_p.h"
+QT_BEGIN_NAMESPACE
+
class QGraphicsItem;
class QGraphicsTransformPrivate : public QObjectPrivate {
@@ -70,4 +72,6 @@ public:
static void updateItem(QGraphicsItem *item);
};
+QT_END_NAMESPACE
+
#endif // QGRAPHICSTRANSFORM_P_H
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index ca55f2e..92f8816 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2209,8 +2209,7 @@ QPolygonF QGraphicsView::mapToScene(const QRect &rect) const
QPointF br = scrollOffset + r.bottomRight();
QPointF bl = scrollOffset + r.bottomLeft();
- QPolygonF poly;
- poly.resize(4);
+ QPolygonF poly(4);
if (!d->identityMatrix) {
QTransform x = d->matrix.inverted();
poly[0] = x.map(tl);
@@ -2313,8 +2312,7 @@ QPolygon QGraphicsView::mapFromScene(const QRectF &rect) const
br -= scrollOffset;
bl -= scrollOffset;
- QPolygon poly;
- poly.resize(4);
+ QPolygon poly(4);
poly[0] = tl.toPoint();
poly[1] = tr.toPoint();
poly[2] = br.toPoint();
@@ -3647,8 +3645,7 @@ QRectF QGraphicsViewPrivate::mapToScene(const QRectF &rect) const
QPointF br = scrollOffset + rect.bottomRight();
QPointF bl = scrollOffset + rect.bottomLeft();
- QPolygonF poly;
- poly.resize(4);
+ QPolygonF poly(4);
if (!identityMatrix) {
QTransform x = matrix.inverted();
poly[0] = x.map(tl);
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index 7d1c5fb..789700a 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -43,6 +43,8 @@
#include "qpixmapdata_p.h"
+QT_BEGIN_NAMESPACE
+
// Legacy, single instance hooks: ### Qt 5: remove
typedef void (*_qt_pixmap_cleanup_hook)(int);
typedef void (*_qt_pixmap_cleanup_hook_64)(qint64);
@@ -108,3 +110,4 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key)
qt_image_cleanup_hook_64(key);
}
+QT_END_NAMESPACE
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index d929590..421d511 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2650,7 +2650,7 @@ void QAbstractItemView::keyboardSearch(const QString &search)
if (search.isEmpty()
|| (d->keyboardInputTime.msecsTo(now) > QApplication::keyboardInputInterval())) {
d->keyboardInput = search;
- skipRow = true;
+ skipRow = currentIndex().isValid(); //if it is not valid we should really start at QModelIndex(0,0)
} else {
d->keyboardInput += search;
}
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index 9dad95f..0f35ac1 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -593,10 +593,30 @@ void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &pare
// update selectionsx
QModelIndex tl = model->index(start, 0, parent);
QModelIndex br = model->index(end, model->columnCount(parent) - 1, parent);
- q->select(QItemSelection(tl, br), QItemSelectionModel::Deselect);
+ recursiveDeselect(QItemSelectionRange(tl, br));
finalize();
}
+void QItemSelectionModelPrivate::recursiveDeselect(const QItemSelectionRange &range)
+{
+ Q_Q(QItemSelectionModel);
+
+ QItemSelection sel(range.topLeft(), range.bottomRight());
+ q->select(sel, QItemSelectionModel::Deselect);
+
+ QModelIndexList idxList = range.indexes();
+ QModelIndexList::const_iterator it = idxList.begin();
+ for (; it != idxList.end(); ++it)
+ {
+ if (!model->hasChildren(*it))
+ continue;
+
+ const QModelIndex &firstChild = it->child(0,0);
+ const QModelIndex &lastChild = it->child(model->rowCount(*it) - 1, model->columnCount(*it) - 1);
+ recursiveDeselect(QItemSelectionRange(firstChild, lastChild));
+ }
+}
+
/*!
\internal
*/
diff --git a/src/gui/itemviews/qitemselectionmodel_p.h b/src/gui/itemviews/qitemselectionmodel_p.h
index 18ad506..8176d4c 100644
--- a/src/gui/itemviews/qitemselectionmodel_p.h
+++ b/src/gui/itemviews/qitemselectionmodel_p.h
@@ -77,6 +77,8 @@ public:
void _q_layoutAboutToBeChanged();
void _q_layoutChanged();
+ void recursiveDeselect(const QItemSelectionRange &range);
+
inline void remove(QList<QItemSelectionRange> &r)
{
QList<QItemSelectionRange>::const_iterator it = r.constBegin();
diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp
index 2565657..b518ff2 100644
--- a/src/gui/itemviews/qlistwidget.cpp
+++ b/src/gui/itemviews/qlistwidget.cpp
@@ -447,21 +447,20 @@ Qt::DropActions QListModel::supportedDropActions() const
\ingroup model-view
- QListWidgetItem is used to represent items in a list provided by the
- QListWidget class. Each item can hold several pieces of information,
- and will display these appropriately.
+ A QListWidgetItem represents a single item in a QListWidget. Each item can
+ hold several pieces of information, and will display them appropriately.
- The item view convenience classes use a classic item-based interface
- rather than a pure model/view approach. For a more flexible list view
- widget, consider using the QListView class with a standard model.
+ The item view convenience classes use a classic item-based interface rather
+ than a pure model/view approach. For a more flexible list view widget,
+ consider using the QListView class with a standard model.
- List items can be automatically inserted into a list when they are
- constructed by specifying the list widget:
+ List items can be inserted automatically into a list, when they are
+ constructed, by specifying the list widget:
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 2
- They can also be created without a parent widget, and later inserted into
- a list (see \l{QListWidget::insertItem()}).
+ Alternatively, list items can also be created without a parent widget, and
+ later inserted into a list using QListWidget::insertItem().
List items are typically used to display text() and an icon(). These are
set with the setText() and setIcon() functions. The appearance of the text
@@ -471,22 +470,24 @@ Qt::DropActions QListModel::supportedDropActions() const
with setToolTip(), setStatusTip(), and setWhatsThis().
By default, items are enabled, selectable, checkable, and can be the source
- of a drag and drop operation.
+ of drag and drop operations.
+
Each item's flags can be changed by calling setFlags() with the appropriate
- value (see \l{Qt::ItemFlags}). Checkable items can be checked, unchecked and
+ value (see Qt::ItemFlags). Checkable items can be checked, unchecked and
partially checked with the setCheckState() function. The corresponding
- checkState() function indicates what check state the item currently has.
+ checkState() function indicates the item's current check state.
+
+ The isHidden() function can be used to determine whether the item is
+ hidden. To hide an item, use setHidden().
- The isHidden() function can be used to determine whether the
- item is hidden. Items can be hidden with setHidden().
\section1 Subclassing
When subclassing QListWidgetItem to provide custom items, it is possible to
- define new types for them so that they can be distinguished from standard
- items. The constructors for subclasses that require this feature need to
- call the base class constructor with a new type value equal to or greater
- than \l UserType.
+ define new types for them enabling them to be distinguished from standard
+ items. For subclasses that require this feature, ensure that you call the
+ base class constructor with a new type value equal to or greater than
+ \l UserType, within \e your constructor.
\sa QListWidget, {Model/View Programming}, QTreeWidgetItem, QTableWidgetItem
*/
@@ -515,59 +516,58 @@ Qt::DropActions QListModel::supportedDropActions() const
/*!
\fn QListWidget *QListWidgetItem::listWidget() const
- Returns the list widget that contains the item.
+ Returns the list widget containing the item.
*/
/*!
- \fn void QListWidgetItem::setSelected(bool select)
- \since 4.2
+ \fn void QListWidgetItem::setSelected(bool select)
+ \since 4.2
- Sets the selected state of the item to \a select.
+ Sets the selected state of the item to \a select.
- \sa isSelected()
+ \sa isSelected()
*/
/*!
- \fn bool QListWidgetItem::isSelected() const
- \since 4.2
+ \fn bool QListWidgetItem::isSelected() const
+ \since 4.2
- Returns true if the item is selected, otherwise returns false.
+ Returns true if the item is selected; otherwise returns false.
- \sa setSelected()
+ \sa setSelected()
*/
/*!
- \fn void QListWidgetItem::setHidden(bool hide)
- \since 4.2
+ \fn void QListWidgetItem::setHidden(bool hide)
+ \since 4.2
- Hides the item if \a hide is true, otherwise shows the item.
+ Hides the item if \a hide is true; otherwise shows the item.
- \sa isHidden()
+ \sa isHidden()
*/
/*!
- \fn bool QListWidgetItem::isHidden() const
- \since 4.2
+ \fn bool QListWidgetItem::isHidden() const
+ \since 4.2
- Returns true if the item is hidden, otherwise returns false.
+ Returns true if the item is hidden; otherwise returns false.
- \sa setHidden()
+ \sa setHidden()
*/
/*!
\fn QListWidgetItem::QListWidgetItem(QListWidget *parent, int type)
Constructs an empty list widget item of the specified \a type with the
- given \a parent.
- If the parent is not specified, the item will need to be inserted into a
- list widget with QListWidget::insertItem().
-
- \note that this constructor inserts this same object into the model of
- the parent that is passed to the constructor. If the model is sorted then
- the behavior of the insert is undetermined since the model will call
- the '<' operator method on this object which has still not yet been
- constructed. In this case it would be better not to specify the parent
- and use the QListWidget::insertItem method to insert the item instead.
+ given \a parent. If \a parent is not specified, the item will need to be
+ inserted into a list widget with QListWidget::insertItem().
+
+ This constructor inserts the item into the model of the parent that is
+ passed to the constructor. If the model is sorted then the behavior of the
+ insert is undetermined since the model will call the \c '<' operator method
+ on the item which, at this point, is not yet constructed. To avoid the
+ undetermined behavior, we recommend not to specify the parent and use
+ QListWidget::insertItem() instead.
\sa type()
*/
@@ -586,16 +586,15 @@ QListWidgetItem::QListWidgetItem(QListWidget *view, int type)
\fn QListWidgetItem::QListWidgetItem(const QString &text, QListWidget *parent, int type)
Constructs an empty list widget item of the specified \a type with the
- given \a text and \a parent.
- If the parent is not specified, the item will need to be inserted into a
- list widget with QListWidget::insertItem().
-
- \note that this constructor inserts this same object into the model of
- the parent that is passed to the constructor. If the model is sorted then
- the behavior of the insert is undetermined since the model will call
- the '<' operator method on this object which has still not yet been
- constructed. In this case it would be better not to specify the parent
- and use the QListWidget::insertItem method to insert the item instead.
+ given \a text and \a parent. If the parent is not specified, the item will
+ need to be inserted into a list widget with QListWidget::insertItem().
+
+ This constructor inserts the item into the model of the parent that is
+ passed to the constructor. If the model is sorted then the behavior of the
+ insert is undetermined since the model will call the \c '<' operator method
+ on the item which, at this point, is not yet constructed. To avoid the
+ undetermined behavior, we recommend not to specify the parent and use
+ QListWidget::insertItem() instead.
\sa type()
*/
@@ -616,17 +615,17 @@ QListWidgetItem::QListWidgetItem(const QString &text, QListWidget *view, int typ
\fn QListWidgetItem::QListWidgetItem(const QIcon &icon, const QString &text, QListWidget *parent, int type)
Constructs an empty list widget item of the specified \a type with the
- given \a icon, \a text and \a parent.
- If the parent is not specified, the item will need to be inserted into a
- list widget with QListWidget::insertItem().
-
- \note that this constructor inserts this same object into the model of
- the parent that is passed to the constructor. If the model is sorted then
- the behavior of the insert is undetermined since the model will call
- the '<' operator method on this object which has still not yet been
- constructed. In this case it would be better not to specify the parent
- and use the QListWidget::insertItem method to insert the item instead.
-
+ given \a icon, \a text and \a parent. If the parent is not specified, the
+ item will need to be inserted into a list widget with
+ QListWidget::insertItem().
+
+ This constructor inserts the item into the model of the parent that is
+ passed to the constructor. If the model is sorted then the behavior of the
+ insert is undetermined since the model will call the \c '<' operator method
+ on the item which, at this point, is not yet constructed. To avoid the
+ undetermined behavior, we recommend not to specify the parent and use
+ QListWidget::insertItem() instead.
+
\sa type()
*/
QListWidgetItem::QListWidgetItem(const QIcon &icon,const QString &text,
@@ -645,7 +644,7 @@ QListWidgetItem::QListWidgetItem(const QIcon &icon,const QString &text,
}
/*!
- Destroys the list item.
+ Destroys the list item.
*/
QListWidgetItem::~QListWidgetItem()
{
@@ -655,7 +654,7 @@ QListWidgetItem::~QListWidgetItem()
}
/*!
- Creates an exact copy of the item.
+ Creates an exact copy of the item.
*/
QListWidgetItem *QListWidgetItem::clone() const
{
@@ -663,11 +662,10 @@ QListWidgetItem *QListWidgetItem::clone() const
}
/*!
- This function sets the data for a given \a role to the given \a value (see
- \l{Qt::ItemDataRole}). Reimplement this function if you need
- extra roles or special behavior for certain roles.
+ Sets the data for a given \a role to the given \a value. Reimplement this
+ function if you need extra roles or special behavior for certain roles.
- \sa Qt::ItemDataRole, data()
+ \sa Qt::ItemDataRole, data()
*/
void QListWidgetItem::setData(int role, const QVariant &value)
{
@@ -689,9 +687,10 @@ void QListWidgetItem::setData(int role, const QVariant &value)
}
/*!
- This function returns the item's data for a given \a role (see
- Qt::ItemDataRole). Reimplement this function if you need
- extra roles or special behavior for certain roles.
+ Returns the item's data for a given \a role. Reimplement this function if
+ you need extra roles or special behavior for certain roles.
+
+ \sa Qt::ItemDataRole, setData()
*/
QVariant QListWidgetItem::data(int role) const
{
@@ -703,8 +702,8 @@ QVariant QListWidgetItem::data(int role) const
}
/*!
- Returns true if this item's text is less then \a other item's text;
- otherwise returns false.
+ Returns true if this item's text is less then \a other item's text;
+ otherwise returns false.
*/
bool QListWidgetItem::operator<(const QListWidgetItem &other) const
{
@@ -740,8 +739,8 @@ void QListWidgetItem::write(QDataStream &out) const
/*!
\since 4.1
- Constructs a copy of \a other. Note that type() and listWidget()
- are not copied.
+ Constructs a copy of \a other. Note that type() and listWidget() are not
+ copied.
This function is useful when reimplementing clone().
@@ -756,8 +755,8 @@ QListWidgetItem::QListWidgetItem(const QListWidgetItem &other)
}
/*!
- Assigns \a other's data and flags to this item. Note that type()
- and listWidget() are not copied.
+ Assigns \a other's data and flags to this item. Note that type() and
+ listWidget() are not copied.
This function is useful when reimplementing clone().
@@ -805,9 +804,9 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
#endif // QT_NO_DATASTREAM
/*!
- \fn Qt::ItemFlags QListWidgetItem::flags() const
+ \fn Qt::ItemFlags QListWidgetItem::flags() const
- Returns the item flags for this item (see \l{Qt::ItemFlags}).
+ Returns the item flags for this item (see \l{Qt::ItemFlags}).
*/
/*!
@@ -851,15 +850,17 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
*/
/*!
- \fn QFont QListWidgetItem::font() const
+ \fn QFont QListWidgetItem::font() const
- Returns the font used to display this list item's text.
+ Returns the font used to display this list item's text.
*/
/*!
- \fn int QListWidgetItem::textAlignment() const
+ \fn int QListWidgetItem::textAlignment() const
- Returns the text alignment for the list item (see \l{Qt::AlignmentFlag}).
+ Returns the text alignment for the list item.
+
+ \sa Qt::AlignmentFlag
*/
/*!
@@ -905,26 +906,26 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
*/
/*!
- \fn QSize QListWidgetItem::sizeHint() const
- \since 4.1
+ \fn QSize QListWidgetItem::sizeHint() const
+ \since 4.1
- Returns the size hint set for the list item.
+ Returns the size hint set for the list item.
*/
/*!
- \fn void QListWidgetItem::setSizeHint(const QSize &size)
- \since 4.1
+ \fn void QListWidgetItem::setSizeHint(const QSize &size)
+ \since 4.1
- Sets the size hint for the list item to be \a size.
- If no size hint is set, the item delegate will compute the
- size hint based on the item data.
+ Sets the size hint for the list item to be \a size. If no size hint is set,
+ the item delegate will compute the size hint based on the item data.
*/
/*!
- \fn void QListWidgetItem::setFlags(Qt::ItemFlags flags)
+ \fn void QListWidgetItem::setFlags(Qt::ItemFlags flags)
- Sets the item flags for the list item to \a flags (see
- \l{Qt::ItemFlags}).
+ Sets the item flags for the list item to \a flags.
+
+ \sa Qt::ItemFlags
*/
void QListWidgetItem::setFlags(Qt::ItemFlags aflags) {
itemFlags = aflags;
@@ -953,10 +954,10 @@ void QListWidgetItem::setFlags(Qt::ItemFlags aflags) {
\fn void QListWidgetItem::setStatusTip(const QString &statusTip)
Sets the status tip for the list item to the text specified by
- \a statusTip. QListWidget mouse tracking needs to be enabled for this
+ \a statusTip. QListWidget mouseTracking needs to be enabled for this
feature to work.
- \sa statusTip() setToolTip() setWhatsThis()
+ \sa statusTip(), setToolTip(), setWhatsThis(), QWidget::setMouseTracking()
*/
/*!
@@ -964,29 +965,30 @@ void QListWidgetItem::setFlags(Qt::ItemFlags aflags) {
Sets the tooltip for the list item to the text specified by \a toolTip.
- \sa toolTip() setStatusTip() setWhatsThis()
+ \sa toolTip(), setStatusTip(), setWhatsThis()
*/
/*!
\fn void QListWidgetItem::setWhatsThis(const QString &whatsThis)
- Sets the "What's This?" help for the list item to the text specified
- by \a whatsThis.
+ Sets the "What's This?" help for the list item to the text specified by
+ \a whatsThis.
- \sa whatsThis() setStatusTip() setToolTip()
+ \sa whatsThis(), setStatusTip(), setToolTip()
*/
/*!
- \fn void QListWidgetItem::setFont(const QFont &font)
+ \fn void QListWidgetItem::setFont(const QFont &font)
- Sets the font used when painting the item to the given \a font.
+ Sets the font used when painting the item to the given \a font.
*/
/*!
- \fn void QListWidgetItem::setTextAlignment(int alignment)
+ \fn void QListWidgetItem::setTextAlignment(int alignment)
+
+ Sets the list item's text alignment to \a alignment.
- Sets the list item's text alignment to \a alignment (see
- \l{Qt::AlignmentFlag}).
+ \sa Qt::AlignmentFlag
*/
/*!
@@ -1127,10 +1129,10 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\ingroup model-view
\mainclass
- QListWidget is a convenience class that provides a list view similar to
- the one supplied by QListView, but with a classic item-based interface
- for adding and removing items. QListWidget uses an internal model to
- manage each QListWidgetItem in the list.
+ QListWidget is a convenience class that provides a list view similar to the
+ one supplied by QListView, but with a classic item-based interface for
+ adding and removing items. QListWidget uses an internal model to manage
+ each QListWidgetItem in the list.
For a more flexible list view widget, use the QListView class with a
standard model.
@@ -1145,23 +1147,23 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
function.
There are two ways to add items to the list: they can be constructed with
- the list widget as their parent widget, or they can be constructed with
- no parent widget and added to the list later. If a list widget already
- exists when the items are constructed, the first method is easier to use:
+ the list widget as their parent widget, or they can be constructed with no
+ parent widget and added to the list later. If a list widget already exists
+ when the items are constructed, the first method is easier to use:
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 1
- If you need to insert a new item into the list at a particular position,
- it is more required to construct the item without a parent widget and
- use the insertItem() function to place it within the list. The list
- widget will take ownership of the item.
+ If you need to insert a new item into the list at a particular position, it
+ is more required to construct the item without a parent widget and use the
+ insertItem() function to place it within the list. The list widget will
+ take ownership of the item.
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 6
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 7
- For multiple items, insertItems() can be used instead. The number of
- items in the list is found with the count() function.
- To remove items from the list, use takeItem().
+ For multiple items, insertItems() can be used instead. The number of items
+ in the list is found with the count() function. To remove items from the
+ list, use takeItem().
The current item in the list can be found with currentItem(), and changed
with setCurrentItem(). The user can also change the current item by
@@ -1187,9 +1189,9 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
Inserts the \a item at the end of the list widget.
- \warning A QListWidgetItem can only be added to a
- QListWidget once. Adding the same QListWidgetItem multiple
- times to a QListWidget will result in undefined behavior.
+ \warning A QListWidgetItem can only be added to a QListWidget once. Adding
+ the same QListWidgetItem multiple times to a QListWidget will result in
+ undefined behavior.
\sa insertItem()
*/
@@ -1197,8 +1199,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::addItem(const QString &label)
- Inserts an item with the text \a label at the end of the list
- widget.
+ Inserts an item with the text \a label at the end of the list widget.
*/
/*!
@@ -1212,8 +1213,8 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::itemPressed(QListWidgetItem *item)
- This signal is emitted with the specified \a item when a mouse button is pressed
- on an item in the widget.
+ This signal is emitted with the specified \a item when a mouse button is
+ pressed on an item in the widget.
\sa itemClicked(), itemDoubleClicked()
*/
@@ -1221,8 +1222,8 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::itemClicked(QListWidgetItem *item)
- This signal is emitted with the specified \a item when a mouse button is clicked
- on an item in the widget.
+ This signal is emitted with the specified \a item when a mouse button is
+ clicked on an item in the widget.
\sa itemPressed(), itemDoubleClicked()
*/
@@ -1230,8 +1231,8 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::itemDoubleClicked(QListWidgetItem *item)
- This signal is emitted with the specified \a item when a mouse button is double
- clicked on an item in the widget.
+ This signal is emitted with the specified \a item when a mouse button is
+ double clicked on an item in the widget.
\sa itemClicked(), itemPressed()
*/
@@ -1239,20 +1240,21 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::itemActivated(QListWidgetItem *item)
- This signal is emitted when the \a item is activated. The \a item
- is activated when the user clicks or double clicks on it,
- depending on the system configuration. It is also activated when
- the user presses the activation key (on Windows and X11 this is
- the \gui Return key, on Mac OS X it is \key{Ctrl+0}).
+ This signal is emitted when the \a item is activated. The \a item is
+ activated when the user clicks or double clicks on it, depending on the
+ system configuration. It is also activated when the user presses the
+ activation key (on Windows and X11 this is the \gui Return key, on Mac OS
+ X it is \key{Ctrl+0}).
*/
/*!
\fn void QListWidget::itemEntered(QListWidgetItem *item)
- This signal is emitted when the mouse cursor enters an item. The
- \a item is the item entered. This signal is only emitted when
- mouseTracking is turned on, or when a mouse button is pressed
- while moving into an item.
+ This signal is emitted when the mouse cursor enters an item. The \a item is
+ the item entered. This signal is only emitted when mouseTracking is turned
+ on, or when a mouse button is pressed while moving into an item.
+
+ \sa QWidget::setMouseTracking()
*/
/*!
@@ -1264,24 +1266,28 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
- This signal is emitted whenever the current item changes. The \a
- previous item is the item that previously had the focus, \a
- current is the new current item.
+ This signal is emitted whenever the current item changes.
+
+ \a previous is the item that previously had the focus; \a current is the
+ new current item.
*/
/*!
- \fn void QListWidget::currentTextChanged(const QString &currentText)
+ \fn void QListWidget::currentTextChanged(const QString &currentText)
- This signal is emitted whenever the current item changes. The \a currentText
- is the text data in the current item. If there is no current item, the \a currentText
- is invalid.
+ This signal is emitted whenever the current item changes.
+
+ \a currentText is the text data in the current item. If there is no current
+ item, the \a currentText is invalid.
*/
/*!
- \fn void QListWidget::currentRowChanged(int currentRow)
+ \fn void QListWidget::currentRowChanged(int currentRow)
+
+ This signal is emitted whenever the current item changes.
- This signal is emitted whenever the current item changes. The \a currentRow
- is the row of the current item. If there is no current item, the \a currentRow is -1.
+ \a currentRow is the row of the current item. If there is no current item,
+ the \a currentRow is -1.
*/
/*!
@@ -1289,15 +1295,15 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
This signal is emitted whenever the selection changes.
- \sa selectedItems() QListWidgetItem::isSelected() currentItemChanged()
+ \sa selectedItems(), QListWidgetItem::isSelected(), currentItemChanged()
*/
/*!
- \since 4.3
+ \since 4.3
- \fn void QListWidget::removeItemWidget(QListWidgetItem *item)
+ \fn void QListWidget::removeItemWidget(QListWidgetItem *item)
- Removes the widget set on the given \a item.
+ Removes the widget set on the given \a item.
*/
/*!
@@ -1361,8 +1367,8 @@ void QListWidget::insertItem(int row, QListWidgetItem *item)
}
/*!
- Inserts an item with the text \a label in the list widget at the
- position given by \a row.
+ Inserts an item with the text \a label in the list widget at the position
+ given by \a row.
\sa addItem()
*/
@@ -1387,11 +1393,11 @@ void QListWidget::insertItems(int row, const QStringList &labels)
}
/*!
- Removes and returns the item from the given \a row in the list widget; otherwise
- returns 0.
+ Removes and returns the item from the given \a row in the list widget;
+ otherwise returns 0.
- Items removed from a list widget will not be managed by Qt, and will need to be
- deleted manually.
+ Items removed from a list widget will not be managed by Qt, and will need
+ to be deleted manually.
\sa insertItem(), addItem()
*/
@@ -1405,8 +1411,8 @@ QListWidgetItem *QListWidget::takeItem(int row)
}
/*!
- \property QListWidget::count
- \brief the number of items in the list including any hidden items.
+ \property QListWidget::count
+ \brief the number of items in the list including any hidden items.
*/
int QListWidget::count() const
@@ -1416,7 +1422,7 @@ int QListWidget::count() const
}
/*!
- Returns the current item.
+ Returns the current item.
*/
QListWidgetItem *QListWidget::currentItem() const
{
@@ -1426,9 +1432,9 @@ QListWidgetItem *QListWidget::currentItem() const
/*!
- Sets the current item to \a item.
+ Sets the current item to \a item.
- Depending on the current selection mode, the item may also be selected.
+ Depending on the current selection mode, the item may also be selected.
*/
void QListWidget::setCurrentItem(QListWidgetItem *item)
{
@@ -1436,8 +1442,8 @@ void QListWidget::setCurrentItem(QListWidgetItem *item)
}
/*!
- \since 4.4
- Set the current item to \a item, using the given \a command.
+ \since 4.4
+ Set the current item to \a item, using the given \a command.
*/
void QListWidget::setCurrentItem(QListWidgetItem *item, QItemSelectionModel::SelectionFlags command)
{
@@ -1445,10 +1451,10 @@ void QListWidget::setCurrentItem(QListWidgetItem *item, QItemSelectionModel::Sel
}
/*!
- \property QListWidget::currentRow
- \brief the row of the current item.
+ \property QListWidget::currentRow
+ \brief the row of the current item.
- Depending on the current selection mode, the row may also be selected.
+ Depending on the current selection mode, the row may also be selected.
*/
int QListWidget::currentRow() const
@@ -1469,9 +1475,9 @@ void QListWidget::setCurrentRow(int row)
}
/*!
- \since 4.4
+ \since 4.4
- Sets the current row to be the given \a row, using the given \a command,
+ Sets the current row to be the given \a row, using the given \a command,
*/
void QListWidget::setCurrentRow(int row, QItemSelectionModel::SelectionFlags command)
{
@@ -1498,7 +1504,7 @@ QListWidgetItem *QListWidget::itemAt(const QPoint &p) const
/*!
- Returns the rectangle on the viewport occupied by the item at \a item.
+ Returns the rectangle on the viewport occupied by the item at \a item.
*/
QRect QListWidget::visualItemRect(const QListWidgetItem *item) const
{
@@ -1508,7 +1514,7 @@ QRect QListWidget::visualItemRect(const QListWidgetItem *item) const
}
/*!
- Sorts all the items in the list widget according to the specified \a order.
+ Sorts all the items in the list widget according to the specified \a order.
*/
void QListWidget::sortItems(Qt::SortOrder order)
{
@@ -1522,8 +1528,10 @@ void QListWidget::sortItems(Qt::SortOrder order)
\property QListWidget::sortingEnabled
\brief whether sorting is enabled
- If this property is true, sorting is enabled for the list; if the
- property is false, sorting is not enabled. The default value is false.
+ If this property is true, sorting is enabled for the list; if the property
+ is false, sorting is not enabled.
+
+ The default value is false.
*/
void QListWidget::setSortingEnabled(bool enable)
{
@@ -1538,7 +1546,7 @@ bool QListWidget::isSortingEnabled() const
}
/*!
- \internal
+ \internal
*/
Qt::SortOrder QListWidget::sortOrder() const
{
@@ -1547,7 +1555,7 @@ Qt::SortOrder QListWidget::sortOrder() const
}
/*!
- Starts editing the \a item if it is editable.
+ Starts editing the \a item if it is editable.
*/
void QListWidget::editItem(QListWidgetItem *item)
@@ -1557,9 +1565,10 @@ void QListWidget::editItem(QListWidgetItem *item)
}
/*!
- Opens an editor for the given \a item. The editor remains open after editing.
+ Opens an editor for the given \a item. The editor remains open after
+ editing.
- \sa closePersistentEditor()
+ \sa closePersistentEditor()
*/
void QListWidget::openPersistentEditor(QListWidgetItem *item)
{
@@ -1569,9 +1578,9 @@ void QListWidget::openPersistentEditor(QListWidgetItem *item)
}
/*!
- Closes the persistent editor for the given \a item.
+ Closes the persistent editor for the given \a item.
- \sa openPersistentEditor()
+ \sa openPersistentEditor()
*/
void QListWidget::closePersistentEditor(QListWidgetItem *item)
{
@@ -1597,9 +1606,10 @@ QWidget *QListWidget::itemWidget(QListWidgetItem *item) const
Sets the \a widget to be displayed in the give \a item.
- This function should only be used to display static content in the place of a list
- widget item. If you want to display custom dynamic content or implement a custom
- editor widget, use QListView and subclass QItemDelegate instead.
+ This function should only be used to display static content in the place of
+ a list widget item. If you want to display custom dynamic content or
+ implement a custom editor widget, use QListView and subclass QItemDelegate
+ instead.
\sa {Delegate Classes}
*/
@@ -1611,11 +1621,11 @@ void QListWidget::setItemWidget(QListWidgetItem *item, QWidget *widget)
}
/*!
- Returns true if \a item is selected; otherwise returns false.
+ Returns true if \a item is selected; otherwise returns false.
- \obsolete
+ \obsolete
- This function is deprecated. Use \l{QListWidgetItem::isSelected()} instead.
+ This function is deprecated. Use QListWidgetItem::isSelected() instead.
*/
bool QListWidget::isItemSelected(const QListWidgetItem *item) const
{
@@ -1625,12 +1635,12 @@ bool QListWidget::isItemSelected(const QListWidgetItem *item) const
}
/*!
- Selects or deselects the given \a item depending on whether \a select is
- true of false.
+ Selects or deselects the given \a item depending on whether \a select is
+ true of false.
- \obsolete
+ \obsolete
- This function is deprecated. Use \l{QListWidgetItem::setSelected()} instead.
+ This function is deprecated. Use QListWidgetItem::setSelected() instead.
*/
void QListWidget::setItemSelected(const QListWidgetItem *item, bool select)
{
@@ -1650,7 +1660,7 @@ void QListWidget::setItemSelected(const QListWidgetItem *item, bool select)
}
/*!
- Returns a list of all selected items in the list widget.
+ Returns a list of all selected items in the list widget.
*/
QList<QListWidgetItem*> QListWidget::selectedItems() const
@@ -1664,7 +1674,8 @@ QList<QListWidgetItem*> QListWidget::selectedItems() const
}
/*!
- Finds items with the text that matches the string \a text using the given \a flags.
+ Finds items with the text that matches the string \a text using the given
+ \a flags.
*/
QList<QListWidgetItem*> QListWidget::findItems(const QString &text, Qt::MatchFlags flags) const
@@ -1679,11 +1690,11 @@ QList<QListWidgetItem*> QListWidget::findItems(const QString &text, Qt::MatchFla
}
/*!
- Returns true if the \a item is explicitly hidden; otherwise returns false.
+ Returns true if the \a item is explicitly hidden; otherwise returns false.
- \obsolete
+ \obsolete
- This function is deprecated. Use \l{QListWidgetItem::isHidden()} instead.
+ This function is deprecated. Use QListWidgetItem::isHidden() instead.
*/
bool QListWidget::isItemHidden(const QListWidgetItem *item) const
{
@@ -1691,11 +1702,11 @@ bool QListWidget::isItemHidden(const QListWidgetItem *item) const
}
/*!
- If \a hide is true, the \a item will be hidden; otherwise it will be shown.
+ If \a hide is true, the \a item will be hidden; otherwise it will be shown.
- \obsolete
+ \obsolete
- This function is deprecated. Use \l{QListWidgetItem::setHidden()} instead.
+ This function is deprecated. Use QListWidgetItem::setHidden() instead.
*/
void QListWidget::setItemHidden(const QListWidgetItem *item, bool hide)
{
@@ -1703,9 +1714,9 @@ void QListWidget::setItemHidden(const QListWidgetItem *item, bool hide)
}
/*!
- Scrolls the view if necessary to ensure that the \a item is
- visible. The \a hint parameter specifies more precisely where the
- \a item should be located after the operation.
+ Scrolls the view if necessary to ensure that the \a item is visible.
+
+ \a hint specifies where the \a item should be located after the operation.
*/
void QListWidget::scrollToItem(const QListWidgetItem *item, QAbstractItemView::ScrollHint hint)
@@ -1718,7 +1729,7 @@ void QListWidget::scrollToItem(const QListWidgetItem *item, QAbstractItemView::S
/*!
Removes all items and selections in the view.
- \note All items will be permanently deleted.
+ \warning All items will be permanently deleted.
*/
void QListWidget::clear()
{
@@ -1743,8 +1754,8 @@ QStringList QListWidget::mimeTypes() const
\a items. The format used to describe the items is obtained from the
mimeTypes() function.
- If the list of items is empty, 0 is returned rather than a serialized
- empty list.
+ If the list of items is empty, 0 is returned instead of a serialized empty
+ list.
*/
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*>) const
{
@@ -1753,10 +1764,9 @@ QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*>) const
#ifndef QT_NO_DRAGANDDROP
/*!
- Handles the \a data supplied by an external drag and drop operation
- that ended with the given \a action in the given \a index.
- Returns true if the data and action can be handled by the model;
- otherwise returns false.
+ Handles \a data supplied by an external drag and drop operation that ended
+ with the given \a action in the given \a index. Returns true if \a data and
+ \a action can be handled by the model; otherwise returns false.
\sa supportedDropActions()
*/
@@ -1823,9 +1833,9 @@ void QListWidget::dropEvent(QDropEvent *event) {
}
/*!
- Returns the drop actions supported by this view.
+ Returns the drop actions supported by this view.
- \sa Qt::DropActions
+ \sa Qt::DropActions
*/
Qt::DropActions QListWidget::supportedDropActions() const
{
@@ -1835,9 +1845,9 @@ Qt::DropActions QListWidget::supportedDropActions() const
#endif // QT_NO_DRAGANDDROP
/*!
- Returns a list of pointers to the items contained in the \a data object.
- If the object was not created by a QListWidget in the same process, the list
- is empty.
+ Returns a list of pointers to the items contained in the \a data object. If
+ the object was not created by a QListWidget in the same process, the list
+ is empty.
*/
QList<QListWidgetItem*> QListWidget::items(const QMimeData *data) const
{
@@ -1848,7 +1858,7 @@ QList<QListWidgetItem*> QListWidget::items(const QMimeData *data) const
}
/*!
- Returns the QModelIndex assocated with the given \a item.
+ Returns the QModelIndex assocated with the given \a item.
*/
QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const
@@ -1858,7 +1868,7 @@ QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const
}
/*!
- Returns a pointer to the QListWidgetItem assocated with the given \a index.
+ Returns a pointer to the QListWidgetItem assocated with the given \a index.
*/
QListWidgetItem *QListWidget::itemFromIndex(const QModelIndex &index) const
@@ -1870,7 +1880,7 @@ QListWidgetItem *QListWidget::itemFromIndex(const QModelIndex &index) const
}
/*!
- \internal
+ \internal
*/
void QListWidget::setModel(QAbstractItemModel * /*model*/)
{
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index e6eff6e..d9deefe 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -100,7 +100,8 @@ unix:x11 {
INCLUDEPATH += ../3rdparty/xorg
HEADERS += \
kernel/qx11embed_x11.h \
- kernel/qx11info_x11.h
+ kernel/qx11info_x11.h \
+ kernel/qkde_p.h
SOURCES += \
kernel/qapplication_x11.cpp \
@@ -114,7 +115,8 @@ unix:x11 {
kernel/qwidgetcreate_x11.cpp \
kernel/qx11embed_x11.cpp \
kernel/qx11info_x11.cpp \
- kernel/qkeymapper_x11.cpp
+ kernel/qkeymapper_x11.cpp \
+ kernel/qkde.cpp
contains(QT_CONFIG, glib) {
SOURCES += \
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index 19ae085..58e0cc3 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -375,10 +375,6 @@ private:
friend class QDirectPainterPrivate;
#endif
-#if defined(Q_WS_WIN)
- friend QApplicationPrivate* getQApplicationPrivateInternal();
-#endif
-
#if defined(Q_WS_MAC) || defined(Q_WS_X11)
Q_PRIVATE_SLOT(d_func(), void _q_alertTimeOut())
#endif
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 700d1ab..f809672 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -235,6 +235,7 @@ typedef struct tagGESTUREINFO
# define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004
# define GC_ZOOM 0x00000001
+# define GC_ROTATE 0x00000001
typedef struct tagGESTURECONFIG
{
@@ -243,6 +244,8 @@ typedef struct tagGESTURECONFIG
DWORD dwBlock;
} GESTURECONFIG;
+# define GID_ROTATE_ANGLE_FROM_ARGUMENT(arg) ((((double)(arg) / 65535.0) * 4.0 * 3.14159265) - 2.0*3.14159265)
+
#endif // WM_GESTURE
#endif // Q_WS_WIN
@@ -284,7 +287,6 @@ public:
#if defined(Q_WS_X11)
#ifndef QT_NO_SETTINGS
- static QString kdeHome();
static QString x11_desktop_style();
static bool x11_apply_settings();
#endif
@@ -525,7 +527,6 @@ public:
static PtrCloseTouchInputHandle CloseTouchInputHandle;
QHash<DWORD, int> touchInputIDToTouchPointID;
- QList<QTouchEvent::TouchPoint> appAllTouchPoints;
bool translateTouchEvent(const MSG &msg);
PtrGetGestureInfo GetGestureInfo;
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 281be33..5843c34 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -431,11 +431,6 @@ extern QCursor *qt_grab_cursor();
#define __export
#endif
-QApplicationPrivate* getQApplicationPrivateInternal()
-{
- return qApp->d_func();
-}
-
extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
class QETWidget : public QWidget // event translator widget
@@ -1475,7 +1470,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// we receive the message for each toplevel window included internal hidden ones,
// but the aboutToQuit signal should be emitted only once.
- QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal();
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
if (endsession && !qAppPriv->aboutToQuitEmitted) {
qAppPriv->aboutToQuitEmitted = true;
int index = QApplication::staticMetaObject.indexOfSignal("aboutToQuit()");
@@ -1662,7 +1657,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
} else {
switch (message) {
case WM_TOUCH:
- result = getQApplicationPrivateInternal()->translateTouchEvent(msg);
+ result = QApplicationPrivate::instance()->translateTouchEvent(msg);
break;
case WM_KEYDOWN: // keyboard event
case WM_SYSKEYDOWN:
@@ -3744,17 +3739,20 @@ bool QETWidget::translateGestureEvent(const MSG &msg)
if (qAppPriv->GetGestureInfo)
bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi);
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
+ BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi);
+ if (bResult) {
+ const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
+ QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
+ if (alienWidget && alienWidget->internalWinId())
+ alienWidget = 0;
+ QWidget *widget = alienWidget ? alienWidget : this;
- const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
- QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
- if (alienWidget && alienWidget->internalWinId())
- alienWidget = 0;
- QWidget *widget = alienWidget ? alienWidget : this;
+ QNativeGestureEvent event;
+ event.sequenceId = gi.dwSequenceID;
+ event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
+ event.argument = gi.ullArguments;
- QNativeGestureEvent event;
- event.sequenceId = gi.dwSequenceID;
- event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
- if (bResult) {
switch (gi.dwID) {
case GID_BEGIN:
event.gestureType = QNativeGestureEvent::GestureBegin;
@@ -3769,6 +3767,8 @@ bool QETWidget::translateGestureEvent(const MSG &msg)
event.gestureType = QNativeGestureEvent::Pan;
break;
case GID_ROTATE:
+ event.gestureType = QNativeGestureEvent::Rotate;
+ break;
case GID_TWOFINGERTAP:
case GID_ROLLOVER:
default:
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 4016563..32e7e3c 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -83,6 +83,7 @@
#include "qtimer.h"
#include "qlibrary.h"
#include <private/qgraphicssystemfactory_p.h>
+#include "qkde_p.h"
#if !defined (QT_NO_TABLET)
extern "C" {
@@ -813,33 +814,6 @@ Q_GUI_EXPORT void qt_x11_apply_settings_in_all_apps()
PropModeReplace, (unsigned char *)stamp.data(), stamp.size());
}
-static int kdeSessionVersion()
-{
- static int kdeVersion = 0;
- if (!kdeVersion)
- kdeVersion = QString::fromLocal8Bit(qgetenv("KDE_SESSION_VERSION")).toInt();
- return kdeVersion;
-}
-
-/*! \internal
- Gets the current KDE 3 or 4 home path
-*/
-QString QApplicationPrivate::kdeHome()
-{
- static QString kdeHomePath;
- if (kdeHomePath.isEmpty()) {
- kdeHomePath = QString::fromLocal8Bit(qgetenv("KDEHOME"));
- if (kdeHomePath.isEmpty()) {
- QDir homeDir(QDir::homePath());
- QString kdeConfDir(QLatin1String("/.kde"));
- if (4 == kdeSessionVersion() && homeDir.exists(QLatin1String(".kde4")))
- kdeConfDir = QLatin1String("/.kde4");
- kdeHomePath = QDir::homePath() + kdeConfDir;
- }
- }
- return kdeHomePath;
-}
-
/*! \internal
apply the settings to the application
*/
@@ -905,8 +879,8 @@ bool QApplicationPrivate::x11_apply_settings()
QFont font(QApplication::font());
QString fontDescription;
// Override Qt font if KDE4 settings can be used
- if (4 == kdeSessionVersion()) {
- QSettings kdeSettings(kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
+ if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4) {
+ QSettings kdeSettings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
fontDescription = kdeSettings.value(QLatin1String("font")).toString();
if (fontDescription.isEmpty()) {
// KDE stores fonts without quotes
@@ -936,7 +910,6 @@ bool QApplicationPrivate::x11_apply_settings()
// read new QStyle
QString stylename = settings.value(QLatin1String("style")).toString();
-
if (stylename.isEmpty() && QApplicationPrivate::styleOverride.isNull() && X11->use_xrender) {
stylename = x11_desktop_style();
}
@@ -1094,22 +1067,6 @@ static void qt_set_input_encoding()
XFree((char *)data);
}
-// Reads a KDE color setting
-static QColor kdeColor(const QString &key, const QSettings &kdeSettings)
-{
- QVariant variant = kdeSettings.value(key);
- if (variant.isValid()) {
- QStringList values = variant.toStringList();
- if (values.size() == 3) {
- int r = values[0].toInt();
- int g = values[1].toInt();
- int b = values[2].toInt();
- return QColor(r, g, b);
- }
- }
- return QColor();
-}
-
// set font, foreground and background from x11 resources. The
// arguments may override the resource settings.
static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
@@ -1276,9 +1233,10 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
QApplicationPrivate::setSystemFont(fnt);
}
+ // QGtkStyle sets it's own system palette
+ bool gtkStyle = QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle");
bool kdeColors = (QApplication::desktopSettingsAware() && X11->desktopEnvironment == DE_KDE);
-
- if (kdeColors || (button || !resBG.isEmpty() || !resFG.isEmpty())) {// set app colors
+ if (!gtkStyle && (kdeColors || (button || !resBG.isEmpty() || !resFG.isEmpty()))) {// set app colors
bool allowX11ColorNames = QColor::allowX11ColorNames();
QColor::setAllowX11ColorNames(true);
@@ -1314,45 +1272,6 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
bright_mode = true;
}
- if (kdeColors) {
- const QSettings theKdeSettings(
- QApplicationPrivate::kdeHome()
- + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
-
- // Setup KDE palette
- QColor color;
- color = kdeColor(QLatin1String("buttonBackground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Button/BackgroundNormal"), theKdeSettings);
- if (color.isValid())
- btn = color;
-
- color = kdeColor(QLatin1String("background"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Window/BackgroundNormal"), theKdeSettings);
- if (color.isValid())
- bg = color;
-
- color = kdeColor(QLatin1String("foreground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:View/ForegroundNormal"), theKdeSettings);
- if (color.isValid()) {
- fg = color;
- }
-
- color = kdeColor(QLatin1String("windowForeground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Window/ForegroundNormal"), theKdeSettings);
- if (color.isValid())
- wfg = color;
-
- color = kdeColor(QLatin1String("windowBackground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:View/BackgroundNormal"), theKdeSettings);
- if (color.isValid())
- base = color;
- }
-
QPalette pal(fg, btn, btn.lighter(125), btn.darker(130), btn.darker(120), wfg.isValid() ? wfg : fg, Qt::white, base, bg);
QColor disabled((fg.red() + btn.red()) / 2,
(fg.green() + btn.green())/ 2,
@@ -1365,50 +1284,6 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
highlight = QColor(selectBackground);
highlightText = QColor(selectForeground);
}
- // Use KDE3 or KDE4 color settings if present
- if (kdeColors) {
- const QSettings theKdeSettings(
- QApplicationPrivate::kdeHome()
- + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
-
- QColor color = kdeColor(QLatin1String("selectBackground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Selection/BackgroundNormal"), theKdeSettings);
- if (color.isValid())
- highlight = color;
-
- color = kdeColor(QLatin1String("selectForeground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Selection/ForegroundNormal"), theKdeSettings);
- if (color.isValid())
- highlightText = color;
-
- color = kdeColor(QLatin1String("alternateBackground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:View/BackgroundAlternate"), theKdeSettings);
- if (color.isValid())
- pal.setColor(QPalette::AlternateBase, color);
- else
- pal.setBrush(QPalette::AlternateBase, pal.base().color().darker(110));
-
- color = kdeColor(QLatin1String("buttonForeground"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:Button/ForegroundNormal"), theKdeSettings);
- if (color.isValid())
- pal.setColor(QPalette::ButtonText, color);
-
- color = kdeColor(QLatin1String("linkColor"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:View/ForegroundLink"), theKdeSettings);
- if (color.isValid())
- pal.setColor(QPalette::Link, color);
-
- color = kdeColor(QLatin1String("visitedLinkColor"), theKdeSettings);
- if (!color.isValid())
- color = kdeColor(QLatin1String("Colors:View/ForegroundVisited"), theKdeSettings);
- if (color.isValid())
- pal.setColor(QPalette::LinkVisited, color);
- }
if (highlight.isValid() && highlightText.isValid()) {
pal.setColor(QPalette::Highlight, highlight);
@@ -1431,10 +1306,9 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::darkBlue);
}
- // QGtkStyle sets it's own system palette
- if (!(QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle"))) {
- QApplicationPrivate::setSystemPalette(pal);
- }
+ if (kdeColors)
+ pal = QKde::kdePalette().resolve(pal);
+ QApplicationPrivate::setSystemPalette(pal);
QColor::setAllowX11ColorNames(allowX11ColorNames);
}
@@ -2315,6 +2189,7 @@ void qt_init(QApplicationPrivate *priv, int,
X11->compositingManagerRunning = XGetSelectionOwner(X11->display,
ATOM(_NET_WM_CM_S0));
X11->desktopEnvironment = DE_UNKNOWN;
+ X11->desktopVersion = 0;
// See if the current window manager is using the freedesktop.org spec to give its name
Window windowManagerWindow = XNone;
@@ -2390,6 +2265,9 @@ void qt_init(QApplicationPrivate *priv, int,
XFree((char *)data);
}
+ if (X11->desktopEnvironment == DE_KDE)
+ X11->desktopVersion = QString::fromLocal8Bit(qgetenv("KDE_SESSION_VERSION")).toInt();
+
qt_set_input_encoding();
qt_set_x11_resources(appFont, appFGCol, appBGCol, appBTNCol);
@@ -2657,44 +2535,30 @@ void qt_init(QApplicationPrivate *priv, int,
QString QApplicationPrivate::x11_desktop_style()
{
QString stylename;
- QStringList availableStyles = QStyleFactory::keys();
- // Override Qt style if KDE4 settings can be used
- if (4 == kdeSessionVersion()) {
- QSettings kdeSettings(kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
- QString kde4Style = kdeSettings.value(QLatin1String("widgetStyle"),
- QLatin1String("Oxygen")).toString();
- foreach (const QString &style, availableStyles) {
- if (style.toLower() == kde4Style.toLower())
- stylename = kde4Style;
- }
- // Set QGtkStyle for GNOME
- } else if (X11->desktopEnvironment == DE_GNOME) {
+ switch(X11->desktopEnvironment) {
+ case DE_KDE:
+ stylename = QKde::kdeStyle();
+ break;
+ case DE_GNOME: {
+ QStringList availableStyles = QStyleFactory::keys();
+ // Set QGtkStyle for GNOME if available
QString gtkStyleKey = QString::fromLatin1("GTK+");
- if (availableStyles.contains(gtkStyleKey))
+ if (availableStyles.contains(gtkStyleKey)) {
stylename = gtkStyleKey;
- }
-
- if (stylename.isEmpty()) {
- switch(X11->desktopEnvironment) {
- case DE_KDE:
- if (X11->use_xrender)
- stylename = QLatin1String("plastique");
- else
- stylename = QLatin1String("windows");
- break;
- case DE_GNOME:
- if (X11->use_xrender)
- stylename = QLatin1String("cleanlooks");
- else
- stylename = QLatin1String("windows");
- break;
- case DE_CDE:
- stylename = QLatin1String("cde");
- break;
- default:
- // Don't do anything
break;
}
+ if (X11->use_xrender)
+ stylename = QLatin1String("cleanlooks");
+ else
+ stylename = QLatin1String("windows");
+ break;
+ }
+ case DE_CDE:
+ stylename = QLatin1String("cde");
+ break;
+ default:
+ // Don't do anything
+ break;
}
return stylename;
}
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index b21b35c..2ff672b 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -133,9 +133,9 @@ public:
};
QNativeGestureEvent()
- : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0), direction(0, 0)
+ : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0)
#ifdef Q_WS_WIN
- , sequenceId(0)
+ , sequenceId(0), argument(0)
#endif
{
}
@@ -146,6 +146,7 @@ public:
QSize direction;
#ifdef Q_WS_WIN
ulong sequenceId;
+ quint64 argument;
#endif
};
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 38e8851..672fc1c 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -204,7 +204,7 @@ Qt::GestureState QGesture::state() const
\a state, and it should be called after all the internal properties have been
initialized.
- \sa started, triggered, finished, cancelled
+ \sa started(), triggered(), finished(), cancelled()
*/
void QGesture::updateState(Qt::GestureState state)
{
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 7da37c4..839fdca 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -73,14 +73,13 @@ public:
void setGraphicsItem(QGraphicsItem *);
QGraphicsItem *graphicsItem() const;
- virtual void reset();
-
Qt::GestureState state() const;
protected:
QGesture(QGesturePrivate &dd, QObject *parent);
bool eventFilter(QObject*, QEvent*);
+ virtual void reset();
void updateState(Qt::GestureState state);
Q_SIGNALS:
diff --git a/src/gui/kernel/qkde.cpp b/src/gui/kernel/qkde.cpp
new file mode 100644
index 0000000..96ff21e
--- /dev/null
+++ b/src/gui/kernel/qkde.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qkde_p.h"
+#include <QtCore/QLibrary>
+#include <QtCore/QDir>
+#include <QtCore/qdebug.h>
+#include <QtCore/QSettings>
+#include "QtGui/qstylefactory.h"
+#include "qt_x11_p.h"
+
+#if defined(Q_WS_X11)
+
+QT_BEGIN_NAMESPACE
+
+/*! \internal
+Gets the current KDE home path
+like "/home/troll/.kde"
+*/
+QString QKde::kdeHome()
+{
+ static QString kdeHomePath;
+ if (kdeHomePath.isEmpty()) {
+ kdeHomePath = QString::fromLocal8Bit(qgetenv("KDEHOME"));
+ if (kdeHomePath.isEmpty()) {
+ QDir homeDir(QDir::homePath());
+ QString kdeConfDir(QLatin1String("/.kde"));
+ if (4 == X11->desktopVersion && homeDir.exists(QLatin1String(".kde4")))
+ kdeConfDir = QLatin1String("/.kde4");
+ kdeHomePath = QDir::homePath() + kdeConfDir;
+ }
+ }
+ return kdeHomePath;
+}
+
+/*!\internal
+ Reads the color from the config, and store it in the palette with the given color role if found
+ */
+static bool kdeColor(QPalette *pal, QPalette::ColorRole role, const QSettings &kdeSettings, const QString &kde4Key, const QString &kde3Key = QString())
+{
+ QVariant variant = kdeSettings.value(kde4Key);
+ if (!variant.isValid())
+ QVariant variant = kdeSettings.value(kde3Key);
+ if (variant.isValid()) {
+ QStringList values = variant.toStringList();
+ if (values.size() == 3) {
+ int r = values[0].toInt();
+ int g = values[1].toInt();
+ int b = values[2].toInt();
+ pal->setBrush(role, QColor(r, g, b));
+ return true;
+ }
+ }
+ return false;
+}
+
+
+/*!\internal
+ Returns the KDE palette
+*/
+QPalette QKde::kdePalette()
+{
+ const QSettings theKdeSettings(QKde::kdeHome() +
+ QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
+ QPalette pal;
+
+ // Setup KDE palette
+ kdeColor(&pal, QPalette::Button, theKdeSettings, QLatin1String("Colors:Button/BackgroundNormal"), QLatin1String("buttonBackground"));
+ kdeColor(&pal, QPalette::Window, theKdeSettings, QLatin1String("Colors:Window/BackgroundNormal"), QLatin1String("background"));
+ kdeColor(&pal, QPalette::Text, theKdeSettings, QLatin1String("Colors:View/ForegroundNormal"), QLatin1String("foreground"));
+ kdeColor(&pal, QPalette::WindowText, theKdeSettings, QLatin1String("Colors:Window/ForegroundNormal"), QLatin1String("windowForeground"));
+ kdeColor(&pal, QPalette::Base, theKdeSettings, QLatin1String("Colors:View/BackgroundNormal"), QLatin1String("windowBackground"));
+ kdeColor(&pal, QPalette::Highlight, theKdeSettings, QLatin1String("Colors:Selection/BackgroundNormal"), QLatin1String("selectBackground"));
+ kdeColor(&pal, QPalette::HighlightedText, theKdeSettings, QLatin1String("Colors:Selection/ForegroundNormal"), QLatin1String("selectForeground"));
+ kdeColor(&pal, QPalette::AlternateBase, theKdeSettings, QLatin1String("Colors:View/BackgroundAlternate"), QLatin1String("alternateBackground"));
+ kdeColor(&pal, QPalette::ButtonText, theKdeSettings, QLatin1String("Colors:Button/ForegroundNormal"), QLatin1String("buttonForeground"));
+ kdeColor(&pal, QPalette::Link, theKdeSettings, QLatin1String("Colors:View/ForegroundLink"), QLatin1String("linkColor"));
+ kdeColor(&pal, QPalette::LinkVisited, theKdeSettings, QLatin1String("Colors:View/ForegroundVisited"), QLatin1String("visitedLinkColor"));
+ //## TODO tooltip color
+
+ return pal;
+}
+
+/*!\internal
+ Returns the name of the QStyle to use.
+ (read from the kde config if needed)
+*/
+QString QKde::kdeStyle()
+{
+ if (X11->desktopVersion >= 4) {
+ QSettings kdeSettings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
+ QString style = kdeSettings.value(QLatin1String("widgetStyle"), QLatin1String("Oxygen")).toString();
+
+ QStringList availableStyles = QStyleFactory::keys();
+ if(availableStyles.contains(style, Qt::CaseInsensitive))
+ return style;
+ }
+
+ if (X11->use_xrender)
+ return QLatin1String("plastique");
+ else
+ return QLatin1String("windows");
+
+ return QString();
+}
+
+/*!\internal
+ placeholder to load icon from kde.
+ to be implemented
+ */
+QIcon QKde::kdeIcon(const QString &name)
+{
+ //###todo
+ return QIcon();
+}
+
+QT_END_NAMESPACE
+
+#endif //Q_WS_X11
+
diff --git a/src/gui/kernel/qkde_p.h b/src/gui/kernel/qkde_p.h
new file mode 100644
index 0000000..ac760bd
--- /dev/null
+++ b/src/gui/kernel/qkde_p.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QKDE_H
+#define QKDE_H
+
+#include <QtCore/qglobal.h>
+#include <QtGui/QPalette>
+#include <QtGui/QIcon>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+#if defined(Q_WS_X11)
+
+
+QT_BEGIN_NAMESPACE
+
+// This namespace contains helper function to help KDE integration
+namespace QKde {
+ QString kdeHome();
+ QString kdeStyle();
+ QPalette kdePalette();
+ QIcon kdeIcon(const QString &name);
+}
+
+
+QT_END_NAMESPACE
+
+#endif // Q_WS_X11
+#endif // QKDE_H
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 7078dbf..b4c3787 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -132,8 +132,7 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event)
it = qAppPriv->widgetGestures.find(static_cast<QWidget*>(receiver));
if (it == qAppPriv->widgetGestures.end())
return false;
- QPanGesture *gesture = it.value().pan;
- if (this != gesture)
+ if (this != it.value().pan)
return false;
Qt::GestureState nextState = Qt::NoGesture;
switch(ev->gestureType) {
@@ -162,7 +161,7 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event)
d->totalOffset += d->lastOffset;
}
d->lastPosition = ev->position;
- gesture->updateState(nextState);
+ updateState(nextState);
return true;
}
#endif
@@ -248,6 +247,7 @@ void QPanGesture::reset()
d->panFinishedTimer = 0;
}
#endif
+ QGesture::reset();
}
/*!
@@ -273,6 +273,210 @@ QSize QPanGesture::lastOffset() const
return d->lastOffset;
}
+
+/*!
+ \class QPinchGesture
+ \since 4.6
+
+ \brief The QPinchGesture class represents a Pinch gesture,
+ providing additional information related to zooming and/or rotation.
+*/
+
+/*!
+ Creates a new Pinch gesture handler object and marks it as a child of \a
+ parent.
+
+ On some platform like Windows it's necessary to provide a non-null widget
+ as \a parent to get native gesture support.
+*/
+QPinchGesture::QPinchGesture(QWidget *parent)
+ : QGesture(*new QPinchGesturePrivate, parent)
+{
+ if (parent) {
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
+ qAppPriv->widgetGestures[parent].pinch = this;
+#ifdef Q_WS_WIN
+ qt_widget_private(parent)->winSetupGestures();
+#endif
+ }
+}
+
+/*! \internal */
+bool QPinchGesture::event(QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::ParentAboutToChange:
+ if (QWidget *w = qobject_cast<QWidget*>(parent())) {
+ QApplicationPrivate::instance()->widgetGestures[w].pinch = 0;
+#ifdef Q_WS_WIN
+ qt_widget_private(w)->winSetupGestures();
+#endif
+ }
+ break;
+ case QEvent::ParentChange:
+ if (QWidget *w = qobject_cast<QWidget*>(parent())) {
+ QApplicationPrivate::instance()->widgetGestures[w].pinch = this;
+#ifdef Q_WS_WIN
+ qt_widget_private(w)->winSetupGestures();
+#endif
+ }
+ break;
+ default:
+ break;
+ }
+ return QObject::event(event);
+}
+
+bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event)
+{
+#ifdef Q_WS_WIN
+ Q_D(QPinchGesture);
+ if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) {
+ QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event);
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
+ QApplicationPrivate::WidgetStandardGesturesMap::iterator it;
+ it = qAppPriv->widgetGestures.find(static_cast<QWidget*>(receiver));
+ if (it == qAppPriv->widgetGestures.end())
+ return false;
+ if (this != it.value().pinch)
+ return false;
+ Qt::GestureState nextState = Qt::NoGesture;
+ switch(ev->gestureType) {
+ case QNativeGestureEvent::GestureBegin:
+ // next we might receive the first gesture update event, so we
+ // prepare for it.
+ d->state = Qt::NoGesture;
+ d->scaleFactor = d->lastScaleFactor = 1;
+ d->rotationAngle = d->lastRotationAngle = 0;
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ d->initialDistance = 0;
+ return false;
+ case QNativeGestureEvent::Rotate:
+ d->lastRotationAngle = d->rotationAngle;
+ d->rotationAngle = -1 * GID_ROTATE_ANGLE_FROM_ARGUMENT(ev->argument);
+ nextState = Qt::GestureUpdated;
+ event->accept();
+ break;
+ case QNativeGestureEvent::Zoom:
+ if (d->initialDistance != 0) {
+ d->lastScaleFactor = d->scaleFactor;
+ int distance = int(qint64(ev->argument));
+ d->scaleFactor = (qreal) distance / d->initialDistance;
+ } else {
+ d->initialDistance = int(qint64(ev->argument));
+ }
+ nextState = Qt::GestureUpdated;
+ event->accept();
+ break;
+ case QNativeGestureEvent::GestureEnd:
+ if (state() == Qt::NoGesture)
+ return false; // some other gesture has ended
+ nextState = Qt::GestureFinished;
+ break;
+ default:
+ return false;
+ }
+ if (d->startCenterPoint.isNull())
+ d->startCenterPoint = d->centerPoint;
+ d->lastCenterPoint = d->centerPoint;
+ d->centerPoint = static_cast<QWidget*>(receiver)->mapFromGlobal(ev->position);
+ updateState(nextState);
+ return true;
+ }
+#endif
+ return QGesture::eventFilter(receiver, event);
+}
+
+/*! \internal */
+bool QPinchGesture::filterEvent(QEvent *event)
+{
+ Q_UNUSED(event);
+ return false;
+}
+
+/*! \internal */
+void QPinchGesture::reset()
+{
+ Q_D(QPinchGesture);
+ d->scaleFactor = d->lastScaleFactor = 0;
+ d->rotationAngle = d->lastRotationAngle = 0;
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ QGesture::reset();
+}
+
+/*!
+ \property QPinchGesture::scaleFactor
+
+ Specifies a scale factor of the pinch gesture.
+*/
+qreal QPinchGesture::scaleFactor() const
+{
+ return d_func()->scaleFactor;
+}
+
+/*!
+ \property QPinchGesture::lastScaleFactor
+
+ Specifies a previous scale factor of the pinch gesture.
+*/
+qreal QPinchGesture::lastScaleFactor() const
+{
+ return d_func()->lastScaleFactor;
+}
+
+/*!
+ \property QPinchGesture::rotationAngle
+
+ Specifies a rotation angle of the gesture.
+*/
+qreal QPinchGesture::rotationAngle() const
+{
+ return d_func()->rotationAngle;
+}
+
+/*!
+ \property QPinchGesture::lastRotationAngle
+
+ Specifies a previous rotation angle of the gesture.
+*/
+qreal QPinchGesture::lastRotationAngle() const
+{
+ return d_func()->lastRotationAngle;
+}
+
+/*!
+ \property QPinchGesture::centerPoint
+
+ Specifies a center point of the gesture. The point can be used as a center
+ point that the object is rotated around.
+*/
+QPoint QPinchGesture::centerPoint() const
+{
+ return d_func()->centerPoint;
+}
+
+/*!
+ \property QPinchGesture::lastCenterPoint
+
+ Specifies a previous center point of the gesture.
+*/
+QPoint QPinchGesture::lastCenterPoint() const
+{
+ return d_func()->lastCenterPoint;
+}
+
+/*!
+ \property QPinchGesture::startCenterPoint
+
+ Specifies an initial center point of the gesture. Difference between the
+ startCenterPoint and the centerPoint is the distance at which pinching
+ fingers has shifted.
+*/
+QPoint QPinchGesture::startCenterPoint() const
+{
+ return d_func()->startCenterPoint;
+}
+
QT_END_NAMESPACE
#include "moc_qstandardgestures.cpp"
diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h
index c734fba..adee740 100644
--- a/src/gui/kernel/qstandardgestures.h
+++ b/src/gui/kernel/qstandardgestures.h
@@ -66,11 +66,52 @@ public:
QPanGesture(QWidget *parent);
bool filterEvent(QEvent *event);
- void reset();
QSize totalOffset() const;
QSize lastOffset() const;
+protected:
+ void reset();
+
+private:
+ bool event(QEvent *event);
+ bool eventFilter(QObject *receiver, QEvent *event);
+
+ friend class QWidget;
+};
+
+class QPinchGesturePrivate;
+class Q_GUI_EXPORT QPinchGesture : public QGesture
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QPinchGesture)
+
+ Q_PROPERTY(qreal scaleFactor READ scaleFactor)
+ Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor)
+
+ Q_PROPERTY(qreal rotationAngle READ rotationAngle)
+ Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle)
+
+ Q_PROPERTY(QPoint startCenterPoint READ startCenterPoint)
+ Q_PROPERTY(QPoint lastCenterPoint READ lastCenterPoint)
+ Q_PROPERTY(QPoint centerPoint READ centerPoint)
+
+public:
+ QPinchGesture(QWidget *parent);
+
+ bool filterEvent(QEvent *event);
+ void reset();
+
+ QPoint startCenterPoint() const;
+ QPoint lastCenterPoint() const;
+ QPoint centerPoint() const;
+
+ qreal scaleFactor() const;
+ qreal lastScaleFactor() const;
+
+ qreal rotationAngle() const;
+ qreal lastRotationAngle() const;
+
private:
bool event(QEvent *event);
bool eventFilter(QObject *receiver, QEvent *event);
diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h
index 0fe24ee..43636d0 100644
--- a/src/gui/kernel/qstandardgestures_p.h
+++ b/src/gui/kernel/qstandardgestures_p.h
@@ -85,6 +85,31 @@ public:
#endif
};
+class QPinchGesturePrivate : public QGesturePrivate
+{
+ Q_DECLARE_PUBLIC(QPinchGesture)
+
+public:
+ QPinchGesturePrivate()
+ : scaleFactor(0), lastScaleFactor(0),
+ rotationAngle(0), lastRotationAngle(0)
+#ifdef Q_WS_WIN
+ ,initialDistance(0)
+#endif
+ {
+ }
+ qreal scaleFactor;
+ qreal lastScaleFactor;
+ qreal rotationAngle;
+ qreal lastRotationAngle;
+ QPoint startCenterPoint;
+ QPoint lastCenterPoint;
+ QPoint centerPoint;
+#ifdef Q_WS_WIN
+ int initialDistance;
+#endif
+};
+
QT_END_NAMESPACE
#endif // QSTANDARDGESTURES_P_H
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index 1ac51e0..44652d3 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -515,7 +515,8 @@ struct QX11Data
char *startupId;
- DesktopEnvironment desktopEnvironment;
+ DesktopEnvironment desktopEnvironment : 8;
+ uint desktopVersion : 8; /* Used only for KDE */
/* Warning: if you modify this list, modify the names of atoms in qapplication_x11.cpp as well! */
enum X11Atom {
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 7cfa111..510df7f 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -1160,6 +1160,8 @@ void QWidgetPrivate::show_sys()
data.window_state |= Qt::WindowMaximized;
}
+ winSetupGestures();
+
invalidateBuffer(q->rect());
}
#endif //Q_WS_WINCE
@@ -2058,8 +2060,11 @@ void QWidgetPrivate::winSetupGestures()
Q_Q(QWidget);
if (!q)
return;
- extern QApplicationPrivate* getQApplicationPrivateInternal();
- QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal();
+ q->setAttribute(Qt::WA_DontCreateNativeAncestors);
+ q->setAttribute(Qt::WA_NativeWindow);
+ if (!q->isVisible())
+ return;
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
bool needh = false;
bool needv = false;
bool singleFingerPanEnabled = false;
@@ -2072,34 +2077,43 @@ void QWidgetPrivate::winSetupGestures()
QScrollBar *vbar = asa->verticalScrollBar();
Qt::ScrollBarPolicy hbarpolicy = asa->horizontalScrollBarPolicy();
Qt::ScrollBarPolicy vbarpolicy = asa->verticalScrollBarPolicy();
- needh = (hbarpolicy == Qt::ScrollBarAlwaysOn
- || (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum()));
- needv = (vbarpolicy == Qt::ScrollBarAlwaysOn
- || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum()));
+ needh = (hbarpolicy == Qt::ScrollBarAlwaysOn ||
+ (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum()));
+ needv = (vbarpolicy == Qt::ScrollBarAlwaysOn ||
+ (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum()));
singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled;
} else {
winid = q->winId();
}
if (qAppPriv->SetGestureConfig) {
- GESTURECONFIG gc[2];
+ GESTURECONFIG gc[3];
+ memset(gc, 0, sizeof(gc));
gc[0].dwID = GID_PAN;
- if (gestures.pan || needh || needv) {
+ if (gestures.pan) {
gc[0].dwWant = GC_PAN;
- gc[0].dwBlock = 0;
if (needv && singleFingerPanEnabled)
gc[0].dwWant |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
+ else
+ gc[0].dwBlock |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
if (needh && singleFingerPanEnabled)
gc[0].dwWant |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;
+ else
+ gc[0].dwBlock |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;
} else {
- gc[0].dwWant = 0;
gc[0].dwBlock = GC_PAN;
}
gc[1].dwID = GID_ZOOM;
- if (gestures.pinch) {
+ if (gestures.pinch)
gc[1].dwWant = GC_ZOOM;
- gc[1].dwBlock = 0;
- }
+ else
+ gc[1].dwBlock = GC_ZOOM;
+ gc[2].dwID = GID_ROTATE;
+ if (gestures.pinch)
+ gc[2].dwWant = GC_ROTATE;
+ else
+ gc[2].dwBlock = GC_ROTATE;
+
Q_ASSERT(winid);
qAppPriv->SetGestureConfig(winid, 0, sizeof(gc)/sizeof(gc[0]), gc, sizeof(gc[0]));
}
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 2a3d2f3..cf65af3 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -512,6 +512,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
dialog = popup = false; // force these flags off
data.crect.setRect(0, 0, sw, sh);
} else if (topLevel && !q->testAttribute(Qt::WA_Resized)) {
+ QDesktopWidget *desktopWidget = qApp->desktop();
+ if (desktopWidget->isVirtualDesktop()) {
+ QRect r = desktopWidget->screenGeometry();
+ sw = r.width();
+ sh = r.height();
+ }
+
int width = sw / 2;
int height = 4 * sh / 10;
if (extra) {
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 74456dd..b260f41 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2542,6 +2542,9 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
qDebug() << " - QRasterPaintEngine::drawImage(), r=" << r << " sr=" << sr << " image=" << img.size() << "depth=" << img.depth();
#endif
+ if (r.isEmpty())
+ return;
+
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
const bool aa = s->flags.antialiased || s->flags.bilinear;
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index ba28e75..c7feb25 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -63,7 +63,7 @@
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qrubberband.h>
-#include <private/qapplication_p.h>
+#include <../kernel/qkde_p.h>
#include <private/qcommonstylepixmaps_p.h>
#include <private/qmath_p.h>
#include <private/qstylehelper_p.h>
@@ -842,12 +842,6 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut
#ifdef Q_WS_X11 // These functions are used to parse the X11 freedesktop icon spec
-static int kdeVersion()
-{
- static int kdeVersion = qgetenv("KDE_SESSION_VERSION").toInt();
- return kdeVersion;
-}
-
void QCommonStylePrivate::lookupIconTheme() const
{
if (!themeName.isEmpty())
@@ -856,7 +850,7 @@ void QCommonStylePrivate::lookupIconTheme() const
QString dataDirs = QString::fromLocal8Bit(getenv("XDG_DATA_DIRS"));
if (dataDirs.isEmpty())
dataDirs = QLatin1String("/usr/local/share/:/usr/share/");
- dataDirs += QLatin1Char(':') + QApplicationPrivate::kdeHome() + QLatin1String("/share");
+ dataDirs += QLatin1Char(':') + QKde::kdeHome() + QLatin1String("/share");
dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));
QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'), QString::SkipEmptyParts);
foreach (const QString &dirName, kdeDirs)
@@ -865,9 +859,10 @@ void QCommonStylePrivate::lookupIconTheme() const
QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde"));
QDir dir(fileInfo.canonicalFilePath());
- QString kdeDefault = kdeVersion() >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");
+ QString kdeDefault = (X11->desktopEnvironment != DE_KDE || X11->desktopVersion >= 4)
+ ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");
QString defaultTheme = fileInfo.exists() ? dir.dirName() : kdeDefault;
- QSettings settings(QApplicationPrivate::kdeHome() +
+ QSettings settings(QKde::kdeHome() +
QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
settings.beginGroup(QLatin1String("Icons"));
themeName = settings.value(QLatin1String("Theme"), defaultTheme).toString();
@@ -979,8 +974,15 @@ QPixmap QCommonStylePrivate::findIconHelper(int size,
return pixmap;
}
+/*! \internal
+ find a pixmap with the given size and name from the freedesktop theme.
+*/
QPixmap QCommonStylePrivate::findIcon(int size, const QString &name) const
{
+ QIcon icon = QKde::kdeIcon(name);
+ if (!icon.isNull())
+ return icon.pixmap(size);
+
QPixmap pixmap;
QString pixmapName = QLatin1String("$qt") + name + QString::number(size);
@@ -995,12 +997,17 @@ QPixmap QCommonStylePrivate::findIcon(int size, const QString &name) const
return pixmap;
}
+/*! \internal
+ create an Icon from the freedesktop theme.
+ */
QIcon QCommonStylePrivate::createIcon(const QString &name) const
{
- QIcon icon;
- icon.addPixmap(findIcon(16, name));
- icon.addPixmap(findIcon(24, name));
- icon.addPixmap(findIcon(32, name));
+ QIcon icon = QKde::kdeIcon(name);
+ if (icon.isNull()) {
+ icon.addPixmap(findIcon(16, name));
+ icon.addPixmap(findIcon(24, name));
+ icon.addPixmap(findIcon(32, name));
+ }
return icon;
}
/*!internal
@@ -1012,8 +1019,8 @@ from the KDE configuration file
int QCommonStylePrivate::lookupToolButtonStyle() const
{
int result = Qt::ToolButtonIconOnly;
- if (kdeVersion() >= 4) {
- QSettings settings(QApplicationPrivate::kdeHome() +
+ if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4) {
+ QSettings settings(QKde::kdeHome() +
QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
settings.beginGroup(QLatin1String("Toolbar style"));
QString toolbarStyle = settings.value(QLatin1String("ToolButtonStyle"), QLatin1String("TextBesideIcon")).toString();
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index ee29b55..cad6903 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -1545,7 +1545,7 @@ void QDockAreaLayoutInfo::apply(bool animate)
QRect geo = w->geometry();
widgetAnimator.animate(w, r, animate);
- if (!w->isHidden()) {
+ if (!w->isHidden() && w->window()->isVisible()) {
QDockWidget *dw = qobject_cast<QDockWidget*>(w);
if (!r.isValid() && geo.right() >= 0 && geo.bottom() >= 0) {
dw->lower();
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index 5810c81..e60f099 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -1390,7 +1390,7 @@ bool QDockWidget::event(QEvent *event)
break;
case QEvent::Show:
d->toggleViewAction->setChecked(true);
- emit visibilityChanged(true);
+ emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0);
break;
#endif
case QEvent::ApplicationLayoutDirectionChange:
diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp
index b4a0ef0..afd526a 100644
--- a/src/gui/widgets/qtoolbararealayout.cpp
+++ b/src/gui/widgets/qtoolbararealayout.cpp
@@ -1156,8 +1156,8 @@ QLayoutItem *QToolBarAreaLayout::unplug(const QList<int> &path, QToolBarAreaLayo
if (!next.skip()) {
newExtraSpace = next.pos - previous.pos - pick(line.o, previous.sizeHint());
previous.resize(line.o, next.pos - previous.pos);
+ break;
}
- break;
}
break;
}
diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp
index faa2398..4c06848 100644
--- a/src/network/access/qhttp.cpp
+++ b/src/network/access/qhttp.cpp
@@ -1597,11 +1597,11 @@ QHttp::~QHttp()
This enum is used to specify the mode of connection to use:
- \value ConnectionModeHttp The connection is a regular Http connection to the server
- \value ConnectionModeHttps The Https protocol is used and the connection is encrypted using SSL.
+ \value ConnectionModeHttp The connection is a regular HTTP connection to the server
+ \value ConnectionModeHttps The HTTPS protocol is used and the connection is encrypted using SSL.
- When using the Https mode, care should be taken to connect to the sslErrors signal, and
- handle possible Ssl errors.
+ When using the HTTPS mode, care should be taken to connect to the sslErrors signal, and
+ handle possible SSL errors.
\sa QSslSocket
*/
@@ -2039,7 +2039,7 @@ int QHttp::setHost(const QString &hostName, quint16 port)
port \a port using the connection mode \a mode.
If port is 0, it will use the default port for the \a mode used
- (80 for Http and 443 fopr Https).
+ (80 for HTTP and 443 for HTTPS).
The function does not block; instead, it returns immediately. The request
is scheduled, and its execution is performed asynchronously. The
diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h
index ef309a8..4bc3f3f 100644
--- a/src/network/access/qnetworkcookie.h
+++ b/src/network/access/qnetworkcookie.h
@@ -106,9 +106,6 @@ private:
};
Q_DECLARE_TYPEINFO(QNetworkCookie, Q_MOVABLE_TYPE);
-// ### Qt5 remove this include
-#include "qnetworkcookiejar.h"
-
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QNetworkCookie &);
@@ -116,6 +113,9 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QNetworkCookie &);
QT_END_NAMESPACE
+// ### Qt5 remove this include
+#include "qnetworkcookiejar.h"
+
Q_DECLARE_METATYPE(QNetworkCookie)
Q_DECLARE_METATYPE(QList<QNetworkCookie>)
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 90fd9a5..6f2024f 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -341,4 +341,29 @@ QImage::Format QVGPixmapData::sourceFormat() const
return QImage::Format_ARGB32_Premultiplied;
}
+/*
+ \internal
+
+ Returns the VGImage that is storing the contents of \a pixmap.
+ Returns VG_INVALID_HANDLE if \a pixmap is not owned by the OpenVG
+ graphics system or \a pixmap is invalid.
+
+ This function is typically used to access the backing store
+ for a pixmap when executing raw OpenVG calls. It must only
+ be used when a QPainter is active and the OpenVG paint engine
+ is in use by the QPainter.
+
+ \sa {QtOpenVG Module}
+*/
+Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap)
+{
+ QPixmapData *pd = pixmap.pixmapData();
+ if (pd->classId() == QPixmapData::OpenVGClass) {
+ QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pd);
+ if (vgpd->isValid())
+ return vgpd->toVGImage();
+ }
+ return VG_INVALID_HANDLE;
+}
+
QT_END_NAMESPACE
diff --git a/src/qbase.pri b/src/qbase.pri
index 0ab04e6..9e2d26f 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -13,7 +13,7 @@ mac:!contains(QMAKE_EXT_C, .mm):QMAKE_EXT_C += .mm
#load up the headers info
CONFIG += qt_install_headers
HEADERS_PRI = $$QT_BUILD_TREE/include/$$TARGET/headers.pri
-include($$HEADERS_PRI)|clear(HEADERS_PRI)
+include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
#version overriding
win32 {
diff --git a/src/script/qscriptable.cpp b/src/script/qscriptable.cpp
index 5da9e95..94468de 100644
--- a/src/script/qscriptable.cpp
+++ b/src/script/qscriptable.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QT_NO_QOBJECT
-
#include "qscriptable.h"
+#ifndef QT_NO_QOBJECT
+
#ifndef QT_NO_SCRIPT
#include "qscriptable_p.h"
diff --git a/src/script/qscriptable_p.h b/src/script/qscriptable_p.h
index 8ea65ed..1d297d9 100644
--- a/src/script/qscriptable_p.h
+++ b/src/script/qscriptable_p.h
@@ -55,7 +55,7 @@
// We mean it.
//
-#if !defined(QT_NO_QOBJECT) && !defined(QT_NO_SCRIPT)
+#ifndef QT_NO_SCRIPT
QT_BEGIN_NAMESPACE
@@ -79,6 +79,6 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_QOBJECT && QT_NO_SCRIPT
+#endif // QT_NO_SCRIPT
#endif
diff --git a/src/script/qscriptclassdata.cpp b/src/script/qscriptclassdata.cpp
index 08e7220..576a519 100644
--- a/src/script/qscriptclassdata.cpp
+++ b/src/script/qscriptclassdata.cpp
@@ -114,4 +114,4 @@ QScriptClassDataIterator::~QScriptClassDataIterator()
QT_END_NAMESPACE
-#endif
+#endif // QT_NO_SCRIPT
diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp
index 6482ec9..6b4b375 100644
--- a/src/testlib/qabstracttestlogger.cpp
+++ b/src/testlib/qabstracttestlogger.cpp
@@ -43,8 +43,11 @@
#include "QtTest/private/qtestlog_p.h"
#include "QtTest/qtestassert.h"
+#include "QtCore/qbytearray.h"
+
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
#ifndef Q_OS_WIN
#include <unistd.h>
@@ -106,4 +109,50 @@ void QAbstractTestLogger::stopLogging()
QTest::stream = 0;
}
+namespace QTest
+{
+
+extern void filter_unprintable(char *str);
+
+/*!
+ \fn int QTest::qt_asprintf(QTestCharBuffer *buf, const char *format, ...);
+ \internal
+ */
+int qt_asprintf(QTestCharBuffer *str, const char *format, ...)
+{
+ static const int MAXSIZE = 1024*1024*2;
+
+ Q_ASSERT(str);
+
+ int size = str->size();
+
+ va_list ap;
+ int res = 0;
+
+ for (;;) {
+ va_start(ap, format);
+ res = qvsnprintf(str->data(), size, format, ap);
+ va_end(ap);
+ str->data()[size - 1] = '\0';
+ if (res >= 0 && res < size) {
+ // We succeeded
+ break;
+ }
+ // buffer wasn't big enough, try again.
+ // Note, we're assuming that a result of -1 is always due to running out of space.
+ size *= 2;
+ if (size > MAXSIZE) {
+ break;
+ }
+ if (!str->reset(size))
+ break; // out of memory - take what we have
+ }
+
+ filter_unprintable(str->data());
+
+ return res;
+}
+
+}
+
QT_END_NAMESPACE
diff --git a/src/testlib/qabstracttestlogger_p.h b/src/testlib/qabstracttestlogger_p.h
index 588184e..1834086 100644
--- a/src/testlib/qabstracttestlogger_p.h
+++ b/src/testlib/qabstracttestlogger_p.h
@@ -101,27 +101,26 @@ public:
struct QTestCharBuffer
{
- inline QTestCharBuffer()
- : buf(0)
- {}
+ enum { InitialSize = 512 };
- inline ~QTestCharBuffer()
+ inline QTestCharBuffer()
+ : _size(InitialSize), buf(staticBuf)
{
- delete[] buf;
- buf = 0;
+ staticBuf[0] = '\0';
}
- inline operator void*()
+ inline ~QTestCharBuffer()
{
- return buf;
+ if (buf != staticBuf)
+ qFree(buf);
}
- inline operator char*()
+ inline char *data()
{
return buf;
}
- inline operator char**()
+ inline char **buffer()
{
return &buf;
}
@@ -131,10 +130,43 @@ struct QTestCharBuffer
return buf;
}
+ inline int size() const
+ {
+ return _size;
+ }
+
+ inline bool reset(int newSize)
+ {
+ char *newBuf = 0;
+ if (buf == staticBuf) {
+ // if we point to our internal buffer, we need to malloc first
+ newBuf = reinterpret_cast<char *>(qMalloc(newSize));
+ } else {
+ // if we already malloc'ed, just realloc
+ newBuf = reinterpret_cast<char *>(qRealloc(buf, newSize));
+ }
+
+ // if the allocation went wrong (newBuf == 0), we leave the object as is
+ if (!newBuf)
+ return false;
+
+ _size = newSize;
+ buf = newBuf;
+ return true;
+ }
+
private:
+ int _size;
char* buf;
+ char staticBuf[InitialSize];
};
+namespace QTest
+{
+ int qt_asprintf(QTestCharBuffer *buf, const char *format, ...);
+}
+
+
QT_END_NAMESPACE
#endif
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index 9cdf232..eaec02f 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -116,7 +116,7 @@ int QBenchmarkGlobalData::adjustMedianIterationCount()
QBenchmarkTestMethodData *QBenchmarkTestMethodData::current;
QBenchmarkTestMethodData::QBenchmarkTestMethodData()
-:resultAccepted(false), iterationCount(-1)
+:resultAccepted(false), runOnce(false), iterationCount(-1)
{
}
@@ -157,6 +157,11 @@ void QBenchmarkTestMethodData::setResult(qint64 value)
if (QBenchmarkGlobalData::current->iterationCount != -1)
accepted = true;
+ if (QBenchmarkTestMethodData::current->runOnce) {
+ iterationCount = 1;
+ accepted = true;
+ }
+
// Test the result directly without calling the measurer if the minimum time
// has been specifed on the command line with -minimumvalue.
else if (QBenchmarkGlobalData::current->walltimeMinimum != -1)
@@ -174,15 +179,23 @@ void QBenchmarkTestMethodData::setResult(qint64 value)
QBenchmarkResult(QBenchmarkGlobalData::current->context, value, iterationCount);
}
-/*! \internal
+/*!
+ \class QTest::QBenchmarkIterationController
+ \internal
+
The QBenchmarkIterationController class is used by the QBENCHMARK macro to
drive the benchmarking loop. It is repsonsible for starting and stopping
the timing measurements as well as calling the result reporting functions.
*/
-QTest::QBenchmarkIterationController::QBenchmarkIterationController()
+
+/*! \internal
+*/
+QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runMode)
{
QTest::beginBenchmarkMeasurement();
i = 0;
+ if (runMode == RunOnce)
+ QBenchmarkTestMethodData::current->runOnce = true;
}
/*! \internal
*/
@@ -195,6 +208,8 @@ QTest::QBenchmarkIterationController::~QBenchmarkIterationController()
*/
bool QTest::QBenchmarkIterationController::isDone()
{
+ if (QBenchmarkTestMethodData::current->runOnce)
+ return i > 0;
return i >= QTest::iterationCount();
}
diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h
index c06bfc0..87d34e7 100644
--- a/src/testlib/qbenchmark.h
+++ b/src/testlib/qbenchmark.h
@@ -64,7 +64,8 @@ namespace QTest
class Q_TESTLIB_EXPORT QBenchmarkIterationController
{
public:
- QBenchmarkIterationController();
+ enum RunMode { RepeatUntilValidMeasurement, RunOnce };
+ QBenchmarkIterationController(RunMode runMode);
~QBenchmarkIterationController();
bool isDone();
void next();
@@ -74,7 +75,12 @@ public:
}
#define QBENCHMARK \
- for (QTest::QBenchmarkIterationController __iteration_controller; __iteration_controller.isDone() == false; __iteration_controller.next())
+ for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RepeatUntilValidMeasurement); \
+ __iteration_controller.isDone() == false; __iteration_controller.next())
+
+#define QBENCHMARK_ONCE \
+ for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RunOnce); \
+ __iteration_controller.isDone() == false; __iteration_controller.next())
QT_END_NAMESPACE
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index 25f9cdc..185d656 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -171,6 +171,7 @@ public:
QBenchmarkResult result;
bool resultAccepted;
+ bool runOnce;
int iterationCount;
};
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index e075b36..2515c51 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -180,7 +180,7 @@ namespace QTest {
: "";
const char *filler = (tag[0] && gtag[0]) ? ":" : "";
if (file) {
- QTest::qt_asprintf(buf, "%s: %s::%s(%s%s%s)%s%s\n"
+ QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n"
#ifdef Q_OS_WIN
"%s(%d) : failure location\n"
#else
@@ -189,14 +189,14 @@ namespace QTest {
, type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
msg[0] ? " " : "", msg, file, line);
} else {
- QTest::qt_asprintf(buf, "%s: %s::%s(%s%s%s)%s%s\n",
+ QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n",
type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
msg[0] ? " " : "", msg);
}
// In colored mode, printf above stripped our nonprintable control characters.
// Put them back.
- memcpy(buf, type, strlen(type));
- outputMessage(buf);
+ memcpy(buf.data(), type, strlen(type));
+ outputMessage(buf.data());
}
template <typename T>
@@ -207,7 +207,7 @@ namespace QTest {
int digits = 0;
qreal divisor = 1;
-
+
while (num / divisor >= 1) {
divisor *= 10;
++digits;
diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h
index c40f0ad..b5b0fc0 100644
--- a/src/testlib/qtest_global.h
+++ b/src/testlib/qtest_global.h
@@ -82,7 +82,6 @@ namespace QTest
enum TestFailMode { Abort = 1, Continue = 2 };
int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format, ...);
- int qt_asprintf(char **str, const char *format, ...);
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestbasicstreamer.cpp b/src/testlib/qtestbasicstreamer.cpp
index aac57ba..89de7d8 100644
--- a/src/testlib/qtestbasicstreamer.cpp
+++ b/src/testlib/qtestbasicstreamer.cpp
@@ -68,39 +68,39 @@ QTestBasicStreamer::QTestBasicStreamer()
QTestBasicStreamer::~QTestBasicStreamer()
{}
-void QTestBasicStreamer::formatStart(const QTestElement *element, char **formatted) const
+void QTestBasicStreamer::formatStart(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
-void QTestBasicStreamer::formatEnd(const QTestElement *element, char **formatted) const
+void QTestBasicStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
-void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
+void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
-void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, char **formatted) const
+void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
-void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, char **formatted) const
+void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const
{
if(!attribute || !formatted )
return;
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
void QTestBasicStreamer::output(QTestElement *element) const
@@ -125,22 +125,22 @@ void QTestBasicStreamer::outputElements(QTestElement *element, bool) const
while (element) {
hasChildren = element->childElements();
- formatStart(element, buf);
- outputString(buf);
+ formatStart(element, &buf);
+ outputString(buf.data());
- formatBeforeAttributes(element, buf);
- outputString(buf);
+ formatBeforeAttributes(element, &buf);
+ outputString(buf.data());
outputElementAttributes(element, element->attributes());
- formatAfterAttributes(element, buf);
- outputString(buf);
+ formatAfterAttributes(element, &buf);
+ outputString(buf.data());
if(hasChildren)
outputElements(element->childElements(), true);
- formatEnd(element, buf);
- outputString(buf);
+ formatEnd(element, &buf);
+ outputString(buf.data());
element = element->previousElement();
}
@@ -150,8 +150,8 @@ void QTestBasicStreamer::outputElementAttributes(const QTestElement* element, QT
{
QTestCharBuffer buf;
while(attribute){
- formatAttributes(element, attribute, buf);
- outputString(buf);
+ formatAttributes(element, attribute, &buf);
+ outputString(buf.data());
attribute = attribute->nextElement();
}
}
diff --git a/src/testlib/qtestbasicstreamer.h b/src/testlib/qtestbasicstreamer.h
index 432dd22..932f5c3 100644
--- a/src/testlib/qtestbasicstreamer.h
+++ b/src/testlib/qtestbasicstreamer.h
@@ -53,6 +53,7 @@ QT_MODULE(Test)
class QTestElement;
class QTestElementAttribute;
class QTestLogger;
+struct QTestCharBuffer;
class QTestBasicStreamer
{
@@ -71,11 +72,11 @@ class QTestBasicStreamer
const QTestLogger *logger() const;
protected:
- virtual void formatStart(const QTestElement *element, char **formatted) const;
- virtual void formatEnd(const QTestElement *element, char **formatted) const;
- virtual void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
- virtual void formatAfterAttributes(const QTestElement *element, char **formatted) const;
- virtual void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, char **formatted) const;
+ virtual void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
+ virtual void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
+ virtual void formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
+ virtual void formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
+ virtual void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const;
virtual void outputElements(QTestElement *element, bool isChildElement = false) const;
virtual void outputElementAttributes(const QTestElement *element, QTestElementAttribute *attribute) const;
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index ac4ca83..51e767c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -351,6 +351,26 @@ QT_BEGIN_NAMESPACE
{Chapter 5: Writing a Benchmark}{Writing a Benchmark}
*/
+/*!
+ \macro QBENCHMARK_ONCE
+ \since 4.6
+
+ \relates QTest
+
+ This macro is used to measure the performance of code within a test.
+ The code to be benchmarked is contained within a code block following
+ this macro.
+
+ Unlike QBENCHMARK, the contents of the contained code block is only run
+ once. The elapsed time will be reported as "0" if it's to short to
+ be measured by the selected backend. (Use)
+
+ \sa {QTestLib Manual#Creating a Benchmark}{Creating a Benchmark},
+ {Chapter 5: Writing a Benchmark}{Writing a Benchmark}
+*/
+
+
+
/*! \enum QTest::SkipMode
This enum describes the modes for skipping tests during execution
@@ -820,43 +840,6 @@ void filter_unprintable(char *str)
/*! \internal
*/
-int qt_asprintf(char **str, const char *format, ...)
-{
- static const int MAXSIZE = 1024*1024*2;
-
- int size = 32;
- delete[] *str;
- *str = new char[size];
-
- va_list ap;
- int res = 0;
-
- for (;;) {
- va_start(ap, format);
- res = qvsnprintf(*str, size, format, ap);
- va_end(ap);
- (*str)[size - 1] = '\0';
- if (res >= 0 && res < size) {
- // We succeeded
- break;
- }
- // buffer wasn't big enough, try again.
- // Note, we're assuming that a result of -1 is always due to running out of space.
- size *= 2;
- if (size > MAXSIZE) {
- break;
- }
- delete[] *str;
- *str = new char[size];
- }
-
- filter_unprintable(*str);
-
- return res;
-}
-
-/*! \internal
- */
int qt_snprintf(char *str, int size, const char *format, ...)
{
va_list ap;
diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp
index e176201..b84f531 100644
--- a/src/testlib/qtestlightxmlstreamer.cpp
+++ b/src/testlib/qtestlightxmlstreamer.cpp
@@ -59,7 +59,7 @@ QTestLightXmlStreamer::QTestLightXmlStreamer()
QTestLightXmlStreamer::~QTestLightXmlStreamer()
{}
-void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **formatted) const
+void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
@@ -67,14 +67,14 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **form
switch(element->elementType()){
case QTest::LET_TestCase: {
QTestCharBuffer quotedTf;
- QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name));
+ QXmlTestLogger::xmlQuote(&quotedTf, element->attributeValue(QTest::AI_Name));
QTest::qt_asprintf(formatted, "<TestFunction name=\"%s\">\n", quotedTf.constData());
break;
}
case QTest::LET_Failure: {
QTestCharBuffer cdataDesc;
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
+ QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, " <Description><![CDATA[%s]]></Description>\n",
cdataDesc.constData());
@@ -84,8 +84,8 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **form
// assuming type and attribute names don't need quoting
QTestCharBuffer quotedFile;
QTestCharBuffer cdataDesc;
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
+ QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n",
element->attributeValue(QTest::AI_Type),
@@ -100,8 +100,8 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **form
// assuming value and iterations don't need quoting
QTestCharBuffer quotedMetric;
QTestCharBuffer quotedTag;
- QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric));
- QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag));
+ QXmlTestLogger::xmlQuote(&quotedMetric, element->attributeValue(QTest::AI_Metric));
+ QXmlTestLogger::xmlQuote(&quotedTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "<BenchmarkResult %s=\"%s\" %s=\"%s\" %s=\"%s\" %s=\"%s\" />\n",
element->attributeName(QTest::AI_Metric),
@@ -115,11 +115,11 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **form
break;
}
default:
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
}
-void QTestLightXmlStreamer::formatEnd(const QTestElement *element, char **formatted) const
+void QTestLightXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
@@ -129,47 +129,47 @@ void QTestLightXmlStreamer::formatEnd(const QTestElement *element, char **format
QTest::qt_asprintf(formatted, "</Incident>\n</TestFunction>\n");
else
QTest::qt_asprintf(formatted, "</TestFunction>\n");
+ } else {
+ formatted->data()[0] = '\0';
}
- else
- QTest::qt_asprintf(formatted, "");
}
-void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
+void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
- if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
- QTestCharBuffer buf;
- QTestCharBuffer quotedFile;
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
-
- QTest::qt_asprintf(buf, "%s=\"%s\" %s=\"%s\"",
- element->attributeName(QTest::AI_File),
- quotedFile.constData(),
- element->attributeName(QTest::AI_Line),
- element->attributeValue(QTest::AI_Line));
-
- if( !element->childElements() )
- QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s/>\n",
- element->attributeValue(QTest::AI_Result), buf.constData());
- else
- QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n",
- element->attributeValue(QTest::AI_Result), buf.constData());
- }else{
- QTest::qt_asprintf(formatted, "");
+ if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)) {
+ QTestCharBuffer buf;
+ QTestCharBuffer quotedFile;
+ QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
+
+ QTest::qt_asprintf(&buf, "%s=\"%s\" %s=\"%s\"",
+ element->attributeName(QTest::AI_File),
+ quotedFile.constData(),
+ element->attributeName(QTest::AI_Line),
+ element->attributeValue(QTest::AI_Line));
+
+ if( !element->childElements() )
+ QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s/>\n",
+ element->attributeValue(QTest::AI_Result), buf.constData());
+ else
+ QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n",
+ element->attributeValue(QTest::AI_Result), buf.constData());
+ } else {
+ formatted->data()[0] = '\0';
}
}
void QTestLightXmlStreamer::output(QTestElement *element) const
{
QTestCharBuffer buf;
- QTest::qt_asprintf(buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
+ QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
qVersion(), QTEST_VERSION_STR );
- outputString(buf);
+ outputString(buf.constData());
- QTest::qt_asprintf(buf, "</Environment>\n");
- outputString(buf);
+ QTest::qt_asprintf(&buf, "</Environment>\n");
+ outputString(buf.constData());
QTestBasicStreamer::output(element);
}
diff --git a/src/testlib/qtestlightxmlstreamer.h b/src/testlib/qtestlightxmlstreamer.h
index 6dafdcc..e147e5c 100644
--- a/src/testlib/qtestlightxmlstreamer.h
+++ b/src/testlib/qtestlightxmlstreamer.h
@@ -59,9 +59,9 @@ class QTestLightXmlStreamer: public QTestBasicStreamer
QTestLightXmlStreamer();
~QTestLightXmlStreamer();
- void formatStart(const QTestElement *element, char **formatted) const;
- void formatEnd(const QTestElement *element, char **formatted) const;
- void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
+ void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
void output(QTestElement *element) const;
};
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp
index 1b6e674..c72d648 100644
--- a/src/testlib/qtestxmlstreamer.cpp
+++ b/src/testlib/qtestxmlstreamer.cpp
@@ -60,7 +60,7 @@ QTestXmlStreamer::QTestXmlStreamer()
QTestXmlStreamer::~QTestXmlStreamer()
{}
-void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted) const
+void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
@@ -68,20 +68,20 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
switch(element->elementType()){
case QTest::LET_TestCase: {
QTestCharBuffer quotedTf;
- QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name));
+ QXmlTestLogger::xmlQuote(&quotedTf, element->attributeValue(QTest::AI_Name));
QTest::qt_asprintf(formatted, "<TestFunction name=\"%s\">\n", quotedTf.constData());
break;
}
case QTest::LET_Failure: {
QTestCharBuffer cdataDesc;
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
+ QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTestCharBuffer location;
QTestCharBuffer quotedFile;
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
- QTest::qt_asprintf(location, "%s=\"%s\" %s=\"%s\"",
+ QTest::qt_asprintf(&location, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
@@ -89,7 +89,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
if (element->attribute(QTest::AI_Tag)) {
QTestCharBuffer cdataTag;
- QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag));
+ QXmlTestLogger::xmlCdata(&cdataTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n"
" <DataTag><![CDATA[%s]]></DataTag>\n"
" <Description><![CDATA[%s]]></Description>\n"
@@ -108,8 +108,8 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
// assuming type and attribute names don't need quoting
QTestCharBuffer quotedFile;
QTestCharBuffer cdataDesc;
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
+ QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n",
element->attributeValue(QTest::AI_Type),
@@ -124,8 +124,8 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
// assuming value and iterations don't need quoting
QTestCharBuffer quotedMetric;
QTestCharBuffer quotedTag;
- QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric));
- QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag));
+ QXmlTestLogger::xmlQuote(&quotedMetric, element->attributeValue(QTest::AI_Metric));
+ QXmlTestLogger::xmlQuote(&quotedTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "<BenchmarkResult %s=\"%s\" %s=\"%s\" %s=\"%s\" %s=\"%s\" />\n",
element->attributeName(QTest::AI_Metric),
@@ -139,23 +139,23 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
break;
}
default:
- QTest::qt_asprintf(formatted, "");
+ formatted->data()[0] = '\0';
}
}
-void QTestXmlStreamer::formatEnd(const QTestElement *element, char **formatted) const
+void QTestXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
if (element->elementType() == QTest::LET_TestCase) {
QTest::qt_asprintf(formatted, "</TestFunction>\n");
+ } else {
+ formatted->data()[0] = '\0';
}
- else
- QTest::qt_asprintf(formatted, "");
}
-void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
+void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
return;
@@ -163,9 +163,9 @@ void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char
if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
QTestCharBuffer buf;
QTestCharBuffer quotedFile;
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
- QTest::qt_asprintf(buf, "%s=\"%s\" %s=\"%s\"",
+ QTest::qt_asprintf(&buf, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
@@ -174,12 +174,11 @@ void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char
if( !element->childElements() ) {
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s/>\n",
element->attributeValue(QTest::AI_Result), buf.constData());
+ } else {
+ formatted->data()[0] = '\0';
}
- else {
- QTest::qt_asprintf(formatted, "");
- }
- }else{
- QTest::qt_asprintf(formatted, "");
+ } else {
+ formatted->data()[0] = '\0';
}
}
@@ -187,23 +186,23 @@ void QTestXmlStreamer::output(QTestElement *element) const
{
QTestCharBuffer buf;
QTestCharBuffer quotedTc;
- QXmlTestLogger::xmlQuote(quotedTc, QTestResult::currentTestObjectName());
+ QXmlTestLogger::xmlQuote(&quotedTc, QTestResult::currentTestObjectName());
- QTest::qt_asprintf(buf, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<TestCase name=\"%s\">\n",
+ QTest::qt_asprintf(&buf, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<TestCase name=\"%s\">\n",
quotedTc.constData());
- outputString(buf);
+ outputString(buf.constData());
- QTest::qt_asprintf(buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
+ QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
qVersion(), QTEST_VERSION_STR );
- outputString(buf);
+ outputString(buf.constData());
- QTest::qt_asprintf(buf, "</Environment>\n");
- outputString(buf);
+ QTest::qt_asprintf(&buf, "</Environment>\n");
+ outputString(buf.constData());
QTestBasicStreamer::output(element);
- QTest::qt_asprintf(buf, "</TestCase>\n");
- outputString(buf);
+ QTest::qt_asprintf(&buf, "</TestCase>\n");
+ outputString(buf.constData());
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestxmlstreamer.h b/src/testlib/qtestxmlstreamer.h
index a601f60..6e1ae84 100644
--- a/src/testlib/qtestxmlstreamer.h
+++ b/src/testlib/qtestxmlstreamer.h
@@ -59,9 +59,9 @@ class QTestXmlStreamer: public QTestBasicStreamer
QTestXmlStreamer();
~QTestXmlStreamer();
- void formatStart(const QTestElement *element, char **formatted) const;
- void formatEnd(const QTestElement *element, char **formatted) const;
- void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
+ void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
void output(QTestElement *element) const;
};
diff --git a/src/testlib/qtestxunitstreamer.cpp b/src/testlib/qtestxunitstreamer.cpp
index d5d2631..932b70b 100644
--- a/src/testlib/qtestxunitstreamer.cpp
+++ b/src/testlib/qtestxunitstreamer.cpp
@@ -73,7 +73,7 @@ void QTestXunitStreamer::indentForElement(const QTestElement* element, char* buf
}
}
-void QTestXunitStreamer::formatStart(const QTestElement *element, char **formatted) const
+void QTestXunitStreamer::formatStart(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
@@ -85,8 +85,7 @@ void QTestXunitStreamer::formatStart(const QTestElement *element, char **formatt
if (element->elementType() == QTest::LET_Error) {
if (element->parentElement()->elementType() == QTest::LET_SystemError) {
QTest::qt_asprintf(formatted, "<![CDATA[");
- }
- else {
+ } else {
QTest::qt_asprintf(formatted, "%s<!--", indent);
}
return;
@@ -95,13 +94,13 @@ void QTestXunitStreamer::formatStart(const QTestElement *element, char **formatt
QTest::qt_asprintf(formatted, "%s<%s", indent, element->elementName());
}
-void QTestXunitStreamer::formatEnd(const QTestElement *element, char **formatted) const
+void QTestXunitStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const
{
- if(!element || !formatted )
+ if (!element || !formatted )
return;
- if(!element->childElements()){
- QTest::qt_asprintf(formatted, "");
+ if (!element->childElements()){
+ formatted->data()[0] = '\0';
return;
}
@@ -111,7 +110,7 @@ void QTestXunitStreamer::formatEnd(const QTestElement *element, char **formatted
QTest::qt_asprintf(formatted, "%s</%s>\n", indent, element->elementName());
}
-void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTestElementAttribute *attribute, char **formatted) const
+void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const
{
if(!attribute || !formatted )
return;
@@ -136,15 +135,14 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe
if (key) {
QTestCharBuffer quotedValue;
- QXmlTestLogger::xmlQuote(quotedValue, attribute->value());
+ QXmlTestLogger::xmlQuote(&quotedValue, attribute->value());
QTest::qt_asprintf(formatted, " %s=\"%s\"", key, quotedValue.constData());
- }
- else {
- QTest::qt_asprintf(formatted, "");
+ } else {
+ formatted->data()[0] = '\0';
}
}
-void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char **formatted) const
+void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted )
return;
@@ -153,8 +151,7 @@ void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char
if (element->elementType() == QTest::LET_Error) {
if (element->parentElement()->elementType() == QTest::LET_SystemError) {
QTest::qt_asprintf(formatted, "]]>\n");
- }
- else {
+ } else {
QTest::qt_asprintf(formatted, " -->\n");
}
return;
@@ -187,22 +184,22 @@ void QTestXunitStreamer::outputElements(QTestElement *element, bool) const
hasChildren = element->childElements();
if(element->elementType() != QTest::LET_Benchmark){
- formatStart(element, buf);
- outputString(buf);
+ formatStart(element, &buf);
+ outputString(buf.data());
- formatBeforeAttributes(element, buf);
- outputString(buf);
+ formatBeforeAttributes(element, &buf);
+ outputString(buf.data());
outputElementAttributes(element, element->attributes());
- formatAfterAttributes(element, buf);
- outputString(buf);
+ formatAfterAttributes(element, &buf);
+ outputString(buf.data());
if(hasChildren)
outputElements(element->childElements(), true);
- formatEnd(element, buf);
- outputString(buf);
+ formatEnd(element, &buf);
+ outputString(buf.data());
}
element = element->previousElement();
}
diff --git a/src/testlib/qtestxunitstreamer.h b/src/testlib/qtestxunitstreamer.h
index 044307f..43ff03d 100644
--- a/src/testlib/qtestxunitstreamer.h
+++ b/src/testlib/qtestxunitstreamer.h
@@ -58,10 +58,10 @@ class QTestXunitStreamer: public QTestBasicStreamer
QTestXunitStreamer();
~QTestXunitStreamer();
- void formatStart(const QTestElement *element, char **formatted) const;
- void formatEnd(const QTestElement *element, char **formatted) const;
- void formatAfterAttributes(const QTestElement *element, char **formatted) const;
- void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, char **formatted) const;
+ void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const;
void output(QTestElement *element) const;
void outputElements(QTestElement *element, bool isChildElement = false) const;
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index fca7bfc..494acb4 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -108,19 +108,19 @@ void QXmlTestLogger::startLogging()
if (xmlmode == QXmlTestLogger::Complete) {
QTestCharBuffer quotedTc;
- xmlQuote(quotedTc, QTestResult::currentTestObjectName());
- QTest::qt_asprintf(buf,
+ xmlQuote(&quotedTc, QTestResult::currentTestObjectName());
+ QTest::qt_asprintf(&buf,
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
"<TestCase name=\"%s\">\n", quotedTc.constData());
- outputString(buf);
+ outputString(buf.constData());
}
- QTest::qt_asprintf(buf,
+ QTest::qt_asprintf(&buf,
"<Environment>\n"
" <QtVersion>%s</QtVersion>\n"
" <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
"</Environment>\n", qVersion());
- outputString(buf);
+ outputString(buf.constData());
}
void QXmlTestLogger::stopLogging()
@@ -136,9 +136,9 @@ void QXmlTestLogger::enterTestFunction(const char *function)
{
QTestCharBuffer buf;
QTestCharBuffer quotedFunction;
- xmlQuote(quotedFunction, function);
- QTest::qt_asprintf(buf, "<TestFunction name=\"%s\">\n", quotedFunction.constData());
- outputString(buf);
+ xmlQuote(&quotedFunction, function);
+ QTest::qt_asprintf(&buf, "<TestFunction name=\"%s\">\n", quotedFunction.constData());
+ outputString(buf.constData());
}
void QXmlTestLogger::leaveTestFunction()
@@ -219,12 +219,12 @@ void QXmlTestLogger::addIncident(IncidentTypes type, const char *description,
QTestCharBuffer cdataTag;
QTestCharBuffer cdataDescription;
- xmlQuote(quotedFile, file);
- xmlCdata(cdataGtag, gtag);
- xmlCdata(cdataTag, tag);
- xmlCdata(cdataDescription, description);
+ xmlQuote(&quotedFile, file);
+ xmlCdata(&cdataGtag, gtag);
+ xmlCdata(&cdataTag, tag);
+ xmlCdata(&cdataDescription, description);
- QTest::qt_asprintf(buf,
+ QTest::qt_asprintf(&buf,
QTest::incidentFormatString(QTest::isEmpty(description), notag),
QTest::xmlIncidentType2String(type),
quotedFile.constData(), line,
@@ -233,7 +233,7 @@ void QXmlTestLogger::addIncident(IncidentTypes type, const char *description,
cdataTag.constData(),
cdataDescription.constData());
- outputString(buf);
+ outputString(buf.constData());
}
void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result)
@@ -242,18 +242,18 @@ void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result)
QTestCharBuffer quotedMetric;
QTestCharBuffer quotedTag;
- xmlQuote(quotedMetric,
+ xmlQuote(&quotedMetric,
QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData());
- xmlQuote(quotedTag, result.context.tag.toAscii().constData());
+ xmlQuote(&quotedTag, result.context.tag.toAscii().constData());
QTest::qt_asprintf(
- buf,
+ &buf,
QTest::benchmarkResultFormatString(),
quotedMetric.constData(),
quotedTag.constData(),
QByteArray::number(result.value).constData(), //no 64-bit qt_snprintf support
result.iterations);
- outputString(buf);
+ outputString(buf.constData());
}
void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
@@ -270,12 +270,12 @@ void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
QTestCharBuffer cdataTag;
QTestCharBuffer cdataDescription;
- xmlQuote(quotedFile, file);
- xmlCdata(cdataGtag, gtag);
- xmlCdata(cdataTag, tag);
- xmlCdata(cdataDescription, message);
+ xmlQuote(&quotedFile, file);
+ xmlCdata(&cdataGtag, gtag);
+ xmlCdata(&cdataTag, tag);
+ xmlCdata(&cdataDescription, message);
- QTest::qt_asprintf(buf,
+ QTest::qt_asprintf(&buf,
QTest::messageFormatString(QTest::isEmpty(message), notag),
QTest::xmlMessageType2String(type),
quotedFile.constData(), line,
@@ -284,7 +284,7 @@ void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
cdataTag.constData(),
cdataDescription.constData());
- outputString(buf);
+ outputString(buf.constData());
}
/*
@@ -292,10 +292,11 @@ void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
XML characters as necessary so that dest is suitable for use in an XML
quoted attribute string.
*/
-int QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
+int QXmlTestLogger::xmlQuote(QTestCharBuffer* destBuf, char const* src, size_t n)
{
if (n == 0) return 0;
+ char *dest = destBuf->data();
*dest = 0;
if (!src) return 0;
@@ -351,10 +352,12 @@ int QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
Copy up to n characters from the src string into dest, escaping any
special strings such that dest is suitable for use in an XML CDATA section.
*/
-int QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
+int QXmlTestLogger::xmlCdata(QTestCharBuffer *destBuf, char const* src, size_t n)
{
if (!n) return 0;
+ char *dest = destBuf->data();
+
if (!src || n == 1) {
*dest = 0;
return 0;
@@ -394,25 +397,23 @@ int QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
return (dest-begin);
}
-typedef int (*StringFormatFunction)(char*,char const*,size_t);
+typedef int (*StringFormatFunction)(QTestCharBuffer*,char const*,size_t);
/*
A wrapper for string functions written to work with a fixed size buffer so they can be called
with a dynamically allocated buffer.
*/
-int allocateStringFn(char** str, char const* src, StringFormatFunction func)
+int allocateStringFn(QTestCharBuffer* str, char const* src, StringFormatFunction func)
{
static const int MAXSIZE = 1024*1024*2;
- int size = 32;
- delete[] *str;
- *str = new char[size];
+ int size = str->size();
int res = 0;
for (;;) {
- res = func(*str, src, size);
- (*str)[size - 1] = '\0';
+ res = func(str, src, size);
+ str->data()[size - 1] = '\0';
if (res < size) {
// We succeeded or fatally failed
break;
@@ -422,19 +423,19 @@ int allocateStringFn(char** str, char const* src, StringFormatFunction func)
if (size > MAXSIZE) {
break;
}
- delete[] *str;
- *str = new char[size];
+ if (!str->reset(size))
+ break; // ran out of memory - bye
}
return res;
}
-int QXmlTestLogger::xmlQuote(char** str, char const* src)
+int QXmlTestLogger::xmlQuote(QTestCharBuffer* str, char const* src)
{
return allocateStringFn(str, src, QXmlTestLogger::xmlQuote);
}
-int QXmlTestLogger::xmlCdata(char** str, char const* src)
+int QXmlTestLogger::xmlCdata(QTestCharBuffer* str, char const* src)
{
return allocateStringFn(str, src, QXmlTestLogger::xmlCdata);
}
diff --git a/src/testlib/qxmltestlogger_p.h b/src/testlib/qxmltestlogger_p.h
index a7cc00a..e14504c 100644
--- a/src/testlib/qxmltestlogger_p.h
+++ b/src/testlib/qxmltestlogger_p.h
@@ -79,10 +79,10 @@ public:
void addMessage(MessageTypes type, const char *message,
const char *file = 0, int line = 0);
- static int xmlCdata(char** dest, char const* src);
- static int xmlQuote(char** dest, char const* src);
- static int xmlCdata(char* dest, char const* src, size_t n);
- static int xmlQuote(char* dest, char const* src, size_t n);
+ static int xmlCdata(QTestCharBuffer *dest, char const* src);
+ static int xmlQuote(QTestCharBuffer *dest, char const* src);
+ static int xmlCdata(QTestCharBuffer *dest, char const* src, size_t n);
+ static int xmlQuote(QTestCharBuffer *dest, char const* src, size_t n);
private:
XmlMode xmlmode;
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index f789980..14576e2 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -184,7 +184,7 @@ DomUI *Uic::parseUiFile(QXmlStreamReader &reader)
if (reader.hasError()) {
delete ui;
ui = 0;
- fprintf(stderr, qPrintable(QString::fromLatin1("uic: Error in line %1, column %2 : %3\n")
+ fprintf(stderr, "%s\n", qPrintable(QString::fromLatin1("uic: Error in line %1, column %2 : %3")
.arg(reader.lineNumber()).arg(reader.columnNumber())
.arg(reader.errorString())));
}
diff --git a/src/xmlpatterns/query.pri b/src/xmlpatterns/query.pri
index e09a618..fab1940 100644
--- a/src/xmlpatterns/query.pri
+++ b/src/xmlpatterns/query.pri
@@ -11,4 +11,4 @@ include($$PWD/parser/parser.pri)
include($$PWD/projection/projection.pri)
include($$PWD/type/type.pri)
include($$PWD/utils/utils.pri)
-include($$PWD/qobjectmodel/qobjectmodel.pri)
+include($$PWD/qobjectmodel/qobjectmodel.pri, "", true)
diff --git a/src/xmlpatterns/xmlpatterns.pro b/src/xmlpatterns/xmlpatterns.pro
index fb6aa1a..bb8e452 100644
--- a/src/xmlpatterns/xmlpatterns.pro
+++ b/src/xmlpatterns/xmlpatterns.pro
@@ -22,10 +22,9 @@ include($$PWD/janitors/janitors.pri)
include($$PWD/parser/parser.pri)
include($$PWD/projection/projection.pri)
include($$PWD/schema/schema.pri)
-include($$PWD/schematron/schematron.pri)
include($$PWD/type/type.pri)
include($$PWD/utils/utils.pri)
-include($$PWD/qobjectmodel/qobjectmodel.pri)
+include($$PWD/qobjectmodel/qobjectmodel.pri, "", true)
wince*: {
# The Microsoft MIPS compiler crashes if /Og is specified
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp
index f95b426..0c9f3d8 100644
--- a/tests/arthur/lance/main.cpp
+++ b/tests/arthur/lance/main.cpp
@@ -271,7 +271,7 @@ int main(int argc, char **argv)
QString format = QString(argv[++i]).toLower();
imageFormat = QImage::Format_Invalid;
- static const unsigned int formatCount =
+ static const int formatCount =
sizeof(imageFormats) / sizeof(imageFormats[0]);
for (int ff = 0; ff < formatCount; ++ff) {
if (QLatin1String(imageFormats[ff].name) == format) {
diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h
index 7247608..61691dc 100644
--- a/tests/arthur/lance/widgets.h
+++ b/tests/arthur/lance/widgets.h
@@ -56,6 +56,9 @@
#include <QFileDialog>
#include <QTextStream>
#include <QPaintEngine>
+#include <QSignalMapper>
+#include <QAction>
+
#include <private/qwindowsurface_p.h>
@@ -96,8 +99,8 @@ public:
OnScreenWidget(const QString &file, QWidget *parent = 0)
: T(parent),
- m_view_mode(RenderView),
- m_filename(file)
+ m_filename(file),
+ m_view_mode(RenderView)
{
QSettings settings("Trolltech", "lance");
for (int i=0; i<10; ++i) {
@@ -117,36 +120,36 @@ public:
}
if (m_baseline.isNull()) {
- setWindowTitle("Rendering: '" + file + "'. No baseline available");
+ T::setWindowTitle("Rendering: '" + file + "'. No baseline available");
} else {
- setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference");
+ T::setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference");
StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode);
QSignalMapper *mapper = new QSignalMapper(this);
- connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int)));
- connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString)));
+ T::connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int)));
+ T::connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString)));
QAction *renderViewAction = new QAction("Render View", this);
renderViewAction->setShortcut(Qt::Key_1);
- connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(renderViewAction, RenderView);
mapper->setMapping(renderViewAction, "Render View: " + file);
- addAction(renderViewAction);
+ T::addAction(renderViewAction);
QAction *baselineAction = new QAction("Baseline", this);
baselineAction->setShortcut(Qt::Key_2);
- connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(baselineAction, BaselineView);
mapper->setMapping(baselineAction, "Baseline View: " + file);
- addAction(baselineAction);
+ T::addAction(baselineAction);
QAction *differenceAction = new QAction("Differenfe View", this);
differenceAction->setShortcut(Qt::Key_3);
- connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(differenceAction, DifferenceView);
mapper->setMapping(differenceAction, "Difference View" + file);
- addAction(differenceAction);
+ T::addAction(differenceAction);
}
@@ -178,7 +181,7 @@ public:
}
}
- void OnScreenWidget<T>::paintRenderView()
+ void paintRenderView()
{
QPainter pt;
QPaintDevice *dev = this;
@@ -233,7 +236,7 @@ public:
}
if (m_render_view.isNull()) {
- m_render_view = window()->windowSurface()->grabWidget(this);
+ m_render_view = T::window()->windowSurface()->grabWidget(this);
m_render_view.save("renderView.png");
}
}
@@ -242,7 +245,7 @@ public:
QPainter p(this);
if (m_baseline.isNull()) {
- p.drawText(rect(), Qt::AlignCenter,
+ p.drawText(T::rect(), Qt::AlignCenter,
"No baseline found\n"
"file '" + m_baseline_name + "' does not exist...");
return;
@@ -258,7 +261,7 @@ public:
QPixmap generateDifference()
{
- QImage img(size(), QImage::Format_RGB32);
+ QImage img(T::size(), QImage::Format_RGB32);
img.fill(0);
QPainter p(&img);
@@ -275,13 +278,13 @@ public:
void paintDifferenceView() {
QPainter p(this);
if (m_baseline.isNull()) {
- p.drawText(rect(), Qt::AlignCenter,
+ p.drawText(T::rect(), Qt::AlignCenter,
"No baseline found\n"
"file '" + m_baseline_name + "' does not exist...");
return;
}
- p.fillRect(rect(), Qt::black);
+ p.fillRect(T::rect(), Qt::black);
p.drawPixmap(0, 0, generateDifference());
}
diff --git a/tests/auto/qaccessibility_mac/qaccessibility_mac.pro b/tests/auto/qaccessibility_mac/qaccessibility_mac.pro
index b32a7e5..47f72d1 100644
--- a/tests/auto/qaccessibility_mac/qaccessibility_mac.pro
+++ b/tests/auto/qaccessibility_mac/qaccessibility_mac.pro
@@ -11,7 +11,7 @@ requires(mac)
# builds (where QTDIR points to the build directory).
# autotest + shadow build is not supported :)
exists($$(QTDIR)/tools/designer/src/lib/uilib/uilib.pri) {
- include($$(QTDIR)/tools/designer/src/lib/uilib/uilib.pri)
+ include($$(QTDIR)/tools/designer/src/lib/uilib/uilib.pri, "", true)
INCLUDEPATH += $$(QTDIR)/tools/designer/src/uitools
SOURCES += $$(QTDIR)/tools/designer/src/uitools/quiloader.cpp
HEADERS += $$(QTDIR)/tools/designer/src/uitools/quiloader.h
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index bd11fa4..4797698 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -139,6 +139,7 @@ private slots:
void task190205_setModelAdjustToContents();
void task248169_popupWithMinimalSize();
void task247863_keyBoardSelection();
+ void task220195_keyBoardSelection2();
void setModelColumn();
void noScrollbar_data();
void noScrollbar();
@@ -2138,6 +2139,40 @@ void tst_QComboBox::task247863_keyBoardSelection()
QCOMPARE(spy.count(), 1);
}
+void tst_QComboBox::task220195_keyBoardSelection2()
+{
+ QComboBox combo;
+ combo.setEditable(false);
+ combo.addItem( QLatin1String("foo1"));
+ combo.addItem( QLatin1String("foo2"));
+ combo.addItem( QLatin1String("foo3"));
+ combo.show();
+ QApplication::setActiveWindow(&combo);
+ QTest::qWait(100);
+
+ combo.setCurrentIndex(-1);
+ QVERIFY(combo.currentText().isNull());
+
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo1"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo2"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo3"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo1"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+
+ combo.setCurrentIndex(1);
+ QCOMPARE(combo.currentText(), QLatin1String("foo2"));
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo3"));
+}
+
+
void tst_QComboBox::setModelColumn()
{
QStandardItemModel model(5,3);
@@ -2238,5 +2273,6 @@ void tst_QComboBox::task253944_itemDelegateIsReset()
QCOMPARE(comboBox.itemDelegate(), itemDelegate);
}
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index 9b0e706..16bb12d 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -91,6 +91,7 @@ private slots:
void task169808_setFloating();
void task237438_setFloatingCrash();
void task248604_infiniteResize();
+ void task258459_visibilityChanged();
};
// Testing get/set functions
@@ -730,7 +731,7 @@ void tst_QDockWidget::task169808_setFloating()
return QSize(20,20);
}
- void paintEvent(QPaintEvent *e)
+ void paintEvent(QPaintEvent *)
{
QPainter p(this);
p.fillRect(rect(), Qt::red);
@@ -798,5 +799,21 @@ void tst_QDockWidget::task248604_infiniteResize()
}
+void tst_QDockWidget::task258459_visibilityChanged()
+{
+ QMainWindow win;
+ QDockWidget dock1, dock2;
+ win.addDockWidget(Qt::RightDockWidgetArea, &dock1);
+ win.tabifyDockWidget(&dock1, &dock2);
+ QSignalSpy spy1(&dock1, SIGNAL(visibilityChanged(bool)));
+ QSignalSpy spy2(&dock2, SIGNAL(visibilityChanged(bool)));
+ win.show();
+ QTest::qWait(200);
+ QCOMPARE(spy1.count(), 1);
+ QCOMPARE(spy1.first().first().toBool(), false); //dock1 is invisible
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(spy2.first().first().toBool(), true); //dock1 is visible
+}
+
QTEST_MAIN(tst_QDockWidget)
#include "tst_qdockwidget.moc"
diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
index 672b1f1..c9481da 100644
--- a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
+++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
@@ -137,7 +137,10 @@ void tst_QGraphicsTransform::rotation()
void tst_QGraphicsTransform::rotation3d()
{
QGraphicsRotation3D rotation;
- rotation.setOrigin(QPointF(10, 10));
+ QCOMPARE(rotation.axis().x(), (qreal)0);
+ QCOMPARE(rotation.axis().y(), (qreal)0);
+ QCOMPARE(rotation.axis().z(), (qreal)1);
+ QCOMPARE(rotation.angle(), (qreal)0);
QTransform t;
rotation.applyTo(&t);
@@ -147,6 +150,23 @@ void tst_QGraphicsTransform::rotation3d()
rotation.setAngle(180);
+ QTransform t180;
+ t180.rotate(180.0f);
+
+ QCOMPARE(t, QTransform());
+ QVERIFY(qFuzzyCompare(rotation.transform(), t180));
+
+ rotation.setAxis(QVector3D(0, 0, 0));
+ rotation.setOrigin(QPointF(10, 10));
+
+ t = QTransform();
+ rotation.applyTo(&t);
+
+ QCOMPARE(t, QTransform());
+ QCOMPARE(rotation.transform(), QTransform());
+
+ rotation.setAngle(180);
+
QCOMPARE(t, QTransform());
QCOMPARE(rotation.transform(), QTransform());
diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 0541b46..05e23f1 100644
--- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -90,6 +90,7 @@ private slots:
void merge();
void task119433_isRowSelected();
void task252069_rowIntersectsSelection();
+ void task232634_childrenDeselectionSignal();
private:
QAbstractItemModel *model;
@@ -2187,5 +2188,28 @@ void tst_QItemSelectionModel::task252069_rowIntersectsSelection()
QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
}
+void tst_QItemSelectionModel::task232634_childrenDeselectionSignal()
+{
+ QStandardItemModel model;
+
+ QStandardItem *parentItem = model.invisibleRootItem();
+ for (int i = 0; i < 4; ++i) {
+ QStandardItem *item = new QStandardItem(QString("item %0").arg(i));
+ parentItem->appendRow(item);
+ parentItem = item;
+ }
+
+ QModelIndex root = model.index(0,0);
+ QModelIndex par = root.child(0,0);
+ QModelIndex sel = par.child(0,0);
+
+ QItemSelectionModel selectionModel(&model);
+ selectionModel.select(sel, QItemSelectionModel::SelectCurrent);
+
+ QSignalSpy deselectSpy(&selectionModel, SIGNAL(selectionChanged(const QItemSelection& , const QItemSelection&)));
+ model.removeRows(0, 1, root);
+ QVERIFY(deselectSpy.count() == 1);
+}
+
QTEST_MAIN(tst_QItemSelectionModel)
#include "tst_qitemselectionmodel.moc"
diff --git a/tests/auto/qmake/testdata/functions/functions.pro b/tests/auto/qmake/testdata/functions/functions.pro
index 9ed92f96..5e089e4 100644
--- a/tests/auto/qmake/testdata/functions/functions.pro
+++ b/tests/auto/qmake/testdata/functions/functions.pro
@@ -46,7 +46,7 @@ isEmpty( CONFIG ) {
}
#include
-include( infiletest.pro )
+include( infiletest.pro, "", true )
!contains( DEFINES, QT_DLL ) {
message( "FAILED: include function: $$DEFINES" )
}
diff --git a/tests/auto/qstringbuilder/scenario1.pro b/tests/auto/qstringbuilder/scenario1.pro
index 4ce7156..d72451c 100644
--- a/tests/auto/qstringbuilder/scenario1.pro
+++ b/tests/auto/qstringbuilder/scenario1.pro
@@ -3,6 +3,7 @@ load(qttest_p4)
QT = core
SOURCES += scenario1.cpp
+HEADERS += tst_qstringbuilder.h
DEFINES += SCENARIO=1
diff --git a/tests/auto/qstringbuilder/scenario2.pro b/tests/auto/qstringbuilder/scenario2.pro
index 64c46e2..78e0c68 100644
--- a/tests/auto/qstringbuilder/scenario2.pro
+++ b/tests/auto/qstringbuilder/scenario2.pro
@@ -3,5 +3,6 @@ load(qttest_p4)
QT = core
SOURCES += scenario2.cpp
+HEADERS += tst_qstringbuilder.h
DEFINES += SCENARIO=2
diff --git a/tests/auto/qstringbuilder/scenario3.pro b/tests/auto/qstringbuilder/scenario3.pro
index beedffd..7b9e5af 100644
--- a/tests/auto/qstringbuilder/scenario3.pro
+++ b/tests/auto/qstringbuilder/scenario3.pro
@@ -3,5 +3,6 @@ load(qttest_p4)
QT = core
SOURCES += scenario3.cpp
+HEADERS += tst_qstringbuilder.h
DEFINES += SCENARIO=3
diff --git a/tests/auto/qstringbuilder/scenario4.pro b/tests/auto/qstringbuilder/scenario4.pro
index 1c45a70..1b62b25 100644
--- a/tests/auto/qstringbuilder/scenario4.pro
+++ b/tests/auto/qstringbuilder/scenario4.pro
@@ -3,5 +3,6 @@ load(qttest_p4)
QT = core
SOURCES += scenario4.cpp
+HEADERS += tst_qstringbuilder.h
DEFINES += SCENARIO=4
diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp
index 72889bc..86f6ada 100644
--- a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp
+++ b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp
@@ -86,20 +86,13 @@
#endif
#include <QtTest/QtTest>
+#include "tst_qstringbuilder.h"
//TESTED_CLASS=QStringBuilder
//TESTED_FILES=qstringbuilder.cpp
#define LITERAL "some literal"
-class tst_QStringBuilder : public QObject
-{
- Q_OBJECT
-
-private slots:
- void scenario();
-};
-
void tst_QStringBuilder::scenario()
{
QLatin1Literal l1literal(LITERAL);
@@ -138,5 +131,3 @@ void tst_QStringBuilder::scenario()
}
QTEST_APPLESS_MAIN(tst_QStringBuilder)
-
-#include "tst_qstringbuilder.moc"
diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.h b/tests/auto/qstringbuilder/tst_qstringbuilder.h
new file mode 100644
index 0000000..92c66d8
--- /dev/null
+++ b/tests/auto/qstringbuilder/tst_qstringbuilder.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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 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://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TST_QSTRINGBUILDER_H
+#define TST_QSTRINGBUILDER_H
+
+#include <qobject.h>
+
+class tst_QStringBuilder : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void scenario();
+};
+
+#endif
diff --git a/tests/auto/qtimeline/tst_qtimeline.cpp b/tests/auto/qtimeline/tst_qtimeline.cpp
index e6e75ff..4ce1f4b 100644
--- a/tests/auto/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/qtimeline/tst_qtimeline.cpp
@@ -81,6 +81,7 @@ private slots:
void outOfRange();
void stateInFinishedSignal();
void resume();
+ void restart();
protected slots:
void finishedSlot();
@@ -177,7 +178,7 @@ void tst_QTimeLine::currentTime()
QCOMPARE(spy.count(), 1);
spy.clear();
QCOMPARE(timeLine.currentTime(), timeLine.duration()/2);
- timeLine.start();
+ timeLine.resume();
// Let it update on its own
QTest::qWait(timeLine.duration()/4);
QCOMPARE(timeLine.state(), QTimeLine::Running);
@@ -699,5 +700,43 @@ void tst_QTimeLine::resume()
}
}
+void tst_QTimeLine::restart()
+{
+ QTimeLine timeLine(100);
+ timeLine.setFrameRange(0,9);
+
+ timeLine.start();
+ QTest::qWait(timeLine.duration()*2);
+ QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+
+ // A restart with the same duration
+ timeLine.start();
+ QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
+ QCOMPARE(timeLine.currentTime(), 0);
+ QTest::qWait(250);
+ QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+
+ // Set a smaller duration and restart
+ timeLine.setDuration(50);
+ timeLine.start();
+ QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
+ QCOMPARE(timeLine.currentTime(), 0);
+ QTest::qWait(250);
+ QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+
+ // Set a longer duration and restart
+ timeLine.setDuration(150);
+ timeLine.start();
+ QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
+ QCOMPARE(timeLine.currentTime(), 0);
+}
+
QTEST_MAIN(tst_QTimeLine)
+
#include "tst_qtimeline.moc"
diff --git a/tests/auto/runQtXmlPatternsTests.sh b/tests/auto/runQtXmlPatternsTests.sh
deleted file mode 100755
index 41d6c83..0000000
--- a/tests/auto/runQtXmlPatternsTests.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-# Runs all the tests specific to QtXmlPatterns in one go.
-
-# If you add a test, remember to update ./auto.pro too.
-# checkxmlfiles is not part of Patternist, but since it shares test code
-# and use Patternist, we include it as well.
-#
-# Sorted alphabetically, with the difference that xmlpatternsxqts appears
-# before xmlpattersview, xmlpatternsdiagnosticsts, and xmlpatternsxslts, since
-# they have the former as dependency.
-tests=" \
-checkxmlfiles \
-patternistexamplefiletree \
-patternistexamples \
-patternistheaders \
-qabstractmessagehandler \
-qabstracturiresolver \
-qabstractxmlforwarditerator \
-qabstractxmlnodemodel \
-qabstractxmlreceiver \
-qapplicationargumentparser \
-qautoptr \
-qsimplexmlnodemodel \
-qsourcelocation \
-qtokenautomaton \
-qxmlformatter \
-qxmlitem \
-qxmlname \
-qxmlnamepool \
-qxmlnodemodelindex \
-qxmlquery \
-qxmlresultitems \
-qxmlserializer \
-xmlpatterns \
-xmlpatternsxqts \
-xmlpatternsdiagnosticsts \
-xmlpatternsschema \
-xmlpatternsschemats \
-xmlpatternsview \
-xmlpatternsxslts"
-
-os=`uname`
-
-for test in $tests; do
- cd $test
- make distclean
- qmake
- make
-
- if [ $os = "Darwin" ]; then
- ./tst_"$test".app/Contents/MacOS/tst_"$test"
- else
- ./tst_$test
- fi
-
- if [ $? -ne 0 ]; then
- exit $?
- else
- cd ..
- fi
-done
diff --git a/tests/auto/selftests/benchlibwalltime/tst_benchlibwalltime.cpp b/tests/auto/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
index de65599..8474144f 100644
--- a/tests/auto/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
+++ b/tests/auto/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
@@ -50,6 +50,7 @@ class tst_BenchlibWalltime: public QObject
private slots:
void waitForOneThousand();
void waitForFourThousand();
+ void qbenchmark_once();
};
void tst_BenchlibWalltime::waitForOneThousand()
@@ -66,6 +67,16 @@ void tst_BenchlibWalltime::waitForFourThousand()
}
}
+void tst_BenchlibWalltime::qbenchmark_once()
+{
+ int iterations = 0;
+ QBENCHMARK_ONCE {
+ ++iterations;
+ }
+ QCOMPARE(iterations, 1);
+}
+
+
QTEST_MAIN(tst_BenchlibWalltime)
#include "tst_benchlibwalltime.moc"
diff --git a/tests/auto/selftests/expected_benchlibwalltime.txt b/tests/auto/selftests/expected_benchlibwalltime.txt
index 03f2465..ec2d020 100644
--- a/tests/auto/selftests/expected_benchlibwalltime.txt
+++ b/tests/auto/selftests/expected_benchlibwalltime.txt
@@ -7,6 +7,9 @@ PASS : tst_BenchlibWalltime::waitForOneThousand()
RESULT : tst_BenchlibWalltime::waitForFourThousand():
4,000 msec per iteration (total: 4000, iterations: 1)
PASS : tst_BenchlibWalltime::waitForFourThousand()
+RESULT : tst_BenchlibWalltime::qbenchmark_once():
+ 0 msec per iteration (total: 0, iterations: 1)
+PASS : tst_BenchlibWalltime::qbenchmark_once()
PASS : tst_BenchlibWalltime::cleanupTestCase()
-Totals: 4 passed, 0 failed, 0 skipped
+Totals: 5 passed, 0 failed, 0 skipped
********* Finished testing of tst_BenchlibWalltime *********
diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
index 2069d03..26dc280 100644
--- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
+++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
@@ -154,7 +154,7 @@ void tst_XmlPatterns::xquerySupport()
const QByteArray rawProducedStderr((process.readAllStandardError()));
const QString fixedStderr(QString::fromLocal8Bit(rawProducedStderr).remove(m_filenameInStderr));
- const QString errorFileName(inputFile(QLatin1String("stderrBaselines/") +
+ const QString errorFileName(inputFile(QLatin1String(SRCDIR "stderrBaselines/") +
QString::fromUtf8(QTest::currentDataTag()).remove(m_normalizeTestName) +
QLatin1String(".txt")));
@@ -221,7 +221,7 @@ void tst_XmlPatterns::xquerySupport_data() const
#endif
/* Check one file for existence, to avoid possible false positives. */
- QVERIFY(QFile::exists(inputFile(QLatin1String("queries/onePlusOne.xq"))));
+ QVERIFY(QFile::exists(inputFile(QLatin1String(SRCDIR "queries/onePlusOne.xq"))));
QTest::addColumn<int>("expectedExitCode");
QTest::addColumn<QByteArray>("expectedQueryOutput");
@@ -232,21 +232,21 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("A simple math query")
<< 0
<< QByteArray("2\n")
- << QStringList((QLatin1String("queries/onePlusOne.xq")))
+ << QStringList((QLatin1String(SRCDIR "queries/onePlusOne.xq")))
<< QString()
<< QString();
QTest::newRow("An unbound external variable")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/externalVariable.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/externalVariable.xq"))
<< QString()
<< QString();
QTest::newRow("Bind an external variable")
<< 0
<< QByteArray("1 4<e>1</e>true\n")
- << (QStringList() << QLatin1String("queries/externalVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("externalVariable=1"))
<< QString()
@@ -257,21 +257,21 @@ void tst_XmlPatterns::xquerySupport_data() const
<< QByteArray("1 4<e>1</e>true\n")
<< (QStringList() << QLatin1String("-param")
<< QLatin1String("externalVariable=1")
- << QLatin1String("queries/externalVariable.xq"))
+ << QLatin1String(SRCDIR "queries/externalVariable.xq"))
<< QString()
<< QString();
QTest::newRow("Use fn:doc")
<< 0
<< QByteArray("<e xmlns=\"http://example.com\" xmlns:p=\"http://example.com/P\" attr=\"1\" p:attr=\"\">\n <?target data?>\n <!-- a comment -->\n <e/>text <f/>text node</e>\n")
- << QStringList(QLatin1String("queries/openDocument.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/openDocument.xq"))
<< QString()
<< QString();
QTest::newRow("Use fn:doc, together with -no-format, last")
<< 0
<< QByteArray("<e xmlns=\"http://example.com\" xmlns:p=\"http://example.com/P\" attr=\"1\" p:attr=\"\"><?target data?><!-- a comment --><e/>text <f/>text node</e>")
- << (QStringList() << QLatin1String("queries/openDocument.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/openDocument.xq")
<< QLatin1String("-no-format"))
<< QString()
<< QString();
@@ -280,7 +280,7 @@ void tst_XmlPatterns::xquerySupport_data() const
<< 0
<< QByteArray("<e xmlns=\"http://example.com\" xmlns:p=\"http://example.com/P\" attr=\"1\" p:attr=\"\"><?target data?><!-- a comment --><e/>text <f/>text node</e>")
<< (QStringList() << QLatin1String("-no-format")
- << QLatin1String("queries/openDocument.xq"))
+ << QLatin1String(SRCDIR "queries/openDocument.xq"))
<< QString()
<< QString();
@@ -288,28 +288,28 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Make sure query paths are resolved against CWD, not the location of the executable.")
<< 0
<< QByteArray("2\n")
- << QStringList(QLatin1String("onePlusOne.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/onePlusOne.xq"))
<< QString::fromLatin1("queries")
<< QString();
QTest::newRow("Call fn:error()")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/errorFunction.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/errorFunction.xq"))
<< QString()
<< QString();
QTest::newRow("Evaluate a library module")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/simpleLibraryModule.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/simpleLibraryModule.xq"))
<< QString()
<< QString();
QTest::newRow("Trigger a static error.")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/staticError.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/staticError.xq"))
<< QString()
<< QString();
@@ -323,7 +323,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Open an nonexistent file")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/ThisFileDoesNotExist.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/ThisFileDoesNotExist.xq"))
<< QString()
<< QString();
@@ -332,63 +332,63 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("XQuery-function message markups")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/wrongArity.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/wrongArity.xq"))
<< QString()
<< QString();
QTest::newRow("XQuery-type message markups")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/typeError.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/typeError.xq"))
<< QString()
<< QString();
QTest::newRow("XQuery-data & XQuery-keyword message markups")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/zeroDivision.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/zeroDivision.xq"))
<< QString()
<< QString();
QTest::newRow("XQuery-uri message markups")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/unsupportedCollation.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/unsupportedCollation.xq"))
<< QString()
<< QString();
QTest::newRow("XQuery-expression message markups")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/invalidRegexp.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/invalidRegexp.xq"))
<< QString()
<< QString();
QTest::newRow("Print a list of available regexp flags(The available flags are formatted in a complex way.)")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/invalidRegexpFlag.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/invalidRegexpFlag.xq"))
<< QString()
<< QString();
QTest::newRow("Trigger an assert in QPatternist::ColorOutput. The query naturally contains an error; XPTY0004.")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/flwor.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/flwor.xq"))
<< QString()
<< QString();
QTest::newRow("Trigger a second assert in QPatternist::ColorOutput. The query naturally contains XPST0003.")
<< 2
<< QByteArray()
- << QStringList(QLatin1String("queries/syntaxError.xq"))
+ << QStringList(QLatin1String(SRCDIR "queries/syntaxError.xq"))
<< QString()
<< QString();
QTest::newRow("-param is missing so multiple queries appear")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("queries/reportGlobals.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/reportGlobals.xq")
<< QLatin1String("fileToOpen=globals.gccxml"))
<< QString()
<< QString();
@@ -403,7 +403,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Basic use of -output, query first")
<< 0
<< QByteArray("2\n")
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
<< QLatin1String("-output")
<< QLatin1String("basicOutput.out"))
<< QString()
@@ -414,22 +414,22 @@ void tst_XmlPatterns::xquerySupport_data() const
<< QByteArray("<e/>\n")
<< (QStringList() << QLatin1String("-output")
<< QLatin1String("basicOutput2.out")
- << QLatin1String("queries/oneElement.xq"))
+ << QLatin1String(SRCDIR "queries/oneElement.xq"))
<< QString()
<< QString::fromLatin1("basicOutput2.out");
QTest::newRow("A single query, that does not exist")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("doesNotExist.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "doesNotExist.xq"))
<< QString()
<< QString();
QTest::newRow("Specify two identical query names")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("query.xq")
- << QLatin1String("query.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "query.xq")
+ << QLatin1String(SRCDIR "query.xq"))
<< QString()
<< QString();
@@ -459,7 +459,7 @@ void tst_XmlPatterns::xquerySupport_data() const
<< QByteArray()
<< (QStringList() << QLatin1String("-output")
<< filename
- << QLatin1String("queries/onePlusOne.xq"))
+ << QLatin1String(SRCDIR "queries/onePlusOne.xq"))
<< QString()
<< filename;
}
@@ -476,7 +476,7 @@ void tst_XmlPatterns::xquerySupport_data() const
<< QByteArray("2\n")
<< (QStringList() << QLatin1String("-output")
<< outName
- << QLatin1String("queries/onePlusOne.xq"))
+ << QLatin1String(SRCDIR "queries/onePlusOne.xq"))
<< QString()
<< outName;
}
@@ -484,7 +484,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("one query, and a terminating dash at the end")
<< 0
<< QByteArray("2\n")
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
<< QLatin1String("-"))
<< QString()
<< QString();
@@ -493,7 +493,7 @@ void tst_XmlPatterns::xquerySupport_data() const
<< 0
<< QByteArray("2\n")
<< (QStringList() << QLatin1String("-")
- << QLatin1String("queries/onePlusOne.xq"))
+ << QLatin1String(SRCDIR "queries/onePlusOne.xq"))
<< QString()
<< QString();
@@ -580,21 +580,21 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Run a query which evaluates to the empty sequence.")
<< 0
<< QByteArray("\n")
- << (QStringList() << QLatin1String("queries/emptySequence.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "queries/emptySequence.xq"))
<< QString()
<< QString();
QTest::newRow("Run a query which evaluates to a single document node with no children.")
<< 0
<< QByteArray("\n")
- << (QStringList() << QLatin1String("queries/onlyDocumentNode.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "queries/onlyDocumentNode.xq"))
<< QString()
<< QString();
QTest::newRow("Invoke with invalid -param value.")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/externalVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("EqualSignIsMissing"))
<< QString()
@@ -603,7 +603,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Invoke with colon in variable name.")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/externalVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("xs:name=value"))
<< QString()
@@ -612,7 +612,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Invoke with missing name in -param arg.")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/externalVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("=value"))
<< QString()
@@ -621,7 +621,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Invoke with -param that has two adjacent equal signs.")
<< 0
<< QByteArray("START =text END\n")
- << (QStringList() << QLatin1String("queries/externalStringVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalStringVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("externalString==text"))
<< QString()
@@ -630,7 +630,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Pass in an external variable, but the query doesn't use it.")
<< 0
<< QByteArray("2\n")
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
<< QLatin1String("-param")
<< QLatin1String("externalString==text"))
<< QString()
@@ -640,7 +640,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Invoke with -param that has no value.")
<< 0
<< QByteArray("START END\n")
- << (QStringList() << QLatin1String("queries/externalStringVariable.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/externalStringVariable.xq")
<< QLatin1String("-param")
<< QLatin1String("externalString="))
<< QString()
@@ -656,7 +656,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Use a native path")
<< 0
<< QByteArray("2\n")
- << (QStringList() << QDir::toNativeSeparators(QLatin1String("queries/onePlusOne.xq")))
+ << (QStringList() << QDir::toNativeSeparators(QLatin1String(SRCDIR "queries/onePlusOne.xq")))
<< QString()
<< QString();
@@ -671,8 +671,8 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("A valid, existing query, followed by a bogus one")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
- << QLatin1String("doesNotExist.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
+ << QLatin1String(SRCDIR "doesNotExist.xq"))
<< QString()
<< QString();
*/
@@ -681,8 +681,8 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Specify two different query names")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("query1.xq")
- << QLatin1String("query2.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "query1.xq")
+ << QLatin1String(SRCDIR "query2.xq"))
<< QString()
<< QString();
*/
@@ -696,7 +696,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Use -param twice")
<< 0
<< QByteArray("param1 param2\n")
- << (QStringList() << QLatin1String("queries/twoVariables.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/twoVariables.xq")
<< QLatin1String("-param")
<< QLatin1String("var1=param1")
<< QLatin1String("-param")
@@ -707,7 +707,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Use -param thrice")
<< 0
<< QByteArray("param1 param2 third\n")
- << (QStringList() << QLatin1String("queries/threeVariables.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/threeVariables.xq")
<< QLatin1String("-param")
<< QLatin1String("var1=param1")
<< QLatin1String("-param")
@@ -720,7 +720,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Specify the same parameter twice, different values")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
<< QLatin1String("-param")
<< QLatin1String("duplicated=param1")
<< QLatin1String("-param")
@@ -731,7 +731,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Specify the same parameter twice, same values")
<< 1
<< QByteArray()
- << (QStringList() << QLatin1String("queries/onePlusOne.xq")
+ << (QStringList() << QLatin1String(SRCDIR "queries/onePlusOne.xq")
<< QLatin1String("-param")
<< QLatin1String("duplicated=param1")
<< QLatin1String("-param")
@@ -742,7 +742,7 @@ void tst_XmlPatterns::xquerySupport_data() const
QTest::newRow("Open a non-existing collection.")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("queries/nonexistingCollection.xq"))
+ << (QStringList() << QLatin1String(SRCDIR "queries/nonexistingCollection.xq"))
<< QString()
<< QString();
@@ -804,7 +804,7 @@ void tst_XmlPatterns::stdoutFailure() const
//process.setStandardOutputFile(outName);
process.setWorkingDirectory(QDir::current().absoluteFilePath(QString()));
- process.start(m_command, QStringList("queries/onePlusOne.xq"));
+ process.start(m_command, QStringList(SRCDIR "queries/onePlusOne.xq"));
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QVERIFY(process.waitForFinished());
@@ -865,8 +865,8 @@ void tst_XmlPatterns::xsltSupport_data() const
QTest::newRow("Pass in a stylesheet file which contains an XQuery query")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("stylesheets/queryAsStylesheet.xsl")
- << QLatin1String("queries/simpleDocument.xml"))
+ << (QStringList() << QLatin1String(SRCDIR "stylesheets/queryAsStylesheet.xsl")
+ << QLatin1String(SRCDIR "queries/simpleDocument.xml"))
<< QString()
<< QString();
@@ -883,7 +883,7 @@ void tst_XmlPatterns::xsltSupport_data() const
<< QByteArray()
<< (QStringList() << QLatin1String("-initial-template")
<< QLatin1String("name")
- << QLatin1String("queries/onePlusOne.xq"))
+ << QLatin1String(SRCDIR "queries/onePlusOne.xq"))
<< QString()
<< QString();
@@ -918,8 +918,8 @@ void tst_XmlPatterns::xsltSupport_data() const
<< (QStringList() << QLatin1String("-no-format")
<< QLatin1String("-initial-template")
<< QLatin1String("main")
- << QLatin1String("stylesheets/namedAndRootTemplate.xsl")
- << QLatin1String("stylesheets/documentElement.xml"))
+ << QLatin1String(SRCDIR "stylesheets/namedAndRootTemplate.xsl")
+ << QLatin1String(SRCDIR "stylesheets/documentElement.xml"))
<< QString()
<< QString();
@@ -929,8 +929,8 @@ void tst_XmlPatterns::xsltSupport_data() const
<< (QStringList() << QLatin1String("-no-format")
<< QLatin1String("-initial-template")
<< QLatin1String("no-template-by-this-name")
- << QLatin1String("stylesheets/namedAndRootTemplate.xsl")
- << QLatin1String("stylesheets/documentElement.xml"))
+ << QLatin1String(SRCDIR "stylesheets/namedAndRootTemplate.xsl")
+ << QLatin1String(SRCDIR "stylesheets/documentElement.xml"))
<< QString()
<< QString();
@@ -940,7 +940,7 @@ void tst_XmlPatterns::xsltSupport_data() const
<< (QStringList() << QLatin1String("-no-format")
<< QLatin1String("-initial-template")
<< QLatin1String("main")
- << QLatin1String("stylesheets/namedAndRootTemplate.xsl"))
+ << QLatin1String(SRCDIR "stylesheets/namedAndRootTemplate.xsl"))
<< QString()
<< QString();
@@ -950,7 +950,7 @@ void tst_XmlPatterns::xsltSupport_data() const
<< (QStringList() << QLatin1String("-no-format")
<< QLatin1String("-initial-template")
<< QLatin1String("{http://example.com/NS}main")
- << QLatin1String("stylesheets/namedAndRootTemplate.xsl"))
+ << QLatin1String(SRCDIR "stylesheets/namedAndRootTemplate.xsl"))
<< QString()
<< QString();
@@ -959,7 +959,7 @@ void tst_XmlPatterns::xsltSupport_data() const
<< QByteArray("defParam overridedDefaultedParam implicitlyRequiredValue\n")
<< (QStringList() << QLatin1String("-initial-template")
<< QLatin1String("main")
- << QLatin1String("stylesheets/useParameters.xsl")
+ << QLatin1String(SRCDIR "stylesheets/useParameters.xsl")
<< QLatin1String("-param")
<< QLatin1String("overridedDefaultedParam=overridedDefaultedParam")
<< QLatin1String("-param")
@@ -970,24 +970,24 @@ void tst_XmlPatterns::xsltSupport_data() const
QTest::newRow("Use a simplified stylesheet module")
<< 0
<< QByteArray("<output>some text</output>\n")
- << (QStringList() << QLatin1String("stylesheets/simplifiedStylesheetModule.xsl")
- << QLatin1String("stylesheets/simplifiedStylesheetModule.xml"))
+ << (QStringList() << QLatin1String(SRCDIR "stylesheets/simplifiedStylesheetModule.xsl")
+ << QLatin1String(SRCDIR "stylesheets/simplifiedStylesheetModule.xml"))
<< QString()
<< QString();
QTest::newRow("Not well-formed stylesheet, causes crash in coloring code.")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("stylesheets/notWellformed.xsl")
- << QLatin1String("queries/simpleDocument.xml"))
+ << (QStringList() << QLatin1String(SRCDIR "stylesheets/notWellformed.xsl")
+ << QLatin1String(SRCDIR "queries/simpleDocument.xml"))
<< QString()
<< QString();
QTest::newRow("Not well-formed instance document, causes crash in coloring code.")
<< 2
<< QByteArray()
- << (QStringList() << QLatin1String("stylesheets/bool070.xsl")
- << QLatin1String("stylesheets/bool070.xml"))
+ << (QStringList() << QLatin1String(SRCDIR "stylesheets/bool070.xsl")
+ << QLatin1String(SRCDIR "stylesheets/bool070.xml"))
<< QString()
<< QString();
diff --git a/tests/auto/xmlpatterns/xmlpatterns.pro b/tests/auto/xmlpatterns/xmlpatterns.pro
index 569e23f..01e3b2b 100644
--- a/tests/auto/xmlpatterns/xmlpatterns.pro
+++ b/tests/auto/xmlpatterns/xmlpatterns.pro
@@ -2,4 +2,10 @@ load(qttest_p4)
SOURCES += tst_xmlpatterns.cpp \
../qxmlquery/TestFundament.cpp
+!wince* {
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+} else {
+DEFINES += SRCDIR=\\\"./\\\"
+}
+
include (../xmlpatterns.pri)
diff --git a/tools/assistant/compat/lib/lib.pro b/tools/assistant/compat/lib/lib.pro
index d4b5a47..e50d470 100644
--- a/tools/assistant/compat/lib/lib.pro
+++ b/tools/assistant/compat/lib/lib.pro
@@ -32,7 +32,7 @@ contains(CONFIG, static) {
#load up the headers info
CONFIG += qt_install_headers
HEADERS_PRI = $$QT_BUILD_TREE/include/QtAssistant/headers.pri
-include($$HEADERS_PRI)|clear(HEADERS_PRI)
+include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
#mac frameworks
mac:!static:contains(QT_CONFIG, qt_framework) {
diff --git a/tools/checksdk/main.cpp b/tools/checksdk/main.cpp
index 6322eb7..b36aa32 100644
--- a/tools/checksdk/main.cpp
+++ b/tools/checksdk/main.cpp
@@ -161,5 +161,5 @@ int main(int argc, char **argv)
}
}
qWarning("Could not find specified SDK: %s" , qPrintable(sdkName));
- return 0;
-} \ No newline at end of file
+ return -1;
+}
diff --git a/tools/designer/src/components/lib/lib.pro b/tools/designer/src/components/lib/lib.pro
index 4515b66..92cf387 100644
--- a/tools/designer/src/components/lib/lib.pro
+++ b/tools/designer/src/components/lib/lib.pro
@@ -24,7 +24,7 @@ QMAKE_TARGET_DESCRIPTION = Graphical user interface designer.
#load up the headers info
CONFIG += qt_install_headers
HEADERS_PRI = $$QT_BUILD_TREE/include/QtDesigner/headers.pri
-include($$HEADERS_PRI)|clear(HEADERS_PRI)
+include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
#mac frameworks
mac:!static:contains(QT_CONFIG, qt_framework) {
diff --git a/tools/designer/src/lib/lib.pro b/tools/designer/src/lib/lib.pro
index e0f2f23..495976d 100644
--- a/tools/designer/src/lib/lib.pro
+++ b/tools/designer/src/lib/lib.pro
@@ -34,7 +34,7 @@ QMAKE_TARGET_DESCRIPTION = Graphical user interface designer.
#load up the headers info
CONFIG += qt_install_headers
HEADERS_PRI = $$QT_BUILD_TREE/include/QtDesigner/headers.pri
-include($$HEADERS_PRI)|clear(HEADERS_PRI)
+include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
#mac frameworks
mac:CONFIG += explicitlib
diff --git a/tools/designer/src/uitools/uitools.pro b/tools/designer/src/uitools/uitools.pro
index a20abf0..34e4877 100644
--- a/tools/designer/src/uitools/uitools.pro
+++ b/tools/designer/src/uitools/uitools.pro
@@ -22,7 +22,7 @@ include(../lib/uilib/uilib.pri)
HEADERS += quiloader.h
SOURCES += quiloader.cpp
-include($$QT_BUILD_TREE/include/QtUiTools/headers.pri)
+include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true)
quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools
INSTALLS += quitools_headers
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index bb79b19..22ff46a 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -482,9 +482,9 @@ MainWindow::MainWindow()
readConfig();
m_statistics = 0;
- connect(m_ui.actionLenghtVariants, SIGNAL(toggled(bool)),
- m_messageEditor, SLOT(setLenghtVariants(bool)));
- m_messageEditor->setLenghtVariants(m_ui.actionLenghtVariants->isChecked());
+ connect(m_ui.actionLengthVariants, SIGNAL(toggled(bool)),
+ m_messageEditor, SLOT(setLengthVariants(bool)));
+ m_messageEditor->setLengthVariants(m_ui.actionLengthVariants->isChecked());
m_focusWatcher = new FocusWatcher(m_messageEditor, this);
m_contextView->installEventFilter(m_focusWatcher);
@@ -2521,7 +2521,7 @@ void MainWindow::readConfig()
config.value(settingPath("Validators/PhraseMatch"), true).toBool());
m_ui.actionPlaceMarkerMatches->setChecked(
config.value(settingPath("Validators/PlaceMarkers"), true).toBool());
- m_ui.actionLenghtVariants->setChecked(
+ m_ui.actionLengthVariants->setChecked(
config.value(settingPath("Options/LengthVariants"), false).toBool());
recentFiles().readConfig();
@@ -2548,7 +2548,7 @@ void MainWindow::writeConfig()
config.setValue(settingPath("Validators/PlaceMarkers"),
m_ui.actionPlaceMarkerMatches->isChecked());
config.setValue(settingPath("Options/LengthVariants"),
- m_ui.actionLenghtVariants->isChecked());
+ m_ui.actionLengthVariants->isChecked());
config.setValue(settingPath("MainWindowState"),
saveState());
recentFiles().writeConfig();
diff --git a/tools/linguist/linguist/mainwindow.ui b/tools/linguist/linguist/mainwindow.ui
index 613241b..9dfb1ff 100644
--- a/tools/linguist/linguist/mainwindow.ui
+++ b/tools/linguist/linguist/mainwindow.ui
@@ -116,7 +116,7 @@
<addaction name="actionResetSorting"/>
<addaction name="actionDisplayGuesses"/>
<addaction name="actionStatistics"/>
- <addaction name="actionLenghtVariants"/>
+ <addaction name="actionLengthVariants"/>
<addaction name="separator"/>
<addaction name="menuToolbars"/>
<addaction name="menuViewViews"/>
@@ -878,12 +878,12 @@
<string>Ctrl+W</string>
</property>
</action>
- <action name="actionLenghtVariants">
+ <action name="actionLengthVariants">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
- <string>Lenght Variants</string>
+ <string>Length Variants</string>
</property>
</action>
</widget>
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp
index 9e598a8..e911389 100644
--- a/tools/linguist/linguist/messageeditor.cpp
+++ b/tools/linguist/linguist/messageeditor.cpp
@@ -710,7 +710,7 @@ void MessageEditor::setEditingEnabled(int model, bool enabled)
updateCanPaste();
}
-void MessageEditor::setLenghtVariants(bool on)
+void MessageEditor::setLengthVariants(bool on)
{
m_lengthVariants = on;
foreach (const MessageEditorData &ed, m_editors)
diff --git a/tools/linguist/linguist/messageeditor.h b/tools/linguist/linguist/messageeditor.h
index 4106036..b195a04 100644
--- a/tools/linguist/linguist/messageeditor.h
+++ b/tools/linguist/linguist/messageeditor.h
@@ -110,7 +110,7 @@ public slots:
void beginFromSource();
void setEditorFocus();
void setTranslation(int latestModel, const QString &translation);
- void setLenghtVariants(bool on);
+ void setLengthVariants(bool on);
private slots:
void editorCreated(QTextEdit *);
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 562684b..12ec7f3 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -1737,6 +1737,9 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
property->setDesignable(value.toLower() == "true");
else if (key == "RESET")
tre->addPropertyFunction(property, value, PropertyNode::Resetter);
+ else if (key == "NOTIFY") {
+ tre->addPropertyFunction(property, value, PropertyNode::Notifier);
+ }
}
match(Tok_RightParen);
return true;
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index e92f53b..9538dfe 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -283,7 +283,7 @@ bool Generator::generateText(const Text& text,
bool Generator::generateQmlText(const Text& text,
const Node *relative,
CodeMarker *marker,
- const QString& qmlName)
+ const QString& /* qmlName */ )
{
const Atom* atom = text.firstAtom();
if (atom == 0)
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 26874e1..c203c62 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -3420,6 +3420,14 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
out() << "<p><b>Access functions:</b></p>\n";
generateSectionList(section, node, marker, CodeMarker::Accessors);
}
+
+ Section notifiers;
+ notifiers.members += property->notifiers();
+
+ if (!notifiers.members.isEmpty()) {
+ out() << "<p><b>Notifier signal:</b></p>\n";
+ generateSectionList(notifiers, node, marker, CodeMarker::Accessors);
+ }
}
else if (node->type() == Node::Enum) {
const EnumNode *enume = static_cast<const EnumNode *>(node);
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 17ec447..61f2a76 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -590,8 +590,8 @@ class FunctionNode : public LeafNode
class PropertyNode : public LeafNode
{
public:
- enum FunctionRole { Getter, Setter, Resetter };
- enum { NumFunctionRoles = Resetter + 1 };
+ enum FunctionRole { Getter, Setter, Resetter, Notifier };
+ enum { NumFunctionRoles = Notifier + 1 };
PropertyNode(InnerNode *parent, const QString& name);
virtual ~PropertyNode() { }
@@ -609,6 +609,7 @@ class PropertyNode : public LeafNode
NodeList getters() const { return functions(Getter); }
NodeList setters() const { return functions(Setter); }
NodeList resetters() const { return functions(Resetter); }
+ NodeList notifiers() const { return functions(Notifier); }
bool isStored() const { return fromTrool(sto, storedDefault()); }
bool isDesignable() const { return fromTrool(des, designableDefault()); }
const PropertyNode *overriddenFrom() const { return overrides; }
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index f832062..a5e22f1 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -485,6 +485,7 @@ void Tree::resolveProperties()
QString getterName = (*propEntry)[PropertyNode::Getter];
QString setterName = (*propEntry)[PropertyNode::Setter];
QString resetterName = (*propEntry)[PropertyNode::Resetter];
+ QString notifierName = (*propEntry)[PropertyNode::Notifier];
NodeList::ConstIterator c = parent->childNodes().begin();
while (c != parent->childNodes().end()) {
@@ -499,6 +500,8 @@ void Tree::resolveProperties()
property->addFunction(function, PropertyNode::Setter);
} else if (function->name() == resetterName) {
property->addFunction(function, PropertyNode::Resetter);
+ } else if (function->name() == notifierName) {
+ property->addFunction(function, PropertyNode::Notifier);
}
}
}
diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts
index f702465..ce32062 100644
--- a/translations/assistant_de.ts
+++ b/translations/assistant_de.ts
@@ -52,11 +52,11 @@
<translation>Neuer Ordner</translation>
</message>
<message>
- <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+185"/>
+ <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+184"/>
<location line="+18"/>
- <location line="+36"/>
- <location line="+24"/>
- <location line="+32"/>
+ <location line="+39"/>
+ <location line="+18"/>
+ <location line="+30"/>
<source>Bookmarks</source>
<translation>Lesezeichen</translation>
</message>
@@ -66,7 +66,7 @@
<translation>+</translation>
</message>
<message>
- <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="-69"/>
+ <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="-61"/>
<source>Delete Folder</source>
<translation>Ordner löschen</translation>
</message>
@@ -79,12 +79,12 @@
<context>
<name>BookmarkManager</name>
<message>
- <location line="+450"/>
+ <location line="+434"/>
<source>Bookmarks</source>
<translation>Lesezeichen</translation>
</message>
<message>
- <location line="+36"/>
+ <location line="+37"/>
<source>Remove</source>
<translation>Entfernen</translation>
</message>
@@ -94,7 +94,7 @@
<translation>Wenn Sie diesen Ordner löschen, wird auch&lt;br&gt;dessen kompletter Inhalt gelöscht. Möchten Sie wirklich fortfahren?</translation>
</message>
<message>
- <location line="+109"/>
+ <location line="+143"/>
<location line="+9"/>
<source>New Folder</source>
<translation>Neuer Ordner</translation>
@@ -103,25 +103,17 @@
<context>
<name>BookmarkWidget</name>
<message>
- <location line="-391"/>
+ <location line="-416"/>
<source>Filter:</source>
<translation>Filter:</translation>
</message>
<message>
- <source>Bookmarks</source>
- <translation type="obsolete">Lesezeichen</translation>
- </message>
- <message>
- <location line="+32"/>
+ <location line="+33"/>
<source>Remove</source>
<translation>Entfernen</translation>
</message>
<message>
- <source>You are going to delete a Folder, this will also&lt;br&gt;remove it&apos;s content. Are you sure to continue?</source>
- <translation type="obsolete">Wenn Sie dieses Verzeichnis löschen, wird auch&lt;br&gt;dessen kompletter Inhalt gelöscht! Fortfahren?</translation>
- </message>
- <message>
- <location line="-78"/>
+ <location line="-79"/>
<source>Delete Folder</source>
<translation>Ordner löschen</translation>
</message>
@@ -151,11 +143,7 @@
<translation>Lesezeichen umbenennen</translation>
</message>
<message>
- <source>Search for:</source>
- <translation type="obsolete">Suchen:</translation>
- </message>
- <message>
- <location line="+61"/>
+ <location line="+62"/>
<source>Add</source>
<translation>Hinzufügen</translation>
</message>
@@ -163,7 +151,7 @@
<context>
<name>CentralWidget</name>
<message>
- <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+208"/>
+ <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+238"/>
<source>Add new page</source>
<translation>Neue Seite hinzufügen</translation>
</message>
@@ -173,7 +161,7 @@
<translation>Aktuelle Seite schließen</translation>
</message>
<message>
- <location line="+282"/>
+ <location line="+312"/>
<source>Print Document</source>
<translation>Drucken</translation>
</message>
@@ -184,7 +172,7 @@
<translation>unbekannt</translation>
</message>
<message>
- <location line="+91"/>
+ <location line="+93"/>
<source>Add New Page</source>
<translation>Neue Seite hinzufügen</translation>
</message>
@@ -204,7 +192,7 @@
<translation>Lesezeichen für diese Seite hinzufügen ...</translation>
</message>
<message>
- <location line="+259"/>
+ <location line="+255"/>
<source>Search</source>
<translation>Suchen</translation>
</message>
@@ -212,7 +200,7 @@
<context>
<name>ContentWindow</name>
<message>
- <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+155"/>
+ <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+158"/>
<source>Open Link</source>
<translation>Link öffnen</translation>
</message>
@@ -225,10 +213,6 @@
<context>
<name>FilterNameDialogClass</name>
<message>
- <source>FilterNameDialog</source>
- <translation type="obsolete">FilterNameDialog</translation>
- </message>
- <message>
<location filename="../tools/assistant/tools/assistant/filternamedialog.ui"/>
<source>Add Filter Name</source>
<translation>Filternamen hinzufügen</translation>
@@ -242,7 +226,7 @@
<context>
<name>FindWidget</name>
<message>
- <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-899"/>
+ <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-955"/>
<source>Previous</source>
<translation>Zurück</translation>
</message>
@@ -303,12 +287,6 @@
<translation>Hilfe</translation>
</message>
<message>
- <source>Unable to launch web browser.
-</source>
- <translation type="obsolete">Der Webbrowser konnte nicht gestarted werden.
-</translation>
- </message>
- <message>
<location line="+1"/>
<source>OK</source>
<translation>OK</translation>
@@ -362,13 +340,13 @@
<context>
<name>InstallDialog</name>
<message>
- <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+75"/>
<location filename="../tools/assistant/tools/assistant/installdialog.ui"/>
+ <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+76"/>
<source>Install Documentation</source>
<translation>Dokumentation installieren</translation>
</message>
<message>
- <location line="+30"/>
+ <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+30"/>
<source>Downloading documentation info...</source>
<translation>Dokumentationsinformation herunterladen ...</translation>
</message>
@@ -462,20 +440,20 @@
<context>
<name>MainWindow</name>
<message>
- <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+108"/>
- <location line="+354"/>
+ <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+110"/>
+ <location line="+391"/>
<source>Index</source>
<translation>Index</translation>
</message>
<message>
- <location line="-348"/>
- <location line="+346"/>
+ <location line="-385"/>
+ <location line="+383"/>
<source>Contents</source>
<translation>Inhalt</translation>
</message>
<message>
- <location line="-341"/>
- <location line="+345"/>
+ <location line="-378"/>
+ <location line="+382"/>
<source>Bookmarks</source>
<translation>Lesezeichen</translation>
</message>
@@ -485,24 +463,20 @@
<translation>Suchen</translation>
</message>
<message>
- <location line="-335"/>
- <location line="+208"/>
- <location line="+476"/>
+ <location line="-372"/>
+ <location line="+215"/>
+ <location line="+502"/>
<source>Qt Assistant</source>
<translation>Qt Assistant</translation>
</message>
<message>
- <location line="-508"/>
+ <location line="-534"/>
<location line="+5"/>
<source>Unfiltered</source>
<translation>Ohne Filter</translation>
</message>
<message>
- <source>File</source>
- <translation type="obsolete">Datei</translation>
- </message>
- <message>
- <location line="+84"/>
+ <location line="+107"/>
<source>Page Set&amp;up...</source>
<translation>S&amp;eite einrichten ...</translation>
</message>
@@ -517,111 +491,62 @@
<translation>&amp;Drucken ...</translation>
</message>
<message>
- <source>CTRL+P</source>
- <translation type="obsolete">CTRL+P</translation>
- </message>
- <message>
- <location line="+6"/>
+ <location line="+7"/>
<source>New &amp;Tab</source>
<translation>Neuer &amp;Tab</translation>
</message>
<message>
- <source>CTRL+T</source>
- <translation type="obsolete">CTRL+T</translation>
- </message>
- <message>
<location line="+3"/>
<source>&amp;Close Tab</source>
<translation>Tab &amp;schließen</translation>
</message>
<message>
- <source>CTRL+W</source>
- <translation type="obsolete">CTRL+W</translation>
- </message>
- <message>
<location line="+4"/>
<source>&amp;Quit</source>
<translation>&amp;Beenden</translation>
</message>
<message>
- <location line="+1"/>
- <source>CTRL+Q</source>
- <translation>CTRL+Q</translation>
- </message>
- <message>
- <source>Edit</source>
- <translation type="obsolete">Bearbeiten</translation>
- </message>
- <message>
- <location line="+4"/>
+ <location line="+5"/>
<source>&amp;Copy selected Text</source>
<translation>Ausgewählten Text &amp;kopieren</translation>
</message>
<message>
- <source>Ctrl+C</source>
- <translation type="obsolete">Ctrl+C</translation>
- </message>
- <message>
- <location line="+6"/>
+ <location line="+8"/>
<source>&amp;Find in Text...</source>
<translation>&amp;Textsuche ...</translation>
</message>
<message>
- <source>Ctrl+F</source>
- <translation type="obsolete">Ctrl+F</translation>
- </message>
- <message>
- <location line="+5"/>
+ <location line="+6"/>
<source>Find &amp;Next</source>
<translation>&amp;Weitersuchen</translation>
</message>
<message>
- <source>F3</source>
- <translation type="obsolete">F3</translation>
- </message>
- <message>
<location line="+4"/>
<source>Find &amp;Previous</source>
<translation>&amp;Vorheriges suchen</translation>
</message>
<message>
- <source>Shift+F3</source>
- <translation type="obsolete">Shift+F3</translation>
- </message>
- <message>
<location line="+5"/>
<source>Preferences...</source>
<translation>Einstellungen ...</translation>
</message>
<message>
- <source>View</source>
- <translation type="obsolete">Ansicht</translation>
- </message>
- <message>
<location line="+4"/>
<source>Zoom &amp;in</source>
<translation>&amp;Vergrößern</translation>
</message>
<message>
- <source>Ctrl++</source>
- <translation type="obsolete">Ctrl++</translation>
- </message>
- <message>
- <location line="+5"/>
+ <location line="+6"/>
<source>Zoom &amp;out</source>
<translation>Ver&amp;kleinern</translation>
</message>
<message>
- <source>Ctrl+-</source>
- <translation type="obsolete">Ctrl+-</translation>
- </message>
- <message>
- <location line="+5"/>
+ <location line="+6"/>
<source>Normal &amp;Size</source>
<translation>Standard&amp;größe</translation>
</message>
<message>
- <location line="+3"/>
+ <location line="+4"/>
<source>Ctrl+0</source>
<translation>Ctrl+0</translation>
</message>
@@ -636,30 +561,17 @@
<translation>ALT+I</translation>
</message>
<message>
- <source>ALT+B</source>
- <translation type="obsolete">ALT+B</translation>
- </message>
- <message>
<location line="+4"/>
<source>ALT+S</source>
<translation>ALT+S</translation>
</message>
<message>
- <source>Go</source>
- <translation type="obsolete">Gehe</translation>
- </message>
- <message>
<location line="+3"/>
<source>&amp;Home</source>
<translation>&amp;Startseite</translation>
</message>
<message>
- <location line="+1"/>
- <source>Ctrl+Home</source>
- <translation>Ctrl+Home</translation>
- </message>
- <message>
- <location line="+3"/>
+ <location line="+4"/>
<source>&amp;Back</source>
<translation>&amp;Rückwärts</translation>
</message>
@@ -669,12 +581,12 @@
<translation>&amp;Vorwärts</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>Sync with Table of Contents</source>
<translation>Seite mit Inhalt-Tab abgleichen</translation>
</message>
<message>
- <location line="+6"/>
+ <location line="+7"/>
<source>Next Page</source>
<translation>Nächste Seite</translation>
</message>
@@ -699,15 +611,7 @@
<translation>Lesezeichen hinzufügen ...</translation>
</message>
<message>
- <source>CTRL+B</source>
- <translation type="obsolete">CTRL+B</translation>
- </message>
- <message>
- <source>Help</source>
- <translation type="obsolete">Hilfe</translation>
- </message>
- <message>
- <location line="+4"/>
+ <location line="+5"/>
<source>About...</source>
<translation>Über ...</translation>
</message>
@@ -747,38 +651,22 @@
<translation>Der zugehörige Inhaltseintrag konnte nicht gefunden werden.</translation>
</message>
<message>
- <source>Open Source Edition</source>
- <translation type="obsolete">Open Source Edition</translation>
- </message>
- <message>
- <source>This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</source>
- <translation type="obsolete">This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</translation>
- </message>
- <message>
- <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see &lt;a href=&quot;http://qtsoftware.com/company/model.html&quot;&gt;qtsoftware.com/company/model.html&lt;/a&gt; for an overview of Qt licensing.</source>
- <translation type="obsolete">You need a commercial Qt license for development of proprietary (closed source) applications. Please see &lt;a href=&quot;http://qtsoftware.com/company/model.html&quot;&gt;qtsoftware.com/company/model.html&lt;/a&gt; for an overview of Qt licensing.</translation>
- </message>
- <message>
- <source>This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</source>
- <translation type="obsolete">This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</translation>
- </message>
- <message>
- <location line="+81"/>
+ <location line="+74"/>
<source>About %1</source>
<translation>Über %1</translation>
</message>
<message>
- <location line="+113"/>
+ <location line="+114"/>
<source>Updating search index</source>
<translation>Suchindex wird aufgebaut</translation>
</message>
<message>
- <location line="-601"/>
+ <location line="-628"/>
<source>Looking for Qt Documentation...</source>
<translation>Suche nach Qt-Dokumentation ...</translation>
</message>
<message>
- <location line="+195"/>
+ <location line="+228"/>
<source>&amp;Window</source>
<translation>&amp;Fenster</translation>
</message>
@@ -798,54 +686,47 @@
<translation>Zoom</translation>
</message>
<message>
- <source>Add</source>
- <translation type="obsolete">Hinzufügen</translation>
- </message>
- <message>
- <source>Remove</source>
- <translation type="obsolete">Entfernen</translation>
- </message>
- <message>
- <location line="-136"/>
+ <location line="-146"/>
<source>&amp;File</source>
<translation>&amp;Datei</translation>
</message>
<message>
- <location line="+24"/>
+ <location line="+25"/>
<source>&amp;Edit</source>
<translation>&amp;Bearbeiten</translation>
</message>
<message>
- <location line="+24"/>
+ <location line="+27"/>
<source>&amp;View</source>
<translation>&amp;Ansicht</translation>
</message>
<message>
- <location line="+27"/>
+ <location line="+30"/>
<source>&amp;Go</source>
<translation>&amp;Gehe zu</translation>
</message>
<message>
+ <location line="+2"/>
+ <source>ALT+Home</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<location line="+29"/>
<source>&amp;Bookmarks</source>
<translation>&amp;Lesezeichen</translation>
</message>
<message>
- <location line="+4"/>
+ <location line="+5"/>
<source>&amp;Help</source>
<translation>&amp;Hilfe</translation>
</message>
<message>
- <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see &lt;a href=&quot;http://qtsoftware.com/company/about/businessmodel&quot;&gt;http://qtsoftware.com/company/about/businessmodel&lt;/a&gt; for an overview of Qt licensing.</source>
- <translation type="obsolete">Sie benötigen eine kommerzielle Qt Lizenz für die Entwicklung von proprietären (geschlossenen) Anwendungen. Besuchen Sie &lt;a href=&quot;http://qtsoftware.com/company/about/businessmodel&quot;&gt;http://qtsoftware.com/company/about/businessmodel&lt;/a&gt; um sich einen Überblick über die Qt Lizenzvergabe zu verschaffen.</translation>
- </message>
- <message>
- <location line="-37"/>
+ <location line="-40"/>
<source>ALT+O</source>
<translation>ALT+O</translation>
</message>
<message>
- <location line="+35"/>
+ <location line="+38"/>
<source>CTRL+D</source>
<translation>CTRL+D</translation>
</message>
@@ -853,15 +734,7 @@
<context>
<name>PreferencesDialog</name>
<message>
- <source>From Local File System...</source>
- <translation type="obsolete">Von Dateisystem...</translation>
- </message>
- <message>
- <source>Download from Help Server...</source>
- <translation type="obsolete">Von Hilfe-Server herunterladen...</translation>
- </message>
- <message>
- <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+256"/>
+ <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+259"/>
<location line="+43"/>
<source>Add Documentation</source>
<translation>Dokumentation hinzufügen</translation>
@@ -902,7 +775,7 @@
<translation>OK</translation>
</message>
<message>
- <location line="+86"/>
+ <location line="+88"/>
<source>Use custom settings</source>
<translation>Benutzerdefinierte Einstellungen verwenden</translation>
</message>
@@ -980,22 +853,6 @@
<translation>Hinzufügen ...</translation>
</message>
<message>
- <source>Network</source>
- <translation type="obsolete">Netzwerk</translation>
- </message>
- <message>
- <source>Use Http Proxy</source>
- <translation type="obsolete">Http Proxy</translation>
- </message>
- <message>
- <source>Http Proxy:</source>
- <translation type="obsolete">Http Proxy:</translation>
- </message>
- <message>
- <source>Port:</source>
- <translation type="obsolete">Port:</translation>
- </message>
- <message>
<location/>
<source>Options</source>
<translation>Einstellungen</translation>
@@ -1015,14 +872,35 @@
<source>Homepage</source>
<translation>Startseite</translation>
</message>
+ <message>
+ <location/>
+ <source>On help start:</source>
+ <translation>Zu Beginn:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Show my home page</source>
+ <translation>Startseite zeigen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Show a blank page</source>
+ <translation>Leere Seite zeigen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Show my tabs from last session</source>
+ <translation>Reiter aus letzter Sitzung zeigen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Blank Page</source>
+ <translation>Leere Seite</translation>
+ </message>
</context>
<context>
<name>QObject</name>
<message>
- <source>New Folder</source>
- <translation type="obsolete">Neuer Ordner</translation>
- </message>
- <message>
<location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+112"/>
<source>The specified collection file does not exist!</source>
<translation>Die angegebene Katalogdatei (collection file) kann nicht gefunden werden.</translation>
@@ -1085,7 +963,7 @@
<translation>Qt Assistant</translation>
</message>
<message>
- <location filename="../tools/assistant/tools/assistant/main.cpp" line="+203"/>
+ <location filename="../tools/assistant/tools/assistant/main.cpp" line="+217"/>
<source>Could not register documentation file
%1
@@ -1128,12 +1006,6 @@ Grund:
<source>The specified collection file could not be read!</source>
<translation>Die angegebene Katalogdatei (collection file) kann nicht gelesen werden.</translation>
</message>
- <message>
- <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+167"/>
- <location line="+1"/>
- <source>Bookmark</source>
- <translation>Lesezeichen</translation>
- </message>
</context>
<context>
<name>RemoteControl</name>
@@ -1170,10 +1042,6 @@ Grund:
<source>Select All</source>
<translation>Alles markieren</translation>
</message>
- <message>
- <source>Open Link</source>
- <translation type="obsolete">Link öffnen</translation>
- </message>
</context>
<context>
<name>TopicChooser</name>
diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts
index 48f1f2e..8924b6e 100644
--- a/translations/linguist_de.ts
+++ b/translations/linguist_de.ts
@@ -2,24 +2,9 @@
<!DOCTYPE TS>
<TS version="2.0" language="de">
<context>
- <name></name>
- <message>
- <location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="+59"/>
- <source>(New Entry)</source>
- <translation>(Neuer Eintrag)</translation>
- </message>
-</context>
-<context>
- <name>@default</name>
- <message>
- <source>(New Phrase)</source>
- <translation type="obsolete">(Neue Phrase)</translation>
- </message>
-</context>
-<context>
<name>AboutDialog</name>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1357"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1359"/>
<source>Qt Linguist</source>
<translation>Qt Linguist</translation>
</message>
@@ -76,11 +61,6 @@
</message>
<message>
<location/>
- <source>Note that the modified entries will be reset to unfinished if &apos;Set translated entries to finished&apos; above is unchecked.</source>
- <translation>Beachten Sie, dass die geänderten Einträge in den Status &apos;unerledigt&apos; zurückgesetzt werden, wenn &apos;Übersetzung als erledigt markieren&apos; deaktiviert ist.</translation>
- </message>
- <message>
- <location/>
<source>Translate also finished entries</source>
<translation>Erledigte Einträge übersetzen</translation>
</message>
@@ -101,11 +81,6 @@
</message>
<message>
<location/>
- <source>The batch translator will search through the selected phrase books in the order given above.</source>
- <translation>Der automatische Übersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen.</translation>
- </message>
- <message>
- <location/>
<source>&amp;Run</source>
<translation>&amp;Ausführen</translation>
</message>
@@ -114,6 +89,16 @@
<source>Cancel</source>
<translation>Abbrechen</translation>
</message>
+ <message>
+ <location/>
+ <source>Note that the modified entries will be reset to unfinished if &apos;Set translated entries to finished&apos; above is unchecked</source>
+ <translation>Geänderte Einträge werden als unerledigt gekennzeichnet, wenn die obige Einstellung &apos;Übersetzung als erledigt markieren&apos; nicht aktiviert ist</translation>
+ </message>
+ <message>
+ <location/>
+ <source>The batch translator will search through the selected phrase books in the order given above</source>
+ <translation>Der automatische Übersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen</translation>
+ </message>
</context>
<context>
<name>DataModel</name>
@@ -156,61 +141,6 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
</message>
</context>
<context>
- <name>EditorPage</name>
- <message>
- <source>Source text</source>
- <translation type="obsolete">Ursprungstext</translation>
- </message>
- <message>
- <source>This area shows the source text.</source>
- <translation type="obsolete">Dieser Bereich zeigt den Ursprungstext.</translation>
- </message>
- <message>
- <source>This area shows a comment that may guide you, and the context in which the text occurs.</source>
- <translation type="obsolete">Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt.</translation>
- </message>
- <message>
- <source>Existing %1 translation</source>
- <translation type="obsolete">Existierende Übersetzung %1</translation>
- </message>
- <message>
- <source>Translation</source>
- <translation type="obsolete">Übersetzung</translation>
- </message>
- <message>
- <source>%1 translation</source>
- <translation type="obsolete">Übersetzung %1</translation>
- </message>
- <message>
- <source>%1 translation (%2)</source>
- <translation type="obsolete">Übersetzung %1 (%2)</translation>
- </message>
- <message>
- <source>This is where you can enter or modify the translation of some source text.</source>
- <translation type="obsolete">Hier können Sie die Übersetzung des Ursprungstextes eingeben bzw. ändern.</translation>
- </message>
- <message>
- <source>German</source>
- <translation type="obsolete">Deutsch</translation>
- </message>
- <message>
- <source>Japanese</source>
- <translation type="obsolete">Japanisch</translation>
- </message>
- <message>
- <source>French</source>
- <translation type="obsolete">Französisch</translation>
- </message>
- <message>
- <source>Polish</source>
- <translation type="obsolete">Polnisch</translation>
- </message>
- <message>
- <source>Chinese</source>
- <translation type="obsolete">Chinesisch</translation>
- </message>
-</context>
-<context>
<name>ErrorsView</name>
<message>
<location filename="../tools/linguist/linguist/errorsview.cpp" line="+76"/>
@@ -251,19 +181,11 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
<context>
<name>FindDialog</name>
<message>
- <source>Qt Linguist</source>
- <translation type="obsolete">Qt Linguist</translation>
- </message>
- <message>
<location filename="../tools/linguist/linguist/finddialog.ui"/>
<source>This window allows you to search for some text in the translation source file.</source>
<translation>Dieses Fenster erlaubt die Suche in der Übersetzungsdatei.</translation>
</message>
<message>
- <source>Find what:</source>
- <translation type="obsolete">Suchen nach:</translation>
- </message>
- <message>
<location/>
<source>Type in the text to search for.</source>
<translation>Geben Sie den Text ein, nach dem gesucht werden soll.</translation>
@@ -279,37 +201,21 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
<translation>Wenn aktiviert, wird in den Ursprungstexten gesucht.</translation>
</message>
<message>
- <source>Source texts</source>
- <translation type="obsolete">Ursprungsstexte</translation>
- </message>
- <message>
<location/>
<source>Translations are searched when checked.</source>
<translation>Wenn ausgewählt, wird in den Übersetzungen gesucht.</translation>
</message>
<message>
- <source>Translations</source>
- <translation type="obsolete">Übersetzungen</translation>
- </message>
- <message>
<location/>
<source>Texts such as &apos;TeX&apos; and &apos;tex&apos; are considered as different when checked.</source>
<translation>Wenn aktiviert, werden Texte wie &apos;TeX&apos; und &apos;tex&apos; als unterschiedlich betrachtet.</translation>
</message>
<message>
- <source>Match case</source>
- <translation type="obsolete">Groß-/Kleinschreibung beachten</translation>
- </message>
- <message>
<location/>
<source>Comments and contexts are searched when checked.</source>
<translation>Wenn ausgewählt, werden Kommentare und Kontextnamen durchsucht.</translation>
</message>
<message>
- <source>Comments</source>
- <translation type="obsolete">Kommentare</translation>
- </message>
- <message>
<location/>
<source>Find</source>
<translation>Suchen</translation>
@@ -365,10 +271,6 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
<translation>Abbrechen</translation>
</message>
<message>
- <source>Ignore accelerators</source>
- <translation type="obsolete">Kurztasten ignorieren</translation>
- </message>
- <message>
<location filename="../tools/linguist/linguist/finddialog.cpp" line="+12"/>
<source></source>
<comment>Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog</comment>
@@ -376,16 +278,56 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
</message>
</context>
<context>
- <name>FormHolder</name>
+ <name>FormMultiWidget</name>
+ <message>
+ <location filename="../tools/linguist/linguist/messageeditorwidgets.cpp" line="+296"/>
+ <source>Alt+Delete</source>
+ <extracomment>translate, but don&apos;t change</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Shift+Alt+Insert</source>
+ <extracomment>translate, but don&apos;t change</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Alt+Insert</source>
+ <extracomment>translate, but don&apos;t change</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
<message>
- <source>Preview Form</source>
- <translation type="obsolete">Vorschau</translation>
+ <location line="+131"/>
+ <source>Confirmation - Qt Linguist</source>
+ <translation>Bestätigung - Qt Linguist</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Delete non-empty length variant?</source>
+ <translation>Soll die ausgefüllte Längenvariante gelöscht werden?</translation>
</message>
</context>
<context>
<name>LRelease</name>
<message numerus="yes">
- <location filename="../tools/linguist/shared/qm.cpp" line="+715"/>
+ <location filename="../tools/linguist/shared/qm.cpp" line="+747"/>
+ <source>Dropped %n message(s) which had no ID.</source>
+ <translation>
+ <numerusform>Es wurde ein Eintrag ohne Bezeichner gelöscht.</numerusform>
+ <numerusform>Es wurde %n Einträge ohne Bezeichner gelöscht.</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location line="+4"/>
+ <source>Excess context/disambiguation dropped from %n message(s).</source>
+ <translation>
+ <numerusform>Es wurde überflüssiger Kontext beziehungsweise überflüssige Infomation zur Unterscheidung bei einem Eintrag entfernt.</numerusform>
+ <numerusform>Es wurde überflüssiger Kontext beziehungsweise überflüssige Infomation zur Unterscheidung bei %n Einträgen entfernt.</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location line="+8"/>
<source> Generated %n translation(s) (%1 finished and %2 unfinished)
</source>
<translation>
@@ -408,89 +350,6 @@ Es wird mit einer einfachen Universalform gearbeitet.</translation>
</message>
</context>
<context>
- <name>LanguagesDialog</name>
- <message>
- <source>Open Translation File</source>
- <translation type="obsolete">Öffne Übersetzungsdatei</translation>
- </message>
- <message>
- <source>Qt translation sources (%1);;Qt translation sources (*.ts);;XLIFF localization files (*.xlf);;All files (*)</source>
- <translation type="obsolete">Qt Übersetzungsdateien (%1);;Qt Übersetzungsdateien (*.ts);;XLIFF Lokalisierungsdateien (*.xlf);;Alle Dateien (*)</translation>
- </message>
- <message>
- <source>Auxiliary Languages</source>
- <translation type="obsolete">Unterstützende Sprachen</translation>
- </message>
- <message>
- <source>Locale</source>
- <translation type="obsolete">Regionalschema</translation>
- </message>
- <message>
- <source>File</source>
- <translation type="obsolete">Datei</translation>
- </message>
- <message>
- <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Move selected language up&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="obsolete">&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Bewege ausgewählte Sprache herauf&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <source>up</source>
- <translation type="obsolete">Hoch</translation>
- </message>
- <message>
- <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;Move selected language down&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="obsolete">&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;Bewege ausgewählte Sprache herunter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <source>down</source>
- <translation type="obsolete">Herunter</translation>
- </message>
- <message>
- <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Remove selected language&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="obsolete">&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Entferne ausgewählte Sprache&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <source>remove</source>
- <translation type="obsolete">Entfernen</translation>
- </message>
- <message>
- <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Open auxiliary language files&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="obsolete">&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Öffne unterstützende Sprachen&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <source>...</source>
- <translation type="obsolete">...</translation>
- </message>
- <message>
- <source>OK</source>
- <translation type="obsolete">OK</translation>
- </message>
-</context>
-<context>
<name>MainWindow</name>
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
@@ -538,10 +397,6 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Werkzeugleisten</translation>
</message>
<message>
- <source>Too&amp;ls</source>
- <translation type="obsolete">&amp;Werkzeuge</translation>
- </message>
- <message>
<location/>
<source>&amp;Help</source>
<translation>&amp;Hilfe</translation>
@@ -557,19 +412,11 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Datei</translation>
</message>
<message>
- <source>Re&amp;cently Opened Files</source>
- <translation type="obsolete">&amp;Zuletzt geöffnete Dateien</translation>
- </message>
- <message>
<location/>
<source>&amp;Edit</source>
<translation>&amp;Bearbeiten</translation>
</message>
<message>
- <source>&amp;New</source>
- <translation type="obsolete">&amp;Neu</translation>
- </message>
- <message>
<location/>
<source>&amp;Open...</source>
<translation>Ö&amp;ffnen ...</translation>
@@ -612,51 +459,26 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location/>
- <source>Previous unfinished item.</source>
- <translation>Vorheriger unerledigter Eintrag.</translation>
- </message>
- <message>
- <location/>
<source>Move to the previous unfinished item.</source>
<translation>Zum vorherigen unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
- <source>Next unfinished item.</source>
- <translation>Nächster unerledigter Eintrag.</translation>
- </message>
- <message>
- <location/>
<source>Move to the next unfinished item.</source>
<translation>Zum nächsten unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
- <source>Move to previous item.</source>
- <translation>Zum vorigen Eintrag gehen.</translation>
- </message>
- <message>
- <location/>
<source>Move to the previous item.</source>
<translation>Zum vorigen Eintrag gehen.</translation>
</message>
<message>
<location/>
- <source>Next item.</source>
- <translation>Nächster Eintrag.</translation>
- </message>
- <message>
- <location/>
<source>Move to the next item.</source>
<translation>Zum nächsten Eintrag gehen.</translation>
</message>
<message>
<location/>
- <source>Mark item as done and move to the next unfinished item.</source>
- <translation>Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen.</translation>
- </message>
- <message>
- <location/>
<source>Mark this item as done and move to the next unfinished item.</source>
<translation>Diesen Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen.</translation>
</message>
@@ -667,21 +489,11 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location/>
- <source>Toggle the validity check of accelerators.</source>
- <translation>Prüfung der Tastenkürzel ein- bzw. ausschalten.</translation>
- </message>
- <message>
- <location/>
<source>Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window.</source>
<translation>Die Prüfung der Tastenkürzel, das heißt, die Übereinstimmung der kaufmännischen Und-Zeichen in Quelle und Übersetzung ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
<message>
<location/>
- <source>Toggle the validity check of ending punctuation.</source>
- <translation>Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten.</translation>
- </message>
- <message>
- <location/>
<source>Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window.</source>
<translation>Die Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
@@ -692,11 +504,6 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location/>
- <source>Toggle the validity check of place markers.</source>
- <translation>Prüfung der Platzhalter ein- bzw. ausschalten.</translation>
- </message>
- <message>
- <location/>
<source>Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window.</source>
<translation>Die Prüfung der Platzhalter, das heißt, ob %1, %2 usw. in Ursprungstext und Übersetzung übereinstimmend verwendet werden, ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
@@ -716,14 +523,14 @@ p, li { white-space: pre-wrap; }
<translation>Ctrl+S</translation>
</message>
<message>
+ <location/>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-14"/>
<location line="+11"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Save &amp;As...</source>
<translation>Speichern &amp;unter...</translation>
</message>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
<source>Save As...</source>
<translation>Speichern unter ...</translation>
</message>
@@ -748,10 +555,6 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Drucken ...</translation>
</message>
<message>
- <source>Print a list of all the phrases in the current Qt translation source file.</source>
- <translation type="obsolete">Drucke die Liste aller Übersetzungen in der aktuellen Qt Übersetzungsdatei.</translation>
- </message>
- <message>
<location/>
<source>Ctrl+P</source>
<translation>Ctrl+P</translation>
@@ -762,10 +565,6 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Rückgängig</translation>
</message>
<message>
- <source>Undo the last editing operation performed on the translation.</source>
- <translation type="obsolete">Mache die letzte Änderung an der Übersetzung rückgängig.</translation>
- </message>
- <message>
<location/>
<source>Recently Opened &amp;Files</source>
<translation>Zu&amp;letzt bearbeitete Dateien</translation>
@@ -916,10 +715,6 @@ p, li { white-space: pre-wrap; }
<translation>Ctrl+W</translation>
</message>
<message>
- <source>Moves to the previous unfinished item.</source>
- <translation type="obsolete">Gehe zum letzten unerledigten Eintrag.</translation>
- </message>
- <message>
<location/>
<source>Ctrl+K</source>
<translation>Ctrl+K</translation>
@@ -930,23 +725,11 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Nächster Unerledigter</translation>
</message>
<message>
- <source>Moves to the next unfinished item.</source>
- <translation type="obsolete">Gehe zum nächsten unerledigten Eintrag.</translation>
- </message>
- <message>
- <source>Ctrl+L</source>
- <translation type="obsolete">Ctrl+L</translation>
- </message>
- <message>
<location/>
<source>P&amp;rev</source>
<translation>V&amp;orheriger</translation>
</message>
<message>
- <source>Moves to the previous item.</source>
- <translation type="obsolete">Gehe zum letzten Eintrag.</translation>
- </message>
- <message>
<location/>
<source>Ctrl+Shift+K</source>
<translation>Ctrl+Shift+K</translation>
@@ -957,27 +740,11 @@ p, li { white-space: pre-wrap; }
<translation>Nä&amp;chster</translation>
</message>
<message>
- <source>Moves to the next item.</source>
- <translation type="obsolete">Gehe zum nächsten Eintrag.</translation>
- </message>
- <message>
- <source>Ctrl+Shift+L</source>
- <translation type="obsolete">Ctrl+Shift+L</translation>
- </message>
- <message>
<location/>
<source>&amp;Done and Next</source>
<translation>&amp;Fertig und Nächster</translation>
</message>
<message>
- <source>Marks this item as done and moves to the next unfinished item.</source>
- <translation type="obsolete">Markiere diesen Eintrag als erledigt und gehe zum nächsten unerledigten Eintrg.</translation>
- </message>
- <message>
- <source>&amp;Begin from source</source>
- <translation type="obsolete">Übernehme &amp;Ursprungstext</translation>
- </message>
- <message>
<location/>
<source>Copies the source text into the translation field.</source>
<translation>Kopiert den Ursprungstext in das Übersetzungsfeld.</translation>
@@ -993,38 +760,21 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Kurzbefehle</translation>
</message>
<message>
- <source>Toggle validity checks of accelerators.</source>
- <translation type="obsolete">Aktiviere/Deaktiviere Validitätsprüfung für Kurztasten.</translation>
- </message>
- <message>
<location/>
<source>&amp;Ending Punctuation</source>
<translation>&amp;Punktierung am Ende</translation>
</message>
<message>
- <source>Toggle validity checks of ending punctuation.</source>
- <translation type="obsolete">Aktiviere/Deaktiviere Validitätsprüfung für Punktierung am Ende des Textes.</translation>
- </message>
- <message>
<location/>
<source>&amp;Phrase matches</source>
<translation>&amp;Wörterbuch</translation>
</message>
<message>
<location/>
- <source>Toggle checking that phrase suggestions are used.</source>
- <translation>Überprüfung, ob Wörterbucheinträge benutzt werden, aktivieren/deaktivieren.</translation>
- </message>
- <message>
- <location/>
<source>Place &amp;Marker Matches</source>
<translation>Platz&amp;halter</translation>
</message>
<message>
- <source>Toggle validity checks of place markers.</source>
- <translation type="obsolete">Aktiviere/Deaktiviere Validitätsprüfung für Platzhalter .</translation>
- </message>
- <message>
<location/>
<source>&amp;New Phrase Book...</source>
<translation>&amp;Neues Wörterbuch ...</translation>
@@ -1140,36 +890,31 @@ p, li { white-space: pre-wrap; }
<translation>Die Übersetzung aller Einträge ersetzen, die dem Suchtext entsprechen.</translation>
</message>
<message>
+ <location/>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="+21"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>&amp;Batch Translation...</source>
<translation>&amp;Automatische Übersetzung ...</translation>
</message>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
<source>Batch translate all entries using the information in the phrase books.</source>
<translation>Alle Einträge automatisch mit Hilfe des Wörterbuchs übersetzen.</translation>
</message>
<message>
+ <location/>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-34"/>
<location line="+10"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Release As...</source>
<translation>Freigeben unter ...</translation>
</message>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
- <source>Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the .ts file.</source>
- <translation>Eine Qt-Nachrichtendatei aus der aktuellen Übersetzungsdatei erzeugen. Der Dateiname wird automatisch aus dem Namen der TS-Datei abgeleitet.</translation>
- </message>
- <message>
- <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-2004"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-2006"/>
<source></source>
<comment>This is the application&apos;s main window.</comment>
<translation></translation>
</message>
<message>
- <location line="+195"/>
+ <location line="+188"/>
<source>Source text</source>
<translation>Ursprungstext</translation>
</message>
@@ -1181,17 +926,17 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="-2"/>
- <location line="+61"/>
+ <location line="+62"/>
<source>Context</source>
<translation>Kontext</translation>
</message>
<message>
- <location line="-60"/>
+ <location line="-61"/>
<source>Items</source>
<translation>Einträge</translation>
</message>
<message>
- <location line="+77"/>
+ <location line="+78"/>
<source>This panel lists the source contexts.</source>
<translation>Dieser Bereich zeigt die Kontexte an.</translation>
</message>
@@ -1219,10 +964,10 @@ p, li { white-space: pre-wrap; }
<location line="+59"/>
<source> MOD </source>
<comment>status bar: file(s) modified</comment>
- <translation type="unfinished"></translation>
+ <translation>Geändert</translation>
</message>
<message>
- <location line="+125"/>
+ <location line="+130"/>
<source>Loading...</source>
<translation>Lade ...</translation>
</message>
@@ -1275,14 +1020,19 @@ Soll die erstgenannte Datei übersprungen werden?</translation>
<translation>Datei gespeichert.</translation>
</message>
<message>
- <location line="+15"/>
- <location line="+1164"/>
+ <location line="+526"/>
+ <source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-511"/>
+ <location line="+1167"/>
<source>Release</source>
<translation>Freigeben</translation>
</message>
<message>
- <location line="-1163"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1166"/>
<source>Qt message files for released applications (*.qm)
All files (*)</source>
<translation>Qt-Nachrichtendateien (*.qm)
@@ -1295,7 +1045,7 @@ Alle Dateien (*)</translation>
<translation>Datei erzeugt.</translation>
</message>
<message>
- <location line="+27"/>
+ <location line="+34"/>
<location line="+355"/>
<source>Printing...</source>
<translation>Drucke ...</translation>
@@ -1346,7 +1096,7 @@ Alle Dateien (*)</translation>
<message>
<location line="+17"/>
<location line="+278"/>
- <location line="+40"/>
+ <location line="+36"/>
<location line="+24"/>
<location line="+22"/>
<location line="+516"/>
@@ -1358,18 +1108,11 @@ Alle Dateien (*)</translation>
<translation>Qt Linguist</translation>
</message>
<message>
- <location line="-1204"/>
+ <location line="-1200"/>
<location line="+102"/>
<source>Cannot find the string &apos;%1&apos;.</source>
<translation>Kann Zeichenkette &apos;%1&apos; nicht finden.</translation>
</message>
- <message numerus="yes">
- <source>Translated %n entries to &apos;%1&apos;</source>
- <translation type="obsolete">
- <numerusform>Ein Eintrag wurde mit &apos;%1&apos; übersetzt</numerusform>
- <numerusform>%n Einträge wurden mit &apos;%1&apos; übersetzt</numerusform>
- </translation>
- </message>
<message>
<location line="-82"/>
<source>Search And Translate in &apos;%1&apos; - Qt Linguist</source>
@@ -1463,16 +1206,7 @@ Alle Dateien (*)</translation>
<translation>Version %1</translation>
</message>
<message>
- <source> Open Source Edition</source>
- <translation type="obsolete">Open Source Edition</translation>
- </message>
- <message>
- <location line="+6"/>
- <source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
- <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist ist ein Werkzeug zum Übersetzen von Qt-Anwendungen.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</translation>
- </message>
- <message>
- <location line="+41"/>
+ <location line="+43"/>
<source>Do you want to save the modified files?</source>
<translation>Möchten Sie die geänderten Dateien speichern?</translation>
</message>
@@ -1559,13 +1293,13 @@ Alle Dateien (*)</translation>
<translation>Alles speichern</translation>
</message>
<message>
- <location line="+1"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1"/>
<source>&amp;Release All</source>
<translation>Alles f&amp;reigeben</translation>
</message>
<message>
- <location line="+1"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1"/>
<source>Close All</source>
<translation>Alle schließen</translation>
</message>
@@ -1590,37 +1324,37 @@ Alle Dateien (*)</translation>
<translation>Suchen und &amp;übersetzen ...</translation>
</message>
<message>
- <location line="+51"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+51"/>
<source>File</source>
<translation>Datei</translation>
</message>
<message>
- <location line="+7"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+7"/>
<source>Edit</source>
<translation>Bearbeiten</translation>
</message>
<message>
- <location line="+6"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+6"/>
<source>Translation</source>
<translation>Übersetzung</translation>
</message>
<message>
- <location line="+6"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+6"/>
<source>Validation</source>
<translation>Validierung</translation>
</message>
<message>
- <location line="+7"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+7"/>
<source>Help</source>
<translation>Hilfe</translation>
</message>
<message>
- <location line="+84"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+84"/>
<source>Cannot read from phrase book &apos;%1&apos;.</source>
<translation>Wörterbuch &apos;%1&apos; kann nicht gelesen werden.</translation>
</message>
@@ -1650,7 +1384,7 @@ Alle Dateien (*)</translation>
<translation>Möchten Sie das Wörterbuch &apos;%1&apos; speichern?</translation>
</message>
<message>
- <location line="+314"/>
+ <location line="+323"/>
<source>All</source>
<translation>Alle</translation>
</message>
@@ -1670,21 +1404,13 @@ Alle Dateien (*)</translation>
<translation>F5</translation>
</message>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-527"/>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-536"/>
<source>Translation File &amp;Settings...</source>
<translation>E&amp;instellungen ...</translation>
</message>
<message>
- <source>Other &amp;Languages...</source>
- <translation type="obsolete">A&amp;ndere Sprachen...</translation>
- </message>
- <message>
- <source>Edit which other languages to show.</source>
- <translation type="obsolete">Welche anderen Sprachen sollen dargestellt werden.</translation>
- </message>
- <message>
- <location filename="../tools/linguist/linguist/mainwindow.ui"/>
+ <location/>
<source>&amp;Add to Phrase Book</source>
<translation>Zum Wörterbuch &amp;hinzufügen</translation>
</message>
@@ -1703,11 +1429,82 @@ Alle Dateien (*)</translation>
<source>Ctrl+Shift+J</source>
<translation>Ctrl+Shift+J</translation>
</message>
+ <message>
+ <location/>
+ <source>Previous unfinished item</source>
+ <translation>Vorheriger unerledigter Eintrag</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Next unfinished item</source>
+ <translation>Nächster unerledigter Eintrag</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Move to previous item</source>
+ <translation>Zum vorigen Eintrag gehen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Next item</source>
+ <translation>Nächster Eintrag</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Mark item as done and move to the next unfinished item</source>
+ <translation>Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Copies the source text into the translation field</source>
+ <translation>Kopiert den Ursprungstext in das Übersetzungsfeld</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Toggle the validity check of accelerators</source>
+ <translation>Prüfung der Tastenkürzel ein- bzw. ausschalten</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Toggle the validity check of ending punctuation</source>
+ <translation>Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Toggle checking that phrase suggestions are used</source>
+ <translation>Überprüfung, ob Wörterbucheinträge benutzt werden, aktivieren/deaktivieren</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Toggle the validity check of place markers</source>
+ <translation>Prüfung der Platzhalter ein- bzw. ausschalten&apos;</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file.</source>
+ <translation>Eine Qt-Nachrichtendatei aus der aktuellen Übersetzungsdatei erzeugen. Der Dateiname wird automatisch aus dem Namen der TS-Datei abgeleitet.</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Length Variants</source>
+ <translation>Längenvarianten</translation>
+ </message>
</context>
<context>
<name>MessageEditor</name>
<message>
- <location filename="../tools/linguist/linguist/messageeditor.cpp" line="+72"/>
+ <location filename="../tools/linguist/linguist/messageeditor.cpp" line="+42"/>
+ <source></source>
+ <comment>This is the right panel of the main window.</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+30"/>
+ <source>Russian</source>
+ <translation>Russisch</translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>German</source>
<translation>Deutsch</translation>
</message>
@@ -1732,7 +1529,7 @@ Alle Dateien (*)</translation>
<translation>Chinesisch</translation>
</message>
<message>
- <location line="+50"/>
+ <location line="+53"/>
<source>This whole panel allows you to view and edit the translation of some source text.</source>
<translation>Dieser Bereich erlaubt die Darstellung und Änderung der Übersetzung eines Textes.</translation>
</message>
@@ -1747,7 +1544,7 @@ Alle Dateien (*)</translation>
<translation>Dieser Bereich zeigt den Ursprungstext.</translation>
</message>
<message>
- <location line="+3"/>
+ <location line="+4"/>
<source>Source text (Plural)</source>
<translation>Ursprungstext (Plural)</translation>
</message>
@@ -1757,7 +1554,7 @@ Alle Dateien (*)</translation>
<translation>Dieser Bereich zeigt die Pluralform des Ursprungstexts.</translation>
</message>
<message>
- <location line="+3"/>
+ <location line="+4"/>
<source>Developer comments</source>
<translation>Hinweise des Entwicklers</translation>
</message>
@@ -1772,12 +1569,12 @@ Alle Dateien (*)</translation>
<translation>Hier können Sie Hinweise für den eigenen Gebrauch eintragen. Diese haben keinen Einflusse auf die Übersetzung.</translation>
</message>
<message>
- <location line="+205"/>
+ <location line="+232"/>
<source>%1 translation (%2)</source>
<translation>Übersetzung %1 (%2)</translation>
</message>
<message>
- <location line="+19"/>
+ <location line="+9"/>
<source>This is where you can enter or modify the translation of the above source text.</source>
<translation>Hier können Sie die Übersetzung des Ursprungstextes eingeben bzw. ändern.</translation>
</message>
@@ -1792,56 +1589,16 @@ Alle Dateien (*)</translation>
<translation>%1 Hinweise des Übersetzers</translation>
</message>
<message>
- <location line="+138"/>
+ <location line="+157"/>
<source>&apos;%1&apos;
Line: %2</source>
<translation>&apos;%1&apos;
Zeile: %2</translation>
</message>
- <message>
- <source>%1 Translation (%2)</source>
- <translation type="obsolete">Übersetzung %1 (%2)</translation>
- </message>
- <message>
- <source>bell</source>
- <translation type="obsolete">bell</translation>
- </message>
- <message>
- <source>backspace</source>
- <translation type="obsolete">Rücktaste</translation>
- </message>
- <message>
- <source>new page</source>
- <translation type="obsolete">Neue Seite</translation>
- </message>
- <message>
- <source>new line</source>
- <translation type="obsolete">Neue Zeile</translation>
- </message>
- <message>
- <source>carriage return</source>
- <translation type="obsolete">Carriage Return</translation>
- </message>
- <message>
- <source>tab</source>
- <translation type="obsolete">Tab</translation>
- </message>
</context>
<context>
<name>MessageModel</name>
<message>
- <source>Context</source>
- <translation type="obsolete">Kontext</translation>
- </message>
- <message>
- <source>Items</source>
- <translation type="obsolete">Einträge</translation>
- </message>
- <message>
- <source>Index</source>
- <translation type="obsolete">Index</translation>
- </message>
- <message>
<location filename="../tools/linguist/linguist/messagemodel.cpp" line="+832"/>
<source>Completion status for %1</source>
<translation>Bearbeitungsstand von %1</translation>
@@ -1863,16 +1620,9 @@ Zeile: %2</translation>
</message>
</context>
<context>
- <name>MessagesTreeView</name>
- <message>
- <source>Done</source>
- <translation type="obsolete">Done</translation>
- </message>
-</context>
-<context>
<name>MsgEdit</name>
<message>
- <location filename="../tools/linguist/linguist/messageeditor.cpp" line="-572"/>
+ <location filename="../tools/linguist/linguist/messageeditor.cpp" line="-614"/>
<source></source>
<comment>This is the right panel of the main window.</comment>
<translation></translation>
@@ -1881,17 +1631,18 @@ Zeile: %2</translation>
<context>
<name>PhraseBookBox</name>
<message>
- <source>%1 - %2[*]</source>
- <translation type="obsolete">%1 - %2[*]</translation>
- </message>
- <message>
- <location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="-47"/>
+ <location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="+12"/>
<source></source>
<comment>Go to Phrase &gt; Edit Phrase Book... The dialog that pops up is a PhraseBookBox.</comment>
<translation></translation>
</message>
<message>
- <location line="+55"/>
+ <location line="+54"/>
+ <source>(New Entry)</source>
+ <translation>(Neuer Eintrag)</translation>
+ </message>
+ <message>
+ <location line="+3"/>
<source>%1[*] - Qt Linguist</source>
<translation>%1[*] - Qt Linguist</translation>
</message>
@@ -1911,10 +1662,6 @@ Zeile: %2</translation>
<translation>Wörterbuch bearbeiten</translation>
</message>
<message>
- <source>This window allows you to add, modify, or delete phrases in a phrase book.</source>
- <translation type="obsolete">Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch.</translation>
- </message>
- <message>
<location/>
<source>This window allows you to add, modify, or delete entries in a phrase book.</source>
<translation>Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Wörterbuch-Einträgen.</translation>
@@ -1975,18 +1722,6 @@ Zeile: %2</translation>
<translation>&amp;Einstellungen ...</translation>
</message>
<message>
- <source>&amp;New Phrase</source>
- <translation type="obsolete">&amp;Neuer Eintrag</translation>
- </message>
- <message>
- <source>Click here to remove the phrase from the phrase book.</source>
- <translation type="obsolete">Entferne den Eintrag aus dem Wörterbuch.</translation>
- </message>
- <message>
- <source>&amp;Remove Phrase</source>
- <translation type="obsolete">&amp;Entferne Eintrag</translation>
- </message>
- <message>
<location/>
<source>Click here to save the changes made.</source>
<translation>Änderungen speichern.</translation>
@@ -2028,7 +1763,7 @@ Zeile: %2</translation>
<context>
<name>PhraseView</name>
<message>
- <location filename="../tools/linguist/linguist/phraseview.cpp" line="+121"/>
+ <location filename="../tools/linguist/linguist/phraseview.cpp" line="+122"/>
<source>Insert</source>
<translation>Einfügen</translation>
</message>
@@ -2056,7 +1791,7 @@ Zeile: %2</translation>
<translation>Kompilierte Qt-Übersetzungen</translation>
</message>
<message>
- <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1279"/>
+ <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1282"/>
<source>Translation files (%1);;</source>
<translation>Übersetzungsdateien (%1);;</translation>
</message>
@@ -2077,26 +1812,11 @@ Zeile: %2</translation>
<translation>Qt Linguist</translation>
</message>
<message>
- <location filename="../tools/linguist/shared/cpp.cpp" line="+1072"/>
- <source>C++ source files</source>
- <translation>C++-Quelltextdateien</translation>
- </message>
- <message>
- <location filename="../tools/linguist/shared/java.cpp" line="+646"/>
- <source>Java source files</source>
- <translation>Java-Quelltextdateien</translation>
- </message>
- <message>
- <location filename="../tools/linguist/shared/po.cpp" line="+651"/>
+ <location filename="../tools/linguist/shared/po.cpp" line="+658"/>
<source>GNU Gettext localization files</source>
<translation>GNU-Gettext-Übersetzungsdateien</translation>
</message>
<message>
- <location filename="../tools/linguist/shared/qscript.cpp" line="+2399"/>
- <source>Qt Script source files</source>
- <translation>Qt-Skript-Quelltextdateien</translation>
- </message>
- <message>
<location filename="../tools/linguist/shared/ts.cpp" line="+752"/>
<source>Qt translation sources (format 1.1)</source>
<translation>Qt-Übersetzungsdateien (Formatversion 1.1)</translation>
@@ -2112,61 +1832,17 @@ Zeile: %2</translation>
<translation>Qt-Übersetzungsdateien (aktuelles Format)</translation>
</message>
<message>
- <location filename="../tools/linguist/shared/ui.cpp" line="+213"/>
- <source>Qt Designer form files</source>
- <translation>Formulardateien für Qt Designer</translation>
- </message>
- <message>
- <location line="+9"/>
- <source>Qt Jambi form files</source>
- <translation>Formulardateien für Qt Jambi</translation>
- </message>
- <message>
- <location filename="../tools/linguist/shared/xliff.cpp" line="+817"/>
+ <location filename="../tools/linguist/shared/xliff.cpp" line="+820"/>
<source>XLIFF localization files</source>
<translation>XLIFF-Übersetzungsdateien</translation>
</message>
<message>
- <location filename="../tools/linguist/shared/qph.cpp" line="+192"/>
+ <location filename="../tools/linguist/shared/qph.cpp" line="+183"/>
<source>Qt Linguist &apos;Phrase Book&apos;</source>
<translation>Qt-Linguist-Wörterbuch</translation>
</message>
</context>
<context>
- <name>QtWindowListMenu</name>
- <message>
- <source>Tile</source>
- <translation type="obsolete">Teilen</translation>
- </message>
- <message>
- <source>Cascade</source>
- <translation type="obsolete">Kaskadieren</translation>
- </message>
- <message>
- <source>Close</source>
- <translation type="obsolete">Schließen</translation>
- </message>
- <message>
- <source>Close All</source>
- <translation type="obsolete">Alle schließen</translation>
- </message>
-</context>
-<context>
- <name>SortedMessagesModel</name>
- <message>
- <source>Source text</source>
- <translation type="obsolete">Ursprungstext</translation>
- </message>
- <message>
- <source>Translation</source>
- <translation type="obsolete">Übersetzung</translation>
- </message>
- <message>
- <source>Index</source>
- <translation type="obsolete">Index</translation>
- </message>
-</context>
-<context>
<name>SourceCodeView</name>
<message>
<location filename="../tools/linguist/linguist/sourcecodeview.cpp" line="+70"/>
@@ -2192,10 +1868,6 @@ Zeile: %2</translation>
<translation>Statistiken</translation>
</message>
<message>
- <source>&amp;Close</source>
- <translation type="obsolete">&amp;Schließen</translation>
- </message>
- <message>
<location/>
<source>Translation</source>
<translation>Übersetzung</translation>
@@ -2232,406 +1904,8 @@ Zeile: %2</translation>
</message>
</context>
<context>
- <name>TrPreviewTool</name>
- <message>
- <source>&lt;No Translation&gt;</source>
- <translation type="obsolete">&lt;Keine Übersetzung&gt;</translation>
- </message>
- <message>
- <source>Open Forms</source>
- <translation type="obsolete">Öffne Maske</translation>
- </message>
- <message>
- <source>User interface form files (*.ui);;All files (*.*)</source>
- <translation type="obsolete">User Interface Masken Dateien (*.ui);;Alle Dateien (*.*)</translation>
- </message>
- <message>
- <source>Could not load form file(s):
-</source>
- <translation type="obsolete">Könnte Quelldateien nicht laden:
-</translation>
- </message>
- <message>
- <source>Load Translation</source>
- <translation type="obsolete">Lade Übersetzung</translation>
- </message>
- <message>
- <source>Translation files (*.qm);;All files (*.*)</source>
- <translation type="obsolete">Übersetzungsdateien (*.qm);;Alle Dateien (*.*)</translation>
- </message>
- <message>
- <source>Could not load translation file:
-</source>
- <translation type="obsolete">Konnte Übersetzungsdatei nicht laden:
-</translation>
- </message>
- <message>
- <source>Could not reload translation file(s):
-</source>
- <translation type="obsolete">Konnte Übersetzungsdateien nicht erneut laden:
-</translation>
- </message>
- <message>
- <source>Qt Translation Preview Tool: Warning</source>
- <translation type="obsolete">Qt Vorschau: Warnung</translation>
- </message>
- <message>
- <source>About </source>
- <translation type="obsolete">Info</translation>
- </message>
- <message>
- <source>Could not load form file:
-%1.</source>
- <translation type="obsolete">Konnte Maskendatei nicht laden.
-%1.</translation>
- </message>
-</context>
-<context>
- <name>TrPreviewToolClass</name>
- <message>
- <source>Qt Translation Preview Tool</source>
- <translation type="obsolete">Qt Vorschau Tool</translation>
- </message>
- <message>
- <source>&amp;View</source>
- <translation type="obsolete">&amp;Ansicht</translation>
- </message>
- <message>
- <source>&amp;Views</source>
- <translation type="obsolete">&amp;Ansichten</translation>
- </message>
- <message>
- <source>&amp;Help</source>
- <translation type="obsolete">&amp;Hilfe</translation>
- </message>
- <message>
- <source>&amp;File</source>
- <translation type="obsolete">&amp;Datei</translation>
- </message>
- <message>
- <source>Forms</source>
- <translation type="obsolete">Masken</translation>
- </message>
- <message>
- <source>&amp;Open Form...</source>
- <translation type="obsolete">&amp;Öffne Maske...</translation>
- </message>
- <message>
- <source>&amp;Load Translation...</source>
- <translation type="obsolete">&amp;Lade Übersetzung...</translation>
- </message>
- <message>
- <source>&amp;Reload Translations</source>
- <translation type="obsolete">Lade Übersetzungen &amp;neu</translation>
- </message>
- <message>
- <source>F5</source>
- <translation type="obsolete">F5</translation>
- </message>
- <message>
- <source>&amp;Close</source>
- <translation type="obsolete">&amp;Schließen</translation>
- </message>
- <message>
- <source>About</source>
- <translation type="obsolete">Info</translation>
- </message>
- <message>
- <source>About Qt</source>
- <translation type="obsolete">Über Qt</translation>
- </message>
-</context>
-<context>
- <name>TrWindow</name>
- <message>
- <source>Context</source>
- <translation type="obsolete">Kontext</translation>
- </message>
- <message>
- <source>This panel lists the source contexts.</source>
- <translation type="obsolete">Dieser Bereich zeigt die Kontexte an.</translation>
- </message>
- <message>
- <source>Strings</source>
- <translation type="obsolete">Zeichenketten</translation>
- </message>
- <message>
- <source>Phrases and guesses</source>
- <translation type="obsolete">Wörterbuch und Vorschläge</translation>
- </message>
- <message>
- <source>Source code</source>
- <translation type="obsolete">Quelltext</translation>
- </message>
- <message>
- <source>Warnings</source>
- <translation type="obsolete">Warnungen</translation>
- </message>
- <message>
- <source>MOD</source>
- <translation type="obsolete">MOD</translation>
- </message>
- <message>
- <source>Loading...</source>
- <translation type="obsolete">Lade...</translation>
- </message>
- <message>
- <source>Qt Linguist</source>
- <translation type="obsolete">Qt Linguist</translation>
- </message>
- <message>
- <source>Cannot open &apos;%1&apos;.</source>
- <translation type="obsolete">Kann &apos;%1&apos; nicht öffnen.</translation>
- </message>
- <message numerus="yes">
- <source>%n source phrase(s) loaded.</source>
- <translation type="obsolete">
- <numerusform>Einen Ursprungstext geladen.</numerusform>
- <numerusform>%n Ursprungstexte geladen.</numerusform>
- </translation>
- </message>
- <message>
- <source>Open Translation File</source>
- <translation type="obsolete">Öffne Übersetzungsdatei</translation>
- </message>
- <message>
- <source>Qt translation sources (*.ts);;XLIFF localization files (*.xlf);;All files (*)</source>
- <translation type="obsolete">Qt Übersetzungsdateien (*.ts);;Qt Übersetzungsdateien (*.ts);;Alle Dateien (*)</translation>
- </message>
- <message>
- <source>File saved.</source>
- <translation type="obsolete">Datei gespeichert.</translation>
- </message>
- <message>
- <source>Cannot save &apos;%1&apos;.</source>
- <translation type="obsolete">Kann &apos;%1&apos; nicht speichern.</translation>
- </message>
- <message>
- <source>Qt translation source (*.ts)
-XLIFF localization file (*.xlf)
-All files (*)</source>
- <translation type="obsolete">Qt Übersetzungsdateien (*.ts)
-Qt Übersetzungsdateien (*.ts)
-Alle Dateien (*)</translation>
- </message>
- <message>
- <source>Release</source>
- <translation type="obsolete">Freigeben</translation>
- </message>
- <message>
- <source>Qt message files for released applications (*.qm)
-All files (*)</source>
- <translation type="obsolete">Qt Nachrichtendateien (*.qm)
-Alle Dateien (*)</translation>
- </message>
- <message>
- <source>File created.</source>
- <translation type="obsolete">Datei erzeugt.</translation>
- </message>
- <message>
- <source>Printing...</source>
- <translation type="obsolete">Drucke...</translation>
- </message>
- <message>
- <source>Context: %1</source>
- <translation type="obsolete">Kontext: %1</translation>
- </message>
- <message>
- <source>finished</source>
- <translation type="obsolete">erledigt</translation>
- </message>
- <message>
- <source>unresolved</source>
- <translation type="obsolete">ungelöst</translation>
- </message>
- <message>
- <source>obsolete</source>
- <translation type="obsolete">veraltet</translation>
- </message>
- <message>
- <source>Printing... (page %1)</source>
- <translation type="obsolete">Drucke... (Seite %1)</translation>
- </message>
- <message>
- <source>Printing completed</source>
- <translation type="obsolete">Drucken beendet</translation>
- </message>
- <message>
- <source>Printing aborted</source>
- <translation type="obsolete">Drucken abgebrochen</translation>
- </message>
- <message>
- <source>Search wrapped.</source>
- <translation type="obsolete">Suche beginnt von oben.</translation>
- </message>
- <message>
- <source>Cannot find the string &apos;%1&apos;.</source>
- <translation type="obsolete">Kann Zeichenkette &apos;%1&apos; nicht finden.</translation>
- </message>
- <message>
- <source>Translate</source>
- <translation type="obsolete">Übersetzungen</translation>
- </message>
- <message numerus="yes">
- <source>Translated %n entries to &apos;%1&apos;</source>
- <translation type="obsolete">
- <numerusform>Ein Eintrag wurde mit &apos;%1&apos; übersetzt</numerusform>
- <numerusform>%n Einträge wurden mit &apos;%1&apos; übersetzt</numerusform>
- </translation>
- </message>
- <message>
- <source>Create New Phrase Book</source>
- <translation type="obsolete">Erzeugen eines neuen Wörterbuchs</translation>
- </message>
- <message>
- <source>Qt phrase books (*.qph)
-All files (*)</source>
- <translation type="obsolete">Qt Wörterbücher (*.qph)
-Alle Dateien (*)</translation>
- </message>
- <message>
- <source>A file called &apos;%1&apos; already exists. Please choose another name.</source>
- <translation type="obsolete">Die Datei &apos;%1&apos; existiert schon. Bitte wählen Sie einen anderen Namen.</translation>
- </message>
- <message>
- <source>Phrase book created.</source>
- <translation type="obsolete">Wörterbuch erzeugt.</translation>
- </message>
- <message>
- <source>Open Phrase Book</source>
- <translation type="obsolete">Öffne Wörterbuch</translation>
- </message>
- <message>
- <source>Qt phrase books (*.qph);;All files (*)</source>
- <translation type="obsolete">Qt Wörterbücher (*.qph);;Alle Dateien (*)</translation>
- </message>
- <message numerus="yes">
- <source>%n phrase(s) loaded.</source>
- <translation type="obsolete">
- <numerusform>Ein Wörterbucheintrag geladen.</numerusform>
- <numerusform>%n Wörterbucheinträge geladen.</numerusform>
- </translation>
- </message>
- <message>
- <source>Add to phrase book</source>
- <translation type="obsolete">Hinzufügen zum Wörterbuch</translation>
- </message>
- <message>
- <source>Adding phrase to phrasebook %1</source>
- <translation type="obsolete">Eintrag zu Wörterbuch %1 hinzufügen</translation>
- </message>
- <message>
- <source>Select phrase book to add to</source>
- <translation type="obsolete">Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden?</translation>
- </message>
- <message>
- <source>Unable to launch Qt Assistant (%1)</source>
- <translation type="obsolete">Kann Qt Assistant nicht starten (%1)</translation>
- </message>
- <message>
- <source>Version %1</source>
- <translation type="obsolete">Version %1</translation>
- </message>
- <message>
- <source> Open Source Edition</source>
- <translation type="obsolete">Open Source Edition</translation>
- </message>
- <message>
- <source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
- <translation type="obsolete">&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</translation>
- </message>
- <message>
- <source>Do you want to save &apos;%1&apos;?</source>
- <translation type="obsolete">Wollen Sie &apos;%1&apos; speichern?</translation>
- </message>
- <message>
- <source>Qt Linguist by Trolltech[*]</source>
- <translation type="obsolete">Qt Linguist von Trolltech[*]</translation>
- </message>
- <message>
- <source>%1 - %2[*]</source>
- <translation type="obsolete">%1 - %2[*]</translation>
- </message>
- <message>
- <source>Qt Linguist by Trolltech</source>
- <translation type="obsolete">Qt Linguist von Trolltech</translation>
- </message>
- <message>
- <source>No untranslated phrases left.</source>
- <translation type="obsolete">Alle Einträge sind übersetzt.</translation>
- </message>
- <message>
- <source>&amp;Window</source>
- <translation type="obsolete">&amp;Fenster</translation>
- </message>
- <message>
- <source>Minimize</source>
- <translation type="obsolete">Minimieren</translation>
- </message>
- <message>
- <source>Ctrl+M</source>
- <translation type="obsolete">Ctrl+M</translation>
- </message>
- <message>
- <source>Display the manual for %1.</source>
- <translation type="obsolete">Zeige Handbuch für %1 an.</translation>
- </message>
- <message>
- <source>Display information about %1.</source>
- <translation type="obsolete">Zeige Informationen über %1 an.</translation>
- </message>
- <message>
- <source>File</source>
- <translation type="obsolete">Datei</translation>
- </message>
- <message>
- <source>Edit</source>
- <translation type="obsolete">Bearbeiten</translation>
- </message>
- <message>
- <source>Translation</source>
- <translation type="obsolete">Übersetzung</translation>
- </message>
- <message>
- <source>Validation</source>
- <translation type="obsolete">Validierung</translation>
- </message>
- <message>
- <source>Help</source>
- <translation type="obsolete">Hilfe</translation>
- </message>
- <message>
- <source>Cannot read from phrase book &apos;%1&apos;.</source>
- <translation type="obsolete">Kann Wörterbuch &apos;%1&apos; nicht lesen.</translation>
- </message>
- <message>
- <source>Close this phrase book.</source>
- <translation type="obsolete">Schließe dieses Wörterbuch.</translation>
- </message>
- <message>
- <source>Allow you to add, modify, or delete phrases of this phrase book.</source>
- <translation type="obsolete">Erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch.</translation>
- </message>
- <message>
- <source>Print the entries of the phrase book.</source>
- <translation type="obsolete">Drucke die Einträge des Wörterbuchs.</translation>
- </message>
- <message>
- <source>Cannot create phrase book &apos;%1&apos;.</source>
- <translation type="obsolete">Kann Wörterbuch &apos;%1&apos; nicht erzeugen.</translation>
- </message>
- <message>
- <source>Do you want to save phrasebook &apos;%1&apos;?</source>
- <translation type="obsolete">Wollen Sie das Wörterbuch &apos;%1&apos; speichern?</translation>
- </message>
-</context>
-<context>
<name>TranslateDialog</name>
<message>
- <source>Qt Linguist</source>
- <translation type="obsolete">Qt Linguist</translation>
- </message>
- <message>
<location filename="../tools/linguist/linguist/translatedialog.ui"/>
<source>This window allows you to search for some text in the translation source file.</source>
<translation>Dieses Fenster erlaubt die Suche in der Übersetzungsdatei.</translation>
@@ -2703,25 +1977,6 @@ Alle Dateien (*)</translation>
</message>
</context>
<context>
- <name>TranslationSettings</name>
- <message>
- <source>Qt Linguist - Translation file settings</source>
- <translation type="obsolete">Qt Linguist - Einstellungen der Übersetzungsdatei</translation>
- </message>
- <message>
- <source>Target language</source>
- <translation type="obsolete">Zielsprache</translation>
- </message>
- <message>
- <source>Language</source>
- <translation type="obsolete">Sprache</translation>
- </message>
- <message>
- <source>Country/Region</source>
- <translation type="obsolete">Land/Region</translation>
- </message>
-</context>
-<context>
<name>TranslationSettingsDialog</name>
<message>
<location filename="../tools/linguist/linguist/translationsettingsdialog.cpp" line="+68"/>
@@ -2755,47 +2010,4 @@ Alle Dateien (*)</translation>
<translation>Zielsprache</translation>
</message>
</context>
-<context>
- <name>databaseTranslationDialog</name>
- <message>
- <source>Qt Linguist - Batch Translation</source>
- <translation type="obsolete">Qt Linguist - Automatische Übersetzung</translation>
- </message>
- <message>
- <source>Options</source>
- <translation type="obsolete">Optionen</translation>
- </message>
- <message>
- <source>Only translate entries with no translation</source>
- <translation type="obsolete">Übersetze nur Einträge ohne bisherige Übersetzung</translation>
- </message>
- <message>
- <source>Set translated entries to finished</source>
- <translation type="obsolete">Markiere Übersetzung als erledigt</translation>
- </message>
- <message>
- <source>Phrase book preference</source>
- <translation type="obsolete">Wörterbücher</translation>
- </message>
- <message>
- <source>Move up</source>
- <translation type="obsolete">Nach oben</translation>
- </message>
- <message>
- <source>Move down</source>
- <translation type="obsolete">Nach unten</translation>
- </message>
- <message>
- <source>The batch translator will search through the selected phrasebooks in the order given above.</source>
- <translation type="obsolete">Der automatische Übersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen.</translation>
- </message>
- <message>
- <source>&amp;Run</source>
- <translation type="obsolete">&amp;Ausführen</translation>
- </message>
- <message>
- <source>&amp;Cancel</source>
- <translation type="obsolete">&amp;Abbrechen</translation>
- </message>
-</context>
</TS>
diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts
index 9d48661..8e6cb85 100644
--- a/translations/qt_help_de.ts
+++ b/translations/qt_help_de.ts
@@ -111,8 +111,9 @@
<context>
<name>QHelpDBReader</name>
<message>
- <location filename="../tools/assistant/lib/qhelpdbreader.cpp" line="+95"/>
+ <location filename="../tools/assistant/lib/qhelpdbreader.cpp" line="+98"/>
<source>Cannot open database &apos;%1&apos; &apos;%2&apos;: %3</source>
+ <extracomment>The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string</extracomment>
<translation>Kann Datenbank nicht öffnen: &apos;%1&apos; &apos;%2&apos;: %3</translation>
</message>
</context>
@@ -200,17 +201,22 @@
<translation>Dateien einfügen...</translation>
</message>
<message>
- <location line="+41"/>
+ <location line="+42"/>
+ <source>The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it.</source>
+ <translation>Die referenzierte Datei %1 muss sich im Verzeichnis %2 oder in einem Unterverzeichnis davon befinden. Sie wird übersprungen.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
<source>The file %1 does not exist! Skipping it.</source>
<translation>Die Datei %1 existiert nicht. Wird übersprungen.</translation>
</message>
<message>
- <location line="+7"/>
+ <location line="+6"/>
<source>Cannot open file %1! Skipping it.</source>
<translation>Die Datei %1 kann nicht geöffnet werden. Wird übersprungen.</translation>
</message>
<message>
- <location line="+134"/>
+ <location line="+131"/>
<source>The filter %1 is already registered!</source>
<translation>Der Filter %1 ist bereits registriert.</translation>
</message>
@@ -243,17 +249,27 @@
<context>
<name>QHelpSearchQueryWidget</name>
<message>
- <location filename="../tools/assistant/lib/qhelpsearchquerywidget.cpp" line="+200"/>
+ <location filename="../tools/assistant/lib/qhelpsearchquerywidget.cpp" line="+411"/>
<source>Search for:</source>
<translation>Suche nach:</translation>
</message>
<message>
+ <location line="+5"/>
+ <source>Previous search</source>
+ <translation>Vorige Suche</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Next search</source>
+ <translation>Nächste Suche</translation>
+ </message>
+ <message>
<location line="+2"/>
<source>Search</source>
<translation>Suche</translation>
</message>
<message>
- <location line="+16"/>
+ <location line="+20"/>
<source>Advanced search</source>
<translation>Erweiterte Suche</translation>
</message>
@@ -263,22 +279,22 @@
<translation>Worte &lt;B&gt;ähnlich&lt;/B&gt; zu:</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>&lt;B&gt;without&lt;/B&gt; the words:</source>
<translation>&lt;B&gt;ohne&lt;/B&gt; die Wörter:</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>with &lt;B&gt;exact phrase&lt;/B&gt;:</source>
<translation>mit der &lt;B&gt;genauen Wortgruppe&lt;/B&gt;:</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>with &lt;B&gt;all&lt;/B&gt; of the words:</source>
<translation>mit &lt;B&gt;allen&lt;/B&gt; Wörtern:</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>with &lt;B&gt;at least one&lt;/B&gt; of the words:</source>
<translation>mit &lt;B&gt;irgendeinem&lt;/B&gt; der Wörter:</translation>
</message>
@@ -307,7 +323,7 @@
<translation>Ohne Titel</translation>
</message>
<message>
- <location filename="../tools/assistant/lib/qhelpprojectdata.cpp" line="+80"/>
+ <location filename="../tools/assistant/lib/qhelpprojectdata.cpp" line="+85"/>
<source>Unknown token.</source>
<translation>Unbekanntes Token.</translation>
</message>
@@ -347,7 +363,7 @@
<translation>Fehlendes Attribut in Schlagwort in Zeile %1.</translation>
</message>
<message>
- <location line="+83"/>
+ <location line="+123"/>
<source>The input file %1 could not be opened!</source>
<translation>Die Eingabe-Datei %1 kann nicht geöffnet werden.</translation>
</message>