summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro42
-rw-r--r--demos/symbianpkgrules.pri2
-rw-r--r--dist/changes-4.6.02
-rw-r--r--doc/src/frameworks-technologies/graphicsview.qdoc14
-rw-r--r--examples/symbianpkgrules.pri2
-rw-r--r--mkspecs/features/symbian/application_icon.prf35
-rw-r--r--mkspecs/features/symbian/armcc_warnings.prf3
-rw-r--r--qmake/generators/symbian/symmake.cpp21
-rw-r--r--qmake/generators/symbian/symmake.h4
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp3
-rw-r--r--qmake/generators/symbian/symmake_abld.h2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp7
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.h2
-rw-r--r--src/corelib/animation/qvariantanimation.cpp19
-rw-r--r--src/gui/graphicsview/qgraphicsitemanimation.cpp1
-rw-r--r--src/gui/gui.pro2
-rw-r--r--src/gui/image/qpixmap_s60.cpp5
-rw-r--r--src/gui/image/qpixmap_s60_p.h2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp35
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h2
-rw-r--r--src/gui/itemviews/qlistview.cpp8
-rw-r--r--src/gui/itemviews/qtableview.cpp31
-rw-r--r--src/gui/itemviews/qtreeview.cpp7
-rw-r--r--src/gui/kernel/qapplication_s60.cpp2
-rw-r--r--src/gui/widgets/qabstractslider.cpp45
-rw-r--r--src/gui/widgets/qabstractslider_p.h33
-rw-r--r--src/gui/widgets/qcommandlinkbutton.cpp3
-rw-r--r--src/gui/widgets/qsizegrip.cpp29
-rw-r--r--src/openvg/qpixmapdata_vg.cpp53
-rw-r--r--src/openvg/qpixmapdata_vg_p.h1
-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/qcommandlinkbutton/tst_qcommandlinkbutton.cpp44
-rw-r--r--tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp2
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp13
-rw-r--r--tests/auto/qstatusbar/tst_qstatusbar.cpp14
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp6
-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/shared/translator.cpp11
-rw-r--r--tools/linguist/shared/translator.h7
50 files changed, 470 insertions, 181 deletions
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 30f59c3..b47f6a0 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -59,7 +59,7 @@ symbian {
load(data_caging_paths)
TARGET.UID3 = 0xA000A641
- ICON = ../../../src/s60installs/qt.svg
+ ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
executables.sources = \
styledemo.exe \
@@ -118,42 +118,66 @@ symbian {
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.rsc \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.rsc
-
+
resource.path = $$APP_RESOURCE_DIR
mifs.sources = \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A641.mif \ #fluidlauncher
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif #desktopservices
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fluidlauncher.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qftp.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.mif
mifs.path = $$APP_RESOURCE_DIR
- contains(QT_CONFIG, svg) {
- executables.sources += \
+ contains(QT_CONFIG, svg) {
+ executables.sources += \
embeddedsvgviewer.exe \
weatherinfo.exe
-
+
reg_resource.sources += \
$${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \
$${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/weatherinfo_reg.rsc
-
+
resource.sources += \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.rsc
+
+ mifs.sources += \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.mif \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.mif
+
}
contains(QT_CONFIG, webkit) {
executables.sources += anomaly.exe
reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc
+ mifs.sources += \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.mif
}
contains(QT_CONFIG, phonon) {
executables.sources += qmediaplayer.exe
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.rsc
+ mifs.sources += \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.mif
}
contains(QT_CONFIG, script) {
- executables.sources += context2d.exe
+ executables.sources += context2d.exe
reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc
+ mifs.sources += \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.mif
}
files.sources = $$PWD/screenshots $$PWD/slides
diff --git a/demos/symbianpkgrules.pri b/demos/symbianpkgrules.pri
index 7e6852b..c511836 100644
--- a/demos/symbianpkgrules.pri
+++ b/demos/symbianpkgrules.pri
@@ -11,3 +11,5 @@ vendorinfo = \
" "
default_deployment.pkg_prerules += vendorinfo
+
+isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0
index 736fa66..887c96f 100644
--- a/dist/changes-4.6.0
+++ b/dist/changes-4.6.0
@@ -73,6 +73,8 @@ New features
* Support for getting return arguments in remote method invocation
via QMetaMethod::invokeMethod.
+ - The QtScript module is now based on the 3rdparty JavaScriptCore library. It
+ is only available under the LGPL or a compatible license.
Optimizations
-------------
diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc
index 1503f53..ba89c7d 100644
--- a/doc/src/frameworks-technologies/graphicsview.qdoc
+++ b/doc/src/frameworks-technologies/graphicsview.qdoc
@@ -437,13 +437,10 @@
\section2 Animation
Graphics View supports animation at several levels. You can easily
- assemble animation paths by associating a QGraphicsItemAnimation with
- your item. This allows timeline controlled animations that operate at
- a steady speed on all platforms (although the frame rate may vary
- depending on the platform's performance). QGraphicsItemAnimation
- allows you to create a path for an item's position, rotation, scale,
- shear and translation. The animation can be controlled by a QSlider,
- or more commonly by QTimeLine.
+ assemble animation by using the Animation Framework. For that you'll
+ need your items to inherit from QGraphicsObject and associate
+ QPropertyAnimation with them. QPropertyAnimation allows to animate any
+ QObject property.
Another option is to create a custom item that inherits from QObject
and QGraphicsItem. The item can the set up its own timers, and control
@@ -454,9 +451,6 @@
QGraphicsScene::advance(), which in turn calls
QGraphicsItem::advance().
- See also the \l{Drag and Drop Robot Example}{Drag and Drop Robot}
- example for an illustration of timeline-based animation techniques.
-
\section2 OpenGL Rendering
To enable OpenGL rendering, you simply set a new QGLWidget as the
diff --git a/examples/symbianpkgrules.pri b/examples/symbianpkgrules.pri
index 59c5480..35edbfb 100644
--- a/examples/symbianpkgrules.pri
+++ b/examples/symbianpkgrules.pri
@@ -11,3 +11,5 @@ vendorinfo = \
" "
default_deployment.pkg_prerules += vendorinfo
+
+isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
index b0c1bb1..1edbe14 100644
--- a/mkspecs/features/symbian/application_icon.prf
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -3,38 +3,49 @@ load(data_caging_paths)
# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
# requires the registration resource file to exist always
contains( CONFIG, no_icon ) {
- symbian:RSS_RULES ="hidden = KAppIsHidden;"
+ symbian:RSS_RULES ="hidden = KAppIsHidden;"
CONFIG -= no_icon
} else {
# There is no point in compiling the MIF icon if no_icon CONFIGS is set
!isEmpty(ICON) {
-
- !count(ICON, $$size(TRANSLATIONS)):!count(ICON, 1) {
- message("ICON keyword must have one or the same amout of items as in TRANSLATIONS keyword")
+
+ !count(ICON, 1) {
+ ICON = $$first(ICON)
+ warning("Only first icon specified in ICON variable is used: $$ICON")
}
- # MIF files will have UID in their names, if TARGET.UID3 is not set, remind the user
- isEmpty(TARGET.UID3):error("TARGET.UID3 must be explicitly defined for ICON generation")
+ # Try to produce indentical string to fixedTarget in SymbianMakefileGenerator, replaced chars taken
+ # from SymbianMakefileGenerator::removeSpecialCharacters.
+ #
+ # Note: it is not a major problem even baseTarget is not 100% identical to fixedTarget since qmake
+ # only uses filename from RSS_RULES.icon_file when referring to icon file name.
+ baseTarget = $$basename(TARGET)
+ baseTarget = $$replace(baseTarget, /,_)
+ baseTarget = $$replace(baseTarget, \\,_)
+ baseTarget = $$replace(baseTarget, -,_)
+ baseTarget = $$replace(baseTarget, :,_)
+ baseTarget = $$replace(baseTarget, \.,_)
+ baseTarget = $$replace(baseTarget, " ",_)
# Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
- symbian-abld {
- #Makefile: requires paths with backslash
+ symbian-abld {
+ #Makefile: requires paths with backslash
ICON = $$replace( ICON, /, \\)
# Extra compiler rules for mifconv
- mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${TARGET.UID3}.mif
+ mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${baseTarget}.mif
# Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library
# svg-t icons should always use /c32 depth
- mifconv.commands = mifconv ${QMAKE_FILE_OUT} $$join(ICON, " /c32 ", "/c32 ",)
+ mifconv.commands = mifconv ${QMAKE_FILE_OUT} /c32 ${QMAKE_FILE_IN}
mifconv.input = ICON
mifconv.CONFIG = no_link combine
# target_predeps together with combine seems not to work correctly, lets define it by ourselves
PRE_TARGETDEPS += $$mifconv.output
QMAKE_EXTRA_COMPILERS += mifconv
- }
+ }
# Rules to use generated MIF file from symbian resources
RSS_RULES.number_of_icons = $$size(ICON)
- RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif
+ RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif
}
}
diff --git a/mkspecs/features/symbian/armcc_warnings.prf b/mkspecs/features/symbian/armcc_warnings.prf
index 95b3bc0..72bc996 100644
--- a/mkspecs/features/symbian/armcc_warnings.prf
+++ b/mkspecs/features/symbian/armcc_warnings.prf
@@ -8,3 +8,6 @@
# 2874: <variable> may be used before being set (this one sounds useful, but
# it's output also for class instances, making it useless in practice)
QMAKE_CFLAGS.ARMCC += --diag_suppress 111,185,191,368,1293,1294,2874
+
+# 6780: <origvis> visibility removed from symbol '<symname>' through <impexp>
+QMAKE_LFLAGS.ARMCC += --diag_suppress 6780
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 1326a49..afaf338 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -209,7 +209,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
generatePkgFile(iconFile);
}
- writeBldInfContent(t, generatePkg);
+ writeBldInfContent(t, generatePkg, iconFile);
// Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile,
// but all required data is not yet available.
@@ -378,14 +378,11 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile)
.arg(installPathRegResource)
.arg(fixedTarget + "_reg.rsc") << endl;
- QString myIconFile = iconFile;
- myIconFile = myIconFile.replace("\\\\", "\\");
-
if (!iconFile.isEmpty()) {
t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
.arg(epocRoot())
- .arg(QString(myIconFile).replace('\\','/'))
- .arg(myIconFile) << endl << endl;
+ .arg(iconFile)
+ .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
}
}
}
@@ -1120,7 +1117,7 @@ void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t)
}
}
-void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension)
+void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile)
{
// Read user defined bld inf rules
@@ -1242,7 +1239,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
// Generate extension rules
- writeBldInfExtensionRulesPart(t);
+ writeBldInfExtensionRulesPart(t, iconFile);
userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS);
foreach(QString item, userItems)
@@ -1320,14 +1317,17 @@ void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &ico
t << "\t\t{" << endl;
t << "\t\tcaption = STRING_r_caption;" << endl;
- if (numberOfIcons.isEmpty() || iconFile.isEmpty()) {
+ QString rssIconFile = iconFile;
+ rssIconFile = rssIconFile.replace("/", "\\\\");
+
+ if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) {
// There can be maximum one item in this tag, validated when parsed
t << "\t\tnumber_of_icons = 0;" << endl;
t << "\t\ticon_file = \"\";" << endl;
} else {
// There can be maximum one item in this tag, validated when parsed
t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;
- t << "\t\ticon_file = \"" << iconFile << "\";" << endl;
+ t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl;
}
t << "\t\t};" << endl;
t << "\t}" << endl;
@@ -1697,6 +1697,7 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)
{
+ // When modifying this method check also application_icon.prf
str.replace(QString("/"), QString("_"));
str.replace(QString("\\"), QString("_"));
str.replace(QString("-"), QString("_"));
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index a3e2c17..2e78c46 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -99,7 +99,7 @@ protected:
void checkOverridability(QStringList &overridableKeywords, QString &checkString);
void writeHeader(QTextStream &t);
- void writeBldInfContent(QTextStream& t, bool addDeploymentExtension);
+ void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile);
static bool removeDuplicatedStrings(QStringList& stringList);
@@ -143,7 +143,7 @@ protected:
void generateDistcleanTargets(QTextStream& t);
// Subclass implements
- virtual void writeBldInfExtensionRulesPart(QTextStream& t) = 0;
+ virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) = 0;
virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0;
virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0;
virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0;
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 1b5464f..6225720 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -379,10 +379,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
}
}
-void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile)
{
// We don't use extensions for anything in abld
Q_UNUSED(t);
+ Q_UNUSED(iconTargetFile);
}
bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h
index 11b9cd1..56d31e1 100644
--- a/qmake/generators/symbian/symmake_abld.h
+++ b/qmake/generators/symbian/symmake_abld.h
@@ -51,7 +51,7 @@ class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator
protected:
// Inherited from parent
- virtual void writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile);
virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 5e624de..4fd5833 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -238,7 +238,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
}
}
-void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile)
{
// Makes sure we have needed FLMs in place.
exportFlm();
@@ -379,9 +379,12 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QString iconPath = iconInfo.path();
QString iconFile = iconInfo.baseName();
+ QFileInfo iconTargetInfo = fileInfo(iconTargetFile);
+ QString iconTarget = iconTargetInfo.fileName();
+
t << "OPTION SOURCES -c32 " << iconFile << endl;
t << "OPTION SOURCEDIR " << iconPath << endl;
- t << "OPTION TARGETFILE " << uid3 << ".mif" << endl;
+ t << "OPTION TARGETFILE " << iconTarget << endl;
t << "OPTION SVGENCODINGVERSION 3" << endl; // Compatibility with S60 3.1 devices and up
t << "END" << endl;
}
diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h
index 9472b68..3394908 100644
--- a/qmake/generators/symbian/symmake_sbsv2.h
+++ b/qmake/generators/symbian/symmake_sbsv2.h
@@ -51,7 +51,7 @@ class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator
protected:
// Inherited from parent
- virtual void writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile);
virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index c735778..d529f67 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -104,15 +104,32 @@ QT_BEGIN_NAMESPACE
\o \l{QMetaType::}{QLine}
\o \l{QMetaType::}{QLineF}
\o \l{QMetaType::}{QPoint}
+ \o \l{QMetaType::}{QPointF}
\o \l{QMetaType::}{QSize}
\o \l{QMetaType::}{QSizeF}
\o \l{QMetaType::}{QRect}
\o \l{QMetaType::}{QRectF}
+ \o \l{QMetaType::}{QColor}
\endlist
If you need to interpolate other variant types, including custom
types, you have to implement interpolation for these yourself.
- You do this by reimplementing interpolated(), which returns
+ To do this, you can register an interpolator function for a given
+ type. This function takes 3 parameters: the start value, the end value
+ and the current progress.
+
+ Example:
+ \code
+ QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)
+ {
+ ...
+ return QColor(...);
+ }
+ ...
+ qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
+ \endcode
+
+ Another option is to reimplement interpolated(), which returns
interpolation values for the value being interpolated.
\omit We need some snippets around here. \endomit
diff --git a/src/gui/graphicsview/qgraphicsitemanimation.cpp b/src/gui/graphicsview/qgraphicsitemanimation.cpp
index be2f300..b67ee2e 100644
--- a/src/gui/graphicsview/qgraphicsitemanimation.cpp
+++ b/src/gui/graphicsview/qgraphicsitemanimation.cpp
@@ -45,6 +45,7 @@
support for QGraphicsItem.
\since 4.2
\ingroup graphicsview-api
+ \deprecated
The QGraphicsItemAnimation class animates a QGraphicsItem. You can
schedule changes to the item's transformation matrix at
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 7c24002..4215f97 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -54,4 +54,4 @@ DEFINES += Q_INTERNAL_QAPP_SRC
symbian:TARGET.UID3=0x2001B2DD
# ro-section in gui can exceed default allocated space, so more rw-section little further
-symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000"
+symbian-sbsv2: QMAKE_LFLAGS.ARMCC += --rw-base 0x800000"
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 17baa50..dc33ade 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -977,4 +977,9 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType)
}
}
+QPixmapData *QS60PixmapData::createCompatiblePixmapData() const
+{
+ return new QS60PixmapData(pixelType());
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index b1b5824..8631ebd 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -87,6 +87,8 @@ public:
QS60PixmapData(PixelType type);
~QS60PixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 23bef12..c691fe2 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -138,10 +138,22 @@ void QAbstractItemViewPrivate::init()
#endif
}
+void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index)
+{
+ Q_Q(QAbstractItemView);
+ if (hover == index)
+ return;
+
+ q->update(hover); //update the old one
+ hover = index;
+ q->update(hover); //update the new one
+}
+
void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)
{
//we take a persistent model index because the model might change by emitting signals
Q_Q(QAbstractItemView);
+ setHoverIndex(index);
if (viewportEnteredNeeded || enteredIndex != index) {
viewportEnteredNeeded = false;
@@ -1536,22 +1548,13 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
{
Q_D(QAbstractItemView);
switch (event->type()) {
- case QEvent::HoverEnter: {
- QHoverEvent *he = static_cast<QHoverEvent*>(event);
- d->hover = indexAt(he->pos());
- update(d->hover);
- break; }
- case QEvent::HoverLeave: {
- update(d->hover); // update old
- d->hover = QModelIndex();
- break; }
- case QEvent::HoverMove: {
- QHoverEvent *he = static_cast<QHoverEvent*>(event);
- QModelIndex old = d->hover;
- d->hover = indexAt(he->pos());
- if (d->hover != old)
- d->viewport->update(visualRect(old)|visualRect(d->hover));
- break; }
+ case QEvent::HoverMove:
+ case QEvent::HoverEnter:
+ d->setHoverIndex(indexAt(static_cast<QHoverEvent*>(event)->pos()));
+ break;
+ case QEvent::HoverLeave:
+ d->setHoverIndex(QModelIndex());
+ break;
case QEvent::Enter:
d->viewportEnteredNeeded = true;
break;
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index c691f61..f1ba874 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -152,6 +152,8 @@ public:
const QEvent *event) const;
virtual void selectAll(QItemSelectionModel::SelectionFlags command);
+ void setHoverIndex(const QPersistentModelIndex &index);
+
void checkMouseMove(const QPersistentModelIndex &index);
inline void checkMouseMove(const QPoint &pos) { checkMouseMove(q_func()->indexAt(pos)); }
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 052308c..d03cdd3 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -966,15 +966,19 @@ void QListView::paintEvent(QPaintEvent *e)
bool alternateBase = false;
int previousRow = -2; // trigger the alternateBase adjustment on first pass
+ int maxSize = (flow() == TopToBottom)
+ ? qMax(viewport()->size().width(), d->contentsSize().width()) - 2 * d->spacing()
+ : qMax(viewport()->size().height(), d->contentsSize().height()) - 2 * d->spacing();
+
QVector<QModelIndex>::const_iterator end = toBeRendered.constEnd();
for (QVector<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
Q_ASSERT((*it).isValid());
option.rect = visualRect(*it);
if (flow() == TopToBottom)
- option.rect.setWidth(qMin(d->contentsSize().width() - 2 * d->spacing(), option.rect.width()));
+ option.rect.setWidth(qMin(maxSize, option.rect.width()));
else
- option.rect.setHeight(qMin(d->contentsSize().height() - 2 * d->spacing(), option.rect.height()));
+ option.rect.setHeight(qMin(maxSize, option.rect.height()));
option.state = state;
if (selections && selections->isSelected(*it))
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 02e5fff..a3877b7 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -1064,14 +1064,29 @@ QTableView::~QTableView()
void QTableView::setModel(QAbstractItemModel *model)
{
Q_D(QTableView);
- connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
- this, SLOT(_q_updateSpanInsertedRows(QModelIndex,int,int)));
- connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
- this, SLOT(_q_updateSpanInsertedColumns(QModelIndex,int,int)));
- connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
- this, SLOT(_q_updateSpanRemovedRows(QModelIndex,int,int)));
- connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
- this, SLOT(_q_updateSpanRemovedColumns(QModelIndex,int,int)));
+ if (model == d->model)
+ return;
+ //let's disconnect from the old model
+ if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
+ disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedRows(QModelIndex,int,int)));
+ disconnect(d->model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedColumns(QModelIndex,int,int)));
+ disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedRows(QModelIndex,int,int)));
+ disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedColumns(QModelIndex,int,int)));
+ }
+ if (model) { //and connect to the new one
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedRows(QModelIndex,int,int)));
+ connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedColumns(QModelIndex,int,int)));
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedRows(QModelIndex,int,int)));
+ connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedColumns(QModelIndex,int,int)));
+ }
d->verticalHeader->setModel(model);
d->horizontalHeader->setModel(model);
QAbstractItemView::setModel(model);
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 8d50870b..3ad9fbb 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -215,6 +215,13 @@ void QTreeView::setModel(QAbstractItemModel *model)
Q_D(QTreeView);
if (model == d->model)
return;
+ if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
+ disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+
+ disconnect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_modelAboutToBeReset()));
+ }
+
if (d->selectionModel) { // support row editing
disconnect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
d->model, SLOT(submit()));
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index c7f0c00..85b6d00 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -712,7 +712,7 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod
Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers);
QKeyEventEx qKeyEvent(type == EEventKeyUp ? QEvent::KeyRelease : QEvent::KeyPress, keyCode,
mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods),
- false, 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers);
+ (keyEvent.iRepeats != 0), 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers);
// WId wid = reinterpret_cast<RWindowGroup *>(keyEvent.Handle())->Child();
// if (!wid)
// Could happen if window isn't shown yet.
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index e0db9c2..988a7e7 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -219,6 +219,10 @@ QAbstractSliderPrivate::QAbstractSliderPrivate()
blocktracking(false), pressed(false),
invertedAppearance(false), invertedControls(false),
orientation(Qt::Horizontal), repeatAction(QAbstractSlider::SliderNoAction)
+#ifdef QT_KEYPAD_NAVIGATION
+ , isAutoRepeating(false)
+ , repeatMultiplier(1)
+#endif
{
}
@@ -371,6 +375,9 @@ int QAbstractSlider::maximum() const
abstract sliders provides and typically corresponds to the user
pressing an arrow key.
+ If the property is modified during an auto repeating key event, behavior
+ is undefined.
+
\sa pageStep
*/
@@ -598,10 +605,10 @@ void QAbstractSlider::triggerAction(SliderAction action)
d->blocktracking = true;
switch (action) {
case SliderSingleStepAdd:
- setSliderPosition(d->overflowSafeAdd(d->singleStep));
+ setSliderPosition(d->overflowSafeAdd(d->effectiveSingleStep()));
break;
case SliderSingleStepSub:
- setSliderPosition(d->overflowSafeAdd(-d->singleStep));
+ setSliderPosition(d->overflowSafeAdd(-d->effectiveSingleStep()));
break;
case SliderPageStepAdd:
setSliderPosition(d->overflowSafeAdd(d->pageStep));
@@ -702,7 +709,7 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
// Calculate how many lines to scroll. Depending on what delta is (and
// offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can
// only scroll whole lines, so we keep the reminder until next event.
- qreal stepsToScrollF = offset * QApplication::wheelScrollLines() * d->singleStep;
+ qreal stepsToScrollF = offset * QApplication::wheelScrollLines() * d->effectiveSingleStep();
// Check if wheel changed direction since last event:
if (d->offset_accumulated != 0 && (offset / d->offset_accumulated) < 0)
d->offset_accumulated = 0;
@@ -773,6 +780,38 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
{
Q_D(QAbstractSlider);
SliderAction action = SliderNoAction;
+#ifdef QT_KEYPAD_NAVIGATION
+ if (ev->isAutoRepeat()) {
+ if (d->firstRepeat.isNull())
+ d->firstRepeat = QTime::currentTime();
+ else if (1 == d->repeatMultiplier) {
+ // This is the interval in milli seconds which one key repetition
+ // takes.
+ const int repeatMSecs = d->firstRepeat.msecsTo(QTime::currentTime());
+
+ /**
+ * The time it takes to currently navigate the whole slider.
+ */
+ const qreal currentTimeElapse = (qreal(maximum()) / singleStep()) * repeatMSecs;
+
+ /**
+ * This is an arbitrarily determined constant in msecs that
+ * specifies how long time it should take to navigate from the
+ * start to the end(excluding starting key auto repeat).
+ */
+ const int SliderRepeatElapse = 2500;
+
+ d->repeatMultiplier = currentTimeElapse / SliderRepeatElapse;
+ }
+
+ }
+ else if (!d->firstRepeat.isNull()) {
+ d->firstRepeat = QTime();
+ d->repeatMultiplier = 1;
+ }
+
+#endif
+
switch (ev->key()) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h
index 9324d44..6591981 100644
--- a/src/gui/widgets/qabstractslider_p.h
+++ b/src/gui/widgets/qabstractslider_p.h
@@ -68,7 +68,13 @@ public:
void setSteps(int single, int page);
- int minimum, maximum, singleStep, pageStep, value, position, pressValue;
+ int minimum, maximum, pageStep, value, position, pressValue;
+
+ /**
+ * Call effectiveSingleStep() when changing the slider value.
+ */
+ int singleStep;
+
float offset_accumulated;
uint tracking : 1;
uint blocktracking :1;
@@ -83,8 +89,33 @@ public:
#ifdef QT_KEYPAD_NAVIGATION
int origValue;
+
+ /**
+ */
+ bool isAutoRepeating;
+
+ /**
+ * When we're auto repeating, we multiply singleStep with this value to
+ * get our effective step.
+ */
+ qreal repeatMultiplier;
+
+ /**
+ * The time of when the first auto repeating key press event occurs.
+ */
+ QTime firstRepeat;
+
#endif
+ inline int effectiveSingleStep() const
+ {
+ return singleStep
+#ifdef QT_KEYPAD_NAVIGATION
+ * repeatMultiplier
+#endif
+ ;
+ }
+
inline int bound(int val) const { return qMax(minimum, qMin(maximum, val)); }
inline int overflowSafeAdd(int add) const
{
diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp
index 9adf280..8f47f25 100644
--- a/src/gui/widgets/qcommandlinkbutton.cpp
+++ b/src/gui/widgets/qcommandlinkbutton.cpp
@@ -326,7 +326,8 @@ int QCommandLinkButton::heightForWidth(int width) const
Q_D(const QCommandLinkButton);
int heightWithoutDescription = d->descriptionOffset() + d->bottomMargin();
// find the width available for the description area
- return heightWithoutDescription + d->descriptionHeight(width);
+ return qMax(heightWithoutDescription + d->descriptionHeight(width),
+ iconSize().height() + d->topMargin() + d->bottomMargin());
}
/*! \reimp */
diff --git a/src/gui/widgets/qsizegrip.cpp b/src/gui/widgets/qsizegrip.cpp
index cf193dc..6575dbb 100644
--- a/src/gui/widgets/qsizegrip.cpp
+++ b/src/gui/widgets/qsizegrip.cpp
@@ -99,6 +99,7 @@ public:
int dyMax;
Qt::Corner m_corner;
bool gotMousePress;
+ QWidget *tlw;
#ifdef Q_WS_MAC
void updateMacSizer(bool hide) const;
#endif
@@ -113,6 +114,19 @@ public:
return m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner;
}
+ void updateTopLevelWidget()
+ {
+ Q_Q(QSizeGrip);
+ QWidget *w = qt_sizegrip_topLevelWidget(q);
+ if (tlw == w)
+ return;
+ if (tlw)
+ tlw->removeEventFilter(q);
+ tlw = w;
+ if (tlw)
+ tlw->installEventFilter(q);
+ }
+
// This slot is invoked by QLayout when the size grip is added to
// a layout or reparented after the tlw is shown. This re-implementation is basically
// the same as QWidgetPrivate::_q_showIfNotHidden except that it checks
@@ -121,7 +135,7 @@ public:
{
Q_Q(QSizeGrip);
bool showSizeGrip = !(q->isHidden() && q->testAttribute(Qt::WA_WState_ExplicitShowHide));
- QWidget *tlw = qt_sizegrip_topLevelWidget(q);
+ updateTopLevelWidget();
if (tlw && showSizeGrip) {
Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
#ifndef Q_WS_MAC
@@ -232,6 +246,7 @@ void QSizeGripPrivate::init()
Q_Q(QSizeGrip);
dxMax = 0;
dyMax = 0;
+ tlw = 0;
m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner;
gotMousePress = false;
@@ -240,8 +255,7 @@ void QSizeGripPrivate::init()
? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor);
#endif
q->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
- QWidget *tlw = qt_sizegrip_topLevelWidget(q);
- tlw->installEventFilter(q);
+ updateTopLevelWidget();
}
@@ -524,19 +538,18 @@ void QSizeGrip::setVisible(bool visible)
/*! \reimp */
bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
{
+ Q_D(QSizeGrip);
if ((isHidden() && testAttribute(Qt::WA_WState_ExplicitShowHide))
- || e->type() != QEvent::WindowStateChange) {
+ || e->type() != QEvent::WindowStateChange
+ || o != d->tlw) {
return QWidget::eventFilter(o, e);
}
- QWidget *tlw = qt_sizegrip_topLevelWidget(this);
- if (o != tlw)
- return QWidget::eventFilter(o, e);
Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
#ifndef Q_WS_MAC
sizeGripNotVisibleState |= Qt::WindowMaximized;
#endif
// Don't show the size grip if the tlw is maximized or in full screen mode.
- setVisible(!(tlw->windowState() & sizeGripNotVisibleState));
+ setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState));
setAttribute(Qt::WA_WState_ExplicitShowHide, false);
return QWidget::eventFilter(o, e);
}
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 3254aa3..19c90ed 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -92,7 +92,6 @@ QVGPixmapData::~QVGPixmapData()
vgDestroyImage(vgImage);
if (vgImageOpacity != VG_INVALID_HANDLE)
vgDestroyImage(vgImageOpacity);
- } else {
#endif
}
#if !defined(QT_NO_EGL)
@@ -202,6 +201,14 @@ QPaintEngine* QVGPixmapData::paintEngine() const
return source.paintEngine();
}
+// This function works around QImage::bits() making a deep copy if the
+// QImage is not const. We force it to be const and then get the bits.
+// XXX: Should add a QImage::constBits() in the future to replace this.
+static inline const uchar *qt_vg_imageBits(const QImage& image)
+{
+ return image.bits();
+}
+
VGImage QVGPixmapData::toVGImage()
{
if (!isValid())
@@ -213,7 +220,7 @@ VGImage QVGPixmapData::toVGImage()
context = qt_vg_create_context(0);
#endif
- if (recreate) {
+ if (recreate && prevSize != QSize(w, h)) {
if (vgImage != VG_INVALID_HANDLE) {
vgDestroyImage(vgImage);
vgImage = VG_INVALID_HANDLE;
@@ -222,6 +229,8 @@ VGImage QVGPixmapData::toVGImage()
vgDestroyImage(vgImageOpacity);
vgImageOpacity = VG_INVALID_HANDLE;
}
+ } else if (recreate) {
+ cachedOpacity = -1.0f; // Force opacity image to be refreshed later.
}
if (vgImage == VG_INVALID_HANDLE) {
@@ -232,11 +241,12 @@ VGImage QVGPixmapData::toVGImage()
if (!source.isNull() && recreate) {
vgImageSubData
(vgImage,
- source.bits(), source.bytesPerLine(),
+ qt_vg_imageBits(source), source.bytesPerLine(),
VG_sARGB_8888_PRE, 0, 0, w, h);
}
recreate = false;
+ prevSize = QSize(w, h);
return vgImage;
}
@@ -244,43 +254,14 @@ VGImage QVGPixmapData::toVGImage()
VGImage QVGPixmapData::toVGImage(qreal opacity)
{
#if !defined(QT_SHIVAVG)
- if (!isValid())
+ // Force the primary VG image to be recreated if necessary.
+ if (toVGImage() == VG_INVALID_HANDLE)
return VG_INVALID_HANDLE;
-#if !defined(QT_NO_EGL)
- // Increase the reference count on the shared context.
- if (!context)
- context = qt_vg_create_context(0);
-#endif
-
- if (recreate) {
- if (vgImage != VG_INVALID_HANDLE) {
- vgDestroyImage(vgImage);
- vgImage = VG_INVALID_HANDLE;
- }
- if (vgImageOpacity != VG_INVALID_HANDLE) {
- vgDestroyImage(vgImageOpacity);
- vgImageOpacity = VG_INVALID_HANDLE;
- }
- }
-
- if (vgImage == VG_INVALID_HANDLE) {
- vgImage = vgCreateImage
- (VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER);
- }
-
- if (!source.isNull() && recreate) {
- vgImageSubData
- (vgImage,
- source.bits(), source.bytesPerLine(),
- VG_sARGB_8888_PRE, 0, 0, w, h);
- }
-
- recreate = false;
-
if (opacity == 1.0f)
return vgImage;
+ // Create an alternative image for the selected opacity.
if (vgImageOpacity == VG_INVALID_HANDLE || cachedOpacity != opacity) {
if (vgImageOpacity == VG_INVALID_HANDLE) {
vgImageOpacity = vgCreateImage
@@ -405,6 +386,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
vgDestroyImage(vgImageOpacity);
vgImageOpacity = VG_INVALID_HANDLE;
}
+ prevSize = QSize();
TInt err = 0;
@@ -465,6 +447,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
is_null = (w <= 0 || h <= 0);
source = QImage();
recreate = false;
+ prevSize = QSize(w, h);
setSerialNumber(++qt_vg_pixmap_serial);
// release stuff
eglDestroyImageKHR(context->display(), eglImage);
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index f6fac88..fe19f35 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -109,6 +109,7 @@ protected:
#endif
protected:
+ QSize prevSize;
VGImage vgImage;
VGImage vgImageOpacity;
qreal cachedOpacity;
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/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index 33226bf..f833196 100644
--- a/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -51,6 +51,7 @@
#include <qtimer.h>
#include <QDialog>
#include <QGridLayout>
+#include <QPainter>
Q_DECLARE_METATYPE(QCommandLinkButton*)
@@ -83,7 +84,8 @@ private slots:
void clicked();
void toggled();
void defaultAndAutoDefault();
- void setAutoRepeat();
+ void setAutoRepeat();
+ void heightForWithWithIcon();
protected slots:
void resetCounters();
@@ -106,17 +108,17 @@ private:
void tst_QCommandLinkButton::getSetCheck()
{
QCommandLinkButton obj1;
-
+
QString text("mytext");
QVERIFY(obj1.description().isEmpty());
obj1.setDescription(text);
QVERIFY(obj1.description() == text);
-
+
QVERIFY(obj1.text().isEmpty());
obj1.setText(text);
QVERIFY(obj1.text() == text);
-
-
+
+
QMenu *var1 = new QMenu;
obj1.setMenu(var1);
QCOMPARE(var1, obj1.menu());
@@ -393,8 +395,8 @@ void tst_QCommandLinkButton::setAccel()
QTest::qWait(100);
}
- QVERIFY(testWidget->isActiveWindow());
-
+ QVERIFY(testWidget->isActiveWindow());
+
QTest::keyClick( testWidget, 'A', Qt::AltModifier );
QTest::qWait( 500 );
QVERIFY( click_count == 1 );
@@ -556,5 +558,33 @@ void tst_QCommandLinkButton::defaultAndAutoDefault()
}
}
+void tst_QCommandLinkButton::heightForWithWithIcon()
+{
+ QWidget mainWin;
+
+ QPixmap pixmap(64, 64);
+ {
+ pixmap.fill(Qt::white);
+ QPainter painter(&pixmap);
+ painter.setBrush(Qt::black);
+ painter.drawEllipse(0, 0, 63, 63);
+ }
+
+ QCommandLinkButton *largeIconButton = new QCommandLinkButton(QString("Large Icon"),
+ QString("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris nibh lectus, adipiscing eu."),
+ &mainWin);
+ largeIconButton->setIconSize(QSize(64, 64));
+ largeIconButton->setIcon(pixmap);
+
+ QVBoxLayout *layout = new QVBoxLayout();
+ layout->addWidget(largeIconButton);
+ layout->addStretch();
+ mainWin.setLayout(layout);
+ mainWin.showMaximized();
+ QTest::qWaitForWindowShown(&mainWin);
+ QVERIFY(largeIconButton->height() > 68); //enough room for the icon
+
+}
+
QTEST_MAIN(tst_QCommandLinkButton)
#include "tst_qcommandlinkbutton.moc"
diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index bca59c3..baa1ba1 100644
--- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -167,7 +167,7 @@ public:
{
setContentsMargins( 0,0,0,0 );
if (name.isEmpty())
- setData(0, QString::fromAscii("w%1").arg(int(this)));
+ setData(0, QString::fromAscii("w%1").arg(quintptr(this)));
else
setData(0, name);
}
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 596ac9b..605b3e3 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -1895,6 +1895,8 @@ void tst_QListView::taskQTBUG_5877_skippingItemInPageDownUp()
vu.setModel(&model);
vu.show();
+ QTest::qWaitForWindowShown(&vu);
+
int itemHeight = vu.visualRect(model.index(0, 0)).height();
int visibleRowCount = vu.height() / itemHeight;
int scrolledRowCount = visibleRowCount - 1;
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index d7f042e..0effd01 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -47,6 +47,7 @@
#include <qmatrix.h>
#include <qdesktopwidget.h>
#include <qpaintengine.h>
+#include <qsplashscreen.h>
#include <private/qpixmapdata_p.h>
@@ -169,6 +170,7 @@ private slots:
void loadFromDataNullValues();
void preserveDepth();
+ void splash_crash();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1421,6 +1423,17 @@ void tst_QPixmap::fromImage_crash()
delete img;
}
+//This is testing QPixmapData::createCompatiblePixmapData - see QTBUG-5977
+void tst_QPixmap::splash_crash()
+{
+ QPixmap pix;
+ pix = QPixmap(":/images/designer.png");
+ QSplashScreen splash(pix);
+ splash.show();
+ QCoreApplication::processEvents();
+ splash.close();
+}
+
void tst_QPixmap::fromData()
{
unsigned char bits[] = { 0xaa, 0x55 };
diff --git a/tests/auto/qstatusbar/tst_qstatusbar.cpp b/tests/auto/qstatusbar/tst_qstatusbar.cpp
index 9774559..92d9185 100644
--- a/tests/auto/qstatusbar/tst_qstatusbar.cpp
+++ b/tests/auto/qstatusbar/tst_qstatusbar.cpp
@@ -77,6 +77,7 @@ private slots:
void insertPermanentWidget();
void setSizeGripEnabled();
void task194017_hiddenWidget();
+ void QTBUG4334_hiddenOnMaximizedWindow();
private:
QStatusBar *testWidget;
@@ -257,6 +258,19 @@ void tst_QStatusBar::task194017_hiddenWidget()
QVERIFY(!label->isVisible());
}
+void tst_QStatusBar::QTBUG4334_hiddenOnMaximizedWindow()
+{
+ QMainWindow main;
+ QStatusBar statusbar;
+ statusbar.setSizeGripEnabled(true);
+ main.setStatusBar(&statusbar);
+ main.showMaximized();
+ QTest::qWaitForWindowShown(&main);
+ QVERIFY(!statusbar.findChild<QSizeGrip*>()->isVisible());
+ main.showNormal();
+ QTest::qWaitForWindowShown(&main);
+ QVERIFY(statusbar.findChild<QSizeGrip*>()->isVisible());
+}
QTEST_MAIN(tst_QStatusBar)
#include "tst_qstatusbar.moc"
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index 7c3f4f2..1df26b8 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -1115,14 +1115,14 @@ void tst_QTextLayout::testTabDPIScale()
QTextOption option = layout.textOption();
QList<QTextOption::Tab> tabs;
QTextOption::Tab tab;
- tab.position = 200;
+ tab.position = 300;
tabs.append(tab);
- tab.position = 400;
+ tab.position = 600;
tab.type = QTextOption::RightTab;
tabs.append(tab);
- tab.position = 600;
+ tab.position = 800;
tab.type = QTextOption::CenterTab;
tabs.append(tab);
option.setTabs(tabs);
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/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