summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/createpackage.pl120
-rwxr-xr-xconfigure4
-rw-r--r--demos/boxes/glbuffers.cpp2
-rw-r--r--demos/qtdemo/xml/examples.xml2
-rw-r--r--doc/src/examples/animatedtiles.qdoc50
-rw-r--r--doc/src/examples/appchooser.qdoc52
-rw-r--r--doc/src/examples/easing.qdoc51
-rw-r--r--doc/src/examples/rogue.qdoc16
-rw-r--r--doc/src/examples/states.qdoc50
-rw-r--r--doc/src/frameworks-technologies/plugins-howto.qdoc14
-rw-r--r--doc/src/getting-started/examples.qdoc4
-rw-r--r--doc/src/images/animatedtiles-example.pngbin0 -> 148019 bytes
-rw-r--r--doc/src/images/appchooser-example.pngbin0 -> 29447 bytes
-rw-r--r--doc/src/images/easing-example.pngbin0 -> 23843 bytes
-rw-r--r--doc/src/images/states-example.pngbin0 -> 34844 bytes
-rw-r--r--doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp15
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp16
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h2
-rw-r--r--src/corelib/global/qglobal.h2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp2
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp42
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp7
-rw-r--r--src/gui/kernel/qgesture.cpp10
-rw-r--r--src/gui/kernel/qgesture.h2
-rw-r--r--src/gui/painting/qdrawhelper.cpp11
-rw-r--r--src/gui/styles/qcommonstyle.cpp56
-rw-r--r--src/gui/styles/qmotifstyle.cpp3
-rw-r--r--src/gui/styles/qplastiquestyle.cpp5
-rw-r--r--src/gui/styles/qwindowsstyle.cpp3
-rw-r--r--src/gui/text/qcssparser.cpp2
-rw-r--r--src/opengl/qgl.cpp37
-rw-r--r--src/opengl/qgl.h2
-rw-r--r--src/opengl/qglframebufferobject.cpp109
-rw-r--r--src/opengl/qglframebufferobject.h4
-rw-r--r--src/script/api/qscriptengineagent.cpp4
-rw-r--r--src/sql/drivers/db2/qsql_db2.cpp5
-rw-r--r--src/src.pro3
-rw-r--r--src/svg/qsvghandler.cpp23
-rw-r--r--src/testlib/qtestmouse.h2
-rw-r--r--tests/auto/network-settings.h9
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp111
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp10
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp6
-rw-r--r--tests/auto/qgl/tst_qgl.cpp113
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp20
-rw-r--r--tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp5
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp7
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp51
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp5
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp61
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp16
-rw-r--r--tests/benchmarks/benchmarks.pro1
-rw-r--r--tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp158
-rw-r--r--tests/benchmarks/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro13
65 files changed, 1096 insertions, 249 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 2e31544..1a83abb 100644
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -52,42 +52,70 @@ use strict;
use Getopt::Long;
# Use file name parsing module
use File::Basename;
+# Use File::Spec services mainly rel2abs
+use File::Spec;
+# use CWD abs_bath, which is exported only on request
+use Cwd 'abs_path';
+
sub Usage() {
- print "\n";
- print "==========================================================================================\n";
- print "Convenience script for creating signed packages you can install on your phone.\n";
- print "\n";
- print "Usage: createpackage.pl [-i] templatepkg target-platform [certificate key [passphrase]]\n";
- print "\n";
- print "Where parameters are as follows:\n";
- print " [-i|install] = Install the package right away using PC suite\n";
- print " [-p|preprocess] = Only preprocess the template .pkg file.\n";
- print " templatepkg = Name of .pkg file template\n";
- print " target = Either debug or release\n";
- print " platform = One of the supported platform\n";
- print " winscw | gcce | armv5 | armv6 | armv7\n";
- print " certificate = The certificate file used for signing\n";
- print " key = The certificate's private key file\n";
- print " passphrase = The certificate's private key file's passphrase\n";
- print "\n";
- print "For example:\n";
- print " createpackage.pl fluidlauncher_template.pkg release-armv5\n";
- print "\n";
- print "If no certificate and key files are provided, either a RnD certificate or\n";
- print "a self-signed certificate from Qt installation root directory is used.\n";
- print "\n";
- print "==========================================================================================\n";
+ print <<ENDUSAGESTRING;
+
+==============================================================================================
+Convenience script for creating signed packages you can install on your phone.
+
+Usage: createpackage.pl [options] templatepkg target-platform [certificate key [passphrase]]
+
+Where supported optiobns are as follows:
+ [-i|install] = Install the package right away using PC suite
+ [-p|preprocess] = Only preprocess the template .pkg file.
+ [-c|certfile=<file>] = The file containing certificate information for signing.
+ The file can have several certificates, each specified in
+ separate line. The certificate, key and passphrase in line
+ must be ';' separated. Lines starting with '#' are treated
+ as a comments. Also empty lines are ignored. The paths in
+ <file> can be absolute or relative to <file>.
+Where parameters are as follows:
+ templatepkg = Name of .pkg file template
+ target = Either debug or release
+ platform = One of the supported platform
+ winscw | gcce | armv5 | armv6 | armv7
+ certificate = The certificate file used for signing
+ key = The certificate's private key file
+ passphrase = The certificate's private key file's passphrase
+
+Example:
+ createpackage.pl fluidlauncher_template.pkg release-armv5
+
+Example with certfile:
+ createpackage.pl -c=mycerts.txt fluidlauncher_template.pkg release-armv5
+
+ Content of 'mycerts.txt' must be something like this:
+ # This is comment line, also the empty lines are ignored
+ rd.cer;rd-key.pem
+ .\\cert\\mycert.cer;.\\cert\\mykey.key;yourpassword
+ X:\\QtS60\\selfsigned.cer;X:\\QtS60\\selfsigned.key
+
+If no certificate and key files are provided, either a RnD certificate or
+a self-signed certificate from Qt installation root directory is used.
+==============================================================================================
+
+ENDUSAGESTRING
+
exit();
}
# Read given options
my $install = "";
my $preprocessonly = "";
-unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly)){
+my $certfile = "";
+
+unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly, 'c|certfile=s' => \$certfile)){
Usage();
}
+my $certfilepath = abs_path(dirname($certfile));
+
# Read params to variables
my $templatepkg = $ARGV[0];
my $targetplatform = lc $ARGV[1];
@@ -155,6 +183,32 @@ if (length($certificate)) {
}
}
+# Read the certificates from file to two dimensional array
+my @certificates;
+if (length($certfile)) {
+ open CERTFILE, "<$certfile" or die $!;
+ while(<CERTFILE>){
+ s/#.*//; # ignore comments by erasing them
+ next if /^(\s)*$/; # skip blank lines
+ chomp; # remove trailing newline characters
+ my @certinfo = split(';', $_); # split row to certinfo
+
+ # Trim spaces
+ for(@certinfo) {
+ s/^\s+//;
+ s/\s+$//;
+ }
+
+ # Do some validation
+ unless(scalar(@certinfo) >= 2 && scalar(@certinfo) <= 3 && length($certinfo[0]) && length($certinfo[1]) ) {
+ print "\nError: $certfile line '$_' does not contain valid information!\n";
+ Usage();
+ }
+
+ push @certificates, [@certinfo]; # push data to two dimensional array
+ }
+}
+
# Remove any existing .sis packages
unlink $unsigned_sis_name;
unlink $signed_sis_name;
@@ -180,15 +234,27 @@ if ($preprocessonly) {
exit;
}
-# Create and sign SIS
+# Create SIS.
system ("makesis $pkgoutput $unsigned_sis_name");
+
+# Sign SIS with certificate info given as an argument.
system ("signsis $unsigned_sis_name $signed_sis_name $certificate $key $passphrase");
# Check if creating signed SIS Succeeded
stat($signed_sis_name);
if( -e _ ) {
- print ("\nSuccessfully created $signed_sis_name using certificate $certtext!\n");
+ print ("\nSuccessfully created $signed_sis_name using certificate: $certtext!\n");
+ # Sign with additional certificates & keys
+ for my $row ( @certificates ) {
+ # Get certificate absolute file names, relative paths are relative to certfilepath
+ my $abscert = File::Spec->rel2abs( $row->[0], $certfilepath);
+ my $abskey = File::Spec->rel2abs( $row->[1], $certfilepath);
+
+ system ("signsis $signed_sis_name $signed_sis_name $abscert $abskey $row->[2]");
+ print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n");
+ }
+
# remove temporary pkg and unsigned sis
unlink $pkgoutput;
unlink $unsigned_sis_name;
diff --git a/configure b/configure
index 9ef0b45..70c91c2 100755
--- a/configure
+++ b/configure
@@ -3874,7 +3874,7 @@ elif [ "$Edition" = "OpenSource" ]; then
while true; do
echo "You are licensed to use this software under the terms of"
echo "the Lesser GNU General Public License (LGPL) versions 2.1."
- if [ -e "$relpath/LICENSE.GPL3" ]; then
+ if [ -f "$relpath/LICENSE.GPL3" ]; then
echo "You are also licensed to use this software under the terms of"
echo "the GNU General Public License (GPL) versions 3."
affix="either"
@@ -3886,7 +3886,7 @@ elif [ "$Edition" = "OpenSource" ]; then
echo "You have already accepted the terms of the $LicenseType license."
acceptance=yes
else
- if [ -e "$relpath/LICENSE.GPL3" ]; then
+ if [ -f "$relpath/LICENSE.GPL3" ]; then
echo "Type '3' to view the GNU General Public License version 3."
fi
echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
diff --git a/demos/boxes/glbuffers.cpp b/demos/boxes/glbuffers.cpp
index a3d26f6..3b16d17 100644
--- a/demos/boxes/glbuffers.cpp
+++ b/demos/boxes/glbuffers.cpp
@@ -372,7 +372,7 @@ void GLRenderTargetCube::getViewMatrix(QMatrix4x4& mat, int face)
{-1.0f, -1.0f, +1.0f},
};
- memset(mat.data(), 0, sizeof(float) * 16);
+ mat.fill(0.0f);
for (int i = 0; i < 3; ++i)
mat(i, perm[face][i]) = signs[face][i];
mat(3, 3) = 1.0f;
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 77006c2..b545e1d 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -25,7 +25,7 @@
<example filename="appchooser" name="Appchooser" />
<example filename="easing" name="Easing Curves" />
<example filename="moveblocks" name="Moving Blocks" />
- <example filename="states" name="UI States" />
+ <example filename="states" name="States" />
<example filename="stickman" name="Stickman" />
</category>
<category dirname="qtconcurrent" name="Concurrent Programming">
diff --git a/doc/src/examples/animatedtiles.qdoc b/doc/src/examples/animatedtiles.qdoc
new file mode 100644
index 0000000..87f1f95
--- /dev/null
+++ b/doc/src/examples/animatedtiles.qdoc
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example animation/animatedtiles
+ \title Animated Tiles Example
+
+ The Animated Tiles example animates items in a graphics scene.
+
+ \image animatedtiles-example.png
+*/
+
diff --git a/doc/src/examples/appchooser.qdoc b/doc/src/examples/appchooser.qdoc
new file mode 100644
index 0000000..540291e
--- /dev/null
+++ b/doc/src/examples/appchooser.qdoc
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example animation/appchooser
+ \title Application Chooser Example
+
+ The Application Chooser example shows how to use the Qt state
+ machine and the animation framework to select between
+ applications.
+
+ \image appchooser-example.png
+
+*/
diff --git a/doc/src/examples/easing.qdoc b/doc/src/examples/easing.qdoc
new file mode 100644
index 0000000..20cccd2
--- /dev/null
+++ b/doc/src/examples/easing.qdoc
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example animation/easing
+ \title Easing Curves Example
+
+ The Easing Curves example shows how to use easing curves to
+ control the speed of an animation.
+
+ \image easing-example.png
+
+*/
diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc
index 8f97696..1327df6 100644
--- a/doc/src/examples/rogue.qdoc
+++ b/doc/src/examples/rogue.qdoc
@@ -52,8 +52,8 @@
\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,
+ 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
@@ -61,12 +61,12 @@
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
+ Most games have commands that need more than one key press (we
+ think of consecutive presses, i.e., not of several keys being
+ pressed at the same time). 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
diff --git a/doc/src/examples/states.qdoc b/doc/src/examples/states.qdoc
new file mode 100644
index 0000000..c17abd0
--- /dev/null
+++ b/doc/src/examples/states.qdoc
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example animation/states
+ \title States Example
+
+ The States example shows how to use the Qt state machine to play
+ animations.
+
+ \image states-example.png
+*/
diff --git a/doc/src/frameworks-technologies/plugins-howto.qdoc b/doc/src/frameworks-technologies/plugins-howto.qdoc
index 78e5c20..43bc695 100644
--- a/doc/src/frameworks-technologies/plugins-howto.qdoc
+++ b/doc/src/frameworks-technologies/plugins-howto.qdoc
@@ -226,6 +226,20 @@
located to your applications root folder (i.e., do not include the
\c plugins directory).
+ \note In Symbian all binaries must be located in the directory \\sys\\bin,
+ so each Qt plugin has a stub with the same basename as the plugin dll
+ and suffix ".qtplugin" to make Qt extension plugins work similarly to
+ other platforms.
+ When trying to locate the plugin, Qt actually looks for the stub
+ instead of the plugin binary. While plugin stub files have the
+ suffix ".qtplugin", they can still be loaded also by specifying a filename
+ with the normal library suffix ".dll" for QPluginLoader, so normally application
+ developer doesn't need to care about the different suffix of the stub.
+ Because of the way applications can be installed
+ on ROM or various other drives in Symbian, Qt looks for the stub from
+ the same directory on all available drives if it is not located in the given
+ directory when loading a plugin.
+
For more information about deployment,
see the \l {Deploying Qt Applications} and \l {Deploying Plugins}
documentation.
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index b2a9997..0639bf0 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -1045,7 +1045,11 @@
\image animation-examples.png Animation
\list
+ \o \l{animation/animatedtiles}{Animated Tiles}
+ \o \l{animation/appchooser}{Application Chooser}
+ \o \l{animation/easing}{Easing Curves}
\o \l{animation/moveblocks}{Move Blocks}\raisedaster
+ \o \l{animation/states}{States}
\o \l{animation/stickman}{Stick man}\raisedaster
\endlist
*/
diff --git a/doc/src/images/animatedtiles-example.png b/doc/src/images/animatedtiles-example.png
new file mode 100644
index 0000000..082ac57
--- /dev/null
+++ b/doc/src/images/animatedtiles-example.png
Binary files differ
diff --git a/doc/src/images/appchooser-example.png b/doc/src/images/appchooser-example.png
new file mode 100644
index 0000000..885476e
--- /dev/null
+++ b/doc/src/images/appchooser-example.png
Binary files differ
diff --git a/doc/src/images/easing-example.png b/doc/src/images/easing-example.png
new file mode 100644
index 0000000..de48667
--- /dev/null
+++ b/doc/src/images/easing-example.png
Binary files differ
diff --git a/doc/src/images/states-example.png b/doc/src/images/states-example.png
new file mode 100644
index 0000000..f87b99b
--- /dev/null
+++ b/doc/src/images/states-example.png
Binary files differ
diff --git a/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp b/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp
new file mode 100644
index 0000000..128799f
--- /dev/null
+++ b/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp
@@ -0,0 +1,15 @@
+//! [simple state machine]
+QPushButton button;
+
+QStateMachine machine;
+QState *s1 = new QState();
+s1->assignProperty(&button, "text", "Click me");
+
+QFinalState *s2 = new QFinalState();
+s1->addTransition(&button, SIGNAL(clicked()), s2);
+
+machine.addState(s1);
+machine.addState(s2);
+machine.setInitialState(s1);
+machine.start();
+//! [simple state machine]
diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
index eeeac6f..594c4dd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
+++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
@@ -32,6 +32,7 @@
#include "MacroAssembler.h"
#include "Opcode.h"
#include "Structure.h"
+#include "StructureChain.h"
#include <wtf/VectorTraits.h>
#define POLYMORPHIC_LIST_CACHE_SIZE 8
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
index 4a33e67..da541c5 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
@@ -285,6 +285,11 @@ void JIT::emit_op_tear_off_arguments(Instruction*)
void JIT::emit_op_ret(Instruction* currentInstruction)
{
+#ifdef QT_BUILD_SCRIPT_LIB
+ JITStubCall stubCall(this, JITStubs::cti_op_debug_return);
+ stubCall.addArgument(Imm32(currentInstruction[1].u.operand));
+ stubCall.call();
+#endif
// We could JIT generate the deref, only calling out to C when the refcount hits zero.
if (m_codeBlock->needsFullScopeChain())
JITStubCall(this, JITStubs::cti_op_ret_scopeChain).call();
@@ -686,6 +691,7 @@ void JIT::emit_op_catch(Instruction* currentInstruction)
emitPutVirtualRegister(currentInstruction[1].u.operand);
#ifdef QT_BUILD_SCRIPT_LIB
JITStubCall stubCall(this, JITStubs::cti_op_debug_catch);
+ stubCall.addArgument(Imm32(currentInstruction[1].u.operand));
stubCall.call();
#endif
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index 0eb0799..0a5eb07 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -2747,9 +2747,23 @@ DEFINE_STUB_FUNCTION(void, op_debug_catch)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) {
- debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID());
+ JSValue exceptionValue = callFrame->r(stackFrame.args[0].int32()).jsValue();
+ DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
+ debugger->exceptionCatch(debuggerCallFrame, callFrame->codeBlock()->ownerNode()->sourceID());
}
}
+
+DEFINE_STUB_FUNCTION(void, op_debug_return)
+{
+ STUB_INIT_STACK_FRAME(stackFrame);
+ CallFrame* callFrame = stackFrame.callFrame;
+ if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) {
+ JSValue returnValue = callFrame->r(stackFrame.args[0].int32()).jsValue();
+ intptr_t sourceID = callFrame->codeBlock()->ownerNode()->sourceID();
+ debugger->functionExit(returnValue, sourceID);
+ }
+}
+
#endif
DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
index 60bf64a..325c3fd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
@@ -223,6 +223,7 @@ namespace JITStubs { extern "C" {
void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION);
#ifdef QT_BUILD_SCRIPT_LIB
void JIT_STUB cti_op_debug_catch(STUB_ARGS_DECLARATION);
+ void JIT_STUB cti_op_debug_return(STUB_ARGS_DECLARATION);
#endif
void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_jmp_scopes(STUB_ARGS_DECLARATION);
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
index dc11fee..98e9b68 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
@@ -27,6 +27,7 @@
#include "NativeFunctionWrapper.h"
#include "NumberPrototype.h"
#include "StringPrototype.h"
+#include "StructureChain.h"
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
index b4382f4..67ee9c8 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
@@ -24,6 +24,7 @@
#include "CallFrame.h"
#include "Identifier.h"
#include "Structure.h"
+#include "StructureChain.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
index 0de03a3..dcd4e50 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
@@ -30,7 +30,6 @@
#include "JSType.h"
#include "JSValue.h"
#include "PropertyMapHashTable.h"
-#include "StructureChain.h"
#include "StructureTransitionTable.h"
#include "TypeInfo.h"
#include "UString.h"
@@ -47,6 +46,7 @@ namespace JSC {
class PropertyNameArray;
class PropertyNameArrayData;
+ class StructureChain;
class Structure : public RefCounted<Structure> {
public:
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
index 85049b1..acebc86 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "StructureChain.h"
+#include "Structure.h"
#include "JSObject.h"
#include "Structure.h"
@@ -46,6 +47,11 @@ StructureChain::StructureChain(Structure* head)
m_vector[i] = 0;
}
+PassRefPtr<StructureChain> StructureChain::create(Structure* head)
+{
+ return adoptRef(new StructureChain(head));
+}
+
bool StructureChain::isCacheable() const
{
uint32_t i = 0;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
index c48749d..5990e17 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
@@ -37,7 +37,7 @@ namespace JSC {
class StructureChain : public RefCounted<StructureChain> {
public:
- static PassRefPtr<StructureChain> create(Structure* head) { return adoptRef(new StructureChain(head)); }
+ static PassRefPtr<StructureChain> create(Structure* head);
RefPtr<Structure>* head() { return m_vector.get(); }
bool isCacheable() const;
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index e1e4ba3..fa37d55 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -501,7 +501,7 @@
#endif
#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !PLATFORM(QNX) \
- && !PLATFORM(SYMBIAN) && !COMPILER(RVCT) && !PLATFORM(AIX)
+ && !PLATFORM(SYMBIAN) && !COMPILER(RVCT) && !PLATFORM(AIX) && !PLATFORM(HPUX)
#define HAVE_TM_GMTOFF 1
#define HAVE_TM_ZONE 1
#define HAVE_TIMEGM 1
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index a2c532f..7285f69 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1364,7 +1364,7 @@ inline void qt_noop() {}
#ifdef QT_BOOTSTRAPPED
# define QT_NO_EXCEPTIONS
#endif
-#if defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)
+#if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)
# define QT_NO_EXCEPTIONS
#endif
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 022211c..50b4af7 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -731,6 +731,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
}
QAbstractFileEngine::FileFlags ret = 0;
+ if (type & FlagsMask)
+ ret |= LocalDiskFlag;
bool exists = d->doStat();
if (!exists && !d->isSymlink())
return ret;
@@ -796,7 +798,6 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
}
}
if (type & FlagsMask) {
- ret |= LocalDiskFlag;
if (exists)
ret |= ExistsFlag;
#if defined(Q_OS_SYMBIAN)
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 9c308a3..c6ac6d4 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -1021,6 +1021,8 @@ void QEventDispatcherWin32::closingDown()
// clean up any timers
for (int i = 0; i < d->timerVec.count(); ++i)
d->unregisterTimer(d->timerVec.at(i), true);
+ d->timerVec.clear();
+ d->timerDict.clear();
}
bool QEventDispatcherWin32::event(QEvent *e)
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index f562fb3..a5cdd45 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -78,13 +78,13 @@
QT_BEGIN_NAMESPACE
/*!
- \class QStateMachine
- \reentrant
+ \class QStateMachine
+ \reentrant
- \brief The QStateMachine class provides a hierarchical finite state machine.
+ \brief The QStateMachine class provides a hierarchical finite state machine.
- \since 4.6
- \ingroup statemachine
+ \since 4.6
+ \ingroup statemachine
QStateMachine is based on the concepts and notation of
\l{Statecharts: A visual formalism for complex
@@ -128,21 +128,7 @@ QT_BEGIN_NAMESPACE
The following snippet shows a state machine that will finish when a button
is clicked:
- \code
- QPushButton button;
-
- QStateMachine machine;
- QState *s1 = new QState();
- s1->assignProperty(&button, "text", "Click me");
-
- QFinalState *s2 = new QFinalState();
- s1->addTransition(&button, SIGNAL(clicked()), s2);
-
- machine.addState(s1);
- machine.addState(s2);
- machine.setInitialState(s1);
- machine.start();
- \endcode
+ \snippet doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp simple state machine
This code example uses QState, which inherits QAbstractState. The
QState class provides a state that you can use to set properties
@@ -160,17 +146,7 @@ QT_BEGIN_NAMESPACE
no error state applies to the erroneous state, the machine will stop
executing and an error message will be printed to the console.
- \omit This stuff will be moved elsewhere
-This is
- typically used in conjunction with \l{Signals and Slots}{signals}; the
- signals determine the flow of the state graph, whereas the states' property
- assignments and method invocations are the actions.
-
- The postEvent() function posts an event to the state machine. This is useful
- when you are using custom events to trigger transitions.
- \endomit
-
- \sa QAbstractState, QAbstractTransition, QState, {The State Machine Framework}
+ \sa QAbstractState, QAbstractTransition, QState, {The State Machine Framework}
*/
/*!
@@ -1748,6 +1724,10 @@ bool QStateMachine::isRunning() const
transition to the initial state. When a final top-level state (QFinalState)
is entered, the machine will emit the finished() signal.
+ \note A state machine will not run without a running event loop, such as
+ the main application event loop started with QCoreApplication::exec() or
+ QApplication::exec().
+
\sa started(), finished(), stop(), initialState()
*/
void QStateMachine::start()
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index eae3e63..7023e9e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -934,7 +934,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
QGraphicsItem *lastSubFocusItem = subFocusItem;
- if (subFocusItem) {
+ if (subFocusItem && !inDestructor) {
// Update the child focus chain; when reparenting an item that has a
// focus child, ensure that that focus child clears its focus child
// chain from our parents before it's reparented.
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index ea98cb2..52529ff 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1537,8 +1537,7 @@ void QAbstractItemView::mousePressEvent(QMouseEvent *event)
QPoint offset = d->offset();
if ((command & QItemSelectionModel::Current) == 0)
d->pressedPosition = pos + offset;
-
- if (d->pressedPosition == QPoint(-1, -1))
+ else if (!indexAt(d->pressedPosition).isValid())
d->pressedPosition = visualRect(currentIndex()).center() + offset;
if (edit(index, NoEditTriggers, event))
@@ -2089,8 +2088,8 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
// note that we don't check if the new current index is enabled because moveCursor() makes sure it is
if (command & QItemSelectionModel::Current) {
d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate);
- if (d->pressedPosition == QPoint(-1, -1))
- d->pressedPosition = visualRect(oldCurrent).center();
+ if (!indexAt(d->pressedPosition).isValid())
+ d->pressedPosition = visualRect(oldCurrent).center() + d->offset();
QRect rect(d->pressedPosition - d->offset(), visualRect(newCurrent).center());
setSelection(rect, command);
} else {
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 7831893..32502db 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -131,9 +131,9 @@ private:
about the gesture is contained in the signal sender object.
*/
-/*! \fn void QGesture::cancelled()
+/*! \fn void QGesture::canceled()
- The signal is emitted when the gesture is cancelled, for example the
+ The signal is emitted when the gesture is canceled, for example the
reset() function is called while the gesture was in the process of
emitting a triggered() signal. Extended information about the
gesture is contained in the sender object.
@@ -230,7 +230,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(), canceled()
*/
void QGesture::updateState(Qt::GestureState state)
{
@@ -258,7 +258,7 @@ void QGesture::updateState(Qt::GestureState state)
else if (state == Qt::GestureFinished)
emit finished();
else if (state == Qt::NoGesture)
- emit cancelled();
+ emit canceled();
if (state == Qt::GestureFinished) {
// gesture is finished, so we reset the internal state.
@@ -301,7 +301,7 @@ QGraphicsItem* QGesture::graphicsItem() const
Resets the internal state of the gesture. This function might be called by
the filterEvent() implementation in a derived class, or by the user to
cancel a gesture. The base class implementation calls
- updateState(Qt::NoGesture) which emits the cancelled()
+ updateState(Qt::NoGesture) which emits the canceled()
signal if the state() of the gesture indicated it was active.
*/
void QGesture::reset()
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index ee6f8b3..23c64b2 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -90,7 +90,7 @@ Q_SIGNALS:
void started();
void triggered();
void finished();
- void cancelled();
+ void canceled();
private:
friend class QWidget;
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ab192c5..e9b1bd3 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -4953,15 +4953,18 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
if (modeSource && coverage == 255) {
// Copy the first texture block
- length = image_width;
+ length = qMin(image_width,length);
+ int tx = x;
while (length) {
int l = qMin(image_width - sx, length);
if (buffer_size < l)
l = buffer_size;
- DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
+ DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + tx;
const SRC *src = (SRC*)data->texture.scanLine(sy) + sx;
+
qt_memconvert<DST, SRC>(dest, src, l);
length -= l;
+ tx += l;
sx = 0;
}
@@ -4971,8 +4974,8 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
// We are dealing with one block of data
// - More likely to fit in the cache
// - can use memcpy
- int copy_image_width = image_width;
- length = spans->len - image_width;
+ int copy_image_width = qMin(image_width, int(spans->len));
+ length = spans->len - copy_image_width;
DST *src = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
DST *dest = src + copy_image_width;
while (copy_image_width < length) {
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 7fefb19..817401e 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -5126,6 +5126,9 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = Qt::LinksAccessibleByMouse;
break;
case SH_DialogButtonBox_ButtonsHaveIcons:
+#ifdef Q_WS_X11
+ return true;
+#endif
ret = 0;
break;
case SH_SpellCheckUnderlineStyle:
@@ -5222,6 +5225,19 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
switch (sp) {
+ case SP_DialogYesButton:
+ case SP_DialogOkButton:
+ pixmap = QIcon::fromTheme(QLatin1String("dialog-ok")).pixmap(16);
+ break;
+ case SP_DialogApplyButton:
+ pixmap = QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(16);
+ break;
+ case SP_DialogDiscardButton:
+ pixmap = QIcon::fromTheme(QLatin1String("edit-delete")).pixmap(16);
+ break;
+ case SP_DialogCloseButton:
+ pixmap = QIcon::fromTheme(QLatin1String("dialog-close")).pixmap(16);
+ break;
case SP_DirHomeIcon:
pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16);
break;
@@ -5336,13 +5352,15 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
case SP_DialogHelpButton:
pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24);
break;
+ case SP_DialogNoButton:
case SP_DialogCancelButton:
- pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(24);
+ pixmap = QIcon::fromTheme(QLatin1String("dialog-cancel"),
+ QIcon::fromTheme(QLatin1String("process-stop"))).pixmap(24);
break;
case SP_DialogSaveButton:
pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24);
break;
- case SP_FileLinkIcon:
+ case SP_FileLinkIcon:
pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16);
if (!pixmap.isNull()) {
QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16);
@@ -5530,6 +5548,25 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons
case SP_DirOpenIcon:
icon = QIcon::fromTheme(QLatin1String("folder-open"));
break;
+ case SP_DialogSaveButton:
+ icon = QIcon::fromTheme(QLatin1String("document-save"));
+ break;
+ case SP_DialogApplyButton:
+ icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply"));
+ break;
+ case SP_DialogYesButton:
+ case SP_DialogOkButton:
+ icon = QIcon::fromTheme(QLatin1String("dialog-ok"));
+ break;
+ case SP_DialogDiscardButton:
+ icon = QIcon::fromTheme(QLatin1String("edit-delete"));
+ break;
+ case SP_DialogResetButton:
+ icon = QIcon::fromTheme(QLatin1String("edit-clear"));
+ break;
+ case SP_DialogHelpButton:
+ icon = QIcon::fromTheme(QLatin1String("help-contents"));
+ break;
case SP_FileIcon:
icon = QIcon::fromTheme(QLatin1String("text-x-generic"));
break;
@@ -5575,21 +5612,13 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons
case SP_ArrowLeft:
icon = QIcon::fromTheme(QLatin1String("go-previous"));
break;
- case SP_DialogHelpButton:
- icon = QIcon::fromTheme(QLatin1String("help-contents"));
- break;
case SP_DialogCancelButton:
- icon = QIcon::fromTheme(QLatin1String("process-stop"));
+ icon = QIcon::fromTheme(QLatin1String("dialog-cancel"),
+ QIcon::fromTheme(QLatin1String("process-stop")));
break;
case SP_DialogCloseButton:
icon = QIcon::fromTheme(QLatin1String("window-close"));
break;
- case SP_DialogApplyButton:
- icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply"));
- break;
- case SP_DialogOkButton:
- icon = QIcon::fromTheme(QLatin1String("dialog-ok"));
- break;
case SP_FileDialogDetailedView:
icon = QIcon::fromTheme(QLatin1String("view-list-details"));
break;
@@ -5629,9 +5658,6 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons
case SP_MediaVolumeMuted:
icon = QIcon::fromTheme(QLatin1String("audio-volume-muted"));
break;
- case SP_DialogResetButton:
- icon = QIcon::fromTheme(QLatin1String("edit-clear"));
- break;
case SP_ArrowForward:
if (rtl)
return standardIconImplementation(SP_ArrowLeft, option, widget);
diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp
index 3550408..904a8f56 100644
--- a/src/gui/styles/qmotifstyle.cpp
+++ b/src/gui/styles/qmotifstyle.cpp
@@ -2683,6 +2683,9 @@ QMotifStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *w
case SH_LineEdit_PasswordCharacter:
ret = '*';
break;
+ case SH_DialogButtonBox_ButtonsHaveIcons:
+ ret = 0;
+ break;
default:
ret = QCommonStyle::styleHint(hint, opt, widget, returnData);
break;
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index 8250013..bdd72b7 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -5435,6 +5435,11 @@ int QPlastiqueStyle::styleHint(StyleHint hint, const QStyleOption *option, const
case SH_Menu_SubMenuPopupDelay:
ret = 96; // from Plastik
break;
+#ifdef Q_WS_X11
+ case SH_DialogButtonBox_ButtonsHaveIcons:
+ ret = true;
+ break;
+#endif
#ifndef Q_OS_WIN
case SH_Menu_AllowActiveAndDisabled:
ret = false;
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 31f96c3..2a88578 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -1206,6 +1206,9 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
case SH_ItemView_ArrowKeysNavigateIntoChildren:
ret = true;
break;
+ case SH_DialogButtonBox_ButtonsHaveIcons:
+ ret = 0;
+ break;
default:
ret = QCommonStyle::styleHint(hint, opt, widget, returnData);
break;
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index f252444..a38f276 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1171,7 +1171,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font
{
font->setStyle(QFont::StyleNormal);
font->setWeight(QFont::Normal);
- *fontSizeAdjustment = 0;
+ *fontSizeAdjustment = -255;
int i = 0;
while (i < values.count()) {
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index aa67677..9e0c5f8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -207,9 +207,10 @@ QGLSignalProxy *QGLSignalProxy::instance()
\i \link setSampleBuffers() Multisample buffers.\endlink
\endlist
- You can also specify preferred bit depths for the depth buffer,
- alpha buffer, accumulation buffer and the stencil buffer with the
- functions: setDepthBufferSize(), setAlphaBufferSize(),
+ You can also specify preferred bit depths for the color buffer,
+ depth buffer, alpha buffer, accumulation buffer and the stencil
+ buffer with the functions: setRedBufferSize(), setGreenBufferSize(),
+ setBlueBufferSize(), setDepthBufferSize(), setAlphaBufferSize(),
setAccumBufferSize() and setStencilBufferSize().
Note that even if you specify that you prefer a 32 bit depth
@@ -293,19 +294,20 @@ static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz,
}
/*!
- Constructs a QGLFormat object with the factory default settings:
+ Constructs a QGLFormat object with the following default settings:
\list
\i \link setDoubleBuffer() Double buffer:\endlink Enabled.
\i \link setDepth() Depth buffer:\endlink Enabled.
\i \link setRgba() RGBA:\endlink Enabled (i.e., color index disabled).
\i \link setAlpha() Alpha channel:\endlink Disabled.
\i \link setAccum() Accumulator buffer:\endlink Disabled.
- \i \link setStencil() Stencil buffer:\endlink Disabled.
+ \i \link setStencil() Stencil buffer:\endlink Enabled.
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
\i \link setOverlay() Overlay:\endlink Disabled.
\i \link setPlane() Plane:\endlink 0 (i.e., normal plane).
- \i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
+ \i \link setSampleBuffers() Multisample buffers:\endlink Enabled on
+ OpenGL/ES 2.0, disabled on other platforms.
\endlist
*/
@@ -316,26 +318,26 @@ QGLFormat::QGLFormat()
/*!
- Creates a QGLFormat object that is a copy of the current \link
- defaultFormat() application default format\endlink.
+ Creates a QGLFormat object that is a copy of the current
+ defaultFormat().
- If \a options is not 0, this copy is modified by these format
- options. The \a options parameter should be \c FormatOption values
- OR'ed together.
+ If \a options is not 0, the default format is modified by the
+ specified format options. The \a options parameter should be
+ QGL::FormatOption values OR'ed together.
This constructor makes it easy to specify a certain desired format
in classes derived from QGLWidget, for example:
\snippet doc/src/snippets/code/src_opengl_qgl.cpp 3
- Note that there are \c FormatOption values to turn format settings
- both on and off, e.g. \c DepthBuffer and \c NoDepthBuffer,
- \c DirectRendering and \c IndirectRendering, etc.
+ Note that there are QGL::FormatOption values to turn format settings
+ both on and off, e.g. QGL::DepthBuffer and QGL::NoDepthBuffer,
+ QGL::DirectRendering and QGL::IndirectRendering, etc.
The \a plane parameter defaults to 0 and is the plane which this
format should be associated with. Not all OpenGL implementations
supports overlay/underlay rendering planes.
- \sa defaultFormat(), setOption()
+ \sa defaultFormat(), setOption(), setPlane()
*/
QGLFormat::QGLFormat(QGL::FormatOptions options, int plane)
@@ -742,7 +744,7 @@ void QGLFormat::setOverlay(bool enable)
is 0, which means the normal plane. The default for overlay
formats is 1, which is the first overlay plane.
- \sa setPlane()
+ \sa setPlane(), defaultOverlayFormat()
*/
int QGLFormat::plane() const
{
@@ -1225,7 +1227,7 @@ void QGLFormat::setDefaultFormat(const QGLFormat &f)
/*!
Returns the default QGLFormat for overlay contexts.
- The factory default overlay format is:
+ The default overlay format is:
\list
\i \link setDoubleBuffer() Double buffer:\endlink Disabled.
\i \link setDepth() Depth buffer:\endlink Disabled.
@@ -1236,6 +1238,7 @@ void QGLFormat::setDefaultFormat(const QGLFormat &f)
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
\i \link setOverlay() Overlay:\endlink Disabled.
+ \i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
\i \link setPlane() Plane:\endlink 1 (i.e., first overlay plane).
\endlist
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 0d72469..daac760 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -408,7 +408,7 @@ private:
Q_DISABLE_COPY(QGLContext)
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGLContext::BindOptions);
+Q_DECLARE_OPERATORS_FOR_FLAGS(QGLContext::BindOptions)
class Q_OPENGL_EXPORT QGLWidget : public QWidget
{
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 94e3930..452f155 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
-#define QGL_FUNC_CONTEXT QGLContext *ctx = d_ptr->ctx;
+#define QGL_FUNC_CONTEXT QGLContextGroup *ctx = d_ptr->ctx;
#define QT_CHECK_GLERROR() \
{ \
@@ -74,9 +74,34 @@ extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
} \
}
+#ifndef QT_OPENGL_ES
+#define DEFAULT_FORMAT GL_RGBA8
+#else
+#define DEFAULT_FORMAT GL_RGBA
+#endif
+
class QGLFramebufferObjectFormatPrivate
{
public:
+ QGLFramebufferObjectFormatPrivate()
+ : ref(1),
+ samples(0),
+ attachment(QGLFramebufferObject::NoAttachment),
+ target(GL_TEXTURE_2D),
+ internal_format(DEFAULT_FORMAT)
+ {
+ }
+ QGLFramebufferObjectFormatPrivate
+ (const QGLFramebufferObjectFormatPrivate *other)
+ : ref(1),
+ samples(other->samples),
+ attachment(other->attachment),
+ target(other->target),
+ internal_format(other->internal_format)
+ {
+ }
+
+ QAtomicInt ref;
int samples;
QGLFramebufferObject::Attachment attachment;
GLenum target;
@@ -109,6 +134,20 @@ public:
*/
/*!
+ \internal
+*/
+void QGLFramebufferObjectFormat::detach()
+{
+ if (d->ref != 1) {
+ QGLFramebufferObjectFormatPrivate *newd
+ = new QGLFramebufferObjectFormatPrivate(d);
+ if (!d->ref.deref())
+ delete d;
+ d = newd;
+ }
+}
+
+/*!
Creates a QGLFramebufferObjectFormat object for specifying
the format of an OpenGL framebuffer object.
@@ -118,19 +157,9 @@ public:
\sa samples(), attachment(), target(), internalTextureFormat()
*/
-#ifndef QT_OPENGL_ES
-#define DEFAULT_FORMAT GL_RGBA8
-#else
-#define DEFAULT_FORMAT GL_RGBA
-#endif
-
QGLFramebufferObjectFormat::QGLFramebufferObjectFormat()
{
d = new QGLFramebufferObjectFormatPrivate;
- d->samples = 0;
- d->attachment = QGLFramebufferObject::NoAttachment;
- d->target = GL_TEXTURE_2D;
- d->internal_format = DEFAULT_FORMAT;
}
/*!
@@ -139,8 +168,8 @@ QGLFramebufferObjectFormat::QGLFramebufferObjectFormat()
QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(const QGLFramebufferObjectFormat &other)
{
- d = new QGLFramebufferObjectFormatPrivate;
- *d = *other.d;
+ d = other.d;
+ d->ref.ref();
}
/*!
@@ -149,7 +178,12 @@ QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(const QGLFramebufferObjec
QGLFramebufferObjectFormat &QGLFramebufferObjectFormat::operator=(const QGLFramebufferObjectFormat &other)
{
- *d = *other.d;
+ if (d != other.d) {
+ other.d->ref.ref();
+ if (!d->ref.deref())
+ delete d;
+ d = other.d;
+ }
return *this;
}
@@ -158,7 +192,8 @@ QGLFramebufferObjectFormat &QGLFramebufferObjectFormat::operator=(const QGLFrame
*/
QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat()
{
- delete d;
+ if (!d->ref.deref())
+ delete d;
}
/*!
@@ -176,6 +211,7 @@ QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat()
*/
void QGLFramebufferObjectFormat::setSamples(int samples)
{
+ detach();
d->samples = samples;
}
@@ -197,6 +233,7 @@ int QGLFramebufferObjectFormat::samples() const
*/
void QGLFramebufferObjectFormat::setAttachment(QGLFramebufferObject::Attachment attachment)
{
+ detach();
d->attachment = attachment;
}
@@ -219,6 +256,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObjectFormat::attachment() const
*/
void QGLFramebufferObjectFormat::setTextureTarget(GLenum target)
{
+ detach();
d->target = target;
}
@@ -242,6 +280,7 @@ GLenum QGLFramebufferObjectFormat::textureTarget() const
*/
void QGLFramebufferObjectFormat::setInternalTextureFormat(GLenum internalTextureFormat)
{
+ detach();
d->internal_format = internalTextureFormat;
}
@@ -260,12 +299,14 @@ GLenum QGLFramebufferObjectFormat::internalTextureFormat() const
/*! \internal */
void QGLFramebufferObjectFormat::setTextureTarget(QMacCompatGLenum target)
{
+ detach();
d->target = target;
}
/*! \internal */
void QGLFramebufferObjectFormat::setInternalTextureFormat(QMacCompatGLenum internalTextureFormat)
{
+ detach();
d->internal_format = internalTextureFormat;
}
#endif
@@ -288,7 +329,7 @@ public:
QGLFramebufferObjectFormat format;
uint valid : 1;
QGLFramebufferObject::Attachment fbo_attachment;
- QGLContext *ctx; // for Windows extension ptrs
+ QGLContextGroup *ctx; // for Windows extension ptrs
GLuint previous_fbo;
mutable QPaintEngine *engine;
};
@@ -340,9 +381,10 @@ bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const
void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::Attachment attachment,
GLenum texture_target, GLenum internal_format, GLint samples)
{
- ctx = const_cast<QGLContext *>(QGLContext::currentContext());
+ QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
+ ctx = QGLContextPrivate::contextGroup(currentContext);
bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
- if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(ctx)))
+ if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext)))
return;
size = sz;
@@ -466,7 +508,7 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
fbo_attachment = QGLFramebufferObject::NoAttachment;
}
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, currentContext->d_ptr->current_fbo);
if (!valid) {
if (color_buffer)
glDeleteRenderbuffers(1, &color_buffer);
@@ -736,16 +778,19 @@ QGLFramebufferObject::~QGLFramebufferObject()
delete d->engine;
- if (isValid()
- && (d->ctx == QGLContext::currentContext()
- || qgl_share_reg()->checkSharing(d->ctx, QGLContext::currentContext())))
- {
+ if (isValid()) {
+ const QGLContext *oldContext = QGLContext::currentContext();
+ bool switchContext = !oldContext || QGLContextPrivate::contextGroup(oldContext) != ctx;
+ if (switchContext)
+ const_cast<QGLContext *>(ctx->context())->makeCurrent();
glDeleteTextures(1, &d->texture);
if (d->color_buffer)
glDeleteRenderbuffers(1, &d->color_buffer);
if (d->depth_stencil_buffer)
glDeleteRenderbuffers(1, &d->depth_stencil_buffer);
glDeleteFramebuffers(1, &d->fbo);
+ if (oldContext && switchContext)
+ const_cast<QGLContext *>(oldContext)->makeCurrent();
}
}
@@ -867,7 +912,7 @@ QSize QGLFramebufferObject::size() const
/*!
Returns the format of this framebuffer object.
*/
-const QGLFramebufferObjectFormat &QGLFramebufferObject::format() const
+QGLFramebufferObjectFormat QGLFramebufferObject::format() const
{
Q_D(const QGLFramebufferObject);
return d->format;
@@ -897,7 +942,7 @@ QImage QGLFramebufferObject::toImage() const
bool wasBound = isBound();
if (!wasBound)
const_cast<QGLFramebufferObject *>(this)->bind();
- QImage image = qt_gl_read_framebuffer(d->size, d->ctx->format().alpha(), true);
+ QImage image = qt_gl_read_framebuffer(d->size, format().textureTarget() != GL_RGB, true);
if (!wasBound)
const_cast<QGLFramebufferObject *>(this)->release();
@@ -969,16 +1014,14 @@ bool QGLFramebufferObject::hasOpenGLFramebufferObjects()
*/
void QGLFramebufferObject::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget)
{
- Q_D(QGLFramebufferObject);
- d->ctx->drawTexture(target, textureId, textureTarget);
+ const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget);
}
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
/*! \internal */
void QGLFramebufferObject::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget)
{
- Q_D(QGLFramebufferObject);
- d->ctx->drawTexture(target, textureId, textureTarget);
+ const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget);
}
#endif
@@ -994,16 +1037,14 @@ void QGLFramebufferObject::drawTexture(const QRectF &target, QMacCompatGLuint te
*/
void QGLFramebufferObject::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget)
{
- Q_D(QGLFramebufferObject);
- d->ctx->drawTexture(point, textureId, textureTarget);
+ const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(point, textureId, textureTarget);
}
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
/*! \internal */
void QGLFramebufferObject::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget)
{
- Q_D(QGLFramebufferObject);
- d->ctx->drawTexture(point, textureId, textureTarget);
+ const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(point, textureId, textureTarget);
}
#endif
@@ -1100,7 +1141,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const
bool QGLFramebufferObject::isBound() const
{
Q_D(const QGLFramebufferObject);
- return d->ctx->d_ptr->current_fbo == d->fbo;
+ return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo;
}
/*!
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index ec1ae7d..6c1c0be 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -93,7 +93,7 @@ public:
virtual ~QGLFramebufferObject();
- const QGLFramebufferObjectFormat &format() const;
+ QGLFramebufferObjectFormat format() const;
bool isValid() const;
bool isBound() const;
@@ -161,6 +161,8 @@ public:
private:
QGLFramebufferObjectFormatPrivate *d;
+
+ void detach();
};
QT_END_NAMESPACE
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 333a415..13bc6a6 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -146,11 +146,7 @@ void QScriptEngineAgentPrivate::returnEvent(const JSC::DebuggerCallFrame& frame,
{
Q_UNUSED(frame);
Q_UNUSED(lineno);
-#if ENABLE(JIT)
- functionExit(JSC::JSValue(), sourceID);
-#else
Q_UNUSED(sourceID);
-#endif
}
void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp
index 6187e6b..7bbe122 100644
--- a/src/sql/drivers/db2/qsql_db2.cpp
+++ b/src/sql/drivers/db2/qsql_db2.cpp
@@ -908,8 +908,9 @@ bool QDB2Result::fetchFirst()
SQL_FETCH_FIRST,
0);
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
- setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
- QSqlError::StatementError, d));
+ if(r!= SQL_NO_DATA)
+ setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
+ QSqlError::StatementError, d));
return false;
}
setAt(0);
diff --git a/src/src.pro b/src/src.pro
index 780e56e..240e1f7 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -120,7 +120,8 @@ src_webkit.target = sub-webkit
src_tools_activeqt.depends = src_tools_idc src_gui
src_plugins.depends = src_gui src_sql src_svg
contains(QT_CONFIG, webkit) {
- src_webkit.depends = src_gui src_sql src_network src_xml src_phonon
+ src_webkit.depends = src_gui src_sql src_network src_xml
+ contains(QT_CONFIG, phonon):src_webkit.depends += src_phonon
#exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore
}
contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index e2c3d92..35b8595 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -810,24 +810,27 @@ static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler
case 'r':
{
- // starts with "rgb("
- if (colorStrTr == QLatin1String("rgb(")) {
+ // starts with "rgb(", ends with ")" and consists of at least 7 characters "rgb(,,)"
+ if (colorStrTr.length() >= 7 && colorStrTr.at(colorStrTr.length() - 1) == QLatin1Char(')')
+ && QStringRef(colorStrTr.string(), colorStrTr.position(), 4) == QLatin1String("rgb(")) {
const QChar *s = colorStrTr.constData() + 4;
QVector<qreal> compo = parseNumbersList(s);
//1 means that it failed after reaching non-parsable
//character which is going to be "%"
if (compo.size() == 1) {
- const QChar *s = colorStrTr.constData() + 4;
+ s = colorStrTr.constData() + 4;
compo = parsePercentageList(s);
- compo[0] *= (qreal)2.55;
- compo[1] *= (qreal)2.55;
- compo[2] *= (qreal)2.55;
+ for (int i = 0; i < compo.size(); ++i)
+ compo[i] *= (qreal)2.55;
}
- color = QColor(int(compo[0]),
- int(compo[1]),
- int(compo[2]));
- return true;
+ if (compo.size() == 3) {
+ color = QColor(int(compo[0]),
+ int(compo[1]),
+ int(compo[2]));
+ return true;
+ }
+ return false;
}
}
break;
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 8b06a29..1ab7401 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -117,7 +117,7 @@ namespace QTest
static const char *mouseActionNames[] =
{ "MousePress", "MouseRelease", "MouseClick", "MouseDClick", "MouseMove" };
QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving widget");
- QTest::qWarn(warning.arg(mouseActionNames[static_cast<int>(action)]).toAscii().data());
+ QTest::qWarn(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toAscii().data());
}
}
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index d1c179e..144f7b3 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -143,8 +143,8 @@ public:
}
return QHostAddress(serverIp.data());
}
-#endif
- return QHostInfo::fromName(serverName()).addresses().first();
+#endif // Q_OS_SYMBIAN
+ return QHostInfo::fromName(serverName()).addresses().first();
}
#endif
@@ -161,12 +161,11 @@ public:
}
return imapExpectedReply.data();
}
-#else
- QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " );
+#endif
+ QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " );
expected = expected.append(QtNetworkSettings::serverName().toAscii());
expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
return expected;
-#endif
}
static QByteArray expectedReplySSL()
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index a43b727..eae830f 100644
--- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
@@ -217,6 +217,8 @@ private slots:
void task250754_fontChange();
void task200665_itemEntered();
void task257481_emptyEditor();
+ void shiftArrowSelectionAfterScrolling();
+ void shiftSelectionAfterRubberbandSelection();
};
class MyAbstractItemDelegate : public QAbstractItemDelegate
@@ -1261,6 +1263,115 @@ void tst_QAbstractItemView::task257481_emptyEditor()
QVERIFY(!lineEditors.first()->size().isEmpty());
}
+void tst_QAbstractItemView::shiftArrowSelectionAfterScrolling()
+{
+ QStandardItemModel model;
+ for (int i=0; i<10; ++i) {
+ QStandardItem *item = new QStandardItem(QString("%1").arg(i));
+ model.setItem(i, 0, item);
+ }
+
+ QListView view;
+ view.setFixedSize(150, 250);
+ view.setFlow(QListView::LeftToRight);
+ view.setGridSize(QSize(100, 100));
+ view.setSelectionMode(QListView::ExtendedSelection);
+ view.setViewMode(QListView::IconMode);
+ view.setModel(&model);
+ view.show();
+ QTest::qWait(30);
+
+ QModelIndex index0 = model.index(0, 0);
+ QModelIndex index1 = model.index(1, 0);
+ QModelIndex index9 = model.index(9, 0);
+
+ view.selectionModel()->setCurrentIndex(index0, QItemSelectionModel::NoUpdate);
+ QCOMPARE(view.currentIndex(), index0);
+
+ view.scrollTo(index9);
+ QTest::keyClick(&view, Qt::Key_Down, Qt::ShiftModifier);
+
+ QCOMPARE(view.currentIndex(), index1);
+ QModelIndexList selected = view.selectionModel()->selectedIndexes();
+ QCOMPARE(selected.count(), 2);
+ QVERIFY(selected.contains(index0));
+ QVERIFY(selected.contains(index1));
+}
+
+void tst_QAbstractItemView::shiftSelectionAfterRubberbandSelection()
+{
+ QStandardItemModel model;
+ for (int i=0; i<3; ++i) {
+ QStandardItem *item = new QStandardItem(QString("%1").arg(i));
+ model.setItem(i, 0, item);
+ }
+
+ QListView view;
+ view.setFixedSize(150, 450);
+ view.setFlow(QListView::LeftToRight);
+ view.setGridSize(QSize(100, 100));
+ view.setSelectionMode(QListView::ExtendedSelection);
+ view.setViewMode(QListView::IconMode);
+ view.setModel(&model);
+ view.show();
+ QTest::qWait(30);
+
+ QModelIndex index0 = model.index(0, 0);
+ QModelIndex index1 = model.index(1, 0);
+ QModelIndex index2 = model.index(2, 0);
+
+ view.setCurrentIndex(index0);
+ QCOMPARE(view.currentIndex(), index0);
+
+ // Determine the points where the rubberband selection starts and ends
+ QPoint pressPos = view.visualRect(index1).bottomRight() + QPoint(1, 1);
+ QPoint releasePos = view.visualRect(index1).center();
+ QVERIFY(!view.indexAt(pressPos).isValid());
+ QCOMPARE(view.indexAt(releasePos), index1);
+
+ // Select item 1 using a rubberband selection
+ // The mouse move event has to be created manually because the QTest framework does not
+ // contain a function for mouse moves with buttons pressed
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, pressPos);
+ QMouseEvent moveEvent(QEvent::MouseMove, releasePos, Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
+ bool moveEventReceived = qApp->notify(view.viewport(), &moveEvent);
+ QVERIFY(moveEventReceived);
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, releasePos);
+ QCOMPARE(view.currentIndex(), index1);
+
+ // Shift-click item 2
+ QPoint item2Pos = view.visualRect(index2).center();
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ShiftModifier, item2Pos);
+ QCOMPARE(view.currentIndex(), index2);
+
+ // Verify that the selection worked OK
+ QModelIndexList selected = view.selectionModel()->selectedIndexes();
+ QCOMPARE(selected.count(), 2);
+ QVERIFY(selected.contains(index1));
+ QVERIFY(selected.contains(index2));
+
+ // Select item 0 to revert the selection
+ view.setCurrentIndex(index0);
+ QCOMPARE(view.currentIndex(), index0);
+
+ // Repeat the same steps as above, but with a Shift-Arrow selection
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, pressPos);
+ QMouseEvent moveEvent2(QEvent::MouseMove, releasePos, Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
+ moveEventReceived = qApp->notify(view.viewport(), &moveEvent2);
+ QVERIFY(moveEventReceived);
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, releasePos);
+ QCOMPARE(view.currentIndex(), index1);
+
+ // Press Shift-Down
+ QTest::keyClick(&view, Qt::Key_Down, Qt::ShiftModifier);
+ QCOMPARE(view.currentIndex(), index2);
+
+ // Verify that the selection worked OK
+ selected = view.selectionModel()->selectedIndexes();
+ QCOMPARE(selected.count(), 2);
+ QVERIFY(selected.contains(index1));
+ QVERIFY(selected.contains(index2));
+}
QTEST_MAIN(tst_QAbstractItemView)
#include "tst_qabstractitemview.moc"
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index be33862..0773184 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -879,12 +879,12 @@ void tst_QComboBox::hide()
{
testWidget->addItem("foo");
testWidget->showPopup();
- QTest::qWait(500); //allow combobox effect to complete
- QVERIFY(testWidget->view());
- QVERIFY(testWidget->view()->isVisible());
+ QTest::qWait(200); //allow combobox effect to complete
+ QTRY_VERIFY(testWidget->view());
+ QTRY_VERIFY(testWidget->view()->isVisible());
testWidget->hidePopup();
- QTest::qWait(500); //allow combobox effect to complete
- QVERIFY(!testWidget->view()->isVisible());
+ QTest::qWait(200); //allow combobox effect to complete
+ QTRY_VERIFY(!testWidget->view()->isVisible());
testWidget->hide();
QVERIFY(!testWidget->isVisible());
}
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 3a2d90f..5d4c520 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -180,7 +180,7 @@ void tst_QFontMetrics::elidedText()
QFETCH(QString, text);
QFontMetrics fm(font);
int w = fm.width(text);
- QString newtext = fm.elidedText(text,Qt::ElideRight,w, 0);
+ QString newtext = fm.elidedText(text,Qt::ElideRight,w+1, 0);
QCOMPARE(text,newtext); // should not elide
newtext = fm.elidedText(text,Qt::ElideRight,w-1, 0);
QVERIFY(text != newtext); // should elide
@@ -212,10 +212,10 @@ void tst_QFontMetrics::elidedMultiLength()
QFontMetrics fm = QFontMetrics(QFont());
int width_long = fm.width(text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long);
- QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long), text1_long);
+ QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long + 1), text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 1), text1_short);
int width_short = fm.width(text1_short);
- QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short), text1_short);
+ QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short + 1), text1_short);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small);
// Not even wide enough for "small" - should use ellipsis
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 0fefbf3..650c1ca 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -79,6 +79,7 @@ private slots:
void glWidgetReparent();
void stackedFBOs();
void colormap();
+ void fboFormat();
};
tst_QGL::tst_QGL()
@@ -230,9 +231,15 @@ void tst_QGL::getSetCheck()
// bool QGLFormat::sampleBuffers()
// void QGLFormat::setSampleBuffers(bool)
+#if !defined(QT_OPENGL_ES_2)
QCOMPARE(false, obj1.sampleBuffers());
QVERIFY(!obj1.testOption(QGL::SampleBuffers));
QVERIFY(obj1.testOption(QGL::NoSampleBuffers));
+#else
+ QCOMPARE(true, obj1.sampleBuffers());
+ QVERIFY(obj1.testOption(QGL::SampleBuffers));
+ QVERIFY(!obj1.testOption(QGL::NoSampleBuffers));
+#endif
obj1.setSampleBuffers(false);
QCOMPARE(false, obj1.sampleBuffers());
QVERIFY(obj1.testOption(QGL::NoSampleBuffers));
@@ -499,6 +506,57 @@ void tst_QGL::getSetCheck()
QCOMPARE(format1.redBufferSize(), 8);
QCOMPARE(format1.plane(), 8);
+ // Check the QGLFormat constructor that takes an option list.
+ QGLFormat format5
+ (QGL::DepthBuffer | QGL::StereoBuffers | QGL::ColorIndex, 3);
+ QVERIFY(format5.depth());
+ QVERIFY(format5.stereo());
+ QVERIFY(format5.doubleBuffer()); // From defaultFormat()
+ QVERIFY(!format5.hasOverlay()); // From defaultFormat()
+ QVERIFY(!format5.rgba());
+ QCOMPARE(format5.plane(), 3);
+
+ // The default format should be the same as QGLFormat().
+ QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+
+ // Modify the default format and check that it was changed.
+ QGLFormat::setDefaultFormat(format1);
+ QVERIFY(QGLFormat::defaultFormat() == format1);
+
+ // Restore the default format.
+ QGLFormat::setDefaultFormat(QGLFormat());
+ QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+
+ // Check the default overlay format's expected values.
+ QGLFormat overlay(QGLFormat::defaultOverlayFormat());
+ QCOMPARE(overlay.depthBufferSize(), -1);
+ QCOMPARE(overlay.accumBufferSize(), -1);
+ QCOMPARE(overlay.redBufferSize(), -1);
+ QCOMPARE(overlay.greenBufferSize(), -1);
+ QCOMPARE(overlay.blueBufferSize(), -1);
+ QCOMPARE(overlay.alphaBufferSize(), -1);
+ QCOMPARE(overlay.samples(), -1);
+ QCOMPARE(overlay.swapInterval(), -1);
+ QCOMPARE(overlay.plane(), 1);
+ QVERIFY(!overlay.sampleBuffers());
+ QVERIFY(!overlay.doubleBuffer());
+ QVERIFY(!overlay.depth());
+ QVERIFY(!overlay.rgba());
+ QVERIFY(!overlay.alpha());
+ QVERIFY(!overlay.accum());
+ QVERIFY(!overlay.stencil());
+ QVERIFY(!overlay.stereo());
+ QVERIFY(overlay.directRendering()); // Only option that should be on.
+ QVERIFY(!overlay.hasOverlay()); // Overlay doesn't need an overlay!
+
+ // Modify the default overlay format and check that it was changed.
+ QGLFormat::setDefaultOverlayFormat(format1);
+ QVERIFY(QGLFormat::defaultOverlayFormat() == format1);
+
+ // Restore the default overlay format.
+ QGLFormat::setDefaultOverlayFormat(overlay);
+ QVERIFY(QGLFormat::defaultOverlayFormat() == overlay);
+
MyGLContext obj2(obj1);
// bool QGLContext::windowCreated()
// void QGLContext::setWindowCreated(bool)
@@ -1321,5 +1379,60 @@ void tst_QGL::colormap()
QCOMPARE(cmap4.size(), 256);
}
+#ifndef QT_OPENGL_ES
+#define DEFAULT_FORMAT GL_RGBA8
+#else
+#define DEFAULT_FORMAT GL_RGBA
+#endif
+
+#ifndef GL_TEXTURE_3D
+#define GL_TEXTURE_3D 0x806F
+#endif
+
+#ifndef GL_RGB16
+#define GL_RGB16 0x8054
+#endif
+
+void tst_QGL::fboFormat()
+{
+ // Check the initial conditions.
+ QGLFramebufferObjectFormat format1;
+ QCOMPARE(format1.samples(), 0);
+ QVERIFY(format1.attachment() == QGLFramebufferObject::NoAttachment);
+ QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_2D));
+ QCOMPARE(int(format1.internalTextureFormat()), int(DEFAULT_FORMAT));
+
+ // Modify the values and re-check.
+ format1.setSamples(8);
+ format1.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format1.setTextureTarget(GL_TEXTURE_3D);
+ format1.setInternalTextureFormat(GL_RGB16);
+ QCOMPARE(format1.samples(), 8);
+ QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
+ QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
+
+ // Make copies and check that they are the same.
+ QGLFramebufferObjectFormat format2(format1);
+ QGLFramebufferObjectFormat format3;
+ QCOMPARE(format2.samples(), 8);
+ QVERIFY(format2.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(int(format2.textureTarget()), int(GL_TEXTURE_3D));
+ QCOMPARE(int(format2.internalTextureFormat()), int(GL_RGB16));
+ format3 = format1;
+ QCOMPARE(format3.samples(), 8);
+ QVERIFY(format3.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(int(format3.textureTarget()), int(GL_TEXTURE_3D));
+ QCOMPARE(int(format3.internalTextureFormat()), int(GL_RGB16));
+
+ // Modify the copies and check that the original is unchanged.
+ format2.setSamples(9);
+ format3.setTextureTarget(GL_TEXTURE_2D);
+ QCOMPARE(format1.samples(), 8);
+ QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
+ QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
+}
+
QTEST_MAIN(tst_QGL)
#include "tst_qgl.moc"
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index dc013b9..1ef77c0 100644
--- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
@@ -1155,7 +1155,7 @@ void tst_QItemDelegate::task257859_finalizeEdit()
view.edit(index);
QTest::qWait(30);
- QList<QWidget*> lineEditors = qFindChildren<QWidget *>(view.viewport());
+ QList<QLineEdit *> lineEditors = qFindChildren<QLineEdit *>(view.viewport());
QCOMPARE(lineEditors.count(), 1);
QPointer<QWidget> editor = lineEditors.at(0);
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index c598aeb..2be1a03 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -1614,13 +1614,6 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
list.setModel(&model);
list.setViewMode(QListView::IconMode);
list.show();
- QTest::qWait(200); //makes sure the layout is done
-
- const QPoint topLeft(-6, 0);
-
-
- list.setPositionForIndex(topLeft, index);
-
class MyItemDelegate : public QStyledItemDelegate
{
public:
@@ -1634,15 +1627,18 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
mutable int numPaints;
} delegate;
-
list.setItemDelegate(&delegate);
+ QTest::qWait(200); //makes sure the layout is done
+
+ const QPoint topLeft(-6, 0);
+ list.setPositionForIndex(topLeft, index);
+
//we'll make sure the item is repainted
delegate.numPaints = 0;
- list.viewport()->repaint();
-
- QCOMPARE(list.visualRect(index).topLeft(), topLeft);
- QCOMPARE(delegate.numPaints, 1);
+ QApplication::processEvents();
+ QCOMPARE(list.visualRect(index).topLeft(), topLeft);
+ QCOMPARE(delegate.numPaints, 1);
}
diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
index 8c4415c..78ba46b 100644
--- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -1835,7 +1835,10 @@ void tst_QMdiSubWindow::setFont()
newFont.setBold(true);
subWindow->setFont(newFont);
qApp->processEvents();
- QCOMPARE(subWindow->font(), newFont);
+ const QFont &swFont = subWindow->font();
+ QCOMPARE(swFont.family(), newFont.family());
+ QCOMPARE(swFont.pointSize(), newFont.pointSize());
+ QCOMPARE(swFont.weight(), newFont.weight());
QImage newTitleBar = QPixmap::grabWidget(subWindow, titleBarRect).toImage();
QVERIFY(newTitleBar != originalTitleBar);
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index a223d1c..7c70819 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -2653,6 +2653,7 @@ void tst_QNetworkReply::ioPutToFileFromSocket()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), url);
@@ -2699,6 +2700,7 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), url);
@@ -2971,6 +2973,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocket()
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), url);
@@ -3295,6 +3298,7 @@ void tst_QNetworkReply::uploadPerformance()
QTimer::singleShot(5000, &generator, SLOT(stop()));
QTestEventLoop::instance().enterLoop(10);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
}
@@ -3320,6 +3324,7 @@ void tst_QNetworkReply::httpUploadPerformance()
generator.start();
time.start();
QTestEventLoop::instance().enterLoop(40);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
qint64 elapsed = time.elapsed();
@@ -3387,6 +3392,7 @@ void tst_QNetworkReply::httpDownloadPerformance()
QTime time;
time.start();
QTestEventLoop::instance().enterLoop(40);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
qint64 elapsed = time.elapsed();
@@ -3456,6 +3462,7 @@ void tst_QNetworkReply::downloadProgress()
spy.clear();
QTestEventLoop::instance().enterLoop(2);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(spy.count() > 0);
QVERIFY(!reply->isRunning());
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index 8fe6839..75f7a12 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -177,6 +177,21 @@ struct ScriptEngineEvent
value(exception), hasExceptionHandler(hasHandler)
{ }
+ static QString typeToQString(Type t)
+ {
+ switch (t) {
+ case ScriptEngineEvent::ScriptLoad: return "ScriptLoad";
+ case ScriptEngineEvent::ScriptUnload: return "ScriptUnload";
+ case ScriptEngineEvent::ContextPush: return "ContextPush";
+ case ScriptEngineEvent::ContextPop: return "ContextPop";
+ case ScriptEngineEvent::FunctionEntry: return "FunctionEntry";
+ case ScriptEngineEvent::FunctionExit: return "FunctionExit";
+ case ScriptEngineEvent::PositionChange: return "PositionChange";
+ case ScriptEngineEvent::ExceptionThrow: return "ExceptionThrow";
+ case ScriptEngineEvent::ExceptionCatch: return "ExceptionCatch";
+ case ScriptEngineEvent::DebuggerInvocationRequest: return "DebuggerInvocationRequest";
+ }
+ }
};
class ScriptEngineSpy : public QScriptEngineAgent, public QList<ScriptEngineEvent>
@@ -574,11 +589,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionCall()
// anonymous function exit
QCOMPARE(spy->at(2).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(2).value.isNumber());
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QCOMPARE(spy->at(2).value.toNumber(), qsreal(123));
// evaluate() exit
@@ -655,11 +666,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionDefinition()
// foo() exit
QCOMPARE(spy->at(4).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(4).value.isNumber());
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QCOMPARE(spy->at(4).value.toNumber(), qsreal(456));
// evaluate() exit
@@ -1044,11 +1051,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_call()
// exit
QCOMPARE(spy->at(1).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(1).value.isNumber());
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QCOMPARE(spy->at(1).value.toNumber(), qsreal(123));
}
delete spy;
@@ -1604,8 +1607,6 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::ExceptionCatch);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue);
QVERIFY(spy->at(1).value.strictlyEquals(spy->at(0).value));
}
}
@@ -1749,8 +1750,6 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch()
QVERIFY(spy->at(7).hasExceptionHandler);
// catch
QCOMPARE(spy->at(8).type, ScriptEngineEvent::ExceptionCatch);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue);
QVERIFY(spy->at(8).value.isError());
// void(e)
QCOMPARE(spy->at(9).type, ScriptEngineEvent::PositionChange);
@@ -1801,16 +1800,12 @@ void tst_QScriptEngineAgent::eventOrder_functions()
// bar() exit
QCOMPARE(spy->at(15).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(15).scriptId, spy->at(3).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(15).value.isNumber());
// restore context
QCOMPARE(spy->at(16).type, ScriptEngineEvent::ContextPop);
// foo() exit
QCOMPARE(spy->at(17).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(17).scriptId, spy->at(0).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(17).value.isNumber());
// restore context
QCOMPARE(spy->at(18).type, ScriptEngineEvent::ContextPop);
@@ -1834,7 +1829,7 @@ void tst_QScriptEngineAgent::eventOrder_functions()
eng.evaluate("foo('ciao')");
- //QCOMPARE(spy->count(), 45);
+ QCOMPARE(spy->count(), 45);
// load
QCOMPARE(spy->at(25).type, ScriptEngineEvent::ScriptLoad);
@@ -1875,33 +1870,21 @@ void tst_QScriptEngineAgent::eventOrder_functions()
// bar() exit
QCOMPARE(spy->at(39).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(39).scriptId, spy->at(21).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(39).value.isError());
// restore context
QCOMPARE(spy->at(40).type, ScriptEngineEvent::ContextPop);
// foo() exit
QCOMPARE(spy->at(41).type, ScriptEngineEvent::FunctionExit);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "script ID for function exit is not correct when JIT is enabled", Continue);
QCOMPARE(spy->at(41).scriptId, spy->at(0).scriptId);
QVERIFY(spy->at(41).value.isError());
// restore context
QCOMPARE(spy->at(42).type, ScriptEngineEvent::ContextPop);
// evaluate() exit
QCOMPARE(spy->at(43).type, ScriptEngineEvent::FunctionExit);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "script ID for function exit is not correct when JIT is enabled", Continue);
QCOMPARE(spy->at(43).scriptId, spy->at(26).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(43).value.isError());
// unload
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "wrong event type when JIT is enabled", Continue);
QCOMPARE(spy->at(44).type, ScriptEngineEvent::ScriptUnload);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "wrong script ID when JIT is enabled", Continue);
QCOMPARE(spy->at(44).scriptId, spy->at(25).scriptId);
}
delete spy;
@@ -1958,8 +1941,6 @@ void tst_QScriptEngineAgent::eventOrder_signalsHandling()
emit testSignal(123);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "too many events reported when JIT is enabled", Abort);
QCOMPARE(spy->count(), 14);
// new context
QCOMPARE(spy->at(4).type, ScriptEngineEvent::ContextPush);
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index deebb1b..36b17ed 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -381,6 +381,9 @@ void tst_QSqlQuery::char1SelectUnicode()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ if(db.driverName().startsWith("QDB2"))
+ QSKIP("Needs someone with more Unicode knowledge than I have to fix", SkipSingle);
+
if ( db.driver()->hasFeature( QSqlDriver::Unicode ) ) {
QString uniStr( QChar( 0xfb50 ) );
QSqlQuery q( db );
@@ -1613,6 +1616,8 @@ void tst_QSqlQuery::prepare_bind_exec()
CHECK_DATABASE( db );
if(db.driverName().startsWith("QIBASE") && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb"))
QSKIP("Can't transliterate extended unicode to ascii", SkipSingle);
+ if(db.driverName().startsWith("QDB2"))
+ QSKIP("Needs someone with more Unicode knowledge than I have to fix", SkipSingle);
{
// new scope for SQLITE
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index 34b6f14..0c1d334 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -100,6 +100,9 @@ private slots:
void task240325();
+ void stylesheetFont_data();
+ void stylesheetFont();
+
void toHtml_data();
void toHtml();
void toHtml2();
@@ -571,6 +574,63 @@ void tst_QTextDocument::task240325()
}
}
+void tst_QTextDocument::stylesheetFont_data()
+{
+ QTest::addColumn<QString>("stylesheet");
+ QTest::addColumn<QFont>("font");
+
+ {
+ QFont font;
+ font.setBold(true);
+ font.setPixelSize(64);
+
+ QTest::newRow("Regular font specification")
+ << "font-size: 64px; font-weight: bold;"
+ << font;
+ }
+
+
+ {
+ QFont font;
+ font.setBold(true);
+ font.setPixelSize(64);
+
+ QTest::newRow("Shorthand font specification")
+ << "font: normal bold 64px Arial;"
+ << font;
+ }
+
+}
+
+void tst_QTextDocument::stylesheetFont()
+{
+ QFETCH(QString, stylesheet);
+ QFETCH(QFont, font);
+
+ QString html = QString::fromLatin1("<html>"
+ "<body>"
+ "<div style=\"%1\" >"
+ "Foobar"
+ "</div>"
+ "</body>"
+ "</html>").arg(stylesheet);
+
+ qDebug() << html;
+ doc->setHtml(html);
+ QCOMPARE(doc->blockCount(), 1);
+
+ // First and only block
+ QTextBlock block = doc->firstBlock();
+
+ QString text = block.text();
+ QCOMPARE(text, QString::fromLatin1("Foobar"));
+
+ QFont actualFont = block.charFormat().font();
+
+ QCOMPARE(actualFont.bold(), font.bold());
+ QCOMPARE(actualFont.pixelSize(), font.pixelSize());
+}
+
void tst_QTextDocument::noundo_moreIsModified()
{
doc->setUndoRedoEnabled(false);
@@ -1458,7 +1518,6 @@ void tst_QTextDocument::toHtml_data()
QTest::newRow("list-ul-margin") << QTextDocumentFragment(&doc)
<< QString("EMPTYBLOCK") +
QString("<ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;\"><li DEFAULTBLOCKSTYLE>Blah</li></ul>");
-
}
}
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 6709807..fae4b26 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -2042,7 +2042,7 @@ void tst_QTreeView::scrollTo()
view.show();
view.setVerticalScrollMode(QAbstractItemView::ScrollPerItem); //some styles change that in Polish
-
+
view.resize(300, 200);
//view.verticalScrollBar()->setValue(0);
@@ -2055,7 +2055,7 @@ void tst_QTreeView::scrollTo()
QCOMPARE(view.verticalScrollBar()->value(), 5);
view.scrollTo(model.index(60, 60, QModelIndex()));
-
+
CHECK_VISIBLE(60,60);
view.scrollTo(model.index(60, 30, QModelIndex()));
CHECK_VISIBLE(60,30);
@@ -3059,12 +3059,12 @@ void tst_QTreeView::task216717_updateChildren()
tree.refreshed = false;
QTreeWidgetItem *parent = new QTreeWidgetItem(QStringList() << "parent");
tree.addTopLevelItem(parent);
- QTest::qWait(100);
- QVERIFY(tree.refreshed);
+ QTest::qWait(10);
+ QTRY_VERIFY(tree.refreshed);
tree.refreshed = false;
parent->addChild(new QTreeWidgetItem(QStringList() << "child"));
- QTest::qWait(100);
- QVERIFY(tree.refreshed);
+ QTest::qWait(10);
+ QTRY_VERIFY(tree.refreshed);
}
@@ -3259,7 +3259,7 @@ void tst_QTreeView::task202039_closePersistentEditor()
view.closePersistentEditor(current);
QVERIFY(view.indexWidget(current) == 0);
- //here was the bug: closing the persistent editor would not reset the state
+ //here was the bug: closing the persistent editor would not reset the state
//and it was impossible to go into editinon again
QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
@@ -3313,7 +3313,7 @@ void tst_QTreeView::task244304_clickOnDecoration()
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, rect.topLeft()+QPoint(-rect.left()/2,rect.height()/2));
QVERIFY(!view.currentIndex().isValid());
QVERIFY(view.isExpanded(item0.index()));
-
+
rect = view.visualRect(item1.index());
//the item has no decoration, it should get selected
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, rect.topLeft()+QPoint(-rect.left()/2,rect.height()/2));
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index bf02731..ad1920b 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -3,6 +3,7 @@ SUBDIRS = containers-associative \
containers-sequential \
qanimation \
qbytearray \
+ qfile_vs_qnetworkaccessmanager \
qpainter \
qtestlib-simple events \
qiodevice \
diff --git a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp
new file mode 100644
index 0000000..6a95c81
--- /dev/null
+++ b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QDebug>
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtCore/QTemporaryFile>
+#include <QtCore/QFile>
+#include "../../auto/network-settings.h"
+
+class qfile_vs_qnetworkaccessmanager : public QObject
+{
+ Q_OBJECT
+ // do not use on symbian.. 100 MB is too large..
+ // but.. this is a manual test anyway, so :)
+protected:
+ void qnamFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request);
+ void qfileFileRead_iteration();
+ static const int iterations = 10;
+
+private slots:
+ void qnamFileRead();
+ void qfileFileRead();
+
+ void initTestCase();
+ void cleanupTestCase();
+
+public:
+ qint64 size;
+ QTemporaryFile testFile;
+
+ qfile_vs_qnetworkaccessmanager() : QObject(), size(0) {};
+};
+
+void qfile_vs_qnetworkaccessmanager::initTestCase()
+{
+ testFile.open();
+ QByteArray qba(1*1024*1024, 'x'); // 1 MB
+ for (int i = 0; i < 100; i++) {
+ testFile.write(qba);
+ testFile.flush();
+ size += qba.size();
+ } // 100 MB
+ testFile.reset();
+}
+
+void qfile_vs_qnetworkaccessmanager::cleanupTestCase()
+{
+
+}
+
+void qfile_vs_qnetworkaccessmanager::qnamFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request)
+{
+ QNetworkReply* reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QByteArray qba = reply->readAll();
+ delete reply;
+}
+
+void qfile_vs_qnetworkaccessmanager::qnamFileRead()
+{
+ QNetworkAccessManager manager;
+ QTime t;
+ QNetworkRequest request(QUrl(testFile.fileName()));
+
+ // do 3 dry runs for cache warmup
+ qnamFileRead_iteration(manager, request);
+ qnamFileRead_iteration(manager, request);
+ qnamFileRead_iteration(manager, request);
+
+ t.start();
+ // 10 real runs
+ QBENCHMARK_ONCE {
+ for (int i = 0; i < iterations; i++) {
+ qnamFileRead_iteration(manager, request);
+ }
+ }
+
+ qint64 elapsed = t.elapsed();
+ qDebug() << endl << "Finished!";
+ qDebug() << "Bytes:" << size;
+ qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
+}
+
+void qfile_vs_qnetworkaccessmanager::qfileFileRead_iteration()
+{
+ testFile.reset();
+ QByteArray qba = testFile.readAll();
+}
+
+void qfile_vs_qnetworkaccessmanager::qfileFileRead()
+{
+ QTime t;
+
+ // do 3 dry runs for cache warmup
+ qfileFileRead_iteration();
+ qfileFileRead_iteration();
+ qfileFileRead_iteration();
+
+ t.start();
+ // 10 real runs
+ QBENCHMARK_ONCE {
+ for (int i = 0; i < iterations; i++) {
+ qfileFileRead_iteration();
+ }
+ }
+
+ qint64 elapsed = t.elapsed();
+ qDebug() << endl << "Finished!";
+ qDebug() << "Bytes:" << size;
+ qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
+}
+
+QTEST_MAIN(qfile_vs_qnetworkaccessmanager)
+
+#include "main.moc"
diff --git a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro
new file mode 100644
index 0000000..99d1935
--- /dev/null
+++ b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = qfile_vs_qnetworkaccessmanager
+DEPENDPATH += .
+INCLUDEPATH += .
+
+QT -= gui
+QT += network
+
+CONFIG += release
+
+# Input
+SOURCES += main.cpp