diff options
-rw-r--r-- | demos/spectrum/app/spectrum.sh | 41 | ||||
-rw-r--r-- | demos/spectrum/spectrum.pro | 3 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qtextengine_p.h | 1 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 5 | ||||
-rw-r--r-- | util/s60theme/main.cpp | 4 | ||||
-rw-r--r-- | util/s60theme/s60themeconvert.cpp | 25 |
8 files changed, 73 insertions, 14 deletions
diff --git a/demos/spectrum/app/spectrum.sh b/demos/spectrum/app/spectrum.sh index 75ad6c2..2a230ed 100644 --- a/demos/spectrum/app/spectrum.sh +++ b/demos/spectrum/app/spectrum.sh @@ -1,4 +1,45 @@ #!/bin/sh +############################################################################# +## +## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the examples of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# + # Shell script for launching spectrum application on Unix systems other than Mac OSX diff --git a/demos/spectrum/spectrum.pro b/demos/spectrum/spectrum.pro index 8736ba7..a8f09de 100644 --- a/demos/spectrum/spectrum.pro +++ b/demos/spectrum/spectrum.pro @@ -1,4 +1,3 @@ -load(data_caging_paths) include(spectrum.pri) TEMPLATE = subdirs @@ -15,6 +14,8 @@ SUBDIRS += app TARGET = spectrum symbian { + load(data_caging_paths) + # Create a 'make sis' rule which can be run from the top-level include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 6e6a806..b1e0f63 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -934,6 +934,9 @@ void QSymbianControl::SizeChanged() qwidget->d_func()->syncBackingStore(); if (!slowResize && tlwExtra) tlwExtra->inTopLevelResize = false; + } else { + QResizeEvent *e = new QResizeEvent(newSize, oldSize); + QApplication::postEvent(qwidget, e); } } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 96981af..6055a04 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7806,10 +7806,11 @@ start_lengthVariant: for (int i = 0; i < textLayout.lineCount(); i++) { QTextLine line = textLayout.lineAt(i); + qreal advance = textLayout.engine()->lines[i].textAdvance.toReal(); if (tf & Qt::AlignRight) - xoff = r.width() - line.naturalTextWidth(); + xoff = r.width() - advance; else if (tf & Qt::AlignHCenter) - xoff = (r.width() - line.naturalTextWidth())/2; + xoff = (r.width() - advance)/2; line.draw(painter, QPointF(r.x() + xoff + line.x(), r.y() + yoff)); } diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index f36cbd2..5054b66 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -382,6 +382,7 @@ struct Q_AUTOTEST_EXPORT QScriptLine QFixed y; QFixed width; QFixed textWidth; + QFixed textAdvance; int from; signed int length : 29; mutable uint justified : 1; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 3c0e85e..c5dd854 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -89,9 +89,9 @@ static QFixed alignLine(QTextEngine *eng, const QScriptLine &line) if (align & Qt::AlignJustify && eng->option.textDirection() == Qt::RightToLeft) align = Qt::AlignRight; if (align & Qt::AlignRight) - x = line.width - (line.textWidth + leadingSpaceWidth(eng, line)); + x = line.width - (line.textAdvance + leadingSpaceWidth(eng, line)); else if (align & Qt::AlignHCenter) - x = (line.width - line.textWidth)/2; + x = (line.width - line.textAdvance)/2; } return x; } @@ -1928,6 +1928,7 @@ void QTextLine::layout_helper(int maxGlyphs) found: if (lbh.rightBearing > 0) // If right bearing has not yet been adjusted lbh.adjustRightBearing(); + line.textAdvance = line.textWidth; line.textWidth -= qMin(QFixed(), lbh.rightBearing); if (line.length == 0) { diff --git a/util/s60theme/main.cpp b/util/s60theme/main.cpp index 7f38d5c..1234fd2 100644 --- a/util/s60theme/main.cpp +++ b/util/s60theme/main.cpp @@ -70,9 +70,9 @@ int main(int argc, char *argv[]) const QFileInfo inputInfo(input); const QString output = QString::fromLatin1(argv[2]); if (inputInfo.isDir()) - return S60ThemeConvert::convertDefaultThemeToBlob(input, output); + return S60ThemeConvert::convertDefaultThemeToBlob(input, output) ? 0 : 1; else if (inputInfo.suffix().compare(QString::fromLatin1("tdf"), Qt::CaseInsensitive) == 0) - return S60ThemeConvert::convertTdfToBlob(input, output); + return S60ThemeConvert::convertTdfToBlob(input, output) ? 0 : 1; return help(); } diff --git a/util/s60theme/s60themeconvert.cpp b/util/s60theme/s60themeconvert.cpp index 7908055..b1e8022 100644 --- a/util/s60theme/s60themeconvert.cpp +++ b/util/s60theme/s60themeconvert.cpp @@ -45,6 +45,8 @@ #include <QtWebKit> static const int pictureSize = 256; +static const char* const msgPartNotInTdf = " Warning: The .tdf file does not have a part for "; +static const char* const msgSvgNotFound = " Fatal: Could not find part .svg "; void dumpPartPictures(const QHash<QString, QPicture> &partPictures) { foreach (const QString &partKey, partPictures.keys()) { @@ -84,6 +86,7 @@ private: WebKitSVGRenderer::WebKitSVGRenderer(QWidget *parent) : QWebView(parent) { + connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinishedSlot(bool))); setFixedSize(pictureSize, pictureSize); QPalette pal = palette(); @@ -202,11 +205,19 @@ bool loadThemeFromTdf(const QString &tdfFile, return false; const QString tdfBasePath = QFileInfo(tdfFile).absolutePath(); WebKitSVGRenderer renderer; - foreach(const QString& partKey, parsedPartSvgs.keys()) { - const QString tdfFullName = - tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey); - if (!QFile(tdfFullName).exists()) - qWarning() << "Could not find part:" << parsedPartSvgs.value(partKey); + foreach (const QString &partKey, QS60Style::partKeys()) { + qDebug() << partKey; + QString tdfFullName; + if (parsedPartSvgs.contains(partKey)) { + tdfFullName = tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey); + } else { + qWarning() << msgPartNotInTdf << partKey; + tdfFullName = tdfBasePath + QDir::separator() + partKey + QLatin1String(".svg"); + } + if (!QFile(tdfFullName).exists()) { + qWarning() << msgSvgNotFound << QDir::toNativeSeparators(tdfFullName); + return false; + } const QPicture partPicture = renderer.svgToQPicture(tdfFullName); parsedPartPictures.insert(partKey, partPicture); } @@ -276,8 +287,8 @@ bool loadDefaultTheme(const QString &themePath, const QString partFileName = partKey + QLatin1String(".svg"); const QString partFile(dir.absolutePath() + QDir::separator() + partFileName); if (!QFile::exists(partFile)) { - qWarning() << "Could not find part:" << partFileName; - continue; + qWarning() << msgSvgNotFound << partFileName; + return false; } const QPicture partPicture = renderer.svgToQPicture(partFile); partPictures.insert(partKey, partPicture); |