summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-09-05 23:54:38 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-09-05 23:54:38 (GMT)
commitc3bf669fb7fdac530365f36750613f2e21893a77 (patch)
tree0d7ac6e135913221f94183968a599c4027b2b21e
parent0b5fa23dd25c78b71dfb0932008d226639a43445 (diff)
parent63e15bbb9666ab49305d45380f9f580fb0e168ca (diff)
downloadQt-c3bf669fb7fdac530365f36750613f2e21893a77.zip
Qt-c3bf669fb7fdac530365f36750613f2e21893a77.tar.gz
Qt-c3bf669fb7fdac530365f36750613f2e21893a77.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js4
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/mymodel.cpp2
-rw-r--r--mkspecs/common/symbian/symbian.conf18
-rw-r--r--mkspecs/features/sis_targets.prf24
-rw-r--r--mkspecs/features/symbian/application_icon.prf15
-rw-r--r--mkspecs/features/symbian/run_on_phone.prf10
-rw-r--r--mkspecs/features/symbian/symbian_building.prf66
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp48
-rw-r--r--src/gui/painting/qdrawhelper.cpp197
-rw-r--r--src/gui/styles/qs60style.cpp20
-rw-r--r--src/gui/styles/qs60style_p.h1
-rw-r--r--src/gui/styles/qs60style_s60.cpp6
-rw-r--r--src/gui/text/qstatictext.cpp6
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp1
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp27
16 files changed, 162 insertions, 302 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index b1f427c..79ff0c1 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -127,7 +127,7 @@ function shuffleDown() {
} else {
if (fallDist > 0) {
var obj = board[index(column, row)];
- obj.y += fallDist * gameCanvas.blockSize;
+ obj.y = (row + fallDist) * gameCanvas.blockSize;
board[index(column, row + fallDist)] = obj;
board[index(column, row)] = null;
}
@@ -145,7 +145,7 @@ function shuffleDown() {
obj = board[index(column, row)];
if (obj == null)
continue;
- obj.x -= fallDist * gameCanvas.blockSize;
+ obj.x = (fallDist - column) * gameCanvas.blockSize;
board[index(column - fallDist, row)] = obj;
board[index(column, row)] = null;
}
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index 3e13ff4..2d2556c 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -89,7 +89,7 @@ QVariant MyModel::data(const QModelIndex &index, int role) const
if (row == 1 && col == 2) //change background only for cell(1,2)
{
- QBrush redBackground(QColor(Qt::red));
+ QBrush redBackground(Qt::red);
return redBackground;
}
break;
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 61cc7d9..beef193 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -175,3 +175,21 @@ pkg_platform_dependencies = \
DEPLOYMENT += default_deployment
+defineReplace(symbianRemoveSpecialCharacters) {
+ # Produce identical string to what SymbianCommonGenerator::removeSpecialCharacters and
+ # SymbianCommonGenerator::removeEpocSpecialCharacters produce
+
+ fixedStr = $$1
+
+ fixedStr = $$replace(fixedStr, /,_)
+ fixedStr = $$replace(fixedStr, \\\\,_)
+ fixedStr = $$replace(fixedStr, " ",_)
+ symbian-abld|symbian-sbsv2 {
+ fixedStr = $$replace(fixedStr, -,_)
+ fixedStr = $$replace(fixedStr, \\.,_)
+ fixedStr = $$replace(fixedStr, :,_)
+ }
+
+ return ($$fixedStr)
+}
+
diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index e069ee1..800a04c 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -10,6 +10,9 @@ else:!equals(DEPLOYMENT, default_deployment) {
}
equals(GENERATE_SIS_TARGETS, true) {
+
+ baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
+
symbian-abld|symbian-sbsv2 {
symbian-sbsv2 {
CONVERT_GCCE_PARAM = -g
@@ -19,7 +22,7 @@ equals(GENERATE_SIS_TARGETS, true) {
make_cache_name = .make.cache
sis_target.target = sis
- sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \
+ sis_target.commands = $(if $(wildcard $${baseTarget}_template.pkg), \
$(if $(wildcard $$make_cache_name), \
$(MAKE) -f $(MAKEFILE) ok_sis MAKEFILES=$$make_cache_name \
, \
@@ -34,11 +37,11 @@ equals(GENERATE_SIS_TARGETS, true) {
)
ok_sis_target.target = ok_sis
- ok_sis_target.commands = createpackage.bat $$CONVERT_GCCE_PARAM $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \
+ ok_sis_target.commands = createpackage.bat $$CONVERT_GCCE_PARAM $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
$(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
unsigned_sis_target.target = unsigned_sis
- unsigned_sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \
+ unsigned_sis_target.commands = $(if $(wildcard $${baseTarget}_template.pkg), \
$(if $(wildcard $$make_cache_name), \
$(MAKE) -f $(MAKEFILE) ok_unsigned_sis MAKEFILES=$$make_cache_name \
, \
@@ -53,21 +56,21 @@ equals(GENERATE_SIS_TARGETS, true) {
)
ok_unsigned_sis_target.target = ok_unsigned_sis
- ok_unsigned_sis_target.commands = createpackage.bat $$CONVERT_GCCE_PARAM $(QT_SIS_OPTIONS) -o $$basename(TARGET)_template.pkg $(QT_SIS_TARGET)
+ ok_unsigned_sis_target.commands = createpackage.bat $$CONVERT_GCCE_PARAM $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg $(QT_SIS_TARGET)
- target_sis_target.target = $$basename(TARGET).sis
+ target_sis_target.target = $${baseTarget}.sis
target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis
installer_sis_target.target = installer_sis
- installer_sis_target.commands = $(if $(wildcard $$basename(TARGET)_installer.pkg), \
+ installer_sis_target.commands = $(if $(wildcard $${baseTarget}_installer.pkg), \
$(MAKE) -f $(MAKEFILE) ok_installer_sis \
, \
$(MAKE) -f $(MAKEFILE) fail_sis_nopkg \
)
- installer_sis_target.depends = $$basename(TARGET).sis
+ installer_sis_target.depends = $${baseTarget}.sis
ok_installer_sis_target.target = ok_installer_sis
- ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \
+ ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
fail_sis_nopkg_target.target = fail_sis_nopkg
@@ -77,7 +80,7 @@ equals(GENERATE_SIS_TARGETS, true) {
fail_sis_nocache_target.commands = "$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)"
stub_sis_target.target = stub_sis
- stub_sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \
+ stub_sis_target.commands = $(if $(wildcard $${baseTarget}_template.pkg), \
$(if $(wildcard $$make_cache_name), \
$(MAKE) -f $(MAKEFILE) ok_stub_sis MAKEFILES=$$make_cache_name \
, \
@@ -92,7 +95,7 @@ equals(GENERATE_SIS_TARGETS, true) {
)
ok_stub_sis_target.target = ok_stub_sis
- ok_stub_sis_target.commands = createpackage.bat -s $(QT_SIS_OPTIONS) $$basename(TARGET)_stub.pkg \
+ ok_stub_sis_target.commands = createpackage.bat -s $(QT_SIS_OPTIONS) $${baseTarget}_stub.pkg \
$(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
QMAKE_EXTRA_TARGETS += sis_target \
@@ -134,7 +137,6 @@ equals(GENERATE_SIS_TARGETS, true) {
sis_destdir = $$DESTDIR
isEmpty(sis_destdir):sis_destdir = .
- baseTarget = $$basename(TARGET)
!equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
sis_target.target = sis
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
index c5654d9..9a9395a 100644
--- a/mkspecs/features/symbian/application_icon.prf
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -14,20 +14,7 @@ contains( CONFIG, no_icon ) {
warning("Only first icon specified in ICON variable is used: $$ICON")
}
- # Try to produce indentical string to fixedTarget in SymbianMakefileGenerator, replaced chars taken
- # from SymbianCommonGenerator::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, " ",_)
- symbian-abld|symbian-sbsv2 {
- baseTarget = $$replace(baseTarget, -,_)
- baseTarget = $$replace(baseTarget, \\.,_)
- baseTarget = $$replace(baseTarget, :,_)
- }
+ baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
# Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
!symbian-sbsv2 {
diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf
index f77369c..d845277 100644
--- a/mkspecs/features/symbian/run_on_phone.prf
+++ b/mkspecs/features/symbian/run_on_phone.prf
@@ -11,19 +11,21 @@ else:!equals(DEPLOYMENT, default_deployment) {
}
equals(GENERATE_RUN_TARGETS, true) {
+ baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
+ sis_file = $${baseTarget}.sis
symbian-abld|symbian-sbsv2 {
sis_destdir =
- sis_file = $$basename(TARGET).sis
} else {
sis_destdir = $$DESTDIR
- sis_file = $${TARGET}.sis
+ isEmpty(sis_destdir):sis_destdir = .
+ !equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
!isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
}
contains(SYMBIAN_PLATFORMS, "WINSCW"):contains(TEMPLATE, "app") {
run_target.target = run
- run_target.commands = call "$${EPOCROOT}epoc32/release/winscw/udeb/$$basename(TARGET).exe" $(QT_RUN_OPTIONS)
+ run_target.commands = call "$${EPOCROOT}epoc32/release/winscw/udeb/$${baseTarget}.exe" $(QT_RUN_OPTIONS)
QMAKE_EXTRA_TARGETS += run_target
}
@@ -31,7 +33,7 @@ equals(GENERATE_RUN_TARGETS, true) {
runonphone_target.target = runonphone
runonphone_target.depends = sis
runonphone_target.commands = runonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis "$${sis_destdir}$${sis_file}"
- contains(TEMPLATE, "app"):runonphone_target.commands += "$$basename(TARGET).exe" $(QT_RUN_OPTIONS)
+ contains(TEMPLATE, "app"):runonphone_target.commands += "$${baseTarget}.exe" $(QT_RUN_OPTIONS)
QMAKE_EXTRA_TARGETS += runonphone_target
}
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 414b081..0b621a3 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -35,7 +35,7 @@ symbianDestdir=$$DESTDIR
isEmpty(symbianDestdir) {
symbianDestdir = .
}
-baseTarget = $$basename(TARGET)
+baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
!equals(TARGET, "$$baseTarget"):symbianDestdir = $$symbianDestdir/$$dirname(TARGET)
contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
@@ -253,49 +253,45 @@ symbianresources.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += symbianresources
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
- baseResourceTarget = $$basename(TARGET)
- # If you change this, also see application_icon.prf
- baseResourceTarget = $$replace(baseResourceTarget, " ",_)
-
# Make our own extra target in order to get dependencies for generated
# files right. This also avoids the warning about files not found.
- symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
symbianGenResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseResourceTarget}.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
+ $${baseTarget}.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
- -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
- -i$${baseResourceTarget}.rss
- silent:symbianGenResource.commands = @echo rcomp $${baseResourceTarget}.rss && $$symbianGenResource.commands
- symbianGenResource.depends = $${baseResourceTarget}.rss
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp
- QMAKE_DISTCLEAN += $${baseResourceTarget}.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}.rsc
-
- symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+ -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
+ -o$${symbianDestdir}/$${baseTarget}.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
+ -i$${baseTarget}.rss
+ silent:symbianGenResource.commands = @echo rcomp $${baseTarget}.rss && $$symbianGenResource.commands
+ symbianGenResource.depends = $${baseTarget}.rss
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
+ QMAKE_DISTCLEAN += $${baseTarget}.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
+
+ symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
symbianGenRegResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseResourceTarget}_reg.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
+ $${baseTarget}_reg.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
- -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
- -i$${baseResourceTarget}_reg.rss
- silent:symbianGenRegResource.commands = @echo rcomp $${baseResourceTarget}_reg.rss && $$symbianGenRegResource.commands
- symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp
- QMAKE_DISTCLEAN += $${baseResourceTarget}_reg.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}_reg.rsc
+ -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
+ -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
+ -i$${baseTarget}_reg.rss
+ silent:symbianGenRegResource.commands = @echo rcomp $${baseTarget}_reg.rss && $$symbianGenRegResource.commands
+ symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
+ QMAKE_DISTCLEAN += $${baseTarget}_reg.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}_reg.rsc
# Trick to get qmake to create the RCC_DIR for us.
symbianRccDirCreation.input = SOURCES
@@ -312,3 +308,5 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
# Generated pkg files
QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_installer.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_stub.pkg
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 155dbc9..a60ae07 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -129,7 +129,7 @@ bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QString
void SymbianCommonGenerator::removeSpecialCharacters(QString& str)
{
- // When modifying this method check also application_icon.prf
+ // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf
str.replace(QString("/"), QString("_"));
str.replace(QString("\\"), QString("_"));
str.replace(QString(" "), QString("_"));
@@ -137,7 +137,7 @@ void SymbianCommonGenerator::removeSpecialCharacters(QString& str)
void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str)
{
- // When modifying this method check also application_icon.prf
+ // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf
str.replace(QString("-"), QString("_"));
str.replace(QString(":"), QString("_"));
str.replace(QString("."), QString("_"));
@@ -154,13 +154,8 @@ QString romPath(const QString& path)
void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocBuild)
{
QMakeProject *project = generator->project;
- QString pkgTarget = project->first("QMAKE_ORIG_TARGET");
- if (pkgTarget.isEmpty())
- pkgTarget = project->first("TARGET");
- pkgTarget = generator->unescapeFilePath(pkgTarget);
- pkgTarget = removePathSeparators(pkgTarget);
QString pkgFilename = Option::output_dir + QLatin1Char('/') +
- QString("%1_template.pkg").arg(pkgTarget);
+ QString("%1_template.pkg").arg(fixedTarget);
QFile pkgFile(pkgFilename);
if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -169,7 +164,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
}
QString stubPkgFileName = Option::output_dir + QLatin1Char('/') +
- QString("%1_stub.pkg").arg(pkgTarget);
+ QString("%1_stub.pkg").arg(fixedTarget);
QFile stubPkgFile(stubPkgFileName);
if (!stubPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -193,7 +188,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Header info
QString wrapperPkgFilename = Option::output_dir + QLatin1Char('/') + QString("%1_installer.%2")
- .arg(pkgTarget).arg("pkg");
+ .arg(fixedTarget).arg("pkg");
QString headerComment = "; %1 generated by qmake at %2\n"
"; This file is generated by qmake and should not be modified by the user\n"
@@ -535,7 +530,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Wrapped files deployment
QString currentPath = qmake_getpwd();
- QString sisName = QString("%1.sis").arg(pkgTarget);
+ QString sisName = QString("%1.sis").arg(fixedTarget);
twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\private\\2002CCCE\\import\\" << sisName << "\"" << endl;
QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath);
@@ -552,7 +547,7 @@ QString SymbianCommonGenerator::removePathSeparators(QString &file)
if (QDir::separator().unicode() != '/')
ret.replace(QDir::separator(), QLatin1Char('/'));
- if (ret.indexOf(QLatin1Char('/')) > 0)
+ if (ret.indexOf(QLatin1Char('/')) >= 0)
ret.remove(0, ret.lastIndexOf(QLatin1Char('/')) + 1);
return ret;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index b776b8e..77b26b9 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -247,13 +247,13 @@ void QDeclarativeBasePositioner::prePositioning()
positionedItems.append(posItem);
item = &positionedItems[positionedItems.count()-1];
item->isNew = true;
- if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden)
+ if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height())
item->isVisible = false;
} else {
item = &oldItems[wIdx];
// Items are only omitted from positioning if they are explicitly hidden
// i.e. their positioning is not affected if an ancestor is hidden.
- if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden) {
+ if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height()) {
item->isVisible = false;
} else if (!item->isVisible) {
item->isVisible = true;
@@ -321,12 +321,6 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
d->moveActions.clear();
}
-static inline bool isInvisible(QGraphicsObject *child)
-{
- QGraphicsItemPrivate *childPrivate = static_cast<QGraphicsItemPrivate*>(QGraphicsItemPrivate::get(child));
- return child->opacity() == 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height();
-}
-
/*!
\qmlclass Column QDeclarativeColumn
\ingroup qml-positioning-elements
@@ -449,7 +443,7 @@ void QDeclarativeColumn::doPositioning(QSizeF *contentSize)
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (!child.item || isInvisible(child.item))
+ if (!child.item || !child.isVisible)
continue;
if(child.item->y() != voffset)
@@ -584,7 +578,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (!child.item || isInvisible(child.item))
+ if (!child.item || !child.isVisible)
continue;
if(child.item->x() != hoffset)
@@ -793,9 +787,17 @@ void QDeclarativeGrid::setFlow(Flow flow)
void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
{
+
int c = m_columns;
int r = m_rows;
- int numVisible = positionedItems.count();
+ //Is allocating the extra QPODVector too much overhead?
+ QPODVector<PositionedItem, 8> visibleItems;//we aren't concerned with invisible items
+ visibleItems.reserve(positionedItems.count());
+ for(int i=0; i<positionedItems.count(); i++)
+ if(positionedItems[i].item && positionedItems[i].isVisible)
+ visibleItems.append(positionedItems[i]);
+
+ int numVisible = visibleItems.count();
if (m_columns <= 0 && m_rows <= 0){
c = 4;
r = (numVisible+3)/4;
@@ -816,11 +818,10 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
if (i==0)
maxColWidth << 0;
- if (childIndex == positionedItems.count())
- continue;
- const PositionedItem &child = positionedItems.at(childIndex++);
- if (!child.item || isInvisible(child.item))
- continue;
+ if (childIndex == visibleItems.count())
+ break;
+
+ const PositionedItem &child = visibleItems.at(childIndex++);
QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
if (childPrivate->width() > maxColWidth[j])
maxColWidth[j] = childPrivate->width();
@@ -837,10 +838,9 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
maxColWidth << 0;
if (childIndex == positionedItems.count())
- continue;
- const PositionedItem &child = positionedItems.at(childIndex++);
- if (!child.item || isInvisible(child.item))
- continue;
+ break;
+
+ const PositionedItem &child = visibleItems.at(childIndex++);
QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
if (childPrivate->width() > maxColWidth[j])
maxColWidth[j] = childPrivate->width();
@@ -854,10 +854,8 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
int yoffset=0;
int curRow =0;
int curCol =0;
- for (int i = 0; i < positionedItems.count(); ++i) {
- const PositionedItem &child = positionedItems.at(i);
- if (!child.item || isInvisible(child.item))
- continue;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ const PositionedItem &child = visibleItems.at(i);
if((child.item->x()!=xoffset)||(child.item->y()!=yoffset)){
positionX(xoffset, child);
positionY(yoffset, child);
@@ -1033,7 +1031,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
for (int i = 0; i < positionedItems.count(); ++i) {
const PositionedItem &child = positionedItems.at(i);
- if (!child.item || isInvisible(child.item))
+ if (!child.item || !child.isVisible)
continue;
QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5e1509d..cf487b5 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -684,8 +684,8 @@ Q_STATIC_TEMPLATE_FUNCTION inline void fetchTransformedBilinear_pixelBounds(int
} else {
if (v1 < l1) {
v2 = v1 = l1;
- } else if (v1 >= l2 - 1) {
- v2 = v1 = l2 - 1;
+ } else if (v1 >= l2) {
+ v2 = v1 = l2;
} else {
v2 = v1 + 1;
}
@@ -715,8 +715,8 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
int image_x1 = data->texture.x1;
int image_y1 = data->texture.y1;
- int image_x2 = data->texture.x2;
- int image_y2 = data->texture.y2;
+ int image_x2 = data->texture.x2 - 1;
+ int image_y2 = data->texture.y2 - 1;
const qreal cx = x + 0.5;
const qreal cy = y + 0.5;
@@ -763,9 +763,9 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
x %= image_width;
if (x < 0) x += image_width;
} else {
- lim = qMin(count, image_x2-x);
+ lim = qMin(count, image_x2-x+1);
if (x < image_x1) {
- Q_ASSERT(x < image_x2);
+ Q_ASSERT(x <= image_x2);
uint t = fetch(s1, image_x1, data->texture.colorTable);
uint b = fetch(s2, image_x1, data->texture.colorTable);
quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
@@ -818,7 +818,7 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
if (blendType == BlendTransformedBilinearTiled) {
if (x >= image_width) x -= image_width;
} else {
- x = qMin(x, image_x2 - 1);
+ x = qMin(x, image_x2);
}
uint t = fetch(s1, x, data->texture.colorTable);
@@ -5335,181 +5335,6 @@ static void blend_tiled_rgb444(int count, const QSpan *spans, void *userData)
blend_tiled_generic<RegularSpans>(count, spans, userData);
}
-
-template <SpanMethod spanMethod, TextureBlendType blendType> /* blendType must be either BlendTransformedBilinear or BlendTransformedBilinearTiled */
-Q_STATIC_TEMPLATE_FUNCTION void blend_transformed_bilinear_argb(int count, const QSpan *spans, void *userData)
-{
- QSpanData *data = reinterpret_cast<QSpanData *>(userData);
- if (data->texture.format != QImage::Format_ARGB32_Premultiplied
- && data->texture.format != QImage::Format_RGB32) {
- blend_src_generic<spanMethod>(count, spans, userData);
- return;
- }
-
- CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode];
- uint buffer[buffer_size];
-
- const int image_x1 = data->texture.x1;
- const int image_y1 = data->texture.y1;
- const int image_x2 = data->texture.x2;
- const int image_y2 = data->texture.y2;
- const int image_width = data->texture.width;
- const int image_height = data->texture.height;
- const int scanline_offset = data->texture.bytesPerLine / 4;
-
- if (data->fast_matrix) {
- // The increment pr x in the scanline
- int fdx = (int)(data->m11 * fixed_scale);
- int fdy = (int)(data->m12 * fixed_scale);
-
- while (count--) {
- void *t = data->rasterBuffer->scanLine(spans->y);
-
- uint *target = ((uint *)t) + spans->x;
- uint *image_bits = (uint *)data->texture.imageData;
-
- const qreal cx = spans->x + 0.5;
- const qreal cy = spans->y + 0.5;
-
- int x = int((data->m21 * cy
- + data->m11 * cx + data->dx) * fixed_scale) - half_point;
- int y = int((data->m22 * cy
- + data->m12 * cx + data->dy) * fixed_scale) - half_point;
-
- int length = spans->len;
- const int coverage = (data->texture.const_alpha * spans->coverage) >> 8;
- while (length) {
- int l = qMin(length, buffer_size);
- const uint *end = buffer + l;
- uint *b = buffer;
- while (b < end) {
- int x1 = (x >> 16);
- int x2;
- int y1 = (y >> 16);
- int y2;
-
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
-
- int y1_offset = y1 * scanline_offset;
- int y2_offset = y2 * scanline_offset;
-
-#if defined(Q_IRIX_GCC3_3_WORKAROUND)
- uint tl = gccBug(image_bits[y1_offset + x1]);
- uint tr = gccBug(image_bits[y1_offset + x2]);
- uint bl = gccBug(image_bits[y2_offset + x1]);
- uint br = gccBug(image_bits[y2_offset + x2]);
-#else
- uint tl = image_bits[y1_offset + x1];
- uint tr = image_bits[y1_offset + x2];
- uint bl = image_bits[y2_offset + x1];
- uint br = image_bits[y2_offset + x2];
-#endif
-
- int distx = (x & 0x0000ffff) >> 8;
- int disty = (y & 0x0000ffff) >> 8;
- int idistx = 256 - distx;
- int idisty = 256 - disty;
-
- uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx);
- uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx);
- *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty);
- ++b;
-
- x += fdx;
- y += fdy;
- }
- if (spanMethod == RegularSpans)
- func(target, buffer, l, coverage);
- else
- drawBufferSpan(data, buffer, buffer_size,
- spans->x + spans->len - length,
- spans->y, l, coverage);
- target += l;
- length -= l;
- }
- ++spans;
- }
- } else {
- const qreal fdx = data->m11;
- const qreal fdy = data->m12;
- const qreal fdw = data->m13;
-
- while (count--) {
- void *t = data->rasterBuffer->scanLine(spans->y);
-
- uint *target = ((uint *)t) + spans->x;
- uint *image_bits = (uint *)data->texture.imageData;
-
- const qreal cx = spans->x + 0.5;
- const qreal cy = spans->y + 0.5;
-
- qreal x = data->m21 * cy + data->m11 * cx + data->dx;
- qreal y = data->m22 * cy + data->m12 * cx + data->dy;
- qreal w = data->m23 * cy + data->m13 * cx + data->m33;
-
- int length = spans->len;
- const int coverage = (data->texture.const_alpha * spans->coverage) >> 8;
- while (length) {
- int l = qMin(length, buffer_size);
- const uint *end = buffer + l;
- uint *b = buffer;
- while (b < end) {
- const qreal iw = w == 0 ? 1 : 1 / w;
- const qreal px = x * iw - 0.5;
- const qreal py = y * iw - 0.5;
-
- int x1 = int(px) - (px < 0);
- int x2;
- int y1 = int(py) - (py < 0);
- int y2;
-
- int distx = int((px - x1) * 256);
- int disty = int((py - y1) * 256);
- int idistx = 256 - distx;
- int idisty = 256 - disty;
-
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
-
- int y1_offset = y1 * scanline_offset;
- int y2_offset = y2 * scanline_offset;
-
-#if defined(Q_IRIX_GCC3_3_WORKAROUND)
- uint tl = gccBug(image_bits[y1_offset + x1]);
- uint tr = gccBug(image_bits[y1_offset + x2]);
- uint bl = gccBug(image_bits[y2_offset + x1]);
- uint br = gccBug(image_bits[y2_offset + x2]);
-#else
- uint tl = image_bits[y1_offset + x1];
- uint tr = image_bits[y1_offset + x2];
- uint bl = image_bits[y2_offset + x1];
- uint br = image_bits[y2_offset + x2];
-#endif
-
- uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx);
- uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx);
- *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty);
- ++b;
-
- x += fdx;
- y += fdy;
- w += fdw;
- }
- if (spanMethod == RegularSpans)
- func(target, buffer, l, coverage);
- else
- drawBufferSpan(data, buffer, buffer_size,
- spans->x + spans->len - length,
- spans->y, l, coverage);
- target += l;
- length -= l;
- }
- ++spans;
- }
- }
-}
-
template <class DST, class SRC>
Q_STATIC_TEMPLATE_FUNCTION void blendTransformedBilinear(int count, const QSpan *spans,
void *userData)
@@ -6760,7 +6585,7 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // Indexed8
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB32
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32
- blend_transformed_bilinear_argb<RegularSpans, BlendTransformedBilinear>, // ARGB32_Premultiplied
+ SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32_Premultiplied
blend_transformed_bilinear_rgb565,
blend_transformed_bilinear_argb8565,
blend_transformed_bilinear_rgb666,
@@ -6779,7 +6604,7 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // Indexed8
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB32
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32
- blend_transformed_bilinear_argb<RegularSpans, BlendTransformedBilinearTiled>, // ARGB32_Premultiplied
+ SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32_Premultiplied
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB16
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB8565_Premultiplied
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB666
@@ -6878,7 +6703,7 @@ static const ProcessSpans processTextureSpansCallback[NBlendTypes][QImage::NImag
blend_src_generic<CallbackSpans>, // Indexed8
blend_src_generic<CallbackSpans>, // RGB32
blend_src_generic<CallbackSpans>, // ARGB32
- blend_transformed_bilinear_argb<CallbackSpans, BlendTransformedBilinear>, // ARGB32_Premultiplied
+ blend_src_generic<CallbackSpans>, // ARGB32_Premultiplied
blend_src_generic<CallbackSpans>, // RGB16
blend_src_generic<CallbackSpans>, // ARGB8565_Premultiplied
blend_src_generic<CallbackSpans>, // RGB666
@@ -6897,7 +6722,7 @@ static const ProcessSpans processTextureSpansCallback[NBlendTypes][QImage::NImag
blend_src_generic<CallbackSpans>, // Indexed8
blend_src_generic<CallbackSpans>, // RGB32
blend_src_generic<CallbackSpans>, // ARGB32
- blend_transformed_bilinear_argb<CallbackSpans, BlendTransformedBilinearTiled>, // ARGB32_Premultiplied
+ blend_src_generic<CallbackSpans>, // ARGB32_Premultiplied
blend_src_generic<CallbackSpans>, // RGB16
blend_src_generic<CallbackSpans>, // ARGB8565_Premultiplied
blend_src_generic<CallbackSpans>, // RGB666
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 0ba1bc6..358c6aa 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -154,6 +154,9 @@ QS60StylePrivate::~QS60StylePrivate()
{
clearCaches(); //deletes also background image
deleteThemePalette();
+#ifdef Q_WS_S60
+ removeAnimations();
+#endif
}
void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
@@ -1097,8 +1100,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
}
State mflags = bflags;
if (toolBtn->state & State_Sunken) {
- if (toolBtn->activeSubControls & SC_ToolButton)
- bflags |= State_Sunken;
+ bflags |= State_Sunken;
mflags |= State_Sunken;
}
@@ -1114,11 +1116,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (bflags & (State_Sunken | State_On | State_Raised | State_Enabled)) {
tool.rect = button.unite(menuRect);
tool.state = bflags;
- const QToolButton *toolButtonWidget = qobject_cast<const QToolButton *>(widget);
- const QS60StylePrivate::SkinElements element =
- ((toolButtonWidget && toolButtonWidget->isDown()) || (option->state & State_Sunken)) ?
- QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
- QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
}
if (toolBtn->subControls & SC_ToolButtonMenu) {
@@ -2174,9 +2171,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelButtonBevel:
case PE_FrameButtonBevel:
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) {
- const bool isPressed = option->state & State_Sunken;
- const QS60StylePrivate::SkinElements skinElement =
- isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
+ const bool isPressed = (option->state & State_Sunken) || (option->state & State_On);
+ QS60StylePrivate::SkinElements skinElement;
+ if (element == PE_PanelButtonTool)
+ skinElement = isPressed ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
+ else
+ skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
} else {
commonStyleDraws = true;
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 836969a..51ced96 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -571,6 +571,7 @@ public:
void startAnimation(QS60StyleEnums::SkinParts animation);
void stopAnimation(QS60StyleEnums::SkinParts animation);
static QS60StyleAnimation* animationDefinition(QS60StyleEnums::SkinParts part);
+ static void removeAnimations();
#endif
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index f44b85e..5dda42e 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1152,6 +1152,12 @@ QS60StylePrivate::QS60StylePrivate()
setActiveLayout();
}
+void QS60StylePrivate::removeAnimations()
+{
+ //currently only one animation in the list.
+ m_animations()->removeFirst();
+}
+
QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
int index, const QStyleOption *option)
{
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 21c2e02..b950b13 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -400,9 +400,9 @@ QStaticTextPrivate::QStaticTextPrivate()
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
: text(other.text), font(other.font), textWidth(other.textWidth), matrix(other.matrix),
- items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), needsRelayout(true),
- useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat),
- untransformedCoordinates(other.untransformedCoordinates)
+ items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), textOption(other.textOption),
+ needsRelayout(true), useBackendOptimizations(other.useBackendOptimizations),
+ textFormat(other.textFormat), untransformedCoordinates(other.untransformedCoordinates)
{
}
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 24f6ccf..cd023cb 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -223,6 +223,7 @@ static void handleOtherSchemesL(const TDesC& aUrl)
TApaTask task = taskList.FindApp(KUidBrowser);
if (task.Exists()){
// Switch to existing browser instance
+ task.BringToForeground();
HBufC8* param8 = HBufC8::NewLC(buf16->Length());
param8->Des().Append(buf16->Des());
task.SendMessage(TUid::Uid( 0 ), *param8); // Uid is not used
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 0ae5320..2a60e9e 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -73,6 +73,8 @@ private slots:
void prepareToCorrectData();
void prepareToWrongData();
+ void copyConstructor();
+
void translatedPainter();
void rotatedPainter();
void scaledPainter();
@@ -104,6 +106,31 @@ void tst_QStaticText::constructionAndDestruction()
QStaticText text("My text");
}
+void tst_QStaticText::copyConstructor()
+{
+ QStaticText text(QLatin1String("My text"));
+
+ QTextOption textOption(Qt::AlignRight);
+ text.setTextOption(textOption);
+
+ text.setPerformanceHint(QStaticText::AggressiveCaching);
+ text.setTextWidth(123.456);
+ text.setTextFormat(Qt::PlainText);
+
+ QStaticText copiedText(text);
+ copiedText.setText(QLatin1String("Other text"));
+
+ QCOMPARE(copiedText.textOption().alignment(), Qt::AlignRight);
+ QCOMPARE(copiedText.performanceHint(), QStaticText::AggressiveCaching);
+ QCOMPARE(copiedText.textWidth(), 123.456);
+ QCOMPARE(copiedText.textFormat(), Qt::PlainText);
+
+ QStaticText otherCopiedText(copiedText);
+ otherCopiedText.setTextWidth(789);
+
+ QCOMPARE(otherCopiedText.text(), QString::fromLatin1("Other text"));
+}
+
Q_DECLARE_METATYPE(QStaticText::PerformanceHint)
void tst_QStaticText::drawToPoint_data()
{