summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-11-23 22:56:00 (GMT)
committerBill King <bill.king@nokia.com>2009-11-23 22:56:00 (GMT)
commit551d72554e50a61015b2b95b0cb2517eb7ac633b (patch)
tree97959c8789f4ab7c46b0e6dbb6ae721e08e22685
parent6c7398254f47a70935607297dee53daa5139608a (diff)
parente494b391984a98ea40867cbe6f6bb01726924162 (diff)
downloadQt-551d72554e50a61015b2b95b0cb2517eb7ac633b.zip
Qt-551d72554e50a61015b2b95b0cb2517eb7ac633b.tar.gz
Qt-551d72554e50a61015b2b95b0cb2517eb7ac633b.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--doc/src/deployment/deployment.qdoc8
-rw-r--r--doc/src/getting-started/examples.qdoc1
-rw-r--r--doc/src/getting-started/known-issues.qdoc20
-rw-r--r--doc/src/howtos/HWacceleration.qdoc100
-rw-r--r--doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc62
-rw-r--r--doc/src/platforms/emb-HwAcc-WinCE.qdoc1
-rw-r--r--doc/src/platforms/emb-hardwareacceleration.qdocinc269
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.cpp9
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.h1
-rw-r--r--examples/itemviews/frozencolumn/grades.txt3
-rw-r--r--examples/webkit/framecapture/framecapture.cpp40
-rw-r--r--examples/webkit/framecapture/framecapture.h2
-rw-r--r--examples/webkit/framecapture/main.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp2
-rw-r--r--src/corelib/io/qiodevice.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/image/qnativeimage.cpp2
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
-rw-r--r--src/gui/kernel/qwidget.cpp5
-rw-r--r--src/gui/kernel/qwidget_x11.cpp7
-rw-r--r--src/gui/styles/qgtkstyle.cpp2
-rw-r--r--src/gui/widgets/qmenubar.cpp3
-rw-r--r--src/gui/widgets/qtabbar.cpp4
-rw-r--r--src/gui/widgets/qtabbar_p.h3
-rw-r--r--src/gui/widgets/qtoolbararealayout_p.h2
-rw-r--r--src/openvg/qpaintengine_vg.cpp28
-rw-r--r--src/openvg/qpaintengine_vg_p.h2
-rw-r--r--src/openvg/qwindowsurface_vg.cpp14
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result16
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result11
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp39
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp112
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp6
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp8
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp25
-rw-r--r--tools/linguist/lconvert/main.cpp6
-rw-r--r--tools/linguist/linguist/messageeditor.cpp6
-rw-r--r--tools/linguist/lupdate/cpp.cpp26
-rw-r--r--tools/linguist/lupdate/main.cpp16
-rw-r--r--tools/linguist/phrasebooks/french.qph36
-rw-r--r--tools/linguist/shared/translator.cpp11
-rw-r--r--tools/linguist/shared/translator.h7
49 files changed, 748 insertions, 235 deletions
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc
index ea841f9..6a1760e 100644
--- a/doc/src/deployment/deployment.qdoc
+++ b/doc/src/deployment/deployment.qdoc
@@ -1491,7 +1491,13 @@
\o Accessibility for Qt3Support is deployed if the application uses the Qt3Support module.
\endlist
- macdeployqt supports the following options:
+ \note If you want a 3rd party library to be included in your
+ application bundle, then you must add an excplicit lib entry for
+ that library to your application's .pro file. Otherwise, the
+ \c macdeployqt tool will not copy the 3rd party .dylib into the
+ bundle.
+
+ \c macdeployqt supports the following options:
\list
\o -no-plugins: Skip plugin deployment
\o -dmg : Create a .dmg disk image
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index b5dc03d..e951804 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -794,6 +794,7 @@
\o \l{opengl/framebufferobject2}{Framebuffer Object 2}
\o \l{opengl/grabber}{Grabber}
\o \l{opengl/hellogl}{Hello GL}\raisedaster
+ \o \l{opengl/hellogl_es}{Hello GL - ported to Windows CE}\raisedaster
\o \l{opengl/overpainting}{Overpainting}\raisedaster
\o \l{opengl/pbuffers}{Pixel Buffers}
\o \l{opengl/pbuffers2}{Pixel Buffers 2}
diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc
index 3c92257..b8c2192 100644
--- a/doc/src/getting-started/known-issues.qdoc
+++ b/doc/src/getting-started/known-issues.qdoc
@@ -61,27 +61,33 @@
\section2 Installing the Source Package on Unix systems
+ \list
+
\o If you download a Zip source package, you will need to convert
Windows-style line endings (CR/LF) to Unix-style line-endings (LF) when
you uncompress the package. To do this, give the "-a" option when you
run the "unzip' command.
-
- If you fail to supply the "-a" option when unzipping the package, you
+
+ \o If you fail to supply the "-a" option when unzipping the package, you
will see the following error message when you attempt to execute the
configure command:
"bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory"
+
\endlist
\section2 Installing on Mac OS X 10.6 "Snow Leopard"
+
\list
+
\o Performing a new install of the Qt 4.6 beta on Snow Leopard
triggers a bug in the installer that causes the install to fail.
Updating an existing Qt installation works fine.
- There are two workarounds, either disable spotlight for the target
+ \o There are two workarounds, either disable spotlight for the target
drive during the install, or do a custom install where you deselect
documentation and examples. Run the installer again as a full
install to get the documentation and examples installed.
+
\endlist
\section1 Issues with Third Party Software
@@ -107,6 +113,7 @@
\section2 Windows
\list
+
\o When using version 6.14.11.6921 of the NVIDIA drivers for the GeForce
6600 GT under Windows XP, Qt applications which use drag and drop will
display reduced size drag and drop icons when run alongside
@@ -122,14 +129,21 @@
\o A bug in the Firebird database can cause an application to crash when
\c{fbembed.dll} is unloaded. The bug is fixed in version 2.5.
+ \o On Windows 7, resizing windows is slower than on Vista/Xp. This is because
+ the gesture initialization process (required for native gesture support)
+ currently calls winId() on widgets, which causes whole widget hierarchies
+ to use native window handles. This slows down resizing.
+
\endlist
\section2 Mac OS X
\list
+
\o If a sheet is opened for a given window, clicking the title bar of that
window will cause it to flash. This behavior has been reported to Apple
(bug number 5827676).
+
\endlist
\section2 Symbian
diff --git a/doc/src/howtos/HWacceleration.qdoc b/doc/src/howtos/HWacceleration.qdoc
new file mode 100644
index 0000000..80db740
--- /dev/null
+++ b/doc/src/howtos/HWacceleration.qdoc
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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$
+**
+****************************************************************************/
+
+/*!
+ \page HWAcc_rendering.html
+ \title Using hardware acceleration on embedded platforms.
+
+ \ingroup best-practices
+
+ \section1 Abstract
+ This document describes how to use hardware acceleration for fast
+ rendering on embedded platforms supported by Qt. In short, it explains
+ how the graphics pipeline works. Since there might be differences to
+ how the APIs are being used on different embedded platforms, a table
+ links to documentation dedicated to platform specific documentation
+ for each supported hardware acceleration API.
+
+ \input platforms/emb-hardwareacceleration.qdocinc
+
+ \section1 Supported platforms
+ Since there might be differences to how the APIs are being used on
+ the different embedded platforms, this table provides you with links to
+ pages dedicated to platform specific documentation for each
+ supported hardware acceleration API. Click the API link for the
+ platform to go the correct documentation.
+
+ \table
+ \header
+ \o Operating System
+ \o {3,1} Hardware Acceleration Platform
+ \row
+ \o \bold {Windows CE}
+ \o \l {Qt for Windows CE and OpenGL ES}{OpenGL ES}
+ \o \l {Qt for Windows CE and OpenVG}{OpenVG}
+ \o
+ \row
+ \o \bold {Embedded Linux}
+ \o \l {Qt for Embedded Linux and OpenGL}{OpenGL ES}
+ \o \l {Qt for Embedded Linux and OpenVG}{OpenVG}
+ \o \l {Qt for Embedded Linux and DirectFB}{DirectFB}
+ \row
+ \o \bold {Symbian Platform}
+ \o {3,1} \e {There are currently no support for hardware
+ acceleration.}
+ \endtable
+\omit
+ \section1 Examples using hardware acceleration on embedded platforms.
+
+ \table
+ \header
+ \o Embedded Platform
+ \o Example
+ \row
+ \o Windows CE
+ \row
+ \o Embedded Linux
+ \endtable
+\endomit
+
+
+
+*/
diff --git a/doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc b/doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc
index 9c18d87..a9bd167 100644
--- a/doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc
+++ b/doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc
@@ -49,23 +49,57 @@
\ingroup qt-embedded-linux
- \input platforms/emb-hardwareacceleration.qdocinc
+ \input platforms/emb-hardwareacceleration.qdocinc
-\section1 Supported Hardware Accelerated Graphics APIs
+ \section1 Windowing on Embedded Linux with Hardware Accelerated Graphics
-This list shows which Hardware Accelerated Graphics APIs currently
-supported by Qt.
+ Qt for Embedded Linux includes its own windowing system, QWS. QWS was
+ designed in 1999, well before graphics acceleration was available for
+ embedded devices. It does a great job providing a lightweight window
+ manager including all the expected functionality such as arbitrary
+ windows that can be moved, resized, minimized, etc. Getting QWS to work
+ with GPUs is very challenging, particularly with OpenGL and OpenVG
+ because there is no standard way in Linux to share textures across
+ processes. Some silicon vendors provide private APIs to allow texture
+ sharing, others do not. These limitations are documented under the
+ sections describing each type of accelerated hardware APIs. The simplest
+ most generic support for accelerated graphics is a full screen single
+ process single window.
- \table
- \header
- \o Supported Hardware Accelerated Graphics APIs
- \row
- \o \l {Qt for Embedded Linux and OpenGL}{OpenGL ES}
- \row
- \o \l {Qt for Embedded Linux and OpenVG}{OpenVG}
- \row
- \o \l {Qt for Embedded Linux and DirectFB}{DirectFB}
- \endtable
+ \section2 General options
+ \list
+ \o QWS, not accelerated, allows arbitrary windowing with multiple
+ processes drawing on the screen.
+ \o X11 with an accelerated X11 driver provided by the silicon
+ vendor. Like QWS, this allows arbitrary windows with multiple
+ processes drawing on the screen. Our experience is that there is
+ some overhead from X11 which will adversely affect framerates.
+ Additionally, our experience is that the drivers from silicon
+ vendors are still maturing.
+ \o Full screen single process single window. This will always work.
+ Some additional capabilities are available and are documented in
+ the acceleration specific API sections.
+ \endlist
+
+ \section1 Supported Hardware Accelerated Graphics APIs
+
+ This table shows which Hardware Accelerated Graphics APIs currently
+ supported by Qt.
+
+ \table
+ \header
+ \o Supported APIs
+ \o API Version
+ \row
+ \o \l {Qt for Embedded Linux and OpenGL}{OpenGL ES}
+ \o 1.x and 2.x
+ \row
+ \o \l {Qt for Embedded Linux and OpenVG}{OpenVG }
+ \o 1.1
+ \row
+ \o \l {Qt for Embedded Linux and DirectFB}{DirectFB}
+ \o 2.0
+ \endtable
*/
diff --git a/doc/src/platforms/emb-HwAcc-WinCE.qdoc b/doc/src/platforms/emb-HwAcc-WinCE.qdoc
index 66b6948..b7789f1 100644
--- a/doc/src/platforms/emb-HwAcc-WinCE.qdoc
+++ b/doc/src/platforms/emb-HwAcc-WinCE.qdoc
@@ -47,7 +47,6 @@
\title Qt for Windows CE Hardware Accelerated Graphics
\ingroup qtce
-
\input platforms/emb-hardwareacceleration.qdocinc
\section1 Supported Hardware Accelerated Graphics APIs
diff --git a/doc/src/platforms/emb-hardwareacceleration.qdocinc b/doc/src/platforms/emb-hardwareacceleration.qdocinc
index 3851628..fb00e09 100644
--- a/doc/src/platforms/emb-hardwareacceleration.qdocinc
+++ b/doc/src/platforms/emb-hardwareacceleration.qdocinc
@@ -1,129 +1,140 @@
-
-\section1 Hardware Acceleration
-
-When designing applications for embedded devices the choice often stands
-between graphics effects and performance. On most devices, you cannot have
-both simply because the hardware needed for such operations just is not
-there. Still a growing number of devices use hardware dedicated to graphics
-operations to improve performance.
-
-Using graphics acceleration hardware is more power efficient than using the
-CPU. The reason for this is that the CPU might require a clock speed that
-is up to 20 times higher than the GPU, achieving the same results. E.g. a
-typical hardware accelerated mobile graphics unit can rasterize one or two
-bilinear texture fetches in one cycle, while a software implementation
-takes easily more than 20 cycles. Graphics hardware generally have a much
-lower clock speed and memory bandwidth and different level of acceleration
-than desktop GPUs. One example is that many GPUs leave out transformation
-and lighting from the graphics pipeline and only implements rasterization.
-
-So the key to write good applications for devices is therefore to limit the
-wow factor down to what the target hardware can handle, and to take
-advantage of any graphics dedicated hardware. Qt provides several ways to
-both render advanced effects on the screen and speed up your application
-using hardware accelerated graphics.
-
-\tableofcontents
-
-\section2 Qt for Embedded Graphics pipeline
-
-Qt uses QPainter for all graphics operations. By using the same API
-regardless of platform, the code can be reused on different devices.
-QPainter use different paint engines implemented in the QPaintEngine API to
-do the actual painting.
-
-The QPaintEngine API provides paint engines for each window system and
-painting framework supported by Qt. In regards to Qt for Embedded, this
-also includes implementations for OpenGL ES versions 1.1 and 2.0, as well
-as OpenVG and DirectFB(Embedded Linux only).
-
-By using one of these paint engines, you will be able to improve the
-graphics performance of your Qt application. However, if the graphics
-operations used are not supported, this might as well be a trap, slowing
-down your application significantly. This all depends on what kind of
-graphics operations that are supported by the target devices hardware
-configuration.
-
-\image platformHWAcc.png
-
-The paint engine will direct all graphics operations supported by the
-devices hardware to the GPU, and from there they are sent to the
-framebuffer. Unsupported graphics operations falls back to the
-QRasterPaintEngine and are handled by the CPU before sent to the
-framebuffer. In the end, the operating system sends the paint updates off
-to the screen/display. The fallback operation is quite expensive in regards
-to memory consumption, and should be avoided.
-
-\section2 Hardware configuration requirements
-
-Before implementing any application using hardware acceleration, it is wise
-to get an overview of what kind of hardware accelerated graphics operations
-that are available for the target device.
-
-\note On devices with no hardware acceleration, Qt will use
-QRasterPaintEngine, which handles the acceleration using software. On
-devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows
-CE), Qt will use the
-respective paint engines to accelerate painting. However, hardware
-configurations that only support a limited set of hardware acceleration
-features, might slow the application graphics down rather than speeding it
-up when using unsupported operations that must fall back to the raster
-engine.
-
-\section3 Different architectures
-
-Based on the architecture used in a device we can make a recommendation on
-which hardware acceleration techniques to use. There are mainly two
-different architectures on embedded devices. These are devices with a
-Unified Memory Architecture (UMA), and devices with dedicated graphics
-memory. Generally, high-end devices will have dedicated graphics memory.
-Low-end devices will just use system memory, sometimes reserving a memory
-region and sometimes not.
-
-In addition to this, we can categorize the devices into five types based on
-the different graphics operations supported by their hardware.
-
-\list 1
- \o No support for graphics acceleration.
- \o Support for blitter and alpha blending.
- \o Support for path based 2D vector graphics.
- \o Support for fixed function 3D graphics.
- \o Support for programmable 3D graphics.
-\endlist
-
-Based on these characteristics the table below recommends which paint
-engines to use with the different types of hardware configurations.
-
-\section3 Recommended use of hardware acceleration based on hardware
-
- \table
- \header
- \o Type
- \o UMA
- \o Non-UMA
- \row
- \o \bold {None}
- \o Qt Raster Engine
- \o Qt Raster Engine
- \row
- \o \bold {Blitter}
- \o DirectFB
- \o DirectFB
- \row
- \o \bold {2D Vector}
- \o OpenVG
- \o OpenVG
- \row
- \o \bold {Fixed 3D}
- \o OpenGL (ES) 1.x
- \o OpenGL (ES) 1.x
- \row
- \o \bold {Programmable 3D}
- \o OpenGL (ES) 2.x
- \o OpenGL (ES) 2.x
-
- \endtable
-
-\note Since the DirectFB API is quite primitive, the raster paint engine
-handles most of the operations.
-\note Blitter and Alpha blending is currently not supported on Windows CE.
+ \section1 Hardware Acceleration
+
+ When designing applications for embedded devices there is often a
+ compromise between graphics effects and performance. On most
+ devices, you cannot have both simply because the hardware needed
+ for such operations just is not there. With a growing number of
+ devices that use hardware dedicated to graphics operations there is
+ less need to compromise.
+
+ In addition to enabling dynamic graphics effects, there are two
+ other benefits to using graphics acceleration. One is that graphics
+ acceleration hardware is more power efficient than using the CPU.
+ The reason for this is that the CPU might require a clock speed
+ that is up to 20 times higher than the GPU, achieving the same
+ results. E.g. a typical hardware accelerated mobile graphics unit
+ can rasterize one or two bilinear texture fetches in one cycle,
+ while a software implementation takes easily more than 20 cycles.
+ Typical \e {System-on-a-chip} (SoC) graphics hardware generally have
+ a much lower clock speed and memory bandwidth, and different level
+ of acceleration than desktop GPUs. One example is that many GPUs
+ leave out transformation and lighting from the graphics pipeline
+ and only implements rasterization.
+
+ Another reason to use a GPU is to offload the main CPU, either for
+ power saving or to perform other operations in parallel. Often
+ drawing speed with a GPU is not that much faster than a CPU but
+ the clear benefit of using the GPU is to free up the CPU to perform
+ other tasks which can be used to create a more responsive use
+ experience.
+
+ The key to writing good applications for devices is therefore to
+ limit the wow factor down to what the target hardware can handle,
+ and to take advantage of any graphics dedicated hardware. Qt
+ provides several ways to both render advanced effects on the screen
+ and speed up your application using hardware accelerated graphics.
+
+ \tableofcontents
+
+ \section2 Qt for Embedded Graphics pipeline
+
+ Qt uses QPainter for all graphics operations. By using the same API
+ regardless of platform, the code can be reused on different devices.
+ QPainter use different paint engines implemented in the QPaintEngine API to
+ do the actual painting.
+
+ The QPaintEngine API provides paint engines for each window system and
+ painting framework supported by Qt. In regards to Qt for Embedded, this
+ also includes implementations for OpenGL ES versions 1.1 and 2.0, as well
+ as OpenVG and DirectFB(Embedded Linux only).
+
+ By using one of these paint engines, you will be able to improve the
+ graphics performance of your Qt application. However, if the graphics
+ operations used are not supported, this might as well be a trap, slowing
+ down your application significantly. This all depends on what kind of
+ graphics operations that are supported by the target devices hardware
+ configuration.
+
+ \image platformHWAcc.png
+
+ The paint engine will direct all graphics operations supported by the
+ devices hardware to the GPU, and from there they are sent to the
+ framebuffer. Unsupported graphics operations falls back to the
+ QRasterPaintEngine and are handled by the CPU before sent to the
+ framebuffer. In the end, the operating system sends the paint updates off
+ to the screen/display. The fallback operation is quite expensive in regards
+ to memory consumption, and should be avoided.
+
+ \section2 Hardware configuration requirements
+
+ Before implementing any application using hardware acceleration, it is wise
+ to get an overview of what kind of hardware accelerated graphics operations
+ that are available for the target device.
+
+ \note On devices with no hardware acceleration, Qt will use
+ QRasterPaintEngine, which handles the acceleration using software. On
+ devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows
+ CE), Qt will use the
+ respective paint engines to accelerate painting. However, hardware
+ configurations that only support a limited set of hardware acceleration
+ features, might slow the application graphics down rather than speeding it
+ up when using unsupported operations that must fall back to the raster
+ engine.
+
+ \section3 Different architectures
+
+ Based on the architecture used in a device we can make a recommendation on
+ which hardware acceleration techniques to use. There are mainly two
+ different architectures on embedded devices. These are devices with a
+ Unified Memory Architecture (UMA), and devices with dedicated graphics
+ memory. Generally, high-end devices will have dedicated graphics memory.
+ Low-end devices will just use system memory, sometimes reserving a memory
+ region and sometimes not.
+
+ In addition to this, we can categorize the devices into five types based on
+ the different graphics operations supported by their hardware.
+
+ \list 1
+ \o No support for graphics acceleration.
+ \o Support for blitter and alpha blending.
+ \o Support for path based 2D vector graphics.
+ \o Support for fixed function 3D graphics.
+ \o Support for programmable 3D graphics.
+ \endlist
+
+ Based on these characteristics the table below recommends which paint
+ engines to use with the different types of hardware configurations.
+
+ \section3 Recommended use of hardware acceleration based on hardware
+
+ \table
+ \header
+ \o Type
+ \o UMA
+ \o Non-UMA
+ \row
+ \o \bold {None}
+ \o Qt Raster Engine
+ \o Qt Raster Engine
+ \row
+ \o \bold {Blitter}
+ \o DirectFB
+ \o DirectFB
+ \row
+ \o \bold {2D Vector}
+ \o OpenVG
+ \o OpenVG
+ \row
+ \o \bold {Fixed 3D}
+ \o OpenGL (ES) 1.x
+ \o OpenGL (ES) 1.x
+ \row
+ \o \bold {Programmable 3D}
+ \o OpenGL (ES) 2.x
+ \o OpenGL (ES) 2.x
+ \endtable
+
+ \note Since the DirectFB API is quite primitive, the raster paint engine
+ handles most of the operations.
+
+ \note Blitter and Alpha blending is currently not supported on Windows CE.
diff --git a/examples/itemviews/frozencolumn/freezetablewidget.cpp b/examples/itemviews/frozencolumn/freezetablewidget.cpp
index ee50ae1..72dc2a1 100644
--- a/examples/itemviews/frozencolumn/freezetablewidget.cpp
+++ b/examples/itemviews/frozencolumn/freezetablewidget.cpp
@@ -84,7 +84,8 @@ void FreezeTableWidget::init()
//! [init part2]
frozenTableView->setStyleSheet("QTableView { border: none;"
- "background-color: #8EDE21;}"); //for demo purposes
+ "background-color: #8EDE21;"
+ "selection-background-color: #999}"); //for demo purposes
frozenTableView->setSelectionModel(selectionModel());
for(int col=1; col<model()->columnCount(); col++)
frozenTableView->setColumnHidden(col, true);
@@ -146,6 +147,12 @@ QModelIndex FreezeTableWidget::moveCursor(CursorAction cursorAction,
}
//! [navigate]
+void FreezeTableWidget::scrollTo (const QModelIndex & index, ScrollHint hint){
+ if(index.column()>0)
+ QTableView::scrollTo(index, hint);
+}
+
+
//! [geometry]
void FreezeTableWidget::updateFrozenTableGeometry()
diff --git a/examples/itemviews/frozencolumn/freezetablewidget.h b/examples/itemviews/frozencolumn/freezetablewidget.h
index 403890f..d236d40 100644
--- a/examples/itemviews/frozencolumn/freezetablewidget.h
+++ b/examples/itemviews/frozencolumn/freezetablewidget.h
@@ -56,6 +56,7 @@ public:
protected:
virtual void resizeEvent(QResizeEvent *event);
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
+ void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible);
private:
QTableView *frozenTableView;
diff --git a/examples/itemviews/frozencolumn/grades.txt b/examples/itemviews/frozencolumn/grades.txt
index 4b55b473..e1c6fcc 100644
--- a/examples/itemviews/frozencolumn/grades.txt
+++ b/examples/itemviews/frozencolumn/grades.txt
@@ -32,4 +32,5 @@
9a+ , , 5.15a , , , XI+ , , , , 12a
9b , , 5.15b , , , , , , , 12b
-# Wikipedia contributors. Grade (climbing). Wikipedia, The Free Encyclopedia. May 15, 2009, 20:42 UTC. Available at: http://en.wikipedia.org/w/index.php?title=Grade_(climbing)&oldid=290165724. Accessed May 28, 2009.
+# Wikipedia contributors. Grade (climbing). Wikipedia, The Free Encyclopedia. May 15, 2009, 20:42 UTC.
+# Available at: http://en.wikipedia.org/w/index.php?title=Grade_(climbing)&oldid=290165724. Accessed May 28, 2009.
diff --git a/examples/webkit/framecapture/framecapture.cpp b/examples/webkit/framecapture/framecapture.cpp
index 2c2e11b..ef49e93 100644
--- a/examples/webkit/framecapture/framecapture.cpp
+++ b/examples/webkit/framecapture/framecapture.cpp
@@ -59,6 +59,7 @@ void FrameCapture::load(const QUrl &url, const QString &outputFileName)
m_page.mainFrame()->load(url);
m_page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
m_page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+ m_page.setViewportSize(QSize(1024, 768));
}
void FrameCapture::printProgress(int percent)
@@ -81,41 +82,36 @@ void FrameCapture::saveResult(bool ok)
return;
}
- // save each internal frame in different image files
- int frameCounter = 0;
- foreach(QWebFrame *frame, m_page.mainFrame()->childFrames()) {
- QString fileName(m_fileName);
- int index = m_fileName.lastIndexOf('.');
- fileName = fileName.insert(index, "_frame" + QString::number(++frameCounter));
+ // save each frame in different image files
+ saveFrame(m_page.mainFrame());
- frame->setClipRenderToViewport(false);
+ emit finished();
+}
- QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied);
- image.fill(Qt::transparent);
+void FrameCapture::saveFrame(QWebFrame *frame)
+{
+ static int frameCounter = 0;
- saveFrame(frame, image, fileName);
+ QString fileName(m_fileName);
+ if (frameCounter) {
+ int index = m_fileName.lastIndexOf('.');
+ fileName = fileName.insert(index, "_frame" + QString::number(frameCounter));
}
- // save the main frame
- m_page.setViewportSize(m_page.mainFrame()->contentsSize());
- QImage image(m_page.mainFrame()->contentsSize(), QImage::Format_ARGB32_Premultiplied);
+ QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
- saveFrame(m_page.mainFrame(), image, m_fileName);
-
- emit finished();
-}
-void FrameCapture::saveFrame(QWebFrame *frame, QImage image, QString fileName)
-{
QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
-
- frame->render(&painter);
-
+ frame->documentElement().render(&painter);
painter.end();
image.save(fileName);
+
+ ++frameCounter;
+ foreach(QWebFrame *childFrame, frame->childFrames())
+ saveFrame(childFrame);
}
diff --git a/examples/webkit/framecapture/framecapture.h b/examples/webkit/framecapture/framecapture.h
index 9de9c43..7a6d5f3 100644
--- a/examples/webkit/framecapture/framecapture.h
+++ b/examples/webkit/framecapture/framecapture.h
@@ -64,7 +64,7 @@ private:
QString m_fileName;
int m_percent;
- void saveFrame(QWebFrame *frame, QImage image, QString fileName);
+ void saveFrame(QWebFrame *frame);
};
#endif
diff --git a/examples/webkit/framecapture/main.cpp b/examples/webkit/framecapture/main.cpp
index 050947a..65c0026 100644
--- a/examples/webkit/framecapture/main.cpp
+++ b/examples/webkit/framecapture/main.cpp
@@ -63,7 +63,7 @@ int main(int argc, char * argv[])
return 0;
}
- QUrl url = QWebView::guessUrlFromString(QString::fromLatin1(argv[1]));
+ QUrl url = QUrl::fromUserInput(QString::fromLatin1(argv[1]));
QString fileName = QString::fromLatin1(argv[2]);
QApplication a(argc, argv);
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 05e6fab..35737b3 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1254,7 +1254,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
// undefined behavior. Otherwise, let mmap have its say.
if (doStat()
&& (QT_OFF_T(size) > st.st_size - QT_OFF_T(offset)))
- return 0;
+ qWarning("QFSFileEngine::map: Mapping a file beyond its size is not portable");
int access = 0;
if (openMode & QIODevice::ReadOnly) access |= PROT_READ;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index b84961f..0e5a2de 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1157,6 +1157,10 @@ QByteArray QIODevice::readLine(qint64 maxSize)
// If resize fails or maxSize == 0, read incrementally
if (maxSize == 0)
maxSize = INT_MAX;
+
+ // The first iteration needs to leave an extra byte for the terminating null
+ result.resize(1);
+
qint64 readResult;
do {
result.resize(int(qMin(maxSize, result.size() + QIODEVICE_BUFFERSIZE)));
@@ -1164,7 +1168,7 @@ QByteArray QIODevice::readLine(qint64 maxSize)
if (readResult > 0 || readBytes == 0)
readBytes += readResult;
} while (readResult == QIODEVICE_BUFFERSIZE
- && result[int(readBytes)] != '\n');
+ && result[int(readBytes - 1)] != '\n');
} else
readBytes = readLine(result.data(), result.size());
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 3f6dff2..710048e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1240,7 +1240,7 @@ void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, con
const QTransform reverseMap = worldTransform.inverted();
const QVector<QRect> exposedRects(exposedRegion.rects());
for (int i = 0; i < exposedRects.size(); ++i) {
- option->exposedRect |= reverseMap.mapRect(exposedRects.at(i));
+ option->exposedRect |= reverseMap.mapRect(QRectF(exposedRects.at(i)));
if (option->exposedRect.contains(brect))
break;
}
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index e4ea2e9..3b43ab6 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -178,6 +178,8 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /*
if (ok) {
xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
xshminfo.shmaddr = xshmimg->data;
+ if (shmctl(xshminfo.shmid, IPC_RMID, 0) == -1)
+ qWarning() << "Error while marking the shared memory segment to be destroyed";
ok = (xshminfo.shmaddr != (char*)-1);
if (ok)
image = QImage((uchar *)xshmimg->data, width, height, systemFormat());
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index a3877b7..d27e693 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -114,7 +114,7 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
}
} else if (old_height > span->height()) {
//remove the span from all the subspans lists that intersect the columns not covered anymore
- Index::iterator it_y = index.lowerBound(-span->bottom());
+ Index::iterator it_y = index.lowerBound(qMin(-span->bottom(), 0));
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
while (-it_y.key() <= span->top() + old_height -1) {
if (-it_y.key() > span->bottom()) {
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index a16d1f8..72eedad 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1451,7 +1451,7 @@ Qt::DropAction QDragManager::drag(QDrag *o)
[image release];
dragPrivate()->executed_action = Qt::IgnoreAction;
object = 0;
- Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams.performedAction));
+ Qt::DropAction performedAction(qt_mac_mapNSDragOperation(qMacDnDParams()->performedAction));
// do post drag processing, if required.
if(performedAction != Qt::IgnoreAction) {
// check if the receiver points us to a file location.
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 709f6f3..fbb9115 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8248,7 +8248,8 @@ bool QWidget::event(QEvent *event)
QList<QObject*> childList = d->children;
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
- QApplication::sendEvent(o, event);
+ if (o)
+ QApplication::sendEvent(o, event);
}
}
update();
@@ -8277,7 +8278,7 @@ bool QWidget::event(QEvent *event)
QList<QObject*> childList = d->children;
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
- if (o != QApplication::activeModalWidget()) {
+ if (o && o != QApplication::activeModalWidget()) {
if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->isWindow()) {
// do not forward the event to child windows,
// QApplication does this for us
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 7461637..0bc9cbc 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -527,8 +527,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
xinfo.setX11Data(xd);
} else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
- || parentXinfo->visual() != xinfo.visual()))
+ || (parentXinfo->visual() != xinfo.visual()
+ && !q->inherits("QGLWidget"))))
{
+ // QGLWidgets have to be excluded here as they have a
+ // specially crafted QX11Info structure which can't be swapped
+ // out with the parent widgets QX11Info. The parent visual,
+ // for instance, might not even be GL capable.
xinfo = *parentXinfo;
}
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 5566cc6..b32c55b 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1368,7 +1368,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else {
gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect,
option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
- GTK_SHADOW_NONE, style, entryPath + QString::number(focus));
+ GTK_SHADOW_NONE, gtkCombo->style, entryPath + QString::number(focus));
}
gtkCachedPainter.paintShadow(gtkEntry, comboBox->editable ? "entry" : "frame", frameRect, frameState,
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index e50de02..377b39a 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -736,6 +736,9 @@ void QMenuBarPrivate::init()
if(wce_menubar)
q->hide();
}
+ else {
+ QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
+ }
#endif
#ifdef Q_WS_S60
symbianCreateMenuBar(q->parentWidget());
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 3935c55..8ef6017 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1948,7 +1948,8 @@ void QTabBar::changeEvent(QEvent *event)
Q_D(QTabBar);
if (event->type() == QEvent::StyleChange) {
d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this));
- d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
+ if (!d->useScrollButtonsSetByUser)
+ d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
d->refresh();
} else if (event->type() == QEvent::FontChange) {
d->refresh();
@@ -2003,6 +2004,7 @@ bool QTabBar::usesScrollButtons() const
void QTabBar::setUsesScrollButtons(bool useButtons)
{
Q_D(QTabBar);
+ d->useScrollButtonsSetByUser = true;
if (d->useScrollButtons == useButtons)
return;
d->useScrollButtons = useButtons;
diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h
index 9f3285b..2e8fb6d 100644
--- a/src/gui/widgets/qtabbar_p.h
+++ b/src/gui/widgets/qtabbar_p.h
@@ -75,7 +75,7 @@ class QTabBarPrivate : public QWidgetPrivate
public:
QTabBarPrivate()
:currentIndex(-1), pressedIndex(-1), shape(QTabBar::RoundedNorth), layoutDirty(false),
- drawBase(true), scrollOffset(0), expanding(true), closeButtonOnTabs(false),
+ drawBase(true), scrollOffset(0), useScrollButtonsSetByUser(false) , expanding(true), closeButtonOnTabs(false),
selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false),
dragInProgress(false), documentMode(false), movingTab(0)
#ifdef Q_WS_MAC
@@ -187,6 +187,7 @@ public:
QSize iconSize;
Qt::TextElideMode elideMode;
bool useScrollButtons;
+ bool useScrollButtonsSetByUser;
bool expanding;
bool closeButtonOnTabs;
diff --git a/src/gui/widgets/qtoolbararealayout_p.h b/src/gui/widgets/qtoolbararealayout_p.h
index f0ab80c..134e95a 100644
--- a/src/gui/widgets/qtoolbararealayout_p.h
+++ b/src/gui/widgets/qtoolbararealayout_p.h
@@ -118,7 +118,7 @@ public:
void extendSize(Qt::Orientation o, int extent)
{
- int newSize = qMax(pick(o, minimumSize()), (preferredSize > 0 ? preferredSize : size) + extent);
+ int newSize = qMax(pick(o, minimumSize()), (preferredSize > 0 ? preferredSize : pick(o, sizeHint())) + extent);
int sizeh = pick(o, sizeHint());
if (newSize == sizeh) {
preferredSize = -1;
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 75b7fa5..fda4b10 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3407,6 +3407,34 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty)
#endif
}
+void QVGPaintEngine::fillRegion
+ (const QRegion& region, const QColor& color, const QSize& surfaceSize)
+{
+ Q_D(QVGPaintEngine);
+ if (d->clearColor != color || d->clearOpacity != 1.0f) {
+ VGfloat values[4];
+ values[0] = color.redF();
+ values[1] = color.greenF();
+ values[2] = color.blueF();
+ values[3] = color.alphaF();
+ vgSetfv(VG_CLEAR_COLOR, 4, values);
+ d->clearColor = color;
+ d->clearOpacity = 1.0f;
+ }
+ if (region.rectCount() == 1) {
+ QRect r = region.boundingRect();
+ vgClear(r.x(), surfaceSize.height() - r.y() - r.height(),
+ r.width(), r.height());
+ } else {
+ const QVector<QRect> rects = region.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ QRect r = rects.at(i);
+ vgClear(r.x(), surfaceSize.height() - r.y() - r.height(),
+ r.width(), r.height());
+ }
+ }
+}
+
#if !defined(QVG_NO_SINGLE_CONTEXT) && !defined(QT_NO_EGL)
QVGCompositionHelper::QVGCompositionHelper()
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 1202b55..86a522a 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -151,6 +151,8 @@ public:
QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; }
+ void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize);
+
protected:
QVGPaintEngine(QVGPaintEnginePrivate &data);
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index f8486a6..a1301e3 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -48,6 +48,7 @@
#if !defined(QT_NO_EGL)
#include <QtGui/private/qegl_p.h>
+#include <QtGui/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -71,7 +72,6 @@ QVGWindowSurface::~QVGWindowSurface()
QPaintDevice *QVGWindowSurface::paintDevice()
{
- d_ptr->beginPaint(window());
return this;
}
@@ -94,8 +94,16 @@ bool QVGWindowSurface::scroll(const QRegion &area, int dx, int dy)
void QVGWindowSurface::beginPaint(const QRegion &region)
{
- // Nothing to do here.
- Q_UNUSED(region);
+ d_ptr->beginPaint(window());
+
+ // If the window is not opaque, then fill the region we are about
+ // to paint with the transparent color.
+ if (!qt_widget_private(window())->isOpaque &&
+ window()->testAttribute(Qt::WA_TranslucentBackground)) {
+ QVGPaintEngine *engine = static_cast<QVGPaintEngine *>
+ (d_ptr->paintEngine());
+ engine->fillRegion(region, Qt::transparent, d_ptr->surfaceSize());
+ }
}
void QVGWindowSurface::endPaint(const QRegion &region)
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
index 158633d..9687908 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
@@ -2,6 +2,8 @@
TEMPLATE = subdirs
# We just want to export the sqlite3 binaries for Symbian for platforms that do not have them.
-!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
- BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
+symbian {
+ !exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
+ BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
+ }
}
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
index 158451a..d99723e 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
@@ -47,12 +47,21 @@
int main(int argc, char **argv)
{
QApplication a(argc, argv);
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+
QWidget w;
QLabel label1(QObject::tr("abc", "ascii"), &w);
QLabel label2(QObject::tr("æøå", "utf-8"), &w);
+ QLabel label2a(QObject::tr("\303\246\303\270\303\245", "utf-8 oct"), &w);
+ QLabel label3(QObject::trUtf8("Für Élise", "trUtf8"), &w);
+ QLabel label3a(QObject::trUtf8("F\303\274r \303\211lise", "trUtf8 oct"), &w);
-// I would expect the following to work !?
-// QLabel label3(QObject::trUtf8("F\374r \310lise", "trUtf8"), &w);
+ QBoxLayout *ly = new QVBoxLayout(&w);
+ ly->addWidget(&label1);
+ ly->addWidget(&label2);
+ ly->addWidget(&label2a);
+ ly->addWidget(&label3);
+ ly->addWidget(&label3a);
w.show();
return a.exec();
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
index bc0d9bb..711bf02 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
@@ -5,16 +5,34 @@
<context>
<name>QObject</name>
<message>
- <location filename="main.cpp" line="51"/>
+ <location filename="main.cpp" line="53"/>
<source>abc</source>
<comment>ascii</comment>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="main.cpp" line="52"/>
+ <location filename="main.cpp" line="54"/>
<source>æøå</source>
<comment>utf-8</comment>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="main.cpp" line="55"/>
+ <source>æøå</source>
+ <comment>utf-8 oct</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>Für Élise</source>
+ <comment>trUtf8</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="57"/>
+ <source>Für Élise</source>
+ <comment>trUtf8 oct</comment>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
index 91da744..6ee369a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
@@ -6,7 +6,7 @@
<name>QObject</name>
<message>
<location filename="main.cpp" line="61"/>
- <source>Á</source>
+ <source>Б</source>
<translation type="unfinished"></translation>
</message>
</context>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
index abb8b89..98b491c 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
@@ -49,9 +49,11 @@ public:
void doFoo()
{
tr("random ascii only");
- tr("this contains an umlaut &uuml;");
+ tr("this contains an umlaut &uuml; literally");
+ tr("this contains an umlaut \xfc &uuml; escaped");
trUtf8("random ascii only in utf8");
- trUtf8("umlaut \xfc &uuml; in utf8");
+ trUtf8("umlaut ü &uuml; in literal utf8");
+ trUtf8("umlaut \303\274 &uuml; in escaped utf8");
}
};
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
index 26eb245..d548e24 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
@@ -11,17 +11,27 @@
</message>
<message>
<location filename="main.cpp" line="52"/>
- <source>this contains an umlaut ü &amp;uuml;</source>
+ <source>this contains an umlaut ü &amp;uuml; literally</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="53"/>
+ <source>this contains an umlaut ü &amp;uuml; escaped</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="54"/>
<source>random ascii only in utf8</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
- <location filename="main.cpp" line="54"/>
- <source>umlaut ü &amp;uuml; in utf8</source>
+ <location filename="main.cpp" line="55"/>
+ <source>umlaut ü &amp;uuml; in literal utf8</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message utf8="true">
+ <location filename="main.cpp" line="56"/>
+ <source>umlaut ü &amp;uuml; in escaped utf8</source>
<translation type="unfinished"></translation>
</message>
</context>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
index abb8b89..cd93539 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
@@ -49,9 +49,10 @@ public:
void doFoo()
{
tr("random ascii only");
- tr("this contains an umlaut &uuml;");
+ tr("this contains an umlaut &uuml; literally");
+ tr("this contains an umlaut \303\274 &uuml; escaped, really in utf-8");
trUtf8("random ascii only in utf8");
- trUtf8("umlaut \xfc &uuml; in utf8");
+ trUtf8("umlaut \303\274 &uuml; in escaped utf8");
}
};
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
index e27c157..6728a25 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
@@ -11,17 +11,22 @@
</message>
<message>
<location filename="main.cpp" line="52"/>
- <source>this contains an umlaut ü &amp;uuml;</source>
+ <source>this contains an umlaut ü &amp;uuml; literally</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="53"/>
- <source>random ascii only in utf8</source>
+ <source>this contains an umlaut ü &amp;uuml; escaped, really in utf-8</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="54"/>
- <source>umlaut ü &amp;uuml; in utf8</source>
+ <source>random ascii only in utf8</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="55"/>
+ <source>umlaut ü &amp;uuml; in escaped utf8</source>
<translation type="unfinished"></translation>
</message>
</context>
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 1ff06c2..797e1fb 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -235,6 +235,7 @@ private slots:
void task259503_scrollingArtifacts();
void QTBUG_4151_clipAndIgnore_data();
void QTBUG_4151_clipAndIgnore();
+ void QTBUG_5859_exposedRect();
};
void tst_QGraphicsView::initTestCase()
@@ -3867,5 +3868,43 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
QCOMPARE(view.items(view.rect()).size(), numItems);
}
+void tst_QGraphicsView::QTBUG_5859_exposedRect()
+{
+ class CustomScene : public QGraphicsScene
+ {
+ public:
+ CustomScene(const QRectF &rect) : QGraphicsScene(rect) { }
+ void drawBackground(QPainter *painter, const QRectF &rect)
+ { lastBackgroundExposedRect = rect; }
+ QRectF lastBackgroundExposedRect;
+ };
+
+ class CustomRectItem : public QGraphicsRectItem
+ {
+ public:
+ CustomRectItem(const QRectF &rect) : QGraphicsRectItem(rect)
+ { setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); }
+ void paint(QPainter * painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
+ { lastExposedRect = option->exposedRect; }
+ QRectF lastExposedRect;
+ };
+
+ CustomScene scene(QRectF(0,0,50,50));
+
+ CustomRectItem item(scene.sceneRect());
+
+ scene.addItem(&item);
+
+ QGraphicsView view(&scene);
+ view.scale(4.15, 4.15);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ view.viewport()->repaint(10,10,20,20);
+ QApplication::processEvents();
+
+ QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect);
+}
+
QTEST_MAIN(tst_QGraphicsView)
#include "tst_qgraphicsview.moc"
diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index 056ad6a..84fd8ad 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -77,6 +77,9 @@ private slots:
void readLine_data();
void readLine();
+
+ void readLine2_data();
+ void readLine2();
};
// Testing get/set functions
@@ -453,5 +456,114 @@ void tst_QIODevice::readLine()
QCOMPARE(line.size(), linelen);
}
+void tst_QIODevice::readLine2_data()
+{
+ QTest::addColumn<QByteArray>("line");
+
+ QTest::newRow("1024 - 4") << QByteArray(1024 - 4, 'x');
+ QTest::newRow("1024 - 3") << QByteArray(1024 - 3, 'x');
+ QTest::newRow("1024 - 2") << QByteArray(1024 - 2, 'x');
+ QTest::newRow("1024 - 1") << QByteArray(1024 - 1, 'x');
+ QTest::newRow("1024" ) << QByteArray(1024 , 'x');
+ QTest::newRow("1024 + 1") << QByteArray(1024 + 1, 'x');
+ QTest::newRow("1024 + 2") << QByteArray(1024 + 2, 'x');
+
+ QTest::newRow("4096 - 4") << QByteArray(4096 - 4, 'x');
+ QTest::newRow("4096 - 3") << QByteArray(4096 - 3, 'x');
+ QTest::newRow("4096 - 2") << QByteArray(4096 - 2, 'x');
+ QTest::newRow("4096 - 1") << QByteArray(4096 - 1, 'x');
+ QTest::newRow("4096" ) << QByteArray(4096 , 'x');
+ QTest::newRow("4096 + 1") << QByteArray(4096 + 1, 'x');
+ QTest::newRow("4096 + 2") << QByteArray(4096 + 2, 'x');
+
+ QTest::newRow("8192 - 4") << QByteArray(8192 - 4, 'x');
+ QTest::newRow("8192 - 3") << QByteArray(8192 - 3, 'x');
+ QTest::newRow("8192 - 2") << QByteArray(8192 - 2, 'x');
+ QTest::newRow("8192 - 1") << QByteArray(8192 - 1, 'x');
+ QTest::newRow("8192" ) << QByteArray(8192 , 'x');
+ QTest::newRow("8192 + 1") << QByteArray(8192 + 1, 'x');
+ QTest::newRow("8192 + 2") << QByteArray(8192 + 2, 'x');
+
+ QTest::newRow("16384 - 4") << QByteArray(16384 - 4, 'x');
+ QTest::newRow("16384 - 3") << QByteArray(16384 - 3, 'x');
+ QTest::newRow("16384 - 2") << QByteArray(16384 - 2, 'x');
+ QTest::newRow("16384 - 1") << QByteArray(16384 - 1, 'x');
+ QTest::newRow("16384" ) << QByteArray(16384 , 'x');
+ QTest::newRow("16384 + 1") << QByteArray(16384 + 1, 'x');
+ QTest::newRow("16384 + 2") << QByteArray(16384 + 2, 'x');
+
+ QTest::newRow("20000") << QByteArray(20000, 'x');
+
+ QTest::newRow("32768 - 4") << QByteArray(32768 - 4, 'x');
+ QTest::newRow("32768 - 3") << QByteArray(32768 - 3, 'x');
+ QTest::newRow("32768 - 2") << QByteArray(32768 - 2, 'x');
+ QTest::newRow("32768 - 1") << QByteArray(32768 - 1, 'x');
+ QTest::newRow("32768" ) << QByteArray(32768 , 'x');
+ QTest::newRow("32768 + 1") << QByteArray(32768 + 1, 'x');
+ QTest::newRow("32768 + 2") << QByteArray(32768 + 2, 'x');
+
+ QTest::newRow("40000") << QByteArray(40000, 'x');
+}
+
+void tst_QIODevice::readLine2()
+{
+ QFETCH(QByteArray, line);
+
+ int length = line.size();
+
+ QByteArray data("First line.\r\n");
+ data.append(line);
+ data.append("\r\n");
+ data.append(line);
+ data.append("\r\n");
+ data.append("\r\n0123456789");
+
+ {
+ QBuffer buffer(&data);
+ buffer.open(QIODevice::ReadOnly);
+
+ buffer.seek(0);
+ QByteArray temp;
+ temp.resize(64536);
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(13));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(10));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(-1));
+
+ buffer.seek(0);
+ QCOMPARE(buffer.readLine().size(), 13);
+ QCOMPARE(buffer.readLine().size(), length + 2);
+ QCOMPARE(buffer.readLine().size(), length + 2);
+ QCOMPARE(buffer.readLine().size(), 2);
+ QCOMPARE(buffer.readLine().size(), 10);
+ QVERIFY(buffer.readLine().isNull());
+ }
+
+ {
+ QBuffer buffer(&data);
+ buffer.open(QIODevice::ReadOnly | QIODevice::Text);
+
+ buffer.seek(0);
+ QByteArray temp;
+ temp.resize(64536);
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(12));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(10));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(-1));
+
+ buffer.seek(0);
+ QCOMPARE(buffer.readLine().size(), 12);
+ QCOMPARE(buffer.readLine().size(), length + 1);
+ QCOMPARE(buffer.readLine().size(), length + 1);
+ QCOMPARE(buffer.readLine().size(), 1);
+ QCOMPARE(buffer.readLine().size(), 10);
+ QVERIFY(buffer.readLine().isNull());
+ }
+}
+
QTEST_MAIN(tst_QIODevice)
#include "tst_qiodevice.moc"
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index 2db72b9..e83312d 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -295,6 +295,10 @@ void tst_QTabBar::setUsesScrollButtons()
if (usesArrows != -128)
tabBar.setUsesScrollButtons(usesArrows);
QTEST(tabBar.usesScrollButtons(), "expectedArrows");
+
+ // Make sure style sheet does not override user set mode
+ tabBar.setStyleSheet("QWidget { background-color: #ABA8A6;}");
+ QTEST(tabBar.usesScrollButtons(), "expectedArrows");
}
void tst_QTabBar::removeLastTab()
@@ -532,7 +536,7 @@ void tst_QTabBar::task251184_removeTab()
QCOMPARE(bar.count(), 1);
QCOMPARE(bar.currentIndex(), 0);
- QCOMPARE(bar.tabText(bar.currentIndex()), QString("bar2"));
+ QCOMPARE(bar.tabText(bar.currentIndex()), QString("bar2"));
}
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 46c3fb6..50d6c67 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -3016,6 +3016,14 @@ void tst_QTableView::spans_data()
<< QPoint(2, 0)
<< 1
<< 2;
+
+ QTest::newRow("QTBUG-6004: No failing Q_ASSERT, then it passes.")
+ << 5 << 5
+ << (SpanList() << QRect(0, 0, 2, 2) << QRect(0, 0, 1, 1))
+ << false
+ << QPoint(0, 0)
+ << 1
+ << 1;
}
void tst_QTableView::spans()
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 9692c6e..1e3f5f8 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -384,6 +384,8 @@ private slots:
void activateWindow();
+ void openModal_taskQTBUG_5804();
+
#ifdef Q_OS_SYMBIAN
void cbaVisibility();
#endif
@@ -9583,6 +9585,29 @@ void tst_QWidget::activateWindow()
QTRY_VERIFY(!mainwindow2->isActiveWindow());
}
+void tst_QWidget::openModal_taskQTBUG_5804()
+{
+ class Widget : public QWidget
+ {
+ public:
+ Widget(QWidget *parent) : QWidget(parent)
+ {
+ }
+ ~Widget()
+ {
+ QMessageBox msgbox;
+ QTimer::singleShot(10, &msgbox, SLOT(accept()));
+ msgbox.exec(); //open a modal dialog
+ }
+ };
+
+ QWidget *win = new QWidget;
+ new Widget(win);
+ win->show();
+ QTest::qWaitForWindowShown(win);
+ delete win;
+}
+
#ifdef Q_OS_SYMBIAN
void tst_QWidget::cbaVisibility()
{
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp
index 7807761..5f3de7b 100644
--- a/tools/linguist/lconvert/main.cpp
+++ b/tools/linguist/lconvert/main.cpp
@@ -46,6 +46,8 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
+#include <iostream>
+
static int usage(const QStringList &args)
{
Q_UNUSED(args);
@@ -55,7 +57,7 @@ static int usage(const QStringList &args)
foreach (Translator::FileFormat format, Translator::registeredFileFormats())
loaders += line.arg(format.extension, -5).arg(format.description);
- qWarning("%s", qPrintable(QString(QLatin1String("\nUsage:\n"
+ std::cerr << qPrintable(QString(QLatin1String("\nUsage:\n"
" lconvert [options] <infile> [<infile>...]\n\n"
"lconvert is part of Qt's Linguist tool chain. It can be used as a\n"
"stand-alone tool to convert and filter translation data files.\n"
@@ -117,7 +119,7 @@ static int usage(const QStringList &args)
" 0 on success\n"
" 1 on command line parse failures\n"
" 2 on read failures\n"
- " 3 on write failures\n")).arg(loaders)));
+ " 3 on write failures\n")).arg(loaders));
return 1;
}
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp
index 616bb26..a7cc636 100644
--- a/tools/linguist/linguist/messageeditor.cpp
+++ b/tools/linguist/linguist/messageeditor.cpp
@@ -407,10 +407,12 @@ QTextEdit *MessageEditor::activeTranslation() const
{
if (m_currentNumerus < 0)
return 0;
- foreach (QTextEdit *te, m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditors())
+ const QList<FormatTextEdit *> &editors =
+ m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditors();
+ foreach (QTextEdit *te, editors)
if (te->hasFocus())
return te;
- return 0; // This cannot happen
+ return editors.first();
}
QTextEdit *MessageEditor::activeOr1stTranslation() const
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 443abd0..857233e 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -306,7 +306,6 @@ private:
// the string to read from and current position in the string
QTextCodec *yySourceCodec;
- bool yySourceIsUnicode;
QString yyInStr;
const ushort *yyInPtr;
@@ -353,7 +352,6 @@ void CppParser::setInput(const QString &in)
yyInStr = in;
yyFileName = QString();
yySourceCodec = 0;
- yySourceIsUnicode = true;
yyForceUtf8 = true;
}
@@ -362,7 +360,6 @@ void CppParser::setInput(QTextStream &ts, const QString &fileName)
yyInStr = ts.readAll();
yyFileName = fileName;
yySourceCodec = ts.codec();
- yySourceIsUnicode = yySourceCodec->name().startsWith("UTF-");
yyForceUtf8 = false;
}
@@ -1430,24 +1427,24 @@ QString CppParser::transcode(const QString &str, bool utf8)
{
static const char tab[] = "abfnrtv";
static const char backTab[] = "\a\b\f\n\r\t\v";
- const QString in = (!utf8 || yySourceIsUnicode)
- ? str : QString::fromUtf8(yySourceCodec->fromUnicode(str).data());
- QString out;
+ // This function has to convert back to bytes, as C's \0* sequences work at that level.
+ const QByteArray in = yyForceUtf8 ? str.toUtf8() : tor->codec()->fromUnicode(str);
+ QByteArray out;
out.reserve(in.length());
for (int i = 0; i < in.length();) {
- ushort c = in[i++].unicode();
+ uchar c = in[i++];
if (c == '\\') {
if (i >= in.length())
break;
- c = in[i++].unicode();
+ c = in[i++];
if (c == '\n')
continue;
if (c == 'x') {
QByteArray hex;
- while (i < in.length() && isxdigit((c = in[i].unicode()))) {
+ while (i < in.length() && isxdigit((c = in[i]))) {
hex += c;
i++;
}
@@ -1456,7 +1453,7 @@ QString CppParser::transcode(const QString &str, bool utf8)
QByteArray oct;
int n = 0;
oct += c;
- while (n < 2 && i < in.length() && (c = in[i].unicode()) >= '0' && c < '8') {
+ while (n < 2 && i < in.length() && (c = in[i]) >= '0' && c < '8') {
i++;
n++;
oct += c;
@@ -1464,13 +1461,14 @@ QString CppParser::transcode(const QString &str, bool utf8)
out += oct.toUInt(0, 8);
} else {
const char *p = strchr(tab, c);
- out += QChar(QLatin1Char(!p ? c : backTab[p - tab]));
+ out += !p ? c : backTab[p - tab];
}
} else {
out += c;
}
}
- return out;
+ return (utf8 || yyForceUtf8) ? QString::fromUtf8(out.constData(), out.length())
+ : tor->codec()->toUnicode(out);
}
void CppParser::recordMessage(
@@ -2150,9 +2148,9 @@ void loadCPP(Translator &translator, const QStringList &filenames, ConversionDat
QTextStream ts(&file);
ts.setCodec(codec);
ts.setAutoDetectUnicode(true);
- if (ts.codec()->name() == "UTF-16")
- translator.setCodecName("System");
parser.setInput(ts, filename);
+ if (cd.m_outputCodec.isEmpty() && ts.codec()->name() == "UTF-16")
+ translator.setCodecName("System");
Translator *tor = new Translator;
tor->setCodecName(translator.codecName());
parser.setTranslator(tor);
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index bdaec4f..9a9af68 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -54,13 +54,20 @@
#include <QtCore/QStringList>
#include <QtCore/QTextCodec>
+#include <iostream>
+
static QString m_defaultExtensions;
-static void printOut(const QString & out)
+static void printErr(const QString & out)
{
qWarning("%s", qPrintable(out));
}
+static void printOut(const QString & out)
+{
+ std::cerr << qPrintable(out);
+}
+
static void recursiveFileInfoList(const QDir &dir,
const QSet<QString> &nameFilters, QDir::Filters filter,
QFileInfoList *fileinfolist)
@@ -137,7 +144,7 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
cd.m_sortContexts = !(options & NoSort);
if (QFile(fileName).exists()) {
if (!tor.load(fileName, cd, QLatin1String("auto"))) {
- printOut(cd.error());
+ printErr(cd.error());
*fail = true;
continue;
}
@@ -197,11 +204,11 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
out.normalizeTranslations(cd);
if (!cd.errors().isEmpty()) {
- printOut(cd.error());
+ printErr(cd.error());
cd.clearErrors();
}
if (!out.save(fileName, cd, QLatin1String("auto"))) {
- printOut(cd.error());
+ printErr(cd.error());
*fail = true;
}
}
@@ -494,6 +501,7 @@ int main(int argc, char **argv)
if (!tmp.isEmpty() && !tmp.first().isEmpty()) {
codecForTr = tmp.first().toLatin1();
fetchedTor.setCodecName(codecForTr);
+ cd.m_outputCodec = codecForTr;
}
tmp = variables.value("CODECFORSRC");
if (!tmp.isEmpty() && !tmp.first().isEmpty()) {
diff --git a/tools/linguist/phrasebooks/french.qph b/tools/linguist/phrasebooks/french.qph
index d710abd..9e1a580 100644
--- a/tools/linguist/phrasebooks/french.qph
+++ b/tools/linguist/phrasebooks/french.qph
@@ -1402,4 +1402,40 @@
<source>&amp;Redo</source>
<target>&amp;Rétablir</target>
</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Éditer</target>
+</phrase>
+<phrase>
+ <source>PATH:</source>
+ <target>PATH :</target>
+</phrase>
+<phrase>
+ <source>Change:</source>
+ <target>Modification :</target>
+</phrase>
+<phrase>
+ <source>Edit...</source>
+ <target>Modifier...</target>
+</phrase>
+<phrase>
+ <source>&amp;Username:</source>
+ <target>&amp;Utilisateur :</target>
+</phrase>
+<phrase>
+ <source>Link</source>
+ <target>Lien</target>
+</phrase>
+<phrase>
+ <source>Paste:</source>
+ <target>Collage :</target>
+</phrase>
+<phrase>
+ <source>Label</source>
+ <target>Libellé</target>
+</phrase>
+<phrase>
+ <source>&amp;Debug</source>
+ <target>&amp;Déboguer</target>
+</phrase>
</QPH>
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 05fc6e5..8a071d3 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -67,7 +67,7 @@ QString QObject::tr(const char *sourceText, const char *, int n)
#endif
Translator::Translator() :
- m_codecName("ISO-8859-1"),
+ m_codec(QTextCodec::codecForName("ISO-8859-1")),
m_locationsType(AbsoluteLocations)
{
}
@@ -713,12 +713,17 @@ void Translator::setCodecName(const QByteArray &name)
if (!codec) {
if (!name.isEmpty())
qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData());
- m_codecName = "ISO-8859-1";
+ m_codec = QTextCodec::codecForName("ISO-8859-1");
} else {
- m_codecName = codec->name();
+ m_codec = codec;
}
}
+QByteArray Translator::codecName() const
+{
+ return m_codec->name();
+}
+
void Translator::dump() const
{
for (int i = 0; i != messageCount(); ++i)
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index f29317b..353cf9d 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -97,7 +97,7 @@ public:
public:
QString m_defaultContext;
QByteArray m_codecForSource; // CPP, PO & QM specific
- QByteArray m_outputCodec; // PO specific
+ QByteArray m_outputCodec; // CPP & PO specific
QString m_unTrPrefix; // QM specific
QString m_sourceFileName;
QString m_targetFileName;
@@ -151,7 +151,8 @@ public:
void reportDuplicates(const Duplicates &dupes, const QString &fileName, bool verbose);
void setCodecName(const QByteArray &name);
- QByteArray codecName() const { return m_codecName; }
+ QByteArray codecName() const;
+ QTextCodec *codec() const { return m_codec; }
QString languageCode() const { return m_language; }
QString sourceLanguageCode() const { return m_sourceLanguage; }
@@ -211,7 +212,7 @@ private:
typedef QList<TranslatorMessage> TMM; // int stores the sequence position.
TMM m_messages;
- QByteArray m_codecName;
+ QTextCodec *m_codec;
LocationsType m_locationsType;
// A string beginning with a 2 or 3 letter language code (ISO 639-1