From de4bd221124e0a133858839b4b824165a9eb7dff Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 22 Mar 2011 10:16:54 +0100 Subject: Remove useless profile reference. The profile has been empty since the plugin functionality was moved into QtMultimedia itself (d73df73c556b0a225fdde7341549ed834bc691f4). RevBy: Miikka Heikkinen --- src/plugins/audio/audio.pro | 3 --- src/plugins/plugins.pro | 1 - 2 files changed, 4 deletions(-) delete mode 100644 src/plugins/audio/audio.pro diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro deleted file mode 100644 index b7a775b..0000000 --- a/src/plugins/audio/audio.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = - diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index afa0901..e778ab7 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -13,5 +13,4 @@ embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers !symbian:!contains(QT_CONFIG, no-gui):SUBDIRS += accessible symbian:SUBDIRS += s60 contains(QT_CONFIG, phonon): SUBDIRS *= phonon -contains(QT_CONFIG, multimedia): SUBDIRS *= audio contains(QT_CONFIG, declarative): SUBDIRS *= qmltooling -- cgit v0.12 From 48c5a020c6ad6ee5ef1721d422f10bbc40dd1557 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 22 Mar 2011 11:03:13 +0200 Subject: Change Symbian to use destroyed swap behaviour in GL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Destroyed swap behaviour is a little bit faster than preserved swap with heavily animated UIs like QML. Task-number: QTBUG-18270 Reviewed-by: Samuel Rødal --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 4 --- src/opengl/opengl.pro | 2 +- src/opengl/qgl_symbian.cpp | 21 ++++++++---- src/opengl/qgltexturepool.cpp | 7 ++-- src/opengl/qwindowsurface_gl.cpp | 40 +++++++++++++++++----- 5 files changed, 51 insertions(+), 23 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index c8786fb..5c8d2b6 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -90,10 +90,6 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_SYMBIAN) -#define QT_GL_NO_SCISSOR_TEST -#endif - #if defined(Q_WS_WIN) extern Q_GUI_EXPORT bool qt_cleartype_enabled; #endif diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 6bbf99b..6d79584 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -148,7 +148,7 @@ embedded { } symbian { - DEFINES += QGL_USE_TEXTURE_POOL + DEFINES += QGL_USE_TEXTURE_POOL QGL_NO_PRESERVED_SWAP SOURCES -= qpixmapdata_gl.cpp SOURCES += qgl_symbian.cpp \ qpixmapdata_poolgl.cpp \ diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 78624a2..7caaabd 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -228,13 +228,20 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->eglSurface = QEgl::createSurface(device(), d->eglContext->config()); -#if !defined(QGL_NO_PRESERVED_SWAP) - eglGetError(); // Clear error state first. - eglSurfaceAttrib(QEgl::display(), d->eglSurface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) { - qWarning("QGLContext: could not enable preserved swap"); - } + eglGetError(); // Clear error state first. + +#ifdef QGL_NO_PRESERVED_SWAP + eglSurfaceAttrib(QEgl::display(), d->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); + + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLContext: could not enable destroyed swap behaviour"); +#else + eglSurfaceAttrib(QEgl::display(), d->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLContext: could not enable preserved swap behaviour"); #endif setWindowCreated(true); diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp index 61a88c3..a5472ec 100644 --- a/src/opengl/qgltexturepool.cpp +++ b/src/opengl/qgltexturepool.cpp @@ -135,8 +135,11 @@ void QGLTexturePool::releaseTexture(QGLPixmapData *data, GLuint texture) if (data) removeFromLRU(data); - QGLShareContextScope ctx(qt_gl_share_widget()->context()); - glDeleteTextures(1, &texture); + QGLWidget *shareWidget = qt_gl_share_widget(); + if (shareWidget) { + QGLShareContextScope ctx(shareWidget->context()); + glDeleteTextures(1, &texture); + } } void QGLTexturePool::useTexture(QGLPixmapData *data) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 11a9eb0..ed541ce 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -371,6 +371,10 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window) d_ptr->q_ptr = this; d_ptr->geometry_updated = false; d_ptr->did_paint = false; + +#ifdef QGL_NO_PRESERVED_SWAP + setPartialUpdateSupport(false); +#endif } QGLWindowSurface::~QGLWindowSurface() @@ -467,8 +471,16 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) if (haveNOKSwapRegion) qDebug() << "Found EGL_NOK_swap_region2 extension. Using partial updates."; } - bool swapBehaviourPreserved = (ctx->d_func()->eglContext->configAttrib(EGL_SWAP_BEHAVIOR) - || (ctx->d_func()->eglContext->configAttrib(EGL_SURFACE_TYPE)&EGL_SWAP_BEHAVIOR_PRESERVED_BIT)); + + bool swapBehaviourPreserved = ctx->d_func()->eglContext->configAttrib(EGL_SWAP_BEHAVIOR); + if (ctx->d_func()->eglContext->configAttrib(EGL_SURFACE_TYPE)&EGL_SWAP_BEHAVIOR_PRESERVED_BIT) { + EGLint swapBehavior; + if (eglQuerySurface(ctx->d_func()->eglContext->display(), ctx->d_func()->eglSurface + , EGL_SWAP_BEHAVIOR, &swapBehavior)) { + swapBehaviourPreserved = (swapBehavior == EGL_BUFFER_PRESERVED); + } + } + if (!swapBehaviourPreserved && !haveNOKSwapRegion) setPartialUpdateSupport(false); // Force full-screen updates else @@ -514,6 +526,8 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, void QGLWindowSurface::beginPaint(const QRegion &) { + updateGeometry(); + if (!context()) return; @@ -874,14 +888,22 @@ void QGLWindowSurface::updateGeometry() { ctx->d_func()->eglSurface = QEgl::createSurface(ctx->device(), ctx->d_func()->eglContext->config()); -#if !defined(QGL_NO_PRESERVED_SWAP) - eglGetError(); // Clear error state first. - eglSurfaceAttrib(QEgl::display(), ctx->d_func()->eglSurface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) { - qWarning("QGLWindowSurface: could not restore preserved swap behaviour"); + eglGetError(); // Clear error state. + if (hasPartialUpdateSupport()) { + eglSurfaceAttrib(ctx->d_func()->eglContext->display(), + ctx->d_func()->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLWindowSurface: could not enable preserved swap behaviour"); + } else { + eglSurfaceAttrib(ctx->d_func()->eglContext->display(), + ctx->d_func()->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); + + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLWindowSurface: could not enable destroyed swap behaviour"); } -#endif } #endif -- cgit v0.12 From 933b7f7fe5344adeee7f6e9565897b606555d23f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 22 Mar 2011 12:15:03 +0200 Subject: Changed maximum heap size for qmlflickr on Symbian. 32 MB is certainly not enough to load large (e.g. 12 Mpix or bigger) images. Now it is changed to 128 MB. Reviewed-by: Jani Hautakangas --- demos/embedded/qmlflickr/qmlflickr.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/embedded/qmlflickr/qmlflickr.pro b/demos/embedded/qmlflickr/qmlflickr.pro index 39b316a..8d4e032 100644 --- a/demos/embedded/qmlflickr/qmlflickr.pro +++ b/demos/embedded/qmlflickr/qmlflickr.pro @@ -8,5 +8,6 @@ symbian { TARGET.UID3 = 0x$$qmlflickr_uid3 # defined in deployment.pri include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) TARGET.CAPABILITY = NetworkServices - TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + # Maximum heap size set to 128 MB in order to allow loading large images. + TARGET.EPOCHEAPSIZE = 0x20000 0x8000000 } -- cgit v0.12 From 30dbb938701963c92fc911f59c72720741e556d1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 22 Mar 2011 13:24:21 +0200 Subject: Implement tiled image and pixmap drawing in VG paint engine. The vgWritePixel-based "fallback" in drawImage can only be used when the transformation is simple and no opacity is set. The tiled drawing introduced here will serve as an additional fallback for the more complex cases and will allow drawing large (12 Mpix or more) pixmaps and images with transformation and semi-transparency even when the complete image data would not fit into the GPU memory. Task-number: QTBUG-18251 Reviewed-by: Jani Hautakangas --- src/openvg/qpaintengine_vg.cpp | 101 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 3 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 44dceea..570adfd 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -3071,6 +3071,95 @@ static void drawVGImage(QVGPaintEnginePrivate *d, vgDrawImage(vgImg); } +static void drawImageTiled(QVGPaintEnginePrivate *d, + const QRectF &r, + const QImage &image, + const QRectF &sr = QRectF()) +{ + const int minTileSize = 16; + int tileWidth = 512; + int tileHeight = tileWidth; + + VGImageFormat tileFormat = qt_vg_image_to_vg_format(image.format()); + VGImage tile = VG_INVALID_HANDLE; + QVGImagePool *pool = QVGImagePool::instance(); + while (tile == VG_INVALID_HANDLE && tileWidth >= minTileSize) { + tile = pool->createPermanentImage(tileFormat, tileWidth, tileHeight, + VG_IMAGE_QUALITY_FASTER); + if (tile == VG_INVALID_HANDLE) { + tileWidth /= 2; + tileHeight /= 2; + } + } + if (tile == VG_INVALID_HANDLE) { + qWarning("drawImageTiled: Failed to create %dx%d tile, giving up", tileWidth, tileHeight); + return; + } + + VGfloat opacityMatrix[20] = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, d->opacity, + 0.0f, 0.0f, 0.0f, 0.0f + }; + VGImage tileWithOpacity = VG_INVALID_HANDLE; + if (d->opacity != 1) { + tileWithOpacity = pool->createPermanentImage(VG_sARGB_8888_PRE, + tileWidth, tileHeight, VG_IMAGE_QUALITY_FASTER); + if (tileWithOpacity == VG_INVALID_HANDLE) + qWarning("drawImageTiled: Failed to create extra tile, ignoring opacity"); + } + + QRect sourceRect = sr.toRect(); + if (sourceRect.isNull()) + sourceRect = QRect(0, 0, image.width(), image.height()); + + VGfloat scaleX = r.width() / sourceRect.width(); + VGfloat scaleY = r.height() / sourceRect.height(); + + d->setImageOptions(); + + for (int y = sourceRect.y(); y < sourceRect.height(); y += tileHeight) { + int h = qMin(tileHeight, sourceRect.height() - y); + if (h < 1) + break; + for (int x = sourceRect.x(); x < sourceRect.width(); x += tileWidth) { + int w = qMin(tileWidth, sourceRect.width() - x); + if (w < 1) + break; + + int bytesPerPixel = image.depth() / 8; + const uchar *sptr = image.constBits() + x * bytesPerPixel + y * image.bytesPerLine(); + vgImageSubData(tile, sptr, image.bytesPerLine(), tileFormat, 0, 0, w, h); + + QTransform transform(d->imageTransform); + transform.translate(r.x() + x, r.y() + y); + transform.scale(scaleX, scaleY); + d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); + + VGImage actualTile = tile; + if (tileWithOpacity != VG_INVALID_HANDLE) { + vgColorMatrix(tileWithOpacity, actualTile, opacityMatrix); + if (w < tileWidth || h < tileHeight) + actualTile = vgChildImage(tileWithOpacity, 0, 0, w, h); + else + actualTile = tileWithOpacity; + } else if (w < tileWidth || h < tileHeight) { + actualTile = vgChildImage(tile, 0, 0, w, h); + } + vgDrawImage(actualTile); + + if (actualTile != tile && actualTile != tileWithOpacity) + vgDestroyImage(actualTile); + } + } + + vgDestroyImage(tile); + if (tileWithOpacity != VG_INVALID_HANDLE) + vgDestroyImage(tileWithOpacity); +} + // Used by qpixmapfilter_vg.cpp to draw filtered VGImage's. void qt_vg_drawVGImage(QPainter *painter, const QPointF& pos, VGImage vgImg) { @@ -3170,7 +3259,7 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) vgpd->source.beginDataAccess(); drawImage(pos, vgpd->source.imageRef()); - vgpd->source.endDataAccess(); + vgpd->source.endDataAccess(true); } else { drawImage(pos, *(pd->buffer())); } @@ -3219,7 +3308,10 @@ void QVGPaintEngine::drawImage } else { // Monochrome images need to use the vgChildImage() path. vgImg = toVGImage(image, flags); - drawVGImage(d, r, vgImg, image.size(), sr); + if (vgImg == VG_INVALID_HANDLE) + drawImageTiled(d, r, image, sr); + else + drawVGImage(d, r, vgImg, image.size(), sr); } } vgDestroyImage(vgImg); @@ -3246,7 +3338,10 @@ void QVGPaintEngine::drawImage(const QPointF &pos, const QImage &image) } else { vgImg = toVGImageWithOpacity(image, d->opacity); } - drawVGImage(d, pos, vgImg); + if (vgImg == VG_INVALID_HANDLE) + drawImageTiled(d, QRectF(pos, image.size()), image); + else + drawVGImage(d, pos, vgImg); vgDestroyImage(vgImg); } -- cgit v0.12 From 5054d7ecdb3bd3fc1c5bf77a99b1675c26ba9795 Mon Sep 17 00:00:00 2001 From: Timo Turunen Date: Tue, 22 Mar 2011 15:21:10 +0200 Subject: Changes for 4.7.3 Reviewed-by: Trust Me --- dist/changes-4.7.3 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dist/changes-4.7.3 b/dist/changes-4.7.3 index e69de29..fa8a71e 100644 --- a/dist/changes-4.7.3 +++ b/dist/changes-4.7.3 @@ -0,0 +1,47 @@ +Qt 4.7.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 4.7.0. For more details, +refer to the online documentation included in this distribution. The +documentation is also available online: + +http://qt.nokia.com/doc/4.7 + +The Qt version 4.7 series is binary compatible with the 4.6.x series. +Applications compiled for 4.6 will continue to run with 4.7. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker or the Merge Request queue +of the public source repository. + +Qt Bug Tracker: http://bugreports.qt.nokia.com +Merge Request: http://qt.gitorious.org + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Qt for Symbian +-------------- + +- Bearer Management +* [QTBUG-15108] Deadlock between SymbianEngine mutex and +QNetworkConfigurationPrivate mutex in the symbian bearer code +* [QTBUG-17627] qnetworksession.h Q_DECLARE_METATYPE breaks building +QtMobility QtBearer depending applications + +- GraphicsView +* [QTBUG-17966] Major regression in QGraphicsView OpenVG backend + +- Declarative +* [QTBUG-17503] Export qml debugging symbols on Symbian + +- Widgets +* [QTBUG-17786] BC between Qt 4.7.3 and 4.6.3 QTreeView::indexRowSizeHint +doesn't return correct value on Symbian for row when QPushButton widget is +inserted in the treeview + +- Painting +* [QTBUG-17907] tst_QGraphicsTransform::rotation3d test case from +tests/auto/qgraphicstransfor is failed for some rotation angle on +Symbian^3 devices +* [QTBUG-18154] Symbian's QPixmap::logicalDpi[X\Y]() incorrectly +returns MAXINT -- cgit v0.12 From fe3b07884cf2a9c02a5dc3a8fc7aebcd42a5ee91 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 22 Mar 2011 19:45:13 +0100 Subject: sort out stdout vs. stderr usage Task-number: QTBUG-14728 --- tools/linguist/lconvert/main.cpp | 2 +- tools/linguist/lupdate/main.cpp | 71 +++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index a10a42b..a9960fc 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -65,7 +65,7 @@ static int usage(const QStringList &args) foreach (Translator::FileFormat format, Translator::registeredFileFormats()) loaders += line.arg(format.extension, -5).arg(format.description); - std::cerr << qPrintable(LC::tr("\nUsage:\n" + std::cout << qPrintable(LC::tr("\nUsage:\n" " lconvert [options] [...]\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" diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 15583e1..f8e6a90 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -61,6 +61,11 @@ static QString m_defaultExtensions; static void printOut(const QString & out) { + std::cout << qPrintable(out); +} + +static void printErr(const QString & out) +{ std::cerr << qPrintable(out); } @@ -151,23 +156,23 @@ 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; } tor.resolveDuplicates(); cd.clearErrors(); if (setCodec && fetchedTor.codec() != tor.codec()) - printOut(LU::tr("lupdate warning: Codec for tr() '%1' disagrees with" + printErr(LU::tr("lupdate warning: Codec for tr() '%1' disagrees with" " existing file's codec '%2'. Expect trouble.\n") .arg(QString::fromLatin1(fetchedTor.codecName()), QString::fromLatin1(tor.codecName()))); if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode()) - printOut(LU::tr("lupdate warning: Specified target language '%1' disagrees with" + printErr(LU::tr("lupdate warning: Specified target language '%1' disagrees with" " existing file's language '%2'. Ignoring.\n") .arg(targetLanguage, tor.languageCode())); if (!sourceLanguage.isEmpty() && sourceLanguage != tor.sourceLanguageCode()) - printOut(LU::tr("lupdate warning: Specified source language '%1' disagrees with" + printErr(LU::tr("lupdate warning: Specified source language '%1' disagrees with" " existing file's language '%2'. Ignoring.\n") .arg(sourceLanguage, tor.sourceLanguageCode())); } else { @@ -212,11 +217,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; } } @@ -278,7 +283,7 @@ static void processSources(Translator &fetchedTor, } loadCPP(fetchedTor, sourceFilesCpp, cd); if (!cd.error().isEmpty()) - printOut(cd.error()); + printErr(cd.error()); } static void processProjects( @@ -298,7 +303,7 @@ static void processProject( if (!tmp.isEmpty()) { codecForSource = tmp.last().toLatin1(); if (!QTextCodec::codecForName(codecForSource)) { - printOut(LU::tr("lupdate warning: Codec for source '%1' is invalid." + printErr(LU::tr("lupdate warning: Codec for source '%1' is invalid." " Falling back to codec for tr().\n") .arg(QString::fromLatin1(codecForSource))); codecForSource.clear(); @@ -365,12 +370,12 @@ static void processProjects( if (visitor.contains(QLatin1String("TRANSLATIONS"))) { if (parentTor) { if (topLevel) { - std::cerr << qPrintable(LU::tr("lupdate warning: TS files from command line " - "will override TRANSLATIONS in %1.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: TS files from command line " + "will override TRANSLATIONS in %1.\n").arg(proFile)); goto noTrans; } else if (nestComplain) { - std::cerr << qPrintable(LU::tr("lupdate warning: TS files from command line " - "prevent recursing into %1.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: TS files from command line " + "prevent recursing into %1.\n").arg(proFile)); continue; } } @@ -401,8 +406,8 @@ static void processProjects( noTrans: if (!parentTor) { if (topLevel) - std::cerr << qPrintable(LU::tr("lupdate warning: no TS files specified. Only diagnostics " - "will be produced for '%1'.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: no TS files specified. Only diagnostics " + "will be produced for '%1'.\n").arg(proFile)); Translator tor; processProject(nestComplain, pfi, visitor, options, codecForSource, targetLanguage, sourceLanguage, &tor, fail); @@ -471,7 +476,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-target-language")) { ++i; if (i == argc) { - printOut(LU::tr("The option -target-language requires a parameter.\n")); + printErr(LU::tr("The option -target-language requires a parameter.\n")); return 1; } targetLanguage = args[i]; @@ -479,7 +484,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-source-language")) { ++i; if (i == argc) { - printOut(LU::tr("The option -source-language requires a parameter.\n")); + printErr(LU::tr("The option -source-language requires a parameter.\n")); return 1; } sourceLanguage = args[i]; @@ -487,7 +492,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-disable-heuristic")) { ++i; if (i == argc) { - printOut(LU::tr("The option -disable-heuristic requires a parameter.\n")); + printErr(LU::tr("The option -disable-heuristic requires a parameter.\n")); return 1; } arg = args[i]; @@ -498,14 +503,14 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("number")) { options &= ~HeuristicNumber; } else { - printOut(LU::tr("Invalid heuristic name passed to -disable-heuristic.\n")); + printErr(LU::tr("Invalid heuristic name passed to -disable-heuristic.\n")); return 1; } continue; } else if (arg == QLatin1String("-locations")) { ++i; if (i == argc) { - printOut(LU::tr("The option -locations requires a parameter.\n")); + printErr(LU::tr("The option -locations requires a parameter.\n")); return 1; } if (args[i] == QLatin1String("none")) { @@ -515,7 +520,7 @@ int main(int argc, char **argv) } else if (args[i] == QLatin1String("absolute")) { options |= AbsoluteLocations; } else { - printOut(LU::tr("Invalid parameter passed to -locations.\n")); + printErr(LU::tr("Invalid parameter passed to -locations.\n")); return 1; } continue; @@ -541,7 +546,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-codecfortr")) { ++i; if (i == argc) { - printOut(LU::tr("The -codecfortr option should be followed by a codec name.\n")); + printErr(LU::tr("The -codecfortr option should be followed by a codec name.\n")); return 1; } codecForTr = args[i].toLatin1(); @@ -552,7 +557,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-extensions")) { ++i; if (i == argc) { - printOut(LU::tr("The -extensions option should be followed by an extension list.\n")); + printErr(LU::tr("The -extensions option should be followed by an extension list.\n")); return 1; } extensions = args[i]; @@ -560,7 +565,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro")) { ++i; if (i == argc) { - printOut(LU::tr("The -pro option should be followed by a filename of .pro file.\n")); + printErr(LU::tr("The -pro option should be followed by a filename of .pro file.\n")); return 1; } proFiles += args[i]; @@ -570,7 +575,7 @@ int main(int argc, char **argv) if (arg.length() == 2) { ++i; if (i == argc) { - printOut(LU::tr("The -I option should be followed by a path.\n")); + printErr(LU::tr("The -I option should be followed by a path.\n")); return 1; } includePath += args[i]; @@ -579,7 +584,7 @@ int main(int argc, char **argv) } continue; } else if (arg.startsWith(QLatin1String("-")) && arg != QLatin1String("-")) { - printOut(LU::tr("Unrecognized option '%1'.\n").arg(arg)); + printErr(LU::tr("Unrecognized option '%1'.\n").arg(arg)); return 1; } @@ -587,7 +592,7 @@ int main(int argc, char **argv) if (arg.startsWith(QLatin1String("@"))) { QFile lstFile(arg.mid(1)); if (!lstFile.open(QIODevice::ReadOnly)) { - printOut(LU::tr("lupdate error: List file '%1' is not readable.\n") + printErr(LU::tr("lupdate error: List file '%1' is not readable.\n") .arg(lstFile.fileName())); return 1; } @@ -605,7 +610,7 @@ int main(int argc, char **argv) if (!fi.exists() || fi.isWritable()) { tsFileNames.append(QFileInfo(file).absoluteFilePath()); } else { - printOut(LU::tr("lupdate warning: For some reason, '%1' is not writable.\n") + printErr(LU::tr("lupdate warning: For some reason, '%1' is not writable.\n") .arg(file)); } found = true; @@ -613,7 +618,7 @@ int main(int argc, char **argv) } } if (!found) { - printOut(LU::tr("lupdate error: File '%1' has no recognized extension.\n") + printErr(LU::tr("lupdate error: File '%1' has no recognized extension.\n") .arg(file)); return 1; } @@ -623,7 +628,7 @@ int main(int argc, char **argv) foreach (const QString &file, files) { QFileInfo fi(file); if (!fi.exists()) { - printOut(LU::tr("lupdate error: File '%1' does not exist.\n").arg(file)); + printErr(LU::tr("lupdate error: File '%1' does not exist.\n").arg(file)); return 1; } if (file.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) @@ -682,15 +687,15 @@ int main(int argc, char **argv) } if (!targetLanguage.isEmpty() && tsFileNames.count() != 1) - printOut(LU::tr("lupdate warning: -target-language usually only" + printErr(LU::tr("lupdate warning: -target-language usually only" " makes sense with exactly one TS file.\n")); if (!codecForTr.isEmpty() && tsFileNames.isEmpty()) - printOut(LU::tr("lupdate warning: -codecfortr has no effect without -ts.\n")); + printErr(LU::tr("lupdate warning: -codecfortr has no effect without -ts.\n")); bool fail = false; if (proFiles.isEmpty()) { if (tsFileNames.isEmpty()) - printOut(LU::tr("lupdate warning:" + printErr(LU::tr("lupdate warning:" " no TS files specified. Only diagnostics will be produced.\n")); Translator fetchedTor; @@ -705,7 +710,7 @@ int main(int argc, char **argv) sourceLanguage, targetLanguage, options, &fail); } else { if (!sourceFiles.isEmpty() || !includePath.isEmpty()) { - printOut(LU::tr("lupdate error:" + printErr(LU::tr("lupdate error:" " Both project and source files / include paths specified.\n")); return 1; } -- cgit v0.12 From 551ba5eb80bb8e4e522154f43abf864b8bf5146d Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Wed, 23 Mar 2011 13:00:49 +0200 Subject: Fixes QT-4753 Invalid read in ICD plugin for bearer management. Reviewed-by: Iiro Kause --- src/plugins/bearer/icd/dbusdispatcher.cpp | 9 ++++++--- src/plugins/bearer/icd/qnetworksession_impl.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/plugins/bearer/icd/dbusdispatcher.cpp b/src/plugins/bearer/icd/dbusdispatcher.cpp index 13cd8a9..a317cb4 100644 --- a/src/plugins/bearer/icd/dbusdispatcher.cpp +++ b/src/plugins/bearer/icd/dbusdispatcher.cpp @@ -194,18 +194,21 @@ static bool appendVariantToDBusMessage(const QVariant& argument, &int32_data); break; - case QVariant::String: - str_data = argument.toString().toLatin1().data(); + case QVariant::String: { + QByteArray data = argument.toString().toLatin1(); + str_data = data.data(); dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_STRING, &str_data); break; + } case QVariant::StringList: str_list = argument.toStringList(); dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_ARRAY, "s", &array_iter); for (idx = 0; idx < str_list.size(); idx++) { - str_data = str_list.at(idx).toLatin1().data(); + QByteArray data = str_list.at(idx).toLatin1(); + str_data = data.data(); dbus_message_iter_append_basic(&array_iter, DBUS_TYPE_STRING, &str_data); diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index af5d85e..94a6c81 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -621,21 +621,21 @@ static QString get_network_interface() if (ret == 0) { /* No results */ #ifdef BEARER_MANAGEMENT_DEBUG - qDebug() << "Cannot get addrinfo from icd, are you connected or is icd running?"; + qDebug() << "Cannot get addrinfo from icd, are you connected or is icd running?"; #endif - return iface; + return iface; } if (addr_results.first().ip_info.isEmpty()) - return QString(); + return QString(); - const char *address = addr_results.first().ip_info.first().address.toAscii().constData(); + QByteArray data = addr_results.first().ip_info.first().address.toAscii(); struct in_addr addr; - if (inet_aton(address, &addr) == 0) { + if (inet_aton(data.constData(), &addr) == 0) { #ifdef BEARER_MANAGEMENT_DEBUG - qDebug() << "address" << address << "invalid"; + qDebug() << "address" << data.constData() << "invalid"; #endif - return iface; + return iface; } struct ifaddrs *ifaddr, *ifa; -- cgit v0.12 From 4accdf44eb486e603425c5ee69e05b973915f8a6 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 23 Mar 2011 13:09:52 +0200 Subject: Add missing nullify for the s60 style's background pixmap pointer. Qt apps would crash during orientation change without setting m_background to null after deleting it. Reviewed-by: Sami Merila --- src/gui/styles/qs60style_s60.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index c5149a3..64d2ad2 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1402,6 +1402,7 @@ QPixmap QS60StylePrivate::backgroundTexture(bool skipCreation) if (m_background->width() != applicationRect.Width() || m_background->height() != applicationRect.Height()) { delete m_background; + m_background = 0; createNewBackground = true; } } -- cgit v0.12 From e06d2bc80672776fc4fb0ca8a3861a4f9d493133 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Mar 2011 14:36:43 +0200 Subject: GraphicsViews: Focused widget is not visible after orientation change If there is a graphicsview with input widget focused and splitview is open, and we rotate the device from Portrait to Landscape (or vice versa), the input widget is no longer visible in the splitview rect. This only happens if there are scrollbars visible in the view. Reason is that the input widget is tried to ensure visibility for before window surface is valid. In these cases, make the input widget visibility re-location happen after window server indicates that the view is now visible. Task-number: QTBUG-17576 Reviewed-by: Guoqing Zhang --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 9d8dd41..767b974 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -330,6 +330,21 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE // This should also happen for commands. reset(); + if (event->windowServerEvent() && event->windowServerEvent()->Type() == EEventWindowVisibilityChanged) { + if (S60->splitViewLastWidget) { + QGraphicsView *gv = qobject_cast(S60->splitViewLastWidget); + const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff); + + if (alwaysResize) { + TUint visibleFlags = event->windowServerEvent()->VisibilityChanged()->iFlags; + if (visibleFlags & TWsVisibilityChangedEvent::EPartiallyVisible) + ensureFocusWidgetVisible(S60->splitViewLastWidget); + if (visibleFlags & TWsVisibilityChangedEvent::ENotVisible) + resetSplitViewWidget(true); + } + } + } + return false; } -- cgit v0.12 From 2d2af1cac203bb5d47c6a4b1ce23930bdb03b996 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Mar 2011 14:42:06 +0200 Subject: GraphicsViews: Focused widget is not visible after orientation change Clean up previous fix a little bit, by merging if-statements. Task-number: QTBUG-17576 Reviewed-by: Guoqing Zhang --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 767b974..5fccf96 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -330,18 +330,20 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE // This should also happen for commands. reset(); - if (event->windowServerEvent() && event->windowServerEvent()->Type() == EEventWindowVisibilityChanged) { - if (S60->splitViewLastWidget) { - QGraphicsView *gv = qobject_cast(S60->splitViewLastWidget); - const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff); - - if (alwaysResize) { - TUint visibleFlags = event->windowServerEvent()->VisibilityChanged()->iFlags; - if (visibleFlags & TWsVisibilityChangedEvent::EPartiallyVisible) - ensureFocusWidgetVisible(S60->splitViewLastWidget); - if (visibleFlags & TWsVisibilityChangedEvent::ENotVisible) - resetSplitViewWidget(true); - } + if (event->type() == QSymbianEvent::WindowServerEvent + && event->windowServerEvent() + && event->windowServerEvent()->Type() == EEventWindowVisibilityChanged + && S60->splitViewLastWidget) { + + QGraphicsView *gv = qobject_cast(S60->splitViewLastWidget); + const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff); + + if (alwaysResize) { + TUint visibleFlags = event->windowServerEvent()->VisibilityChanged()->iFlags; + if (visibleFlags & TWsVisibilityChangedEvent::EPartiallyVisible) + ensureFocusWidgetVisible(S60->splitViewLastWidget); + if (visibleFlags & TWsVisibilityChangedEvent::ENotVisible) + resetSplitViewWidget(true); } } -- cgit v0.12 From 1dbd4a629bb5e2392bf2c7ea096ad3d77a265e5f Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Mar 2011 15:22:43 +0200 Subject: Prevent crash when connecting signal in splitview If there is no focusitem when connecting a signal, splitview crashes. This is caused by null pointer use. Prevent the crash by checking the pointer. Task-number: QTBUG-16572 Reviewed-by: Guoqing Zhang --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 5fccf96..41abe95 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -410,8 +410,11 @@ void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget) windowToMove->setUpdatesEnabled(false); if (!alwaysResize) { - if (gv->scene()) { - if (gv->scene()->focusItem()) + if (gv->scene() && gv->scene()->focusItem()) { + // Check if the widget contains cursorPositionChanged signal and disconnect from it. + QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged())); + int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1)); + if (index != -1) disconnect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget())); QGraphicsItem *rootItem; foreach (QGraphicsItem *item, gv->scene()->items()) { @@ -501,6 +504,13 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget) // states getting changed. if (!moveWithinVisibleArea) { + // Check if the widget contains cursorPositionChanged signal and connect to it. + QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged())); + if (gv->scene() && gv->scene()->focusItem()) { + int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1)); + if (index != -1) + connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget())); + } S60->splitViewLastWidget = widget; m_splitViewPreviousWindowStates = windowToMove->windowState(); } @@ -537,13 +547,6 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget) } windowToMove->setUpdatesEnabled(true); } else { - if (!moveWithinVisibleArea) { - // Check if the widget contains cursorPositionChanged signal and connect to it. - const char *signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged())).constData(); - int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal + 1); - if (index != -1) - connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget())); - } translateInputWidget(); } -- cgit v0.12 From 9a42d9815b73e5ceb25360af02936bcb0454a965 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Mar 2011 17:30:45 +0200 Subject: Icon in QMessageBox::question is deformed on Symbian MessageBox icons are deformed on Qt/S60, since style creates all icons with 1:1 width:height ratio. Based on S60 documentation messagebox icons are of 4:3 ratio. This is the same ratio between all the S60 releases. Task-number: QTBUG-14953 Reviewed-by: Laszlo Agocs --- src/gui/styles/qs60style.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index a9e10a3..1320f5e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -3353,9 +3353,9 @@ bool QS60Style::event(QEvent *e) QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const { - const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize); - const QRect iconSize = (!option) ? QRect(0, 0, iconDimension, iconDimension) : option->rect; QS60StyleEnums::SkinParts part; + qreal iconHeightMultiplier = 1.0; + qreal iconWidthMultiplier = 1.0; QS60StylePrivate::SkinElementFlags adjustedFlags; if (option) adjustedFlags = (option->state & State_Enabled || option->state == 0) ? @@ -3364,15 +3364,20 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, switch(standardIcon) { case SP_MessageBoxWarning: + // By default, S60 messagebox icons have 4:3 ratio. Value is from S60 LAF documentation. + iconHeightMultiplier = 1.33; part = QS60StyleEnums::SP_QgnNoteWarning; break; case SP_MessageBoxInformation: + iconHeightMultiplier = 1.33; part = QS60StyleEnums::SP_QgnNoteInfo; break; case SP_MessageBoxCritical: + iconHeightMultiplier = 1.33; part = QS60StyleEnums::SP_QgnNoteError; break; case SP_MessageBoxQuestion: + iconHeightMultiplier = 1.33; part = QS60StyleEnums::SP_QgnNoteQuery; break; case SP_ArrowRight: @@ -3427,11 +3432,13 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, adjustedFlags |= QS60StylePrivate::SF_PointEast; part = QS60StyleEnums::SP_QgnIndiSubmenu; break; - default: return QCommonStyle::standardIconImplementation(standardIcon, option, widget); } const QS60StylePrivate::SkinElementFlags flags = adjustedFlags; + const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize); + const QRect iconSize = (!option) ? + QRect(0, 0, iconDimension * iconWidthMultiplier, iconDimension * iconHeightMultiplier) : option->rect; const QPixmap cachedPixMap(QS60StylePrivate::cachedPart(part, iconSize.size(), 0, flags)); return cachedPixMap.isNull() ? QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap); -- cgit v0.12