From 1dd7b8ace010f3950e835fc67681944d481fb21b Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Wed, 1 Jun 2011 12:38:34 +0200 Subject: [PATCH 01/34] tst_qnetworkreply: add a test for http abort. Change-Id: Iec5fe195ff2befe92e759f77768240728bef31bd Reviewed-on: http://codereview.qt.nokia.com/302 Reviewed-by: Qt Sanity Bot Reviewed-by: Markus Goetz --- .../auto/qnetworkreply/tst_qnetworkreply.cpp | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 67b6e5c5b4..7219e71898 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -6193,16 +6193,62 @@ void tst_QNetworkReply::synchronousRequestSslFailure() } #endif +class HttpAbortHelper : public QObject +{ + Q_OBJECT +public: + HttpAbortHelper(QNetworkReply *parent) + : QObject(parent) + { + mReply = parent; + connect(parent, SIGNAL(readyRead()), this, SLOT(readyRead())); + } + + ~HttpAbortHelper() + { + } + +public slots: + void readyRead() + { + mReply->abort(); + QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection); + } + +private: + QNetworkReply *mReply; +}; + void tst_QNetworkReply::httpAbort() { - // FIXME: Implement a test that aborts a big HTTP reply - // a) after the first readyRead() - // b) immediatly after the get() - // c) after the finished() - // The goal is no crash and no irrelevant signals after the abort - // FIXME Also implement one where we do a big upload and then abort(). // It must not crash either. + + // Abort after the first readyRead() + QNetworkRequest request("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"); + QNetworkReplyPtr reply; + reply = manager.get(request); + HttpAbortHelper replyHolder(reply); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(reply->error(), QNetworkReply::OperationCanceledError); + QVERIFY(reply->isFinished()); + + // Abort immediatly after the get() + QNetworkReplyPtr reply2 = manager.get(request); + connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + reply2->abort(); + QCOMPARE(reply2->error(), QNetworkReply::OperationCanceledError); + QVERIFY(reply2->isFinished()); + + // Abort after the finished() + QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"); + QNetworkReplyPtr reply3 = manager.get(request3); + connect(reply3, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(reply3->isFinished()); + reply3->abort(); + QCOMPARE(reply3->error(), QNetworkReply::NoError); } void tst_QNetworkReply::dontInsertPartialContentIntoTheCache() From 1fb4d6737c09a5d6e1bbcf135029cd0a7f2e72f6 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Wed, 1 Jun 2011 15:34:50 +0200 Subject: [PATCH 02/34] Allow SHM buffers to be displayed in Wayland plugin when using DRM When running an application with the wayland backend, SHM window surfaces were not being displayed on the wayland-demo compositor as wl_surface_damage was being called, but not wl_buffer_damage as well. Change-Id: I2ffea3bbb20cb3729cd029bd21855819cd7fcf55 Reviewed-on: http://codereview.qt.nokia.com/305 Reviewed-by: Qt Sanity Bot Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 333a953b29..eda8c94516 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -140,6 +140,7 @@ void QWaylandWindow::damage(const QRegion ®ion) QVector rects = region.rects(); for (int i = 0; i < rects.size(); i++) { const QRect rect = rects.at(i); + wl_buffer_damage(mBuffer->buffer(), rect.x(), rect.y(), rect.width(), rect.height()); wl_surface_damage(mSurface, rect.x(), rect.y(), rect.width(), rect.height()); } From c8dead71865de3e09414c413faa38b53df09223b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:07:56 +0200 Subject: [PATCH 03/34] Fixed an argument parsing bug in syncqt. We need to move the detection up above the general -no-* match, otherwise it never hits. Change-Id: I04ab5a1ed2c4a01219e7b9e10948b3fc4989f4b8 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/228 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index 69d50ec4ca..7cf8b1b45a 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -590,6 +590,12 @@ while ( @ARGV ) { $arg eq "-relative" || $arg eq "-check-includes") { $var = substr($arg, 1); $val = "yes"; + } elsif($arg eq "-no-module-fwd") { + $var = "no_module_fwd"; + $val = "yes"; + } elsif($arg eq "-no-module-version-header") { + $var = "no_module_version_header"; + $val = "yes"; } elsif($arg =~ /^-no-(.*)$/) { $var = $1; $val = "no"; @@ -619,12 +625,6 @@ while ( @ARGV ) { # skip, it's been dealt with at the top of the file shift @ARGV; next; - } elsif($arg eq "-no-module-fwd") { - $var = "no_module_fwd"; - $val = "yes"; - } elsif($arg eq "-no-module-version-header") { - $var = "no_module_version_header"; - $val = "yes"; } elsif($arg =~/^-/) { print "Unknown option: $arg\n\n" if(!$var); showUsage(); From 43c0e08ba2e3487840b4063b2099bc17cdd4dce2 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 1 Jun 2011 11:06:55 +0200 Subject: [PATCH 04/34] Refactor glyph pretransform check Move paintEngineSupportsTransformations logic from QPainter to paint engine subclasses. Simplify and consolidate checks for cached drawing (pretransformed) and path drawing (untransformed) in raster paint engine. Fix unnecessary transform when paint engines actually take the path drawing track. Fix scaling and rotation transform in raster engine for Mac. Task-number: QTBUG-19086 Change-Id: I1c0c1800a5173d3db765b9fccfd0e7a3628e3815 Reviewed-on: http://codereview.qt.nokia.com/298 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qpaintengine_mac_p.h | 2 + src/gui/painting/qpaintengine_raster.cpp | 67 +++++++++---------- src/gui/painting/qpaintengine_raster_p.h | 2 + src/gui/painting/qpaintengineex.cpp | 10 +++ src/gui/painting/qpaintengineex_p.h | 1 + src/gui/painting/qpainter.cpp | 36 ++++------ .../qpaintengineex_opengl2_p.h | 1 + src/opengl/qpaintengine_opengl_p.h | 1 + src/openvg/qpaintengine_vg_p.h | 1 + 9 files changed, 65 insertions(+), 56 deletions(-) diff --git a/src/gui/painting/qpaintengine_mac_p.h b/src/gui/painting/qpaintengine_mac_p.h index c87501ee1a..2434011e52 100644 --- a/src/gui/painting/qpaintengine_mac_p.h +++ b/src/gui/painting/qpaintengine_mac_p.h @@ -121,6 +121,8 @@ public: void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) { QPaintEngine::drawPolygon(points, pointCount, mode); } + bool supportsTransformations(qreal, const QTransform &) const { return true; }; + protected: friend class QMacPrintEngine; friend class QMacPrintEnginePrivate; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 1f7ab21ca7..f5daef7878 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3029,11 +3029,8 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) ensurePen(); ensureState(); - QRasterPaintEngineState *s = state(); - QFontEngine *fontEngine = textItem->fontEngine(); - const qreal pixelSize = fontEngine->fontDef.pixelSize; - if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) < 64 * 64) { + if (!supportsTransformations(fontEngine)) { drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions, fontEngine); } else { @@ -3061,36 +3058,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte #if defined (Q_WS_WIN) || defined(Q_WS_MAC) - bool drawCached = true; - - if (s->matrix.type() >= QTransform::TxProject) - drawCached = false; - - // don't try to cache huge fonts - const qreal pixelSize = ti.fontEngine->fontDef.pixelSize; - if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) >= 64 * 64) - drawCached = false; - - // ### Remove the TestFontEngine and Box engine crap, in these - // ### cases we should delegate painting to the font engine - // ### directly... - -#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) - QFontEngine::Type fontEngineType = ti.fontEngine->type(); - // qDebug() << "type" << fontEngineType << s->matrix.type(); - if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && s->matrix.type() > QTransform::TxTranslate) - || (s->matrix.type() <= QTransform::TxTranslate - && (fontEngineType == QFontEngine::TestFontEngine - || fontEngineType == QFontEngine::Box))) { - drawCached = false; - } -#else - if (s->matrix.type() > QTransform::TxTranslate) - drawCached = false; -#endif - if (drawCached) { - QRasterPaintEngineState *s = state(); - + if (!supportsTransformations(ti.fontEngine)) { QVarLengthArray positions; QVarLengthArray glyphs; @@ -3386,6 +3354,37 @@ void QRasterPaintEngine::releaseDC(HDC) const #endif +bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const +{ + const QTransform &m = state()->matrix; +#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) + QFontEngine::Type fontEngineType = ti.fontEngine->type(); + if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && m.type() > QTransform::TxTranslate) + || (m.type() <= QTransform::TxTranslate + && (fontEngineType == QFontEngine::TestFontEngine + || fontEngineType == QFontEngine::Box))) { + return true; + } +#endif + return supportsTransformations(fontEngine->fontDef.pixelSize, m); +} + +bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const +{ +#if defined(Q_WS_MAC) + // Mac font engines don't support scaling and rotation + if (m.type() > QTransform::TxTranslate) +#else + if (m.type() >= QTransform::TxProject) +#endif + return true; + + if (pixelSize * pixelSize * qAbs(m.determinant()) >= 64 * 64) + return true; + + return false; +} + /*! \internal */ diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index f7f605d5a1..2bf25f9d40 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -246,6 +246,8 @@ public: virtual void drawBufferSpan(const uint *buffer, int bufsize, int x, int y, int length, uint const_alpha); #endif + bool supportsTransformations(const QFontEngine *fontEngine) const; + bool supportsTransformations(qreal pixelSize, const QTransform &m) const; protected: QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *); diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 3b52a789c3..8510416fcb 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -1093,4 +1093,14 @@ void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem) } } +bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &m) const +{ + Q_UNUSED(pixelSize); + + if (!m.isAffine()) + return true; + + return false; +} + QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 3a3451567a..c6056855f0 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -227,6 +227,7 @@ public: IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine. }; virtual uint flags() const {return 0;} + virtual bool supportsTransformations(qreal pixelSize, const QTransform &m) const; protected: QPaintEngineEx(QPaintEngineExPrivate &data); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 811e59b3b7..e7b5f18112 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -152,14 +152,6 @@ static inline uint line_emulation(uint emulation) | QPaintEngine_OpaqueBackground); } -static bool qt_paintengine_supports_transformations(QPaintEngine::Type type) -{ - return type == QPaintEngine::OpenGL2 - || type == QPaintEngine::OpenVG - || type == QPaintEngine::OpenGL - || type == QPaintEngine::CoreGraphics; -} - #ifndef QT_NO_DEBUG static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false) { @@ -5815,20 +5807,19 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) int count = qMin(glyphIndexes.size(), glyphPositions.size()); QVarLengthArray fixedPointPositions(count); - bool paintEngineSupportsTransformations = - d->extended != 0 - ? qt_paintengine_supports_transformations(d->extended->type()) - : qt_paintengine_supports_transformations(d->engine->type()); - - // If the matrix is not affine, the paint engine will fall back to - // drawing the glyphs as paths, which in turn means we should not - // preprocess the glyph positions - if (!d->state->matrix.isAffine()) - paintEngineSupportsTransformations = true; + QRawFontPrivate *fontD = QRawFontPrivate::get(font); + bool supportsTransformations; + if (d->extended != 0) { + supportsTransformations = d->extended->supportsTransformations(fontD->fontEngine->fontDef.pixelSize, + d->state->matrix); + } else { + supportsTransformations = d->engine->type() == QPaintEngine::CoreGraphics + || d->state->matrix.isAffine(); + } for (int i=0; istate->transform().map(processedPosition); fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition); } @@ -6004,11 +5995,12 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText return; } - bool paintEngineSupportsTransformations = qt_paintengine_supports_transformations(d->extended->type()); - if (paintEngineSupportsTransformations && !staticText_d->untransformedCoordinates) { + bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.pixelSize(), + d->state->matrix); + if (supportsTransformations && !staticText_d->untransformedCoordinates) { staticText_d->untransformedCoordinates = true; staticText_d->needsRelayout = true; - } else if (!paintEngineSupportsTransformations && staticText_d->untransformedCoordinates) { + } else if (!supportsTransformations && staticText_d->untransformedCoordinates) { staticText_d->untransformedCoordinates = false; staticText_d->needsRelayout = true; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 7ba92e4244..2895d5a9b0 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -158,6 +158,7 @@ public: void setRenderTextActive(bool); bool isNativePaintingActive() const; + bool supportsTransformations(qreal, const QTransform &) const { return true; } private: Q_DISABLE_COPY(QGL2PaintEngineEx) }; diff --git a/src/opengl/qpaintengine_opengl_p.h b/src/opengl/qpaintengine_opengl_p.h index 5d5f5ce652..8d0ea83a47 100644 --- a/src/opengl/qpaintengine_opengl_p.h +++ b/src/opengl/qpaintengine_opengl_p.h @@ -143,6 +143,7 @@ public: Qt::HANDLE handle() const; #endif inline Type type() const { return QPaintEngine::OpenGL; } + bool supportsTransformations(qreal, const QTransform &) const { return true; } private: void drawPolyInternal(const QPolygonF &pa, bool close = true); diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h index f1ef0fbdee..267ecd443f 100644 --- a/src/openvg/qpaintengine_vg_p.h +++ b/src/openvg/qpaintengine_vg_p.h @@ -159,6 +159,7 @@ public: QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; } void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize); + bool supportsTransformations(qreal, const QTransform &) const { return true; } protected: QVGPaintEngine(QVGPaintEnginePrivate &data); From 39d6b7b2878fd61989274e7e8565c444154d8764 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 3 Jun 2011 11:54:58 +0200 Subject: [PATCH 05/34] Fix Windows build Change-Id: Ieafe2cefe0dcb00a3b22133506fb854428abff5e Reviewed-on: http://codereview.qt.nokia.com/320 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/painting/qpaintengine_raster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index f5daef7878..0a1b8bbd01 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3358,8 +3358,8 @@ bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) { const QTransform &m = state()->matrix; #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) - QFontEngine::Type fontEngineType = ti.fontEngine->type(); - if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && m.type() > QTransform::TxTranslate) + QFontEngine::Type fontEngineType = fontEngine->type(); + if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) fontEngine)->ttf && m.type() > QTransform::TxTranslate) || (m.type() <= QTransform::TxTranslate && (fontEngineType == QFontEngine::TestFontEngine || fontEngineType == QFontEngine::Box))) { From ce041a6516bfb0d9bd9ee1707605b478e1c9171a Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 3 Jun 2011 13:31:05 +0200 Subject: [PATCH 06/34] Add basic static text drawing capability to lance Task-number: QTBUG-17514 Change-Id: Ife7cd8f940424d805f634ca190bcbf6fd83d8682 Reviewed-on: http://codereview.qt.nokia.com/321 Reviewed-by: Qt Sanity Bot Reviewed-by: aavit --- tests/arthur/common/paintcommands.cpp | 20 ++++ tests/arthur/common/paintcommands.h | 1 + tests/auto/lancelot/scripts/statictext.qps | 122 +++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 tests/auto/lancelot/scripts/statictext.qps diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp index 8060bc7056..d005ffd215 100644 --- a/tests/arthur/common/paintcommands.cpp +++ b/tests/arthur/common/paintcommands.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #ifndef QT_NO_OPENGL #include @@ -433,6 +434,10 @@ void PaintCommands::staticInit() "^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", "drawText ", "drawText 10 10 \"my text\""); + DECL_PAINTCOMMAND("drawStaticText", command_drawStaticText, + "^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", + "drawStaticText ", + "drawStaticText 10 10 \"my text\""); DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap, "^drawTiledPixmap\\s+([\\w.:\\/]*)" "\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)" @@ -1256,6 +1261,21 @@ void PaintCommands::command_drawText(QRegExp re) m_painter->drawText(x, y, txt); } +void PaintCommands::command_drawStaticText(QRegExp re) +{ + if (!m_shouldDrawText) + return; + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + QString txt = caps.at(3); + + if (m_verboseMode) + printf(" -(lance) drawStaticText(%d, %d, %s)\n", x, y, qPrintable(txt)); + + m_painter->drawStaticText(x, y, QStaticText(txt)); +} + /***************************************************************************************************/ void PaintCommands::command_noop(QRegExp) { diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h index cc64aefb90..925a867f2f 100644 --- a/tests/arthur/common/paintcommands.h +++ b/tests/arthur/common/paintcommands.h @@ -201,6 +201,7 @@ private: void command_drawRoundedRect(QRegExp re); void command_drawRoundRect(QRegExp re); void command_drawText(QRegExp re); + void command_drawStaticText(QRegExp re); void command_drawTiledPixmap(QRegExp re); void command_path_addEllipse(QRegExp re); void command_path_addPolygon(QRegExp re); diff --git a/tests/auto/lancelot/scripts/statictext.qps b/tests/auto/lancelot/scripts/statictext.qps new file mode 100644 index 0000000000..b62b623462 --- /dev/null +++ b/tests/auto/lancelot/scripts/statictext.qps @@ -0,0 +1,122 @@ +drawStaticText -5 5 "Text that is drawn outside the bounds..." + +translate 20 20 +begin_block text_drawing +save + setFont "sansserif" 10 normal + drawStaticText 0 20 "sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "sansserif 10pt, bold italic" + + + translate 0 100 + setPen #7fff0000 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "alpha sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "alpha sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "alpha sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "alpha sansserif 10pt, bold italic" + + + translate 0 100 + setPen black + save + scale 0.9 0.9 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "scaled sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "scaled sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "scaled sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "scaled sansserif 10pt, bold italic" + restore + + translate 0 100 + setPen black + save + translate 200 90 + rotate 185 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "scaled sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "scaled sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "scaled sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "scaled sansserif 10pt, bold italic" + restore + + translate 0 100 + gradient_appendStop 0 red + gradient_appendStop 0.5 #00ff00 + gradient_appendStop 1 blue + gradient_setLinear 0 0 200 0 + setPen brush + + setFont "sansserif" 10 normal + drawStaticText 0 0 "gradient sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 20 "gradient sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 40 "gradient sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 60 "gradient sansserif 10pt, bold italic" +restore +end_block + +translate 250 0 +drawStaticText 25 520 "clipped to rectangle" +save + setPen #3f000000 + setBrush nobrush + drawRect 20 0 100 500 + setClipRect 20 0 100 500 + setPen black + repeat_block text_drawing +restore + +translate 150 0 +drawStaticText 25 520 "clipped to path" +save + path_moveTo clip 20 0 + path_cubicTo clip 0 200 40 400 20 400 + path_lineTo clip 30 500 + path_lineTo clip 30 0 + path_lineTo clip 40 0 + path_lineTo clip 40 500 + path_lineTo clip 120 500 + path_lineTo clip 120 0 + path_lineTo clip 20 0 + setPen #3f000000 + setBrush nobrush + drawPath clip + setClipPath clip + setPen black + repeat_block text_drawing +restore From 44595bdb19622c1ceff21cc32d20b2e1b7647055 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:48:06 +0200 Subject: [PATCH 07/34] Changes needed for Qt to accept module .qmake.cache files. Also introduced the QMAKE_EXTRA_MODULE_FORWARDS for specifying a folder where forwarding profiles will be put. Change-Id: I8cb242838a5a4d42dc5e3cfd0bd858ab0d2696cd Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/230 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- mkspecs/features/qt_config.prf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 071bb6c237..01b5a796a5 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -1,18 +1,23 @@ # This file is loaded by the mkspecs, before .qmake.cache has been loaded. # Consequently, we have to do some stunts to get values out of the cache. -exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QMAKE_QT_CONFIG) +exists($$_QMAKE_CACHE_) { + QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QMAKE_QT_CONFIG) + QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS) +} isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { !isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE/mkspecs/qconfig.pri else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri - else:exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri + isEmpty(QMAKE_QT_CONFIG):exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri } !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) { debug(1, "Cannot load qconfig.pri!") } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") for(dir, $$list($$unique($$list($$dirname(QMAKE_QT_CONFIG) \ - $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs))))) { + $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs) \ + $$QMAKE_EXTRA_MODULE_FORWARDS \ + )))) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/modules/qt_*.pri))) { # For installed Qt these paths will be common for all modules From d3e048da7ef0f2f71a24e999feabbe1a56e3d936 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:22:09 +0200 Subject: [PATCH 08/34] Make sure that we error out if we cannot write forwarding profile. Change-Id: Ic0b62532dd8a52cf6ab7a7c10c5ffbe3c9039ec1 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/229 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/syncqt b/bin/syncqt index 7cf8b1b45a..dbdac4d157 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -1071,7 +1071,7 @@ foreach my $lib (@modules_to_sync) { if (-e $modulepri) { my $modulepriname = basename($modulepri); my $moduleprifwd = "$qtbasedir/mkspecs/modules/$modulepriname"; - open MODULE_PRI_FILE, ">$moduleprifwd"; + open MODULE_PRI_FILE, ">$moduleprifwd" or die("Could not open $moduleprifwd for writing"); print MODULE_PRI_FILE "QT_MODULE_BASE = $basedir\n"; print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $qtbasedir/bin\n"; print MODULE_PRI_FILE "QT_MODULE_INCLUDE_BASE = $out_basedir/include\n"; From 3c66ade66fcb14975c811cd85b5a97c648ee5a1e Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:49:51 +0200 Subject: [PATCH 09/34] Don't base QTDIR detection on .qmake.cache. Change-Id: I4adc26c1c070d26277551d302f4638b819ddc311 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/231 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- mkspecs/features/default_pre.prf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index d451d29f7c..7088eb444e 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -12,13 +12,6 @@ exists($$_PRO_FILE_PWD_/sync.profile) { isEmpty(QTDIR) { QTDIR = $$(QTDIR) isEmpty(QTDIR):QTDIR = $$QT_BUILD_TREE - isEmpty(QTDIR):QTDIR = $$dirname(_QMAKE_CACHE_) - isEmpty(QTDIR) { - QMAKE_BASED_QTDIR = $$dirname(QMAKE_QMAKE) - QMAKE_BASED_QTDIR = $$dirname(QMAKE_BASED_QTDIR) - exists($$QMAKE_BASED_QTDIR/mkspecs/qconfig.pri): QTDIR = $$QMAKE_BASED_QTDIR - unset(QMAKE_BASED_QTDIR) - } } isEmpty(QTDIR):QTFWD="-no-module-fwd" From 55f2a05a205adad12cf17f2dbfa37b434a303c23 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 18 May 2011 15:28:25 +0200 Subject: [PATCH 10/34] Install some headers that were previously missing from install. Change-Id: I58a5f58e6e03e3e266de23beee47de0c823f3240 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/233 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- src/corelib/tools/tools.pri | 4 ++++ src/uitools/uitools.pro | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 0c2cf1619e..42cab84cc0 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -116,6 +116,10 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \ tools/qharfbuzz.cpp HEADERS += tools/qharfbuzz_p.h +corelib_tools_private_headers.files = ../3rdparty/harfbuzz/src/*.h +corelib_tools_private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET +INSTALLS += corelib_tools_private_headers + INCLUDEPATH += ../3rdparty/md5 \ ../3rdparty/md4 diff --git a/src/uitools/uitools.pro b/src/uitools/uitools.pro index 0af26d9375..977fe50c09 100644 --- a/src/uitools/uitools.pro +++ b/src/uitools/uitools.pro @@ -34,7 +34,17 @@ SOURCES += quiloader.cpp include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true) quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools -INSTALLS += quitools_headers +quitools_private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES +quitools_private_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools/$$QT.uitools.VERSION/QtUiTools/private +INSTALLS += quitools_headers quitools_private_headers + +# Uilib is from designer. +include($$QT_BUILD_TREE/include/QtDesigner/headers.pri, "", true) +quilib_headers.files = $$replace($$list($$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES), ^, ../../tools/uilib/) +quilib_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner +quilib_private_headers.files = $$replace($$list($$SYNCQT.PRIVATE_HEADER_FILES), ^, ../../tools/uilib/) +quilib_private_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner/$$QT.uilib.VERSION/QtDesigner/private +INSTALLS += quilib_headers quilib_private_headers target.path=$$[QT_INSTALL_LIBS] INSTALLS += target From 0e6be2aa5dcddbab4e13e55e7f84a1099972f194 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 18 May 2011 15:23:51 +0200 Subject: [PATCH 11/34] Implemented module-local caching of module profiles. We use syncqt to generate .qmake.cache also for submodules, which contains the location of forwarding module profiles for that module. This enables us to build without having to put module profiles into mkspecs/modules until install time. Also added support for -developer-build to syncqt. What it does is to point build directories for binaries and libraries to a common location in QtBase. This is more convenient when doing development, since you don't need to set your path to every module's bin/ directory, but it cannot be used with release builds, since they need to build independently of QtBase, in their own directory. Change-Id: I959c62c11c644f2147a98da894a72452d9c44327 Task: QTBUG-19585 Task: QTBUG-19583 Reviewed-on: http://codereview.qt.nokia.com/232 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 62 ++++++++++++++++++++++++-------- mkspecs/features/default_pre.prf | 8 +++-- mkspecs/features/qt_config.prf | 10 +++--- 3 files changed, 58 insertions(+), 22 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index dbdac4d157..a955456fec 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -46,7 +46,9 @@ my $check_includes = 0; my $copy_headers = 0; my $create_uic_class_map = 0; my $create_private_headers = 1; -my $no_module_fwd = 0; +my $module_fwd = ""; +my $cache_module_fwd = 0; +my $developer_build = 0; my $no_module_version_header = 0; my @modules_to_sync ; $force_relative = 1 if ( -d "/System/Library/Frameworks" ); @@ -72,12 +74,18 @@ sub showUsage print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir Specify output directory for sync (default: $out_basedir)\n"; - print " -qtdir Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; + print " -qtdir Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; print " -separate-module ::\n"; - print " Create headers for with original headers in relative to \n"; + print " Create headers for with original headers in\n"; + print " relative to \n"; print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n"; - print " -no-module-fwd Don't create fwd includes for module pri files\n"; + print " -module-fwd Create fwd includes for module pri files in the given\n"; + print " path (default: none)\n"; + print " -cache-module-fwd Create a .qmake.cache file to cache the location of the\n"; + print " fwd includes\n"; + print " -developer-build Point libraries and binaries to a common directory for\n"; + print " easy development\n"; print " -no-module-version-header\n"; print " Don't create module version header file\n"; print " -help This help\n"; @@ -590,8 +598,14 @@ while ( @ARGV ) { $arg eq "-relative" || $arg eq "-check-includes") { $var = substr($arg, 1); $val = "yes"; - } elsif($arg eq "-no-module-fwd") { - $var = "no_module_fwd"; + } elsif($arg eq "-module-fwd") { + $var = "module_fwd"; + $val = shift @ARGV; + } elsif($arg eq "-cache-module-fwd") { + $var = "cache_module_fwd"; + $val = "yes"; + } elsif($arg eq "-developer-build") { + $var = "developer_build"; $val = "yes"; } elsif($arg eq "-no-module-version-header") { $var = "no_module_version_header"; @@ -700,8 +714,12 @@ while ( @ARGV ) { } else { die "The -qtdir option requires an argument"; } - } elsif ($var eq "no_module_fwd") { - $no_module_fwd = 1; + } elsif ($var eq "module_fwd") { + $module_fwd = $val; + } elsif ($var eq "cache_module_fwd") { + $cache_module_fwd = 1; + } elsif ($var eq "developer_build") { + $developer_build = 1; } elsif ($var eq "no_module_version_header") { $no_module_version_header = 1; } elsif ($var eq "output") { @@ -1066,21 +1084,35 @@ foreach my $lib (@modules_to_sync) { } # create forwarding module pri in qtbase/mkspecs/modules - unless ($no_module_fwd) { + if ($module_fwd) { my $modulepri = $modulepris{$lib}; if (-e $modulepri) { my $modulepriname = basename($modulepri); - my $moduleprifwd = "$qtbasedir/mkspecs/modules/$modulepriname"; + mkpath($module_fwd); + my $moduleprifwd = "$module_fwd/$modulepriname"; + my $mod_base = $developer_build ? $basedir : $out_basedir; + my $mod_component_base = $developer_build ? $qtbasedir : $out_basedir; open MODULE_PRI_FILE, ">$moduleprifwd" or die("Could not open $moduleprifwd for writing"); - print MODULE_PRI_FILE "QT_MODULE_BASE = $basedir\n"; - print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $qtbasedir/bin\n"; + print MODULE_PRI_FILE "QT_MODULE_BASE = $mod_base\n"; + print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $mod_component_base/bin\n"; print MODULE_PRI_FILE "QT_MODULE_INCLUDE_BASE = $out_basedir/include\n"; - print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $qtbasedir/imports\n"; - print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $qtbasedir/lib\n"; - print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $qtbasedir/plugins\n"; + print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $mod_component_base/imports\n"; + print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $mod_component_base/lib\n"; + print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $mod_component_base/plugins\n"; print MODULE_PRI_FILE "include($modulepri)\n"; close MODULE_PRI_FILE; utime(time, (stat($modulepri))[9], $moduleprifwd); + if ($cache_module_fwd) { + my $cacheStatement = "QMAKE_EXTRA_MODULE_FORWARDS = \"$module_fwd\""; + my $cacheFile = "$out_basedir/.qmake.cache"; + my $existingQmakeCache = fileContents($cacheFile); + # Skip if it's already there. + if ($existingQmakeCache !~ $cacheStatement) { + open QMAKE_CACHE_FILE, ">>$cacheFile" or die("Could not open $cacheFile for writing"); + print QMAKE_CACHE_FILE "$cacheStatement\n"; + close(QMAKE_CACHE_FILE); + } + } } elsif ($modulepri) { print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n"; } diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index 7088eb444e..86ad9eb764 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -14,8 +14,12 @@ exists($$_PRO_FILE_PWD_/sync.profile) { isEmpty(QTDIR):QTDIR = $$QT_BUILD_TREE } - isEmpty(QTDIR):QTFWD="-no-module-fwd" - else:QTFWD="-qtdir $$QTDIR" + QTFWD = + isEmpty(QTDIR) { + QTFWD += -module-fwd $$OUT_PWD/module-paths/modules -cache-module-fwd + } else { + QTFWD += -qtdir $$QTDIR -module-fwd $$QTDIR/mkspecs/modules -developer-build + } message("Running syncqt for $$PRO_BASENAME in $$OUT_PWD") qtPrepareTool(QMAKE_SYNCQT, syncqt) diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 01b5a796a5..3d0028c3a3 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -14,12 +14,12 @@ isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { debug(1, "Cannot load qconfig.pri!") } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") - for(dir, $$list($$unique($$list($$dirname(QMAKE_QT_CONFIG) \ - $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs) \ - $$QMAKE_EXTRA_MODULE_FORWARDS \ - )))) { + for(dir, $$list($$unique($$list($$replace($$list($$dirname(QMAKE_QT_CONFIG) \ + $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs)), \ + $, /modules) \ + $$QMAKE_EXTRA_MODULE_FORWARDS)))) { debug(1, "Loading modules from $${dir}") - for(mod, $$list($$files($$dir/modules/qt_*.pri))) { + for(mod, $$list($$files($$dir/qt_*.pri))) { # For installed Qt these paths will be common for all modules # For development these will vary per module, and syncqt will override the value in the # qt_.pri forwarding file From ea0e38c0ddb687f7873e0937e1b7130f1588c3d6 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 3 Jun 2011 16:08:54 +0200 Subject: [PATCH 12/34] Correct QStaticText tests after recent changes Raster engine on Mac now correctly handles transformation, so no need to XFAIL anymore. Also fixes a drawStaticText origin mistake, the y origin should be the top left point rather than the baseline. Change-Id: I6058e7099b336d9d5a6586344a07be3c7d76fb64 Reviewed-on: http://codereview.qt.nokia.com/329 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- tests/auto/qstatictext/tst_qstatictext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 29845d9f9a..e14c9db83f 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -361,7 +361,7 @@ bool tst_QStaticText::supportsTransformations() const QPaintEngine::Type type = engine->type(); if (type == QPaintEngine::OpenGL -#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) +#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) && !defined(Q_WS_MAC) || type == QPaintEngine::Raster #endif ) @@ -601,7 +601,7 @@ void tst_QStaticText::setPenPlainText() QStaticText staticText("XXXXX"); staticText.setTextFormat(Qt::PlainText); - p.drawStaticText(0, fm.ascent(), staticText); + p.drawStaticText(0, 0, staticText); } QImage img = image.toImage(); From c25495dba7eff32b66119737552905787e97e665 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 3 Jun 2011 16:03:00 +0200 Subject: [PATCH 13/34] Correct antialias disabling logic for Core Text We should always turn antialias off when QFont::NoAntialias being passed in styleStrategy. That corrects some QStaticText tests. Change-Id: Iaffc5f3bb7f501dcb648cab41a8b6ffcf93f90ae Reviewed-on: http://codereview.qt.nokia.com/328 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qfontengine_coretext.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 737edc3a8c..eedcc69a81 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -745,9 +745,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition 8, im.bytesPerLine(), colorspace, cgflags); CGContextSetFontSize(ctx, fontDef.pixelSize); - CGContextSetShouldAntialias(ctx, aa || - (fontDef.pointSize > qt_antialiasing_threshold - && !(fontDef.styleStrategy & QFont::NoAntialias))); + CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > qt_antialiasing_threshold) + && !(fontDef.styleStrategy & QFont::NoAntialias)); CGContextSetShouldSmoothFonts(ctx, aa); CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx); CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0); From 1835afe6217c562a61c37676119c0d1f081a9828 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 18 May 2011 15:30:27 +0200 Subject: [PATCH 14/34] Moved common module profiles to be feature profiles. This enables external modules to also make use of them without having access to the complete QtBase source code. Change-Id: I056e45cba6c6798b76670b8d238dadb2d9f9c092 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/234 Reviewed-by: Marius Storm-Olsen --- mkspecs/features/qt_installs.prf | 44 +++++ mkspecs/features/qt_module_config.prf | 226 +++++++++++++++++++++++++ mkspecs/features/qt_targets.prf | 4 + src/corelib/corelib.pro | 2 +- src/dbus/dbus.pro | 2 +- src/gui/gui.pro | 2 +- src/network/network.pro | 2 +- src/opengl/opengl.pro | 2 +- src/openvg/openvg.pro | 2 +- src/qbase.pri | 227 +------------------------- src/qt_install.pri | 45 +---- src/qt_targets.pri | 5 +- src/s60main/s60main.pro | 2 +- src/sql/sql.pro | 2 +- src/testlib/testlib.pro | 2 +- src/tools/moc/moc.pro | 2 +- src/tools/rcc/rcc.pro | 2 +- src/tools/uic/uic.pro | 2 +- src/uitools/uitools.pro | 2 +- src/winmain/winmain.pro | 2 +- src/xml/xml.pro | 2 +- 21 files changed, 292 insertions(+), 289 deletions(-) create mode 100644 mkspecs/features/qt_installs.prf create mode 100644 mkspecs/features/qt_module_config.prf create mode 100644 mkspecs/features/qt_targets.prf diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf new file mode 100644 index 0000000000..5a9ab4ba0a --- /dev/null +++ b/mkspecs/features/qt_installs.prf @@ -0,0 +1,44 @@ +#always install the library +win32 { + dlltarget.path=$$[QT_INSTALL_BINS] + INSTALLS += dlltarget +} +target.path=$$[QT_INSTALL_LIBS] +INSTALLS += target + +#headers +qt_install_headers { + INSTALL_HEADERS = $$SYNCQT.HEADER_FILES + equals(TARGET, QtCore) { + #headers created by configure + INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h \ + $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH/arch + } + + equals(TARGET, phonon) { + class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + } else { + flat_headers.files = $$INSTALL_HEADERS + flat_headers.path = $$[QT_INSTALL_HEADERS]/Qt + INSTALLS += flat_headers + + class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + } + class_headers.files = $$SYNCQT.HEADER_CLASSES + INSTALLS += class_headers + + targ_headers.files = $$INSTALL_HEADERS + targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + INSTALLS += targ_headers + + private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES + private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET/private + INSTALLS += private_headers +} + +embedded|qpa: equals(TARGET, QtGui) { + # install fonts for embedded + INSTALLS += fonts + fonts.path = $$[QT_INSTALL_LIBS]/fonts + fonts.files = $$QT_SOURCE_TREE/lib/fonts/* +} diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf new file mode 100644 index 0000000000..024b4fbce0 --- /dev/null +++ b/mkspecs/features/qt_module_config.prf @@ -0,0 +1,226 @@ +load(qt_module) + +isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) +isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") + +MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes) +MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes) +INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES +INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET +INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat +!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR +isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCHa #another compat that will rot for change #215700 +TEMPLATE = lib +isEmpty(QT_MAJOR_VERSION) { + VERSION=5.0.0 +} else { + VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} +} + +#load up the headers info +CONFIG += qt_install_headers +#headers.pri is loaded from the last include path +LAST_MODULE_INCLUDE=$$MODULE_INCLUDES +for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} +HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri +include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) + +#version overriding +win32 { + #because libnetwork.pro could be qmake'd (qmade?) before libqcore.pro we + #need to override the version of libq* in all other libq*'s just to be + #sure the same version is used + VERSIONS_LIST = $$split(VERSION, ".") + QT_LIBS_OVERRIDE = $$member(VERSIONS_LIST, 0) + for(lib, $$list(qtcore qtgui qtnetwork qtxml qtopengl qtsql qt3support)) { + eval(QMAKE_$${upper($$lib)}_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) + eval(QMAKE_$${upper($$lib)}D_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) + } +} + +#other +DESTDIR = $$eval(QT.$${MODULE}.libs) +win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin + +CONFIG += qt warn_on depend_includepath +CONFIG += qmake_cache target_qt +CONFIG -= fix_output_dirs +win32|mac:!macx-xcode:CONFIG += debug_and_release +linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF + +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols +unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions +contains(QT_CONFIG, largefile):CONFIG += largefile + +#mac frameworks +mac:!static:contains(QT_CONFIG, qt_framework) { + #QMAKE_FRAMEWORK_VERSION = 4.0 + CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework + CONFIG(debug, debug|release) { + !build_pass:CONFIG += build_all + } else { #release + !debug_and_release|build_pass { + CONFIG -= qt_install_headers #no need to install these as well + FRAMEWORK_HEADERS.version = Versions + FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES + FRAMEWORK_HEADERS.path = Headers + equals(TARGET, QtCore) { + #headers generated by configure + !contains(FRAMEWORK_HEADERS.files, .*/qconfig.h) { + FRAMEWORK_HEADERS.files *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h + } + } + } + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS + } +} + +mac { + CONFIG += explicitlib + macx-g++ { + QMAKE_CFLAGS += -fconstant-cfstrings + QMAKE_CXXFLAGS += -fconstant-cfstrings + } +} + +win32:!shared:CONFIG += static + +win32-borland { + mng:QMAKE_CFLAGS_WARN_ON += -w-par + mng:QMAKE_CXXFLAGS_WARN_ON += -w-par + # Keep the size of the .tds file for the Qt library smaller than + # 34 Mbytes to avoid linking problems + QMAKE_CFLAGS_DEBUG += -vi -y- + QMAKE_CXXFLAGS_DEBUG += -vi -y- +} + +win32 { + INCLUDEPATH += tmp + !static: DEFINES+=QT_MAKEDLL +} +symbian { + shared { + DEFINES+=QT_MAKEDLL + TARGET.CAPABILITY = All -Tcb + + # When building without autotests, DEF files are used by default. + # This is to maintain binary compatibility with previous releases. + # To explicitly disable DEF files usage, eg. when lots of code churn is + # going on, and functions may be added and removed before shipping, + # configure with -no-usedeffiles + # WARNING - disabling DEF files *will* break BC with previous released versions + # of Qt, and the only compatibility will be between this build of Qt and anything + # built in this exact environment. *Never* use this when building a version + # for release. + contains(CONFIG, def_files) { + DEF_FILE=../s60installs + } + } + load(armcc_warnings) + + # workaround for the fact that some of our required includes in Symbian^3 + # now depend upon files in epoc32/include/platform + INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE +} +win32-borland:INCLUDEPATH += kernel + +aix-g++* { + QMAKE_CFLAGS += -mminimal-toc + QMAKE_CXXFLAGS += -mminimal-toc +} + +embedded { + EMBEDDED_H = $$EMBEDDED_CPP +} + +DEPENDPATH += ;$$NETWORK_H;$$KERNEL_H;$$WIDGETS_H;$$SQL_H;$$TABLE_H;$$DIALOGS_H; +DEPENDPATH += $$ICONVIEW_H;$$OPENGL_H;$$THREAD_H;$$TOOLS_H;$$CODECS_H; +DEPENDPATH += $$WORKSPACE_H;$$XML_H;$$STYLES_H;$$COMPAT_H +embedded:DEPENDPATH += ;$$EMBEDDED_H + +!static:PRL_EXPORT_DEFINES += QT_SHARED + +#install directives +load(qt_installs) + +unix:!symbian { + CONFIG += create_libtool create_pc explicitlib + QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig + include_replace.match = $$QMAKE_INCDIR_QT + include_replace.replace = $$[QT_INSTALL_HEADERS] + lib_replace.match = $$QMAKE_LIBDIR_QT + lib_replace.replace = $$[QT_INSTALL_LIBS] + prefix_replace.match = $$QT_BUILD_TREE + prefix_replace.replace = $$[QT_INSTALL_PREFIX] + QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace + QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace + QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace +} + +win32-g++* { + CONFIG += create_pc + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig +} + +contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE +DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS +contains(QT_CONFIG, gui-qt3support):DEFINES *= QT3_SUPPORT +DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code +DEFINES *= QT_USE_QSTRINGBUILDER + +TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end + +qtPrepareTool(QMAKE_LUPDATE, lupdate) +qtPrepareTool(QMAKE_LRELEASE, lrelease) + +moc_dir.name = moc_location +moc_dir.variable = QMAKE_MOC + +uic_dir.name = uic_location +uic_dir.variable = QMAKE_UIC + +rcc_dir.name = rcc_location +rcc_dir.variable = QMAKE_RCC + +lupdate_dir.name = lupdate_location +lupdate_dir.variable = QMAKE_LUPDATE + +lrelease_dir.name = lrelease_location +lrelease_dir.variable = QMAKE_LRELEASE + +QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir + +load(qt_targets) + +win32:DEFINES+=_USE_MATH_DEFINES + +symbian { + # Make partial upgrade SIS file for all dll's except webkit and s60main + !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2):!contains(TARGET.UID3, 0x2001E61F):!contains(TARGET.UID3, 0xE001E61F) { + # Partial upgrade SIS file + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + isEmpty(QT_LIBINFIX): PARTIAL_UPGRADE_UID = 0x2001E61C + else: PARTIAL_UPGRADE_UID = 0xE001E61C + + pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"$${TARGET}\"}, ($$PARTIAL_UPGRADE_UID), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT += partial_upgrade + } +} diff --git a/mkspecs/features/qt_targets.prf b/mkspecs/features/qt_targets.prf new file mode 100644 index 0000000000..af1a32bb02 --- /dev/null +++ b/mkspecs/features/qt_targets.prf @@ -0,0 +1,4 @@ +QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies) +QMAKE_TARGET_PRODUCT = Qt4 +QMAKE_TARGET_DESCRIPTION = C++ application development framework. +QMAKE_TARGET_COPYRIGHT = Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 1e1e4dacf6..4862263f0c 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -10,7 +10,7 @@ DEFINES += QT_BUILD_CORE_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 731d20a893..4c631aebdc 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -31,7 +31,7 @@ win32 { CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d else:LIBS_PRIVATE += -ldbus-1 } -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/dub/qtdbusversion.h diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 7e9d78d0bb..7412978da8 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -13,7 +13,7 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/gui/qtguiversion.h diff --git a/src/network/network.pro b/src/network/network.pro index 4ee71b028e..e3e576a7a1 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -18,7 +18,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index b30d4057db..079f93d3de 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -13,7 +13,7 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/opengl/qtopenglversion.h diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro index 0e22503c3b..bd9aa1a732 100644 --- a/src/openvg/openvg.pro +++ b/src/openvg/openvg.pro @@ -50,7 +50,7 @@ symbian { } } -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/openvg/qtopenvgversion.h diff --git a/src/qbase.pri b/src/qbase.pri index cf02978853..528dd1e17a 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -1,226 +1 @@ -load(qt_module) - -isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) -isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") - -MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes) -MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes) -INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES -INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET -INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat -!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR -isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 -TEMPLATE = lib -isEmpty(QT_MAJOR_VERSION) { - VERSION=5.0.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} - -#load up the headers info -CONFIG += qt_install_headers -#headers.pri is loaded from the last include path -LAST_MODULE_INCLUDE=$$MODULE_INCLUDES -for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} -HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) - -#version overriding -win32 { - #because libnetwork.pro could be qmake'd (qmade?) before libqcore.pro we - #need to override the version of libq* in all other libq*'s just to be - #sure the same version is used - VERSIONS_LIST = $$split(VERSION, ".") - QT_LIBS_OVERRIDE = $$member(VERSIONS_LIST, 0) - for(lib, $$list(qtcore qtgui qtnetwork qtxml qtopengl qtsql qt3support)) { - eval(QMAKE_$${upper($$lib)}_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - eval(QMAKE_$${upper($$lib)}D_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - } -} - -#other -DESTDIR = $$QMAKE_LIBDIR_QT -win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin - -CONFIG += qt warn_on depend_includepath -CONFIG += qmake_cache target_qt -CONFIG -= fix_output_dirs -win32|mac:!macx-xcode:CONFIG += debug_and_release -linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF - -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols -unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions -contains(QT_CONFIG, largefile):CONFIG += largefile - -#mac frameworks -mac:!static:contains(QT_CONFIG, qt_framework) { - #QMAKE_FRAMEWORK_VERSION = 4.0 - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework - CONFIG(debug, debug|release) { - !build_pass:CONFIG += build_all - } else { #release - !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - equals(TARGET, QtCore) { - #headers generated by configure - !contains(FRAMEWORK_HEADERS.files, .*/qconfig.h) { - FRAMEWORK_HEADERS.files *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h - } - } - } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS - } -} - -mac { - CONFIG += explicitlib - macx-g++ { - QMAKE_CFLAGS += -fconstant-cfstrings - QMAKE_CXXFLAGS += -fconstant-cfstrings - } -} - -win32:!shared:CONFIG += static - -win32-borland { - mng:QMAKE_CFLAGS_WARN_ON += -w-par - mng:QMAKE_CXXFLAGS_WARN_ON += -w-par - # Keep the size of the .tds file for the Qt library smaller than - # 34 Mbytes to avoid linking problems - QMAKE_CFLAGS_DEBUG += -vi -y- - QMAKE_CXXFLAGS_DEBUG += -vi -y- -} - -win32 { - INCLUDEPATH += tmp - !static: DEFINES+=QT_MAKEDLL -} -symbian { - shared { - DEFINES+=QT_MAKEDLL - TARGET.CAPABILITY = All -Tcb - - # When building without autotests, DEF files are used by default. - # This is to maintain binary compatibility with previous releases. - # To explicitly disable DEF files usage, eg. when lots of code churn is - # going on, and functions may be added and removed before shipping, - # configure with -no-usedeffiles - # WARNING - disabling DEF files *will* break BC with previous released versions - # of Qt, and the only compatibility will be between this build of Qt and anything - # built in this exact environment. *Never* use this when building a version - # for release. - contains(CONFIG, def_files) { - DEF_FILE=../s60installs - } - } - load(armcc_warnings) - - # workaround for the fact that some of our required includes in Symbian^3 - # now depend upon files in epoc32/include/platform - INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE -} -win32-borland:INCLUDEPATH += kernel - -aix-g++* { - QMAKE_CFLAGS += -mminimal-toc - QMAKE_CXXFLAGS += -mminimal-toc -} - -embedded { - EMBEDDED_H = $$EMBEDDED_CPP -} - -DEPENDPATH += ;$$NETWORK_H;$$KERNEL_H;$$WIDGETS_H;$$SQL_H;$$TABLE_H;$$DIALOGS_H; -DEPENDPATH += $$ICONVIEW_H;$$OPENGL_H;$$THREAD_H;$$TOOLS_H;$$CODECS_H; -DEPENDPATH += $$WORKSPACE_H;$$XML_H;$$STYLES_H;$$COMPAT_H -embedded:DEPENDPATH += ;$$EMBEDDED_H - -!static:PRL_EXPORT_DEFINES += QT_SHARED - -#install directives -include(qt_install.pri) - -unix:!symbian { - CONFIG += create_libtool create_pc explicitlib - QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - include_replace.match = $$QMAKE_INCDIR_QT - include_replace.replace = $$[QT_INSTALL_HEADERS] - lib_replace.match = $$QMAKE_LIBDIR_QT - lib_replace.replace = $$[QT_INSTALL_LIBS] - prefix_replace.match = $$QT_BUILD_TREE - prefix_replace.replace = $$[QT_INSTALL_PREFIX] - QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace - QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace - QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace -} - -win32-g++* { - CONFIG += create_pc - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig -} - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS -contains(QT_CONFIG, gui-qt3support):DEFINES *= QT3_SUPPORT -DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code -DEFINES *= QT_USE_QSTRINGBUILDER - -TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end - -qtPrepareTool(QMAKE_LUPDATE, lupdate) -qtPrepareTool(QMAKE_LRELEASE, lrelease) - -moc_dir.name = moc_location -moc_dir.variable = QMAKE_MOC - -uic_dir.name = uic_location -uic_dir.variable = QMAKE_UIC - -rcc_dir.name = rcc_location -rcc_dir.variable = QMAKE_RCC - -lupdate_dir.name = lupdate_location -lupdate_dir.variable = QMAKE_LUPDATE - -lrelease_dir.name = lrelease_location -lrelease_dir.variable = QMAKE_LRELEASE - -QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir - -include(qt_targets.pri) - -win32:DEFINES+=_USE_MATH_DEFINES - -symbian { - # Make partial upgrade SIS file for all dll's except webkit and s60main - !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2):!contains(TARGET.UID3, 0x2001E61F):!contains(TARGET.UID3, 0xE001E61F) { - # Partial upgrade SIS file - vendorinfo = \ - "; Localised Vendor name" \ - "%{\"Nokia\"}" \ - " " \ - "; Unique Vendor name" \ - ":\"Nokia, Qt\"" \ - " " - isEmpty(QT_LIBINFIX): PARTIAL_UPGRADE_UID = 0x2001E61C - else: PARTIAL_UPGRADE_UID = 0xE001E61C - - pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ - "$${LITERAL_HASH}{\"$${TARGET}\"}, ($$PARTIAL_UPGRADE_UID), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" - partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll - partial_upgrade.path = c:/sys/bin - DEPLOYMENT += partial_upgrade - } -} +load(qt_module_config) diff --git a/src/qt_install.pri b/src/qt_install.pri index f5ad51f591..8a9a7ab5ba 100644 --- a/src/qt_install.pri +++ b/src/qt_install.pri @@ -1,44 +1 @@ -#always install the library -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target - -#headers -qt_install_headers { - INSTALL_HEADERS = $$SYNCQT.HEADER_FILES - equals(TARGET, QtCore) { - #headers generated by configure - INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h \ - $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH/arch - } - - equals(TARGET, phonon) { - class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - } else { - flat_headers.files = $$INSTALL_HEADERS - flat_headers.path = $$[QT_INSTALL_HEADERS]/Qt - INSTALLS += flat_headers - - class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - } - class_headers.files = $$SYNCQT.HEADER_CLASSES - INSTALLS += class_headers - - targ_headers.files = $$INSTALL_HEADERS - targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - INSTALLS += targ_headers - - private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES - private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET/private - INSTALLS += private_headers -} - -embedded|qpa: equals(TARGET, QtGui) { - # install fonts for embedded - INSTALLS += fonts - fonts.path = $$[QT_INSTALL_LIBS]/fonts - fonts.files = $$QT_SOURCE_TREE/lib/fonts/* -} +load(qt_installs) diff --git a/src/qt_targets.pri b/src/qt_targets.pri index af1a32bb02..900b50bde4 100644 --- a/src/qt_targets.pri +++ b/src/qt_targets.pri @@ -1,4 +1 @@ -QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies) -QMAKE_TARGET_PRODUCT = Qt4 -QMAKE_TARGET_DESCRIPTION = C++ application development framework. -QMAKE_TARGET_COPYRIGHT = Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +load(qt_targets) diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 4c598e2857..8cdd00e56f 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -35,4 +35,4 @@ symbian { error("$$_FILE_ is intended only for Symbian!") } -include(../qbase.pri) +load(qt_module_config) diff --git a/src/sql/sql.pro b/src/sql/sql.pro index c7cbbc4985..74f6cd2cb6 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -11,7 +11,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x62000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/sql/qtsqlversion.h diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 3408c91420..0706a5b510 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -84,7 +84,7 @@ qpa:mac: { } } -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/testlib/qttestlibversion.h diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro index 0b8ddbe31e..8e2e76d4b9 100644 --- a/src/tools/moc/moc.pro +++ b/src/tools/moc/moc.pro @@ -15,4 +15,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/tools/rcc/rcc.pro b/src/tools/rcc/rcc.pro index edc85a1d15..6c78642406 100644 --- a/src/tools/rcc/rcc.pro +++ b/src/tools/rcc/rcc.pro @@ -13,4 +13,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro index 591925ca90..0b0ae782d4 100644 --- a/src/tools/uic/uic.pro +++ b/src/tools/uic/uic.pro @@ -20,4 +20,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/uitools/uitools.pro b/src/uitools/uitools.pro index 977fe50c09..e326c8a726 100644 --- a/src/uitools/uitools.pro +++ b/src/uitools/uitools.pro @@ -22,7 +22,7 @@ isEmpty(QT_MAJOR_VERSION) { } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } -include(../qt_targets.pri) +load(qt_targets) QMAKE_TARGET_PRODUCT = UiLoader QMAKE_TARGET_DESCRIPTION = QUiLoader diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index 8c2710ccd9..b353e8e382 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -16,6 +16,6 @@ win32 { } !win32:error("$$_FILE_ is intended only for Windows!") -include(../qbase.pri) +load(qt_module_config) wince*:QMAKE_POST_LINK = diff --git a/src/xml/xml.pro b/src/xml/xml.pro index 986e478b69..361b948176 100644 --- a/src/xml/xml.pro +++ b/src/xml/xml.pro @@ -10,7 +10,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h From ccd5228a9380fbfa308a57365e4075f90010da00 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 27 May 2011 12:10:43 -0500 Subject: [PATCH 15/34] Disable trying to compile network tests which require QtScript Those tests should be moved to QtScript/tests/auto Change-Id: Icc0c50ef35ac08e604ab18cb87b0c2b19f2fc72c Reviewed-on: http://codereview.qt.nokia.com/197 Reviewed-by: Qt Sanity Bot Reviewed-by: Markus Goetz Reviewed-by: Liang Qi --- tests/auto/qlocalsocket/qlocalsocket.pro | 2 +- tests/auto/qtipc/qtipc.pro | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro index 3911a64936..931c1e0602 100644 --- a/tests/auto/qlocalsocket/qlocalsocket.pro +++ b/tests/auto/qlocalsocket/qlocalsocket.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = lackey test +SUBDIRS = test # lackey should be moved to the QtScript module !wince*:!symbian: SUBDIRS += example symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro index 60037d28d2..e7d2a55cd8 100644 --- a/tests/auto/qtipc/qtipc.pro +++ b/tests/auto/qtipc/qtipc.pro @@ -1,6 +1,5 @@ TEMPLATE=subdirs SUBDIRS=\ - lackey \ qsharedmemory \ qsystemsemaphore \ - +# lackey \ should be moved to QtScript From ff650770749407defb46477b0c2269a9dc0427f1 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 30 May 2011 14:14:28 +0200 Subject: [PATCH 16/34] Make qmake slightly more verbose with its syncqt output. It can be hidden with -silent, however. Change-Id: I6dbd3c743779b8d2070e41f007df26b530987429 Reviewed-on: http://codereview.qt.nokia.com/235 Reviewed-by: Marius Storm-Olsen Reviewed-by: Qt Sanity Bot Reviewed-by: Liang Qi --- mkspecs/features/default_pre.prf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index 86ad9eb764..c91d543d6c 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -21,12 +21,14 @@ exists($$_PRO_FILE_PWD_/sync.profile) { QTFWD += -qtdir $$QTDIR -module-fwd $$QTDIR/mkspecs/modules -developer-build } - message("Running syncqt for $$PRO_BASENAME in $$OUT_PWD") qtPrepareTool(QMAKE_SYNCQT, syncqt) - system("$$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_") { + + MSG = $$quote($$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_) + !silent:message($$MSG) + system($$MSG) { # success! Nothing to do } else { - error("Failed to run: $$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_") + error("Failed to run: $$MSG") } unset(QTFWD) unset(PRO_BASENAME) From ec5cdf9c5d4080906762401c3af26a030522132a Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 18 May 2011 15:31:52 +0200 Subject: [PATCH 17/34] Added module CONFIG to uitools. This seems to be necessary for installing, and has no side effects that I can tell. Change-Id: Ic778b8a3937621ddd401ddd83d05831460db8f39 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/236 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- src/uitools/uitools.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uitools/uitools.pro b/src/uitools/uitools.pro index e326c8a726..3f9f166dbd 100644 --- a/src/uitools/uitools.pro +++ b/src/uitools/uitools.pro @@ -3,7 +3,8 @@ TEMPLATE = lib TARGET = $$qtLibraryTarget(QtUiTools) QT = core xml -CONFIG += qt staticlib # Not adding module here, since the module pri's are only used for building +CONFIG += qt staticlib module +MODULE = uitools MODULE_PRI = ../modules/qt_uitools.pri \ ../modules/qt_uilib.pri From 42b47a404b50473655580d1f2e2c2aefba94f0e7 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 6 Jun 2011 14:17:14 +0200 Subject: [PATCH 18/34] Use Raster pixmaps for the EglFS plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id94df7b5ebe298104d05bee3ae58e06201c596f7 Reviewed-on: http://codereview.qt.nokia.com/334 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 287ffce721..9e8596f19e 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include @@ -78,7 +78,7 @@ QPixmapData *QEglFSIntegration::createPixmapData(QPixmapData::PixelType type) co #ifdef QEGL_EXTRA_DEBUG qWarning("QEglIntegration::createPixmapData %d\n", type); #endif - return new QGLPixmapData(type); + return new QRasterPixmapData(type); } QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWidget *widget, WId winId) const From eabaf61256d8c1966f8f6d49d0cb2d9b2ba9f71b Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Mon, 6 Jun 2011 18:49:21 +0300 Subject: [PATCH 19/34] Added private header dependencies to MeeGo graphics system plugin Depends on core, gui and opengl private headers Change-Id: If3266c3b7233bf40b5ad80a8a99fd5f2c7eafcec Reviewed-on: http://codereview.qt.nokia.com/336 Reviewed-by: Qt Sanity Bot Reviewed-by: Eckhart Koppen --- src/plugins/graphicssystems/meego/meego.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/graphicssystems/meego/meego.pro b/src/plugins/graphicssystems/meego/meego.pro index 5c650eef2e..6432825888 100644 --- a/src/plugins/graphicssystems/meego/meego.pro +++ b/src/plugins/graphicssystems/meego/meego.pro @@ -1,7 +1,7 @@ TARGET = qmeegographicssystem load(qt_plugin) -QT += gui opengl +QT += core-private gui-private opengl-private DESTDIR = $$QT.gui.plugins/graphicssystems From ae3b5b3ab4b9c268db8230cc2ac5edac3680a2d8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 10 May 2011 15:08:29 +0200 Subject: [PATCH 20/34] Add function QGlyphRun::setRawData() To provide an optimized way of constructing QGlyphRun objects with no copying or allocation, we add function setRawData() (naming inspired by QByteArray::setRawData()). Data retrieved from QRawFont can be passed directly into this. The logic is now that the data pointers in QGlyphRunPrivate should always point to the current valid data and is what will be used in comparisons and drawing calls. The vectors are optimizations to avoid unnecessary copying if the user wants to use the QVector based API (which makes it easier to manage the memory.) This reflected in the functions that return QVectors, which will return the stored vector if and only if it is identical to the current pointer. Otherwise we will have to copy the memory. The internal addition operators in QGlyphRun have been removed since they really provide no real optimization and have an unclear definition if the two glyph runs are based on different fonts. Reviewed-by: Jiang Jiang (cherry picked from commit 86d88c5b719fd3d50336d9d8e7127b8045ee82ae) Change-Id: Id5bb55ee3d93afb32ffca850f53382e856df7b3e Reviewed-on: http://codereview.qt.nokia.com/342 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qpainter.cpp | 15 ++-- src/gui/painting/qpainter_p.h | 2 +- src/gui/text/qglyphrun.cpp | 108 +++++++++++++++---------- src/gui/text/qglyphrun.h | 4 + src/gui/text/qglyphrun_p.h | 19 +++++ src/gui/text/qtextlayout.cpp | 16 +++- tests/auto/qglyphrun/tst_qglyphrun.cpp | 79 ++++++++++++++++++ 7 files changed, 190 insertions(+), 53 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index e7b5f18112..b13ca94b30 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5801,10 +5801,12 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) if (!font.isValid()) return; - QVector glyphIndexes = glyphRun.glyphIndexes(); - QVector glyphPositions = glyphRun.positions(); + QGlyphRunPrivate *glyphRun_d = QGlyphRunPrivate::get(glyphRun); - int count = qMin(glyphIndexes.size(), glyphPositions.size()); + const quint32 *glyphIndexes = glyphRun_d->glyphIndexData; + const QPointF *glyphPositions = glyphRun_d->glyphPositionData; + + int count = qMin(glyphRun_d->glyphIndexDataSize, glyphRun_d->glyphPositionDataSize); QVarLengthArray fixedPointPositions(count); QRawFontPrivate *fontD = QRawFontPrivate::get(font); @@ -5818,17 +5820,18 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) } for (int i=0; istate->transform().map(processedPosition); fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition); } - d->drawGlyphs(glyphIndexes.data(), fixedPointPositions.data(), count, font, glyphRun.overline(), + d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, font, glyphRun.overline(), glyphRun.underline(), glyphRun.strikeOut()); } -void QPainterPrivate::drawGlyphs(quint32 *glyphArray, QFixedPoint *positions, int glyphCount, +void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positions, + int glyphCount, const QRawFont &font, bool overline, bool underline, bool strikeOut) { diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h index 35cdf86ee0..79d4b4bbe0 100644 --- a/src/gui/painting/qpainter_p.h +++ b/src/gui/painting/qpainter_p.h @@ -232,7 +232,7 @@ public: void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation); #if !defined(QT_NO_RAWFONT) - void drawGlyphs(quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, + void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, const QRawFont &font, bool overline = false, bool underline = false, bool strikeOut = false); #endif diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp index 4a51e56805..18b6357863 100644 --- a/src/gui/text/qglyphrun.cpp +++ b/src/gui/text/qglyphrun.cpp @@ -132,13 +132,27 @@ QGlyphRun &QGlyphRun::operator=(const QGlyphRun &other) */ bool QGlyphRun::operator==(const QGlyphRun &other) const { - return ((d == other.d) - || (d->glyphIndexes == other.d->glyphIndexes - && d->glyphPositions == other.d->glyphPositions - && d->overline == other.d->overline - && d->underline == other.d->underline - && d->strikeOut == other.d->strikeOut - && d->rawFont == other.d->rawFont)); + if (d == other.d) + return true; + + if ((d->glyphIndexDataSize != other.d->glyphIndexDataSize) + || (d->glyphPositionDataSize != other.d->glyphPositionDataSize)) { + return false; + } + + for (int i=0; iglyphIndexDataSize, d->glyphPositionDataSize); ++i) { + if (i < d->glyphIndexDataSize && d->glyphIndexData[i] != other.d->glyphIndexData[i]) + return false; + + if (i < d->glyphPositionDataSize && d->glyphPositionData[i] != other.d->glyphPositionData[i]) + return false; + } + + + return (d->overline == other.d->overline + && d->underline == other.d->underline + && d->strikeOut == other.d->strikeOut + && d->rawFont == other.d->rawFont); } /*! @@ -150,36 +164,6 @@ bool QGlyphRun::operator!=(const QGlyphRun &other) const return !(*this == other); } -/*! - \internal - - Adds together the lists of glyph indexes and positions in \a other and this QGlyphRun - object and returns the result. The font in the returned QGlyphRun will be the same as in - this QGlyphRun object. -*/ -QGlyphRun QGlyphRun::operator+(const QGlyphRun &other) const -{ - QGlyphRun ret(*this); - ret += other; - return ret; -} - -/*! - \internal - - Appends the glyph indexes and positions in \a other to this QGlyphRun object and returns - a reference to the current object. -*/ -QGlyphRun &QGlyphRun::operator+=(const QGlyphRun &other) -{ - detach(); - - d->glyphIndexes += other.d->glyphIndexes; - d->glyphPositions += other.d->glyphPositions; - - return *this; -} - /*! Returns the font selected for this QGlyphRun object. @@ -208,7 +192,13 @@ void QGlyphRun::setRawFont(const QRawFont &rawFont) */ QVector QGlyphRun::glyphIndexes() const { - return d->glyphIndexes; + if (d->glyphIndexes.constData() == d->glyphIndexData) { + return d->glyphIndexes; + } else { + QVector indexes(d->glyphIndexDataSize); + qMemCopy(indexes.data(), d->glyphIndexData, d->glyphIndexDataSize * sizeof(quint32)); + return indexes; + } } /*! @@ -218,7 +208,9 @@ QVector QGlyphRun::glyphIndexes() const void QGlyphRun::setGlyphIndexes(const QVector &glyphIndexes) { detach(); - d->glyphIndexes = glyphIndexes; + d->glyphIndexes = glyphIndexes; // Keep a reference to the QVector to avoid copying + d->glyphIndexData = glyphIndexes.constData(); + d->glyphIndexDataSize = glyphIndexes.size(); } /*! @@ -226,7 +218,14 @@ void QGlyphRun::setGlyphIndexes(const QVector &glyphIndexes) */ QVector QGlyphRun::positions() const { - return d->glyphPositions; + if (d->glyphPositions.constData() == d->glyphPositionData) { + return d->glyphPositions; + } else { + QVector glyphPositions(d->glyphPositionDataSize); + qMemCopy(glyphPositions.data(), d->glyphPositionData, + d->glyphPositionDataSize * sizeof(QPointF)); + return glyphPositions; + } } /*! @@ -236,7 +235,9 @@ QVector QGlyphRun::positions() const void QGlyphRun::setPositions(const QVector &positions) { detach(); - d->glyphPositions = positions; + d->glyphPositions = positions; // Keep a reference to the vector to avoid copying + d->glyphPositionData = positions.constData(); + d->glyphPositionDataSize = positions.size(); } /*! @@ -245,12 +246,33 @@ void QGlyphRun::setPositions(const QVector &positions) void QGlyphRun::clear() { detach(); - d->glyphPositions = QVector(); - d->glyphIndexes = QVector(); d->rawFont = QRawFont(); d->strikeOut = false; d->overline = false; d->underline = false; + + setPositions(QVector()); + setGlyphIndexes(QVector()); +} + +/*! + Sets the glyph indexes and positions of this QGlyphRun to use the first \a size + elements in the arrays \a glyphIndexArray and \a glyphPositionArray. The data is + \e not copied. The caller must guarantee that the arrays are not deleted as long + as this QGlyphRun and any copies of it exists. + + \sa setGlyphIndexes(), setPositions() +*/ +void QGlyphRun::setRawData(const quint32 *glyphIndexArray, const QPointF *glyphPositionArray, + int size) +{ + detach(); + d->glyphIndexes.clear(); + d->glyphPositions.clear(); + + d->glyphIndexData = glyphIndexArray; + d->glyphPositionData = glyphPositionArray; + d->glyphIndexDataSize = d->glyphPositionDataSize = size; } /*! diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h index 99a1fc8593..b4f02f0d87 100644 --- a/src/gui/text/qglyphrun.h +++ b/src/gui/text/qglyphrun.h @@ -66,6 +66,10 @@ public: QRawFont rawFont() const; void setRawFont(const QRawFont &rawFont); + void setRawData(const quint32 *glyphIndexArray, + const QPointF *glyphPositionArray, + int size); + QVector glyphIndexes() const; void setGlyphIndexes(const QVector &glyphIndexes); diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h index 533679d96a..1cb63b2403 100644 --- a/src/gui/text/qglyphrun_p.h +++ b/src/gui/text/qglyphrun_p.h @@ -71,6 +71,10 @@ public: : overline(false) , underline(false) , strikeOut(false) + , glyphIndexData(glyphIndexes.constData()) + , glyphIndexDataSize(0) + , glyphPositionData(glyphPositions.constData()) + , glyphPositionDataSize(0) { } @@ -82,6 +86,10 @@ public: , overline(other.overline) , underline(other.underline) , strikeOut(other.strikeOut) + , glyphIndexData(other.glyphIndexData) + , glyphIndexDataSize(other.glyphIndexDataSize) + , glyphPositionData(other.glyphPositionData) + , glyphPositionDataSize(other.glyphPositionDataSize) { } @@ -89,6 +97,17 @@ public: QVector glyphPositions; QRawFont rawFont; + const quint32 *glyphIndexData; + int glyphIndexDataSize; + + const QPointF *glyphPositionData; + int glyphPositionDataSize; + + static QGlyphRunPrivate *get(const QGlyphRun &glyphRun) + { + return glyphRun.d.data(); + } + uint overline : 1; uint underline : 1; uint strikeOut : 1; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index add25cdad9..781dd23a58 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2282,10 +2282,20 @@ QList QTextLine::glyphRuns(int from, int length) const glyphIndexes.setRawFont(font); QPair key(fontEngine, int(flags)); - if (!glyphsHash.contains(key)) + if (!glyphsHash.contains(key)) { glyphsHash.insert(key, glyphIndexes); - else - glyphsHash[key] += glyphIndexes; + } else { + QGlyphRun &glyphRun = glyphsHash[key]; + + QVector indexes = glyphRun.glyphIndexes(); + QVector positions = glyphRun.positions(); + + indexes += glyphIndexes.glyphIndexes(); + positions += glyphIndexes.positions(); + + glyphRun.setGlyphIndexes(indexes); + glyphRun.setPositions(positions); + } } } diff --git a/tests/auto/qglyphrun/tst_qglyphrun.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp index 3ea84e3a4d..a18a2ac8dd 100644 --- a/tests/auto/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp @@ -72,6 +72,8 @@ private slots: void drawUnderlinedText(); void drawRightToLeft(); void detach(); + void setRawData(); + void setRawDataAndGetAsVector(); private: int m_testFontId; @@ -284,6 +286,83 @@ void tst_QGlyphRun::drawExistingGlyphs() QCOMPARE(textLayoutDraw, drawGlyphs); } +void tst_QGlyphRun::setRawData() +{ + QGlyphRun glyphRun; + glyphRun.setRawFont(QRawFont::fromFont(m_testFont)); + glyphRun.setGlyphIndexes(QVector() << 2 << 2 << 2); + glyphRun.setPositions(QVector() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20)); + + QPixmap baseline(100, 50); + baseline.fill(Qt::white); + { + QPainter p(&baseline); + p.drawGlyphRun(QPointF(3, 2), glyphRun); + } + + QGlyphRun baselineCopied = glyphRun; + + quint32 glyphIndexArray[3] = { 2, 2, 2 }; + QPointF glyphPositionArray[3] = { QPointF(2, 3), QPointF(20, 3), QPointF(10, 20) }; + + glyphRun.setRawData(glyphIndexArray, glyphPositionArray, 3); + + QPixmap rawDataGlyphs(100, 50); + rawDataGlyphs.fill(Qt::white); + { + QPainter p(&rawDataGlyphs); + p.drawGlyphRun(QPointF(3, 2), glyphRun); + } + + quint32 otherGlyphIndexArray[1] = { 2 }; + QPointF otherGlyphPositionArray[1] = { QPointF(2, 3) }; + + glyphRun.setRawData(otherGlyphIndexArray, otherGlyphPositionArray, 1); + + QPixmap baselineCopiedPixmap(100, 50); + baselineCopiedPixmap.fill(Qt::white); + { + QPainter p(&baselineCopiedPixmap); + p.drawGlyphRun(QPointF(3, 2), baselineCopied); + } + +#if defined(DEBUG_SAVE_IMAGE) + baseline.save("setRawData_baseline.png"); + rawDataGlyphs.save("setRawData_rawDataGlyphs.png"); + baselineCopiedPixmap.save("setRawData_baselineCopiedPixmap.png"); +#endif + + QCOMPARE(rawDataGlyphs, baseline); + QCOMPARE(baselineCopiedPixmap, baseline); +} + +void tst_QGlyphRun::setRawDataAndGetAsVector() +{ + QVector glyphIndexArray; + glyphIndexArray << 3 << 2 << 1 << 4; + + QVector glyphPositionArray; + glyphPositionArray << QPointF(1, 2) << QPointF(3, 4) << QPointF(5, 6) << QPointF(7, 8); + + QGlyphRun glyphRun; + glyphRun.setRawData(glyphIndexArray.constData(), glyphPositionArray.constData(), 4); + + QVector glyphIndexes = glyphRun.glyphIndexes(); + QVector glyphPositions = glyphRun.positions(); + + QCOMPARE(glyphIndexes.size(), 4); + QCOMPARE(glyphPositions.size(), 4); + + QCOMPARE(glyphIndexes, glyphIndexArray); + QCOMPARE(glyphPositions, glyphPositionArray); + + QGlyphRun otherGlyphRun; + otherGlyphRun.setGlyphIndexes(glyphIndexArray); + otherGlyphRun.setPositions(glyphPositionArray); + + QCOMPARE(glyphRun, otherGlyphRun); +} + void tst_QGlyphRun::drawNonExistentGlyphs() { QVector glyphIndexes; From dddfcd66f8b0a9aaff97d9cccf94564191800869 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 16 May 2011 13:20:25 +0200 Subject: [PATCH 21/34] Fix regression that caused waitForXXX(-1) to fail. Regression was introduced by 8d4cd52b6981a4e6deea7fdb77f56e40c4f3e6ba when it failed to check when msecs == -1. This manifested visibly in KDE failing to connect to any SSL site -- kioslaves are synchronous and use waitForXXX(-1) (in this particular case, waitForEncrypted, which calls waitForReadyRead). Also, take the opportunity to convert these tests in QTcpSocket to use port 80 (a defined service in the test server) instead of port 22. Reviewed-by: Martin Petersson (cherry picked from commit cb5b6799333794496269aa7e6515f96c2ac96d37) Change-Id: I256a1e138e43fd45844976fe84cd2bc938552e47 Reviewed-on: http://codereview.qt.nokia.com/359 Reviewed-by: Qt Sanity Bot Reviewed-by: Peter Hartmann --- src/network/socket/qabstractsocket.cpp | 2 +- tests/auto/qsslsocket/tst_qsslsocket.cpp | 15 ++++++++++ tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 36 +++++++++++++++++++++--- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 46665176cf..5316626638 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1908,7 +1908,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) if (state() != ConnectedState) return false; - } while (qt_timeout_value(msecs, stopWatch.elapsed()) > 0); + } while (msecs == -1 || qt_timeout_value(msecs, stopWatch.elapsed()) > 0); return false; } diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 6a4f1ed75e..999cad55ba 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -156,6 +156,7 @@ private slots: void setSslConfiguration_data(); void setSslConfiguration(); void waitForEncrypted(); + void waitForEncryptedMinusOne(); void waitForConnectedEncryptedReadyRead(); void startClientEncryption(); void startServerEncryption(); @@ -1098,6 +1099,20 @@ void tst_QSslSocket::waitForEncrypted() QVERIFY(socket->waitForEncrypted(10000)); } +void tst_QSslSocket::waitForEncryptedMinusOne() +{ + if (!QSslSocket::supportsSsl()) + return; + + QSslSocketPtr socket = newSocket(); + this->socket = socket; + + connect(socket, SIGNAL(sslErrors(const QList &)), this, SLOT(ignoreErrorSlot())); + socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443); + + QVERIFY(socket->waitForEncrypted(-1)); +} + void tst_QSslSocket::waitForConnectedEncryptedReadyRead() { if (!QSslSocket::supportsSsl()) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 69e8ff1dbf..a2f8bac517 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -166,7 +166,9 @@ private slots: void readLineString(); void readChunks(); void waitForBytesWritten(); + void waitForBytesWrittenMinusOne(); void waitForReadyRead(); + void waitForReadyReadMinusOne(); void flush(); void synchronousApi(); void dontCloseOnTimeout(); @@ -1417,10 +1419,10 @@ void tst_QTcpSocket::readChunks() void tst_QTcpSocket::waitForBytesWritten() { QTcpSocket *socket = newSocket(); - socket->connectToHost(QtNetworkSettings::serverName(), 22); + socket->connectToHost(QtNetworkSettings::serverName(), 80); QVERIFY(socket->waitForConnected(10000)); - socket->write(QByteArray(10000, '@')); + socket->write("GET / HTTP/1.0\r\n\r\n"); qint64 toWrite = socket->bytesToWrite(); QVERIFY(socket->waitForBytesWritten(5000)); QVERIFY(toWrite > socket->bytesToWrite()); @@ -1428,12 +1430,38 @@ void tst_QTcpSocket::waitForBytesWritten() delete socket; } +//---------------------------------------------------------------------------------- +void tst_QTcpSocket::waitForBytesWrittenMinusOne() +{ + QTcpSocket *socket = newSocket(); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + QVERIFY(socket->waitForConnected(10000)); + + socket->write("GET / HTTP/1.0\r\n\r\n"); + qint64 toWrite = socket->bytesToWrite(); + QVERIFY(socket->waitForBytesWritten(-1)); + QVERIFY(toWrite > socket->bytesToWrite()); + + delete socket; +} + //---------------------------------------------------------------------------------- void tst_QTcpSocket::waitForReadyRead() { QTcpSocket *socket = newSocket(); - socket->connectToHost(QtNetworkSettings::serverName(), 22); - socket->waitForReadyRead(0); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + socket->write("GET / HTTP/1.0\r\n\r\n"); + QVERIFY(socket->waitForReadyRead(5000)); + delete socket; +} + +//---------------------------------------------------------------------------------- +void tst_QTcpSocket::waitForReadyReadMinusOne() +{ + QTcpSocket *socket = newSocket(); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + socket->write("GET / HTTP/1.0\r\n\r\n"); + QVERIFY(socket->waitForReadyRead(-1)); delete socket; } From ed5a7e22beffd156b13174230322a50b0f7bad64 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Tue, 7 Jun 2011 13:43:17 -0500 Subject: [PATCH 22/34] Fix usage of QT_SOURCE_TREE Functionality has been moved into qt_example.prf Change-Id: I81423eb4c5645f03b131932b2d37eceee9fea086 Reviewed-on: http://codereview.qt.nokia.com/371 Reviewed-by: Marius Storm-Olsen --- examples/animation/animatedtiles/animatedtiles.pro | 2 +- examples/animation/appchooser/appchooser.pro | 2 +- examples/animation/moveblocks/moveblocks.pro | 2 +- examples/animation/states/states.pro | 2 +- examples/animation/stickman/stickman.pro | 2 +- examples/dialogs/configdialog/configdialog.pro | 2 +- examples/dialogs/sipdialog/sipdialog.pro | 2 +- examples/dialogs/standarddialogs/standarddialogs.pro | 2 +- examples/dialogs/tabdialog/tabdialog.pro | 2 +- examples/draganddrop/draggableicons/draggableicons.pro | 2 +- examples/draganddrop/draggabletext/draggabletext.pro | 2 +- examples/draganddrop/fridgemagnets/fridgemagnets.pro | 2 +- examples/draganddrop/puzzle/puzzle.pro | 2 +- examples/effects/blurpicker/blurpicker.pro | 4 ++-- examples/effects/fademessage/fademessage.pro | 4 ++-- examples/effects/lighting/lighting.pro | 4 ++-- examples/gestures/imagegestures/imagegestures.pro | 2 +- examples/graphicsview/anchorlayout/anchorlayout.pro | 4 ++-- .../basicgraphicslayouts/basicgraphicslayouts.pro | 2 +- examples/graphicsview/collidingmice/collidingmice.pro | 2 +- examples/graphicsview/elasticnodes/elasticnodes.pro | 2 +- examples/graphicsview/flowlayout/flowlayout.pro | 4 ++-- examples/graphicsview/padnavigator/padnavigator.pro | 2 +- .../graphicsview/simpleanchorlayout/simpleanchorlayout.pro | 4 ++-- .../graphicsview/weatheranchorlayout/weatheranchorlayout.pro | 4 ++-- examples/ipc/localfortuneclient/localfortuneclient.pro | 4 ++-- examples/itemviews/addressbook/addressbook.pro | 2 +- examples/itemviews/chart/chart.pro | 2 +- examples/itemviews/combowidgetmapper/combowidgetmapper.pro | 4 ++-- examples/itemviews/fetchmore/fetchmore.pro | 4 ++-- examples/itemviews/frozencolumn/frozencolumn.pro | 4 ++-- examples/itemviews/puzzle/puzzle.pro | 2 +- examples/mainwindows/menus/menus.pro | 2 +- examples/network/bearermonitor/bearermonitor.pro | 4 ++-- examples/network/fortuneclient/fortuneclient.pro | 2 +- examples/network/fortuneserver/fortuneserver.pro | 2 +- examples/network/googlesuggest/googlesuggest.pro | 4 ++-- examples/network/network-chat/network-chat.pro | 2 +- examples/network/qftp/qftp.pro | 2 +- examples/opengl/cube/cube.pro | 4 ++-- examples/opengl/hellogl_es/hellogl_es.pro | 4 ++-- examples/opengl/hellogl_es2/hellogl_es2.pro | 4 ++-- examples/painting/basicdrawing/basicdrawing.pro | 2 +- examples/painting/concentriccircles/concentriccircles.pro | 2 +- examples/painting/imagecomposition/imagecomposition.pro | 2 +- examples/painting/painterpaths/painterpaths.pro | 2 +- examples/painting/transformations/transformations.pro | 2 +- examples/qtconcurrent/imagescaling/imagescaling.pro | 2 +- examples/qtestlib/tutorial1/tutorial1.pro | 2 +- examples/qtestlib/tutorial2/tutorial2.pro | 2 +- examples/qtestlib/tutorial3/tutorial3.pro | 2 +- examples/qtestlib/tutorial4/tutorial4.pro | 2 +- examples/qtestlib/tutorial5/tutorial5.pro | 2 +- examples/qws/dbscreen/dbscreen.pro | 4 ++-- examples/qws/framebuffer/framebuffer.pro | 4 ++-- examples/qws/mousecalibration/mousecalibration.pro | 4 ++-- examples/qws/simpledecoration/simpledecoration.pro | 4 ++-- examples/qws/svgalib/svgalib.pro | 4 ++-- examples/richtext/syntaxhighlighter/syntaxhighlighter.pro | 2 +- examples/sql/drilldown/drilldown.pro | 2 +- examples/sql/masterdetail/masterdetail.pro | 2 +- examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro | 4 ++-- examples/statemachine/eventtransitions/eventtransitions.pro | 4 ++-- examples/statemachine/factorial/factorial.pro | 4 ++-- examples/statemachine/pingpong/pingpong.pro | 4 ++-- examples/statemachine/rogue/rogue.pro | 4 ++-- examples/statemachine/trafficlight/trafficlight.pro | 4 ++-- examples/statemachine/twowaybutton/twowaybutton.pro | 4 ++-- examples/threads/queuedcustomtype/queuedcustomtype.pro | 4 ++-- examples/tools/contiguouscache/contiguouscache.pro | 4 ++-- examples/tools/customtype/customtype.pro | 4 ++-- examples/tools/customtypesending/customtypesending.pro | 4 ++-- .../tools/plugandpaintplugins/extrafilters/extrafilters.pro | 2 +- examples/tools/styleplugin/plugin/plugin.pro | 2 +- examples/touch/dials/dials.pro | 4 ++-- examples/touch/fingerpaint/fingerpaint.pro | 4 ++-- examples/touch/knobs/knobs.pro | 4 ++-- examples/touch/pinchzoom/pinchzoom.pro | 4 ++-- examples/tutorials/addressbook-fr/part1/part1.pro | 4 ++-- examples/tutorials/addressbook-fr/part2/part2.pro | 4 ++-- examples/tutorials/addressbook-fr/part3/part3.pro | 4 ++-- examples/tutorials/addressbook-fr/part4/part4.pro | 4 ++-- examples/tutorials/addressbook-fr/part5/part5.pro | 4 ++-- examples/tutorials/addressbook-fr/part6/part6.pro | 4 ++-- examples/tutorials/addressbook-fr/part7/part7.pro | 4 ++-- examples/tutorials/widgets/childwidget/childwidget.pro | 4 ++-- examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro | 4 ++-- examples/tutorials/widgets/toplevel/toplevel.pro | 4 ++-- examples/tutorials/widgets/windowlayout/windowlayout.pro | 4 ++-- examples/uitools/multipleinheritance/multipleinheritance.pro | 2 +- examples/widgets/analogclock/analogclock.pro | 2 +- examples/widgets/applicationicon/applicationicon.pro | 4 ++-- examples/widgets/calculator/calculator.pro | 2 +- examples/widgets/calendarwidget/calendarwidget.pro | 2 +- examples/widgets/codeeditor/codeeditor.pro | 4 ++-- examples/widgets/elidedlabel/elidedlabel.pro | 4 ++-- examples/widgets/icons/icons.pro | 2 +- examples/widgets/imageviewer/imageviewer.pro | 2 +- examples/widgets/lineedits/lineedits.pro | 2 +- examples/widgets/movie/movie.pro | 2 +- examples/widgets/orientation/orientation.pro | 4 ++-- examples/widgets/shapedclock/shapedclock.pro | 2 +- examples/widgets/softkeys/softkeys.pro | 2 +- examples/widgets/tetrix/tetrix.pro | 2 +- examples/widgets/wiggly/wiggly.pro | 2 +- examples/xml/dombookmarks/dombookmarks.pro | 4 ++-- examples/xml/saxbookmarks/saxbookmarks.pro | 2 +- 107 files changed, 159 insertions(+), 159 deletions(-) diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro index 3182c20a4f..1287d8b3d0 100644 --- a/examples/animation/animatedtiles/animatedtiles.pro +++ b/examples/animation/animatedtiles/animatedtiles.pro @@ -11,4 +11,4 @@ symbian { TARGET.UID3 = 0xA000D7D1 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro index 7b735d9d52..958b1710e3 100644 --- a/examples/animation/appchooser/appchooser.pro +++ b/examples/animation/appchooser/appchooser.pro @@ -11,4 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F5 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro index b49495ddd3..ee60e8fcc0 100644 --- a/examples/animation/moveblocks/moveblocks.pro +++ b/examples/animation/moveblocks/moveblocks.pro @@ -10,4 +10,4 @@ symbian { TARGET.UID3 = 0xA000E3F7 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro index 56b3c51299..24d6976334 100644 --- a/examples/animation/states/states.pro +++ b/examples/animation/states/states.pro @@ -11,4 +11,4 @@ symbian { TARGET.UID3 = 0xA000E3F8 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro index 206321dbc8..ba31265055 100644 --- a/examples/animation/stickman/stickman.pro +++ b/examples/animation/stickman/stickman.pro @@ -24,4 +24,4 @@ symbian { TARGET.UID3 = 0xA000E3F9 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro index 24544a9826..1a7e9fccf8 100644 --- a/examples/dialogs/configdialog/configdialog.pro +++ b/examples/dialogs/configdialog/configdialog.pro @@ -14,7 +14,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro index 015aa43dac..989e63734a 100644 --- a/examples/dialogs/sipdialog/sipdialog.pro +++ b/examples/dialogs/sipdialog/sipdialog.pro @@ -11,7 +11,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro index e8f63d0127..c9fb4a3a5e 100644 --- a/examples/dialogs/standarddialogs/standarddialogs.pro +++ b/examples/dialogs/standarddialogs/standarddialogs.pro @@ -11,4 +11,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro index 0486db9ca9..54c95a6bec 100644 --- a/examples/dialogs/tabdialog/tabdialog.pro +++ b/examples/dialogs/tabdialog/tabdialog.pro @@ -10,6 +10,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro index 691c270e81..36e14b5800 100644 --- a/examples/draganddrop/draggableicons/draggableicons.pro +++ b/examples/draganddrop/draggableicons/draggableicons.pro @@ -13,4 +13,4 @@ symbian { TARGET.UID3 = 0xA000C615 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro index 33885f906f..0bc3dd154b 100644 --- a/examples/draganddrop/draggabletext/draggabletext.pro +++ b/examples/draganddrop/draggabletext/draggabletext.pro @@ -15,5 +15,5 @@ symbian { TARGET.UID3 = 0xA000CF64 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro index 5fb7379dd1..9a34a5c29c 100644 --- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro +++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro @@ -16,4 +16,4 @@ symbian { CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro index 2682032e87..fa8ad81b2a 100644 --- a/examples/draganddrop/puzzle/puzzle.pro +++ b/examples/draganddrop/puzzle/puzzle.pro @@ -27,4 +27,4 @@ wince*: { addFile.path = . DEPLOYMENT += addFile } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/effects/blurpicker/blurpicker.pro b/examples/effects/blurpicker/blurpicker.pro index 2dfa8b70d0..913dd10306 100644 --- a/examples/effects/blurpicker/blurpicker.pro +++ b/examples/effects/blurpicker/blurpicker.pro @@ -8,5 +8,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blurpicker.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/blurpicker INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/effects/fademessage/fademessage.pro b/examples/effects/fademessage/fademessage.pro index b46ac0e9c9..78a4ac652f 100644 --- a/examples/effects/fademessage/fademessage.pro +++ b/examples/effects/fademessage/fademessage.pro @@ -12,7 +12,7 @@ sources.files = $$SOURCES \ fademessage.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/fademessage -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/effects/lighting/lighting.pro b/examples/effects/lighting/lighting.pro index e79a40714c..1dbb3ee289 100644 --- a/examples/effects/lighting/lighting.pro +++ b/examples/effects/lighting/lighting.pro @@ -7,6 +7,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lighting.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/lighting INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro index 4c334cfc3c..64810b0aeb 100644 --- a/examples/gestures/imagegestures/imagegestures.pro +++ b/examples/gestures/imagegestures/imagegestures.pro @@ -19,7 +19,7 @@ symbian { TARGET.UID3 = 0xA000D7D0 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example does not work on Maemo platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/graphicsview/anchorlayout/anchorlayout.pro b/examples/graphicsview/anchorlayout/anchorlayout.pro index eb83890f34..b4a75653e0 100644 --- a/examples/graphicsview/anchorlayout/anchorlayout.pro +++ b/examples/graphicsview/anchorlayout/anchorlayout.pro @@ -8,7 +8,7 @@ INSTALLS += target sources TARGET = anchorlayout -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro index 7d0ed4a8cc..32c94ca8c9 100644 --- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro +++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro @@ -15,5 +15,5 @@ symbian { TARGET.UID3 = 0xA000A645 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro index ea2b0d7cdf..05971c5f6d 100644 --- a/examples/graphicsview/collidingmice/collidingmice.pro +++ b/examples/graphicsview/collidingmice/collidingmice.pro @@ -17,5 +17,5 @@ symbian { TARGET.UID3 = 0xA000A643 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro index 7a58dd162b..965d824c7f 100644 --- a/examples/graphicsview/elasticnodes/elasticnodes.pro +++ b/examples/graphicsview/elasticnodes/elasticnodes.pro @@ -21,6 +21,6 @@ symbian { TARGET.UID3 = 0xA000A642 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/flowlayout/flowlayout.pro b/examples/graphicsview/flowlayout/flowlayout.pro index 8a97d2dc79..5a79a9bae9 100644 --- a/examples/graphicsview/flowlayout/flowlayout.pro +++ b/examples/graphicsview/flowlayout/flowlayout.pro @@ -8,6 +8,6 @@ QMAKE_PROJECT_NAME = flowlayout_graphicsview HEADERS += flowlayout.h window.h SOURCES += flowlayout.cpp main.cpp window.cpp -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro index a51571f705..5c05e48221 100644 --- a/examples/graphicsview/padnavigator/padnavigator.pro +++ b/examples/graphicsview/padnavigator/padnavigator.pro @@ -30,6 +30,6 @@ symbian { TARGET.UID3 = 0xA000A644 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro index 6ba525e26c..26f4c82ff3 100644 --- a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro +++ b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro @@ -8,6 +8,6 @@ INSTALLS += target sources TARGET = simpleanchorlayout -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro index f07b7dfca8..81138c4a1b 100644 --- a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro +++ b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro @@ -12,6 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES weatheranchorlayout.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/weatheranchorlayout INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro index ea1d595cda..295c942400 100644 --- a/examples/ipc/localfortuneclient/localfortuneclient.pro +++ b/examples/ipc/localfortuneclient/localfortuneclient.pro @@ -12,6 +12,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example maemo5: CONFIG += qt_example -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro index 855d4b18af..4f182c25aa 100644 --- a/examples/itemviews/addressbook/addressbook.pro +++ b/examples/itemviews/addressbook/addressbook.pro @@ -20,5 +20,5 @@ symbian { TARGET.UID3 = 0xA000A646 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro index 6716f909d1..75dd621a0d 100644 --- a/examples/itemviews/chart/chart.pro +++ b/examples/itemviews/chart/chart.pro @@ -18,5 +18,5 @@ symbian { TARGET.UID3 = 0xA000A647 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro index d02773af9d..0f64715ba8 100644 --- a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro +++ b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro @@ -8,5 +8,5 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/combowidgetmapper INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/fetchmore/fetchmore.pro b/examples/itemviews/fetchmore/fetchmore.pro index b7267e48b2..c9f3fe3746 100644 --- a/examples/itemviews/fetchmore/fetchmore.pro +++ b/examples/itemviews/fetchmore/fetchmore.pro @@ -10,5 +10,5 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/fetchmore INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/frozencolumn/frozencolumn.pro b/examples/itemviews/frozencolumn/frozencolumn.pro index faef47efe1..f16489b7aa 100644 --- a/examples/itemviews/frozencolumn/frozencolumn.pro +++ b/examples/itemviews/frozencolumn/frozencolumn.pro @@ -8,5 +8,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/frozencolumn INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro index 08e7efb65f..c867a50750 100644 --- a/examples/itemviews/puzzle/puzzle.pro +++ b/examples/itemviews/puzzle/puzzle.pro @@ -19,5 +19,5 @@ wince* { DEPLOYMENT_PLUGIN += qjpeg qgif qtiff } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro index 4131d92f92..f64157b5cd 100644 --- a/examples/mainwindows/menus/menus.pro +++ b/examples/mainwindows/menus/menus.pro @@ -12,6 +12,6 @@ symbian { TARGET.UID3 = 0xA000CF66 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro index a91f064f3e..d87bedb330 100644 --- a/examples/network/bearermonitor/bearermonitor.pro +++ b/examples/network/bearermonitor/bearermonitor.pro @@ -25,9 +25,9 @@ CONFIG += console symbian: { TARGET.CAPABILITY = NetworkServices ReadUserData - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index 2737f9862a..b8bb2b9b70 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -14,7 +14,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index 1d84c49593..09dc9773ae 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -15,7 +15,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro index 9b8fa9423d..0f887318a3 100644 --- a/examples/network/googlesuggest/googlesuggest.pro +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index ca4e8beaa6..d34da98822 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -24,7 +24,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro index 5775f0172a..d3f017af52 100644 --- a/examples/network/qftp/qftp.pro +++ b/examples/network/qftp/qftp.pro @@ -16,7 +16,7 @@ symbian { INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData" } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro index 64f6973c00..a11aaf6bc7 100644 --- a/examples/opengl/cube/cube.pro +++ b/examples/opengl/cube/cube.pro @@ -33,8 +33,8 @@ contains(QT_CONFIG, opengl) { message(OpenGL support is not available.) } -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro index d0e953110b..c25ab30235 100644 --- a/examples/opengl/hellogl_es/hellogl_es.pro +++ b/examples/opengl/hellogl_es/hellogl_es.pro @@ -25,8 +25,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example does not work on Maemo platform) diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro index 3714ae0797..4061a0f678 100644 --- a/examples/opengl/hellogl_es2/hellogl_es2.pro +++ b/examples/opengl/hellogl_es2/hellogl_es2.pro @@ -25,13 +25,13 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: CONFIG += qt_example maemo5 { # Debian package name may not contain numbers or special characters # such as '_', lets change this in Maemo. TARGET = helloglestwo - include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + CONFIG += qt_example } symbian: warning(This example might not fully work on Symbian platform) diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro index 41642e8f35..110bf352b2 100644 --- a/examples/painting/basicdrawing/basicdrawing.pro +++ b/examples/painting/basicdrawing/basicdrawing.pro @@ -15,6 +15,6 @@ symbian { TARGET.UID3 = 0xA000A649 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro index 731edc61ae..f4b1979ba9 100644 --- a/examples/painting/concentriccircles/concentriccircles.pro +++ b/examples/painting/concentriccircles/concentriccircles.pro @@ -14,5 +14,5 @@ symbian { TARGET.UID3 = 0xA000A64A CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro index a763108306..c1bc7d4454 100644 --- a/examples/painting/imagecomposition/imagecomposition.pro +++ b/examples/painting/imagecomposition/imagecomposition.pro @@ -13,5 +13,5 @@ symbian { TARGET.UID3 = 0xA000A64B CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro index 2a7d224716..b4233ccafc 100644 --- a/examples/painting/painterpaths/painterpaths.pro +++ b/examples/painting/painterpaths/painterpaths.pro @@ -15,5 +15,5 @@ symbian { TARGET.UID3 = 0xA000A64C CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro index 0107046374..d9b0215c66 100644 --- a/examples/painting/transformations/transformations.pro +++ b/examples/painting/transformations/transformations.pro @@ -14,7 +14,7 @@ symbian { TARGET.UID3 = 0xA000A64D CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro index cb87d718f5..ba1cc04d4f 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.pro +++ b/examples/qtconcurrent/imagescaling/imagescaling.pro @@ -15,6 +15,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro index 6da372bcbb..54817c0562 100644 --- a/examples/qtestlib/tutorial1/tutorial1.pro +++ b/examples/qtestlib/tutorial1/tutorial1.pro @@ -11,7 +11,7 @@ symbian { TARGET.UID3 = 0xA000C60B CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro index 06cf30fae9..3bb540db8f 100644 --- a/examples/qtestlib/tutorial2/tutorial2.pro +++ b/examples/qtestlib/tutorial2/tutorial2.pro @@ -11,7 +11,7 @@ symbian { TARGET.UID3 = 0xA000C60C CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro index ff39bd40bd..2997767543 100644 --- a/examples/qtestlib/tutorial3/tutorial3.pro +++ b/examples/qtestlib/tutorial3/tutorial3.pro @@ -11,7 +11,7 @@ symbian { TARGET.UID3 = 0xA000C60D CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro index ae84726b83..9a804369b5 100644 --- a/examples/qtestlib/tutorial4/tutorial4.pro +++ b/examples/qtestlib/tutorial4/tutorial4.pro @@ -11,7 +11,7 @@ symbian { TARGET.UID3 = 0xA000C60E CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro index 085dfd8b67..92b4d683a4 100644 --- a/examples/qtestlib/tutorial5/tutorial5.pro +++ b/examples/qtestlib/tutorial5/tutorial5.pro @@ -11,7 +11,7 @@ symbian { TARGET.UID3 = 0xA000C60F CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro index faa05260ad..61fab76a7b 100644 --- a/examples/qws/dbscreen/dbscreen.pro +++ b/examples/qws/dbscreen/dbscreen.pro @@ -9,7 +9,7 @@ HEADERS = dbscreen.h SOURCES = dbscreendriverplugin.cpp \ dbscreen.cpp -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro index 65dc715338..2dd2c67db7 100644 --- a/examples/qws/framebuffer/framebuffer.pro +++ b/examples/qws/framebuffer/framebuffer.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/framebuffer INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro index d58f9fdd28..e8f1b6243a 100644 --- a/examples/qws/mousecalibration/mousecalibration.pro +++ b/examples/qws/mousecalibration/mousecalibration.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/mousecalibration INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/simpledecoration/simpledecoration.pro b/examples/qws/simpledecoration/simpledecoration.pro index c452e1e21a..92f41561f7 100644 --- a/examples/qws/simpledecoration/simpledecoration.pro +++ b/examples/qws/simpledecoration/simpledecoration.pro @@ -11,8 +11,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/simpledecoration INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro index 8bc53950d5..fde16666eb 100644 --- a/examples/qws/svgalib/svgalib.pro +++ b/examples/qws/svgalib/svgalib.pro @@ -17,8 +17,8 @@ SOURCES = svgalibscreen.cpp \ svgalibpaintdevice.cpp \ svgalibplugin.cpp -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro index 93305ee426..c3de7c8baf 100644 --- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro +++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro @@ -17,5 +17,5 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro index 460d4e7243..272336eb75 100644 --- a/examples/sql/drilldown/drilldown.pro +++ b/examples/sql/drilldown/drilldown.pro @@ -19,6 +19,6 @@ symbian { TARGET.UID3 = 0xA000C612 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro index 68485f7a59..3f00d750a3 100644 --- a/examples/sql/masterdetail/masterdetail.pro +++ b/examples/sql/masterdetail/masterdetail.pro @@ -19,7 +19,7 @@ symbian { TARGET.UID3 = 0xA000D7CF CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro index 65b058e5b2..a0615bea97 100644 --- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro +++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro @@ -11,6 +11,6 @@ INSTALLS += target sources wince*: DEPLOYMENT_PLUGIN += qsqlite -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro index 8b77bb25a1..21b2655dd6 100644 --- a/examples/statemachine/eventtransitions/eventtransitions.pro +++ b/examples/statemachine/eventtransitions/eventtransitions.pro @@ -6,7 +6,7 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS eventtransitions.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro index 012e175e3b..6fbfd8e598 100644 --- a/examples/statemachine/factorial/factorial.pro +++ b/examples/statemachine/factorial/factorial.pro @@ -10,7 +10,7 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro index 9ee782c1de..e15f593d84 100644 --- a/examples/statemachine/pingpong/pingpong.pro +++ b/examples/statemachine/pingpong/pingpong.pro @@ -10,7 +10,7 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro index c4fcfe9cfe..3596f173ed 100644 --- a/examples/statemachine/rogue/rogue.pro +++ b/examples/statemachine/rogue/rogue.pro @@ -9,6 +9,6 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/rogue INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro index 4b77bcb8e9..6ac90991ea 100644 --- a/examples/statemachine/trafficlight/trafficlight.pro +++ b/examples/statemachine/trafficlight/trafficlight.pro @@ -6,6 +6,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS trafficlight.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro index d9d8941750..7dd560a743 100644 --- a/examples/statemachine/twowaybutton/twowaybutton.pro +++ b/examples/statemachine/twowaybutton/twowaybutton.pro @@ -6,6 +6,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS twowaybutton.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.pro b/examples/threads/queuedcustomtype/queuedcustomtype.pro index 9c9357892e..3b1097b177 100644 --- a/examples/threads/queuedcustomtype/queuedcustomtype.pro +++ b/examples/threads/queuedcustomtype/queuedcustomtype.pro @@ -12,6 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/contiguouscache/contiguouscache.pro b/examples/tools/contiguouscache/contiguouscache.pro index 0cf58ea5fe..1787582a3c 100644 --- a/examples/tools/contiguouscache/contiguouscache.pro +++ b/examples/tools/contiguouscache/contiguouscache.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS contiguouscache.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/contiguouscache INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/customtype/customtype.pro b/examples/tools/customtype/customtype.pro index 0871151237..6ea320f9c3 100644 --- a/examples/tools/customtype/customtype.pro +++ b/examples/tools/customtype/customtype.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro reso sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/customtypesending/customtypesending.pro b/examples/tools/customtypesending/customtypesending.pro index 0ad9aaaea8..6bf7d6e74e 100644 --- a/examples/tools/customtypesending/customtypesending.pro +++ b/examples/tools/customtypesending/customtypesending.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro reso sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro index cc66b57ec7..88bf7b1aa3 100644 --- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro +++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro @@ -17,4 +17,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro index 2484ee64ef..cdcac47591 100644 --- a/examples/tools/styleplugin/plugin/plugin.pro +++ b/examples/tools/styleplugin/plugin/plugin.pro @@ -23,4 +23,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro index 31f0bf4c3f..30377c76f1 100644 --- a/examples/touch/dials/dials.pro +++ b/examples/touch/dials/dials.pro @@ -7,8 +7,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dials.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/dials INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro index 550fc53758..2b0d9c5ac1 100644 --- a/examples/touch/fingerpaint/fingerpaint.pro +++ b/examples/touch/fingerpaint/fingerpaint.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fingerpaint.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/fingerpaint INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro index a28345d91a..f53a9d2a1b 100644 --- a/examples/touch/knobs/knobs.pro +++ b/examples/touch/knobs/knobs.pro @@ -7,8 +7,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS knobs.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/knobs INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro index f7fd695d0f..e038456aa7 100644 --- a/examples/touch/pinchzoom/pinchzoom.pro +++ b/examples/touch/pinchzoom/pinchzoom.pro @@ -15,8 +15,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pinchzoom.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/pinchzoom INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part1/part1.pro b/examples/tutorials/addressbook-fr/part1/part1.pro index d762870a2b..1b1bd7b0f4 100644 --- a/examples/tutorials/addressbook-fr/part1/part1.pro +++ b/examples/tutorials/addressbook-fr/part1/part1.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part1 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part2/part2.pro b/examples/tutorials/addressbook-fr/part2/part2.pro index 7ffe1db5d9..204cc2db58 100644 --- a/examples/tutorials/addressbook-fr/part2/part2.pro +++ b/examples/tutorials/addressbook-fr/part2/part2.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part2 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part3/part3.pro b/examples/tutorials/addressbook-fr/part3/part3.pro index 713afdae59..10193b8b30 100644 --- a/examples/tutorials/addressbook-fr/part3/part3.pro +++ b/examples/tutorials/addressbook-fr/part3/part3.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part3.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part3 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part4/part4.pro b/examples/tutorials/addressbook-fr/part4/part4.pro index 1bfc4dc583..82765821c6 100644 --- a/examples/tutorials/addressbook-fr/part4/part4.pro +++ b/examples/tutorials/addressbook-fr/part4/part4.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part4.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part4 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part5/part5.pro b/examples/tutorials/addressbook-fr/part5/part5.pro index 08a5f7db12..efb36fa907 100644 --- a/examples/tutorials/addressbook-fr/part5/part5.pro +++ b/examples/tutorials/addressbook-fr/part5/part5.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part5.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part5 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part6/part6.pro b/examples/tutorials/addressbook-fr/part6/part6.pro index 3bf1987d6f..4ece4d7280 100644 --- a/examples/tutorials/addressbook-fr/part6/part6.pro +++ b/examples/tutorials/addressbook-fr/part6/part6.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part6.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part6 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part7/part7.pro b/examples/tutorials/addressbook-fr/part7/part7.pro index 337b598f75..9ba980755b 100644 --- a/examples/tutorials/addressbook-fr/part7/part7.pro +++ b/examples/tutorials/addressbook-fr/part7/part7.pro @@ -10,8 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part7.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part7 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/childwidget/childwidget.pro b/examples/tutorials/widgets/childwidget/childwidget.pro index 2251d1b131..d1260c74d2 100644 --- a/examples/tutorials/widgets/childwidget/childwidget.pro +++ b/examples/tutorials/widgets/childwidget/childwidget.pro @@ -6,8 +6,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS childwidget.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/childwidget INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro index 0dd6bf1e42..32af4551d5 100644 --- a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro +++ b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro @@ -6,8 +6,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS nestedlayouts.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/nestedlayouts INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/toplevel/toplevel.pro b/examples/tutorials/widgets/toplevel/toplevel.pro index 629bdefe32..d4ea441cc9 100644 --- a/examples/tutorials/widgets/toplevel/toplevel.pro +++ b/examples/tutorials/widgets/toplevel/toplevel.pro @@ -6,8 +6,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS toplevel.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/toplevel INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/windowlayout/windowlayout.pro b/examples/tutorials/widgets/windowlayout/windowlayout.pro index 1878433b8d..b80f394092 100644 --- a/examples/tutorials/widgets/windowlayout/windowlayout.pro +++ b/examples/tutorials/widgets/windowlayout/windowlayout.pro @@ -6,8 +6,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowlayout.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/windowlayout INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro index 3debb7bd60..4be470bf5f 100644 --- a/examples/uitools/multipleinheritance/multipleinheritance.pro +++ b/examples/uitools/multipleinheritance/multipleinheritance.pro @@ -14,5 +14,5 @@ symbian { TARGET.UID3 = 0xA000D7C1 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro index c9545c897e..3ba9de8a1f 100644 --- a/examples/widgets/analogclock/analogclock.pro +++ b/examples/widgets/analogclock/analogclock.pro @@ -12,5 +12,5 @@ symbian { TARGET.UID3 = 0xA000A64F CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/applicationicon/applicationicon.pro b/examples/widgets/applicationicon/applicationicon.pro index f9ab55d82b..17cc8b6400 100644 --- a/examples/widgets/applicationicon/applicationicon.pro +++ b/examples/widgets/applicationicon/applicationicon.pro @@ -11,7 +11,7 @@ OTHER_FILES += applicationicon.svg \ applicationicon.desktop symbian { - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example # override icon ICON = applicationicon.svg TARGET.UID3 = 0xe9f919ee @@ -20,7 +20,7 @@ symbian { } maemo5 { - include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + CONFIG += qt_example # override icon from maemo5pkgrules.pri icon.files = $${TARGET}.png diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro index 4c10e845f3..a23c757aab 100644 --- a/examples/widgets/calculator/calculator.pro +++ b/examples/widgets/calculator/calculator.pro @@ -14,5 +14,5 @@ symbian { TARGET.UID3 = 0xA000C602 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro index e0845fe0f2..6a5b862d2d 100644 --- a/examples/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/calendarwidget/calendarwidget.pro @@ -12,7 +12,7 @@ symbian { TARGET.UID3 = 0xA000C603 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/codeeditor/codeeditor.pro b/examples/widgets/codeeditor/codeeditor.pro index 8fffb279af..05f758a737 100644 --- a/examples/widgets/codeeditor/codeeditor.pro +++ b/examples/widgets/codeeditor/codeeditor.pro @@ -7,8 +7,8 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/codeeditor INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/elidedlabel/elidedlabel.pro b/examples/widgets/elidedlabel/elidedlabel.pro index 072cd2fb14..5b3be58398 100644 --- a/examples/widgets/elidedlabel/elidedlabel.pro +++ b/examples/widgets/elidedlabel/elidedlabel.pro @@ -21,10 +21,10 @@ symbian { TARGET.UID3 = 0xE2728354 # randomly generated TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x800000 - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index 71c73d6fc3..7c0163d36d 100644 --- a/examples/widgets/icons/icons.pro +++ b/examples/widgets/icons/icons.pro @@ -25,7 +25,7 @@ wince*: { } DEPLOYMENT += imageFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro index 63dd4f0f11..df9d1fedbb 100644 --- a/examples/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/imageviewer/imageviewer.pro @@ -16,7 +16,7 @@ symbian: TARGET = imageviewerexample wince*: { DEPLOYMENT_PLUGIN += qjpeg qmng qgif } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro index d463c506ac..146a2abfc7 100644 --- a/examples/widgets/lineedits/lineedits.pro +++ b/examples/widgets/lineedits/lineedits.pro @@ -12,7 +12,7 @@ symbian { TARGET.UID3 = 0xA000C604 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index 874fb773b4..468c82fb69 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -17,7 +17,7 @@ wince*: { DEPLOYMENT_PLUGIN += qmng } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/orientation/orientation.pro b/examples/widgets/orientation/orientation.pro index c146322635..af1ea8d770 100644 --- a/examples/widgets/orientation/orientation.pro +++ b/examples/widgets/orientation/orientation.pro @@ -22,8 +22,8 @@ FORMS += \ RESOURCES += \ images.qrc -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro index e8dc9c9c51..b49dc95759 100644 --- a/examples/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/shapedclock/shapedclock.pro @@ -12,7 +12,7 @@ symbian { TARGET.UID3 = 0xA000C605 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro index ed4d5b5aaa..4bbbc0477f 100644 --- a/examples/widgets/softkeys/softkeys.pro +++ b/examples/widgets/softkeys/softkeys.pro @@ -13,5 +13,5 @@ symbian { TARGET.UID3 = 0xA000CF6B CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro index 5b95691ca6..559689f2f4 100644 --- a/examples/widgets/tetrix/tetrix.pro +++ b/examples/widgets/tetrix/tetrix.pro @@ -16,5 +16,5 @@ symbian { TARGET.UID3 = 0xA000C606 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro index 411e0d32d2..5e885dd1eb 100644 --- a/examples/widgets/wiggly/wiggly.pro +++ b/examples/widgets/wiggly/wiggly.pro @@ -14,5 +14,5 @@ symbian { TARGET.UID3 = 0xA000C607 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index 3d38ca3f47..07a8f82252 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -14,7 +14,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian: { - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example addFiles.sources = frank.xbel jennifer.xbel addFiles.path = files DEPLOYMENT += addFiles @@ -25,5 +25,5 @@ wince*: { addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro index f03fae8ed4..600b66bca0 100644 --- a/examples/xml/saxbookmarks/saxbookmarks.pro +++ b/examples/xml/saxbookmarks/saxbookmarks.pro @@ -26,5 +26,5 @@ symbian: { addFiles.path = /data/qt/saxbookmarks DEPLOYMENT += addFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example From d9e3d1a54081ec15b6d1513dd2815205a869f942 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Sat, 4 Jun 2011 17:47:13 +0200 Subject: [PATCH 23/34] Fix compile when configure with no fontconfig support Task-number: QTBUG-19716 Reviewed-by: Eskil (cherry picked from commit 5a598afa3f1928e9ad18257e2fa48fe3d5739917) Change-Id: I05107970e3273fce48303c9956e1c9aa928832b9 Reviewed-on: http://codereview.qt.nokia.com/376 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qrawfont_ft.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp index e8c10a5748..db60459176 100644 --- a/src/gui/text/qrawfont_ft.cpp +++ b/src/gui/text/qrawfont_ft.cpp @@ -46,7 +46,7 @@ #include "qrawfont_p.h" #include "qfontengine_ft_p.h" -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) # include "qfontengine_x11_p.h" #endif @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QFontEngineFTRawFont -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) : public QFontEngineX11FT #else : public QFontEngineFT @@ -63,7 +63,7 @@ class QFontEngineFTRawFont { public: QFontEngineFTRawFont(const QFontDef &fontDef) -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) : QFontEngineX11FT(fontDef) #else : QFontEngineFT(fontDef) From c2dddd8322d5eaa4da8321e62d9be09d205d2141 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Sat, 4 Jun 2011 15:53:49 +0200 Subject: [PATCH 24/34] Fix warning in qtextengine compilation enableHarfbuzz() should only be defined on Mac. Reviewed-by: Eskil (cherry picked from commit 5ce3fbb67b79c3732fd47b296ef9421398ca520c) Change-Id: I9ecb5db49478c3f5beb5d41cf99320f0faedce2e Reviewed-on: http://codereview.qt.nokia.com/375 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index ad4f6d3fc6..e8e6c98eab 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -856,7 +856,7 @@ void QTextEngine::shapeLine(const QScriptLine &line) } } -#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) +#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) && defined(Q_WS_MAC) static bool enableHarfBuzz() { static enum { Yes, No, Unknown } status = Unknown; From 3fb67767fc7056d8832f9ff3c49caa10f3453036 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 8 Jun 2011 10:11:10 +0200 Subject: [PATCH 25/34] Reorder member varibles in QGlyphRunPrivate to eliminate warning Reviewed-by: Eskil (cherry picked from commit 74a1135341783449970d579b273d00c837ac14b0) Change-Id: I8e1c6bdc7f0957d8f389531f5f5682c536cdc286 Reviewed-on: http://codereview.qt.nokia.com/374 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qglyphrun_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h index 1cb63b2403..a7745e68ce 100644 --- a/src/gui/text/qglyphrun_p.h +++ b/src/gui/text/qglyphrun_p.h @@ -97,6 +97,10 @@ public: QVector glyphPositions; QRawFont rawFont; + uint overline : 1; + uint underline : 1; + uint strikeOut : 1; + const quint32 *glyphIndexData; int glyphIndexDataSize; @@ -107,10 +111,6 @@ public: { return glyphRun.d.data(); } - - uint overline : 1; - uint underline : 1; - uint strikeOut : 1; }; QT_END_NAMESPACE From 8fe0427cb8a684f16e37a37684b7ddfd803d5ab2 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 8 Jun 2011 06:15:01 -0500 Subject: [PATCH 26/34] Fix typo from 1835afe6 Change-Id: I99e4407bbcb82cb27057ada838d73b6582867937 Reviewed-on: http://codereview.qt.nokia.com/379 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- mkspecs/features/qt_module_config.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 024b4fbce0..55c578fb8d 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -9,7 +9,7 @@ INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat !isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR -isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCHa #another compat that will rot for change #215700 +isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { VERSION=5.0.0 From 2e2ad7ec7fa262826bd2c75f63e506f54ddd5252 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 8 Jun 2011 12:01:24 -0500 Subject: [PATCH 27/34] Complain if we don't load(qt_module) first Not having load(qt_module) first in a .pro file which later does a load(qt_module_config) will likely overwrite compiler/linker options in the .pro file. This can be hard to figure out, and wasn't required before when we used a global .qmake.cache for all modules, since it 'preloaded' qmodule.pri file for all .pro files. Change-Id: I8a9aa3247f938be0b3b13f8c8cc96c18a142ba7b Reviewed-on: http://codereview.qt.nokia.com/412 Reviewed-by: Qt Sanity Bot Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_module.prf | 13 ++++++++++--- mkspecs/features/qt_module_config.prf | 10 +++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index c49a41581f..aee95295e8 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -11,11 +11,18 @@ isEmpty(QMAKE_QT_MODULE)|!exists($$QMAKE_QT_MODULE) { !exists($$QMAKE_QT_MODULE):exists($$[QT_INSTALL_DATA]/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$[QT_INSTALL_DATA]/mkspecs/qmodule.pri } -!exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { - error("Cannot load qmodule.pri!") +!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) { + !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { + error("Cannot load qmodule.pri!") + } else { + QMAKE_QT_MODULE_PRI_LOADED = 1 + debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") + } } else { - debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") + QMAKE_QT_MODULE_PRI_LOADED = 1 # covers 'preloading' from .qmake.cache + debug(1, "Not loading qmodule.pri twice") } + mac { !isEmpty(QMAKE_RPATHDIR){ CONFIG += absolute_library_soname diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 55c578fb8d..8f225fe6ed 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -1,4 +1,12 @@ -load(qt_module) +!no_qt_module_warning:if(!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\\\.pri)|isEmpty(QMAKE_QT_MODULE_PRI_LOADED)) { + QMAKE_ACTUAL_PRO_FILE = $$basename(_PRO_FILE_) + isEmpty(QMAKE_ACTUAL_PRO_FILE): QMAKE_ACTUAL_PRO_FILE=.pro + warning("You should probably load(qt_module) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as it also load()s qt_module_config.") + message("Not doing so may lead to qt_module_config.prf overriding compiler/linker options in your .pro file.") + message("Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.") + unset(QMAKE_ACTUAL_PRO_FILE) +} +load(qt_module) # loads qmodule.pri if hasn't been loaded already isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") From 15d6f1f0315602f5b637353cb67f52636ce1deee Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 8 Jun 2011 12:47:56 -0500 Subject: [PATCH 28/34] Fix modules to load(qt_module) first Change-Id: Iabdfffff09088243863a8661add73298ed8baaf3 Reviewed-on: http://codereview.qt.nokia.com/413 Reviewed-by: Qt Sanity Bot Reviewed-by: Oswald Buddenhagen --- src/corelib/corelib.pro | 2 ++ src/dbus/dbus.pro | 2 ++ src/gui/gui.pro | 2 ++ src/network/network.pro | 2 ++ src/opengl/opengl.pro | 2 ++ src/sql/sql.pro | 2 ++ src/testlib/testlib.pro | 2 ++ src/xml/xml.pro | 2 ++ 8 files changed, 16 insertions(+) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 4862263f0c..2388f53a9e 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtCore QPRO_PWD = $$PWD QT = diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 4c631aebdc..12efd8638b 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtDBus QPRO_PWD = $$PWD QT = core-private \ diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 7412978da8..58e1d6c45f 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtGui QPRO_PWD = $$PWD QT = core-private diff --git a/src/network/network.pro b/src/network/network.pro index e3e576a7a1..cfd3f95300 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -1,3 +1,5 @@ +load(qt_module) + # Qt network module TARGET = QtNetwork QPRO_PWD = $$PWD diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 079f93d3de..16a4ce00e9 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtOpenGL QPRO_PWD = $$PWD QT = core-private gui-private diff --git a/src/sql/sql.pro b/src/sql/sql.pro index 74f6cd2cb6..445946e07c 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtSql QPRO_PWD = $$PWD QT = core-private diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 0706a5b510..aa416699f0 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtTest QPRO_PWD = $$PWD QT = core diff --git a/src/xml/xml.pro b/src/xml/xml.pro index 361b948176..f1d2baca50 100644 --- a/src/xml/xml.pro +++ b/src/xml/xml.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtXml QPRO_PWD = $$PWD QT = core-private From 94c173de057bcf57a5105810d8ee34d2093fe805 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Fri, 20 May 2011 14:16:33 +0200 Subject: [PATCH 29/34] Add tilde (both ~ and ~) expansion to QFileDialog on UNIX. Task-number: QTBUG-3265 Change-Id: Id8062afe69e798e1f9cf3f4e967ae0d30c362b72 Reviewed-on: http://codereview.qt.nokia.com/411 Reviewed-by: Pierre Rossi --- src/gui/dialogs/qfiledialog.cpp | 77 ++++++++++++++++++++-- tests/auto/qfiledialog/tst_qfiledialog.cpp | 39 +++++++++++ 2 files changed, 112 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index c22af651cf..2e57a845c2 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -66,6 +66,9 @@ #if defined(Q_OS_WINCE) extern bool qt_priv_ptr_valid; #endif +#if defined(Q_OS_UNIX) +#include +#endif #endif QT_BEGIN_NAMESPACE @@ -858,23 +861,78 @@ void QFileDialog::selectFile(const QString &filename) d->lineEdit()->setText(file); } +#ifdef Q_OS_UNIX +Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0) +{ + if (expanded != 0) + *expanded = false; + if (!path.startsWith(QLatin1Char('~'))) + return path; + QString ret = path; + QStringList tokens = ret.split(QDir::separator()); + if (tokens.first() == QLatin1String("~")) { + ret.replace(0, 1, QDir::homeDirPath()); + } else { + QString userName = tokens.first(); + userName.remove(0, 1); +#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) + passwd pw; + passwd *tmpPw; + char buf[200]; + const int bufSize = sizeof(buf); + int err = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize, &tmpPw); + if (err || !tmpPw) + return ret; + const QString homePath = QString::fromLocal8Bit(pw.pw_dir); +#else + passwd *pw = getpwnam(userName.toLocal8Bit().constData()); + if (!pw) + return ret; + const QString homePath = QString::fromLocal8Bit(pw->pw_dir); +#endif + ret.replace(0, tokens.first().length(), homePath); + } + if (expanded != 0) + *expanded = true; + return ret; +} +#endif + /** Returns the text in the line edit which can be one or more file names */ QStringList QFileDialogPrivate::typedFiles() const { + Q_Q(const QFileDialog); QStringList files; QString editText = lineEdit()->text(); - if (!editText.contains(QLatin1Char('"'))) + if (!editText.contains(QLatin1Char('"'))) { +#ifdef Q_OS_UNIX + const QString prefix = q->directory().absolutePath() + QDir::separator(); + if (QFile::exists(prefix + editText)) + files << editText; + else + files << qt_tildeExpansion(editText); +#else files << editText; - else { +#endif + } else { // " is used to separate files like so: "file1" "file2" "file3" ... // ### need escape character for filenames with quotes (") QStringList tokens = editText.split(QLatin1Char('\"')); for (int i=0; idirectory().absolutePath() + QDir::separator(); + if (QFile::exists(prefix + token)) + files << token; + else + files << qt_tildeExpansion(token); +#else files << toInternal(tokens.at(i)); +#endif } } return addDefaultSuffixToFiles(files); @@ -3338,6 +3396,17 @@ QStringList QFSCompleter::splitPath(const QString &path) const pathCopy = pathCopy.mid(2); else doubleSlash.clear(); +#elif defined(Q_OS_UNIX) + bool expanded; + pathCopy = qt_tildeExpansion(pathCopy, &expanded); + if (expanded) { + QFileSystemModel *dirModel; + if (proxyModel) + dirModel = qobject_cast(proxyModel->sourceModel()); + else + dirModel = sourceModel; + dirModel->fetchMore(dirModel->index(pathCopy)); + } #endif QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']')); @@ -3354,14 +3423,14 @@ QStringList QFSCompleter::splitPath(const QString &path) const parts.append(QString()); #else QStringList parts = pathCopy.split(re); - if (path[0] == sep[0]) // read the "/" at the beginning as the split removed it + if (pathCopy[0] == sep[0]) // read the "/" at the beginning as the split removed it parts[0] = sep[0]; #endif #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); #else - bool startsFromRoot = path[0] == sep[0]; + bool startsFromRoot = pathCopy[0] == sep[0]; #endif if (parts.count() == 1 || (parts.count() > 1 && !startsFromRoot)) { const QFileSystemModel *dirModel; diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index bc076c5b2b..08d2e88f3c 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -78,6 +78,10 @@ # define STRINGIFY(x) #x # define TOSTRING(x) STRINGIFY(x) # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" +#elif defined(Q_OS_UNIX) +#ifdef QT_BUILD_INTERNAL +extern Q_GUI_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0); +#endif #endif class QNonNativeFileDialog : public QFileDialog @@ -144,6 +148,10 @@ private slots: void clearLineEdit(); void enableChooseButton(); void hooks(); +#ifdef Q_OS_UNIX + void tildeExpansion_data(); + void tildeExpansion(); +#endif private: QByteArray userSettings; @@ -1323,5 +1331,36 @@ void tst_QFiledialog::hooks() QCOMPARE(QFileDialog::getSaveFileName(), QString("saveName")); } +#ifdef Q_OS_UNIX +void tst_QFiledialog::tildeExpansion_data() +{ + QTest::addColumn("tildePath"); + QTest::addColumn("expandedPath"); + + QTest::newRow("empty path") << QString() << QString(); + QTest::newRow("~") << QString::fromLatin1("~") << QDir::homePath(); + QTest::newRow("~/some/sub/dir/") << QString::fromLatin1("~/some/sub/dir") << QDir::homePath() + + QString::fromLatin1("/some/sub/dir"); + QString userHome = QString(qgetenv("USER")); + userHome.prepend('~'); + QTest::newRow("current user (~ syntax)") << userHome << QDir::homePath(); + QString invalid = QString::fromLatin1("~thisIsNotAValidUserName"); + QTest::newRow("invalid user name") << invalid << invalid; +} + + +void tst_QFiledialog::tildeExpansion() +{ +#ifndef QT_BUILD_INTERNAL + QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll); +#else + QFETCH(QString, tildePath); + QFETCH(QString, expandedPath); + + QCOMPARE(qt_tildeExpansion(tildePath), expandedPath); +#endif +} +#endif + QTEST_MAIN(tst_QFiledialog) #include "tst_qfiledialog.moc" From dc25fb72782b3498747d39124847243898bebb21 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Thu, 9 Jun 2011 11:21:26 +0300 Subject: [PATCH 30/34] Use homePath instead of homeDirPath homeDirPath requires Qt 3 support, which is not enabled in all configurations. Change-Id: I7d51b880574021ef4569a4a2b16f06a7786dbb7d Reviewed-on: http://codereview.qt.nokia.com/415 Reviewed-by: Qt Sanity Bot Reviewed-by: Pierre Rossi --- src/gui/dialogs/qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 2e57a845c2..5e8533e3bc 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -871,7 +871,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded QString ret = path; QStringList tokens = ret.split(QDir::separator()); if (tokens.first() == QLatin1String("~")) { - ret.replace(0, 1, QDir::homeDirPath()); + ret.replace(0, 1, QDir::homePath()); } else { QString userName = tokens.first(); userName.remove(0, 1); From b97215b04c0bf12ecfd51ccdeaedd1fab5e8bc03 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 8 Jun 2011 13:12:21 +0200 Subject: [PATCH 31/34] Duplicate some harfbuzz symbols inside Qt. This is done to remove a compile-time dependency on the harfbuzz source files inside qtbase/src/3rdparty. These are not accessible now that QT_SOURCE_TREE is not accessible as a qmake variable anymore. With the refactor branch we might solve this differently, but for now this is how we get svg and declarative to compile. Change-Id: I5dad23f2ea1f650e2621c1c1fcf39632a3a22ae8 Reviewed-on: http://codereview.qt.nokia.com/378 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft_p.h | 6 +- src/gui/text/qharfbuzz_copy_p.h | 101 ++++++++++++++++++++++++++++++++ src/gui/text/qtextengine_p.h | 8 ++- src/gui/text/text.pri | 3 +- 4 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 src/gui/text/qharfbuzz_copy_p.h diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 2549fc5ae1..4ee26582b4 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -70,7 +70,11 @@ #include -#include +#if defined (QT_BUILD_GUI_LIB) +# include "private/qharfbuzz_p.h" +#else +# include "private/qharfbuzz_copy_p.h" +#endif QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h new file mode 100644 index 0000000000..07503240a2 --- /dev/null +++ b/src/gui/text/qharfbuzz_copy_p.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2007 Red Hat, Inc. + * + * This code is a modified version of some part of HarfBuzz, + * an OpenType Layout engine library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef QHARFBUZZ_COPY_P_H +#define QHARFBUZZ_COPY_P_H + +/* + The purpose of this header file is to allow inclusion of the private + headers for font and text classes without having to pull in the full + harfbuzz library under QTDIR/src/3rdparty/harfbuzz/src +*/ + +extern "C" { + +#ifdef __xlC__ +typedef unsigned hb_bitfield; +#else +typedef quint8 hb_bitfield; +#endif + +typedef enum { + /* no error */ + HB_Err_Ok = 0x0000, + HB_Err_Not_Covered = 0xFFFF, + + /* _hb_err() is called whenever returning the following errors, + * and in a couple places for HB_Err_Not_Covered too. */ + + /* programmer error */ + HB_Err_Invalid_Argument = 0x1A66, + + /* font error */ + HB_Err_Invalid_SubTable_Format = 0x157F, + HB_Err_Invalid_SubTable = 0x1570, + HB_Err_Read_Error = 0x6EAD, + + /* system error */ + HB_Err_Out_Of_Memory = 0xDEAD +} HB_Error; + +typedef quint32 HB_Glyph; +typedef void * HB_Font; +typedef void * HB_Face; +typedef void * HB_FontRec; +typedef quint32 hb_uint32; +typedef qint32 HB_Fixed; + +typedef struct { + HB_Fixed x; + HB_Fixed y; +} HB_FixedPoint; + +// The GlyphAttrbutes class is used inline so it needs to be complete. +typedef struct { + hb_bitfield justification :4; /* Justification class */ + hb_bitfield clusterStart :1; /* First glyph of representation of cluster */ + hb_bitfield mark :1; /* needs to be positioned around base char */ + hb_bitfield zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */ + hb_bitfield dontPrint :1; + hb_bitfield combiningClass :8; +} HB_GlyphAttributes; + +// This struct is strictly not needed, but we replicate it completely in +// case the compiler tries to get clever with padding. +typedef struct { + /*HB_LineBreakType*/ hb_bitfield lineBreakType :2; + /*HB_Bool*/ hb_bitfield whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */ + /*HB_Bool*/ hb_bitfield charStop :1; /* Valid cursor position (for left/right arrow) */ + /*HB_Bool*/ hb_bitfield wordBoundary :1; + /*HB_Bool*/ hb_bitfield sentenceBoundary :1; + hb_bitfield unused :2; +} HB_CharAttributes; + +} + +#endif // QHARFBUZZ_COPY_P_H diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 055974a4ad..44e38e7343 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -70,7 +70,13 @@ #ifndef QT_BUILD_COMPAT_LIB #include "private/qtextdocument_p.h" #endif -#include "private/qharfbuzz_p.h" + +#if defined (QT_BUILD_GUI_LIB) +# include "private/qharfbuzz_p.h" +#else +# include "private/qharfbuzz_copy_p.h" +#endif + #include "private/qfixed_p.h" #include diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri index b6cdc52e10..eb5937a493 100644 --- a/src/gui/text/text.pri +++ b/src/gui/text/text.pri @@ -43,7 +43,8 @@ HEADERS += \ text/qrawfont.h \ text/qrawfont_p.h \ text/qglyphrun.h \ - text/qglyphrun_p.h + text/qglyphrun_p.h \ + text/qharfbuzz_copy_p.h SOURCES += \ text/qfont.cpp \ From 97391be5ebddc62545ddb88f92fc2045bfa10711 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Sat, 4 Jun 2011 14:47:22 +0200 Subject: [PATCH 32/34] Allow selecting fonts with irregular style names Fonts like "Helvetica Neue UltraLight" or "Skia Regular Black Condensed" can't be selected in Qt because either they don't report correct numeric values for weight/stretch/etc. or these values are not mapped from QFont enums in a linear way. Thus we provide a shortcut to select these fonts with PostScript name or full name without resorting to family name matching in QFontDatabase (these fonts are not registered in font database anyway). After this, we can simply use: QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); to select these fonts. QCoreTextFontEngineMulti matched like this can be created directly from the CTFontRef instance instead of creating from the font name, making this process faster. The commit also cleaned up the font loading process in Mac font database a bit, moving the code for family matching into a separate function. Add QFontInfo::styleName() and QRawFont::styleName() to access the resolved style name for a font. Task-number: QTBUG-19366 Change-Id: Iad07768c02ed06cc8d6b7395dec554384f410506 Reviewed-on: http://codereview.qt.nokia.com/333 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qfont.cpp | 50 +++++++++ src/gui/text/qfont.h | 6 +- src/gui/text/qfont_p.h | 1 + src/gui/text/qfontdatabase_mac.cpp | 140 +++++++++++++++----------- src/gui/text/qfontdatabase_x11.cpp | 58 ++++++----- src/gui/text/qfontengine_coretext.mm | 22 ++-- src/gui/text/qfontengine_coretext_p.h | 4 +- src/gui/text/qfontengine_ft.cpp | 2 + src/gui/text/qfontinfo.h | 1 + src/gui/text/qrawfont.cpp | 13 +++ src/gui/text/qrawfont.h | 1 + tests/auto/qfont/tst_qfont.cpp | 13 +++ 12 files changed, 216 insertions(+), 95 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 90dd0293fc..d4c81b90db 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -348,6 +348,9 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other) if (! (mask & QFont::FamilyResolved)) request.family = other->request.family; + if (! (mask & QFont::StyleNameResolved)) + request.styleName = other->request.styleName; + if (! (mask & QFont::SizeResolved)) { request.pointSize = other->request.pointSize; request.pixelSize = other->request.pixelSize; @@ -896,6 +899,38 @@ void QFont::setFamily(const QString &family) resolve_mask |= QFont::FamilyResolved; } +/*! + \since 4.8 + + Returns the requested font style name, it will be used to match the + font with irregular styles (that can't be normalized in other style + properties). It depends on system font support, thus only works for + Mac OS X and X11 so far. On Windows irregular styles will be added + as separate font families so there is no need for this. + + \sa setFamily() setStyle() +*/ +QString QFont::styleName() const +{ + return d->request.styleName; +} + +/*! + \since 4.8 + + Sets the style name of the font. When set, other style properties + like \a style() and \a weight() will be ignored for font matching. + + \sa styleName() +*/ +void QFont::setStyleName(const QString &styleName) +{ + detach(); + + d->request.styleName = styleName; + resolve_mask |= QFont::StyleNameResolved; +} + /*! Returns the point size of the font. Returns -1 if the font size was specified in pixels. @@ -2508,6 +2543,21 @@ QString QFontInfo::family() const return engine->fontDef.family; } +/*! + \since 4.8 + + Returns the style name of the matched window system font on + system that supports it. + + \sa QFont::styleName() +*/ +QString QFontInfo::styleName() const +{ + QFontEngine *engine = d->engineForScript(QUnicodeTables::Common); + Q_ASSERT(engine != 0); + return engine->fontDef.styleName; +} + /*! Returns the point size of the matched window system font. diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 7636ecf910..14f290ceb3 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -156,7 +156,8 @@ public: LetterSpacingResolved = 0x2000, WordSpacingResolved = 0x4000, HintingPreferenceResolved = 0x8000, - AllPropertiesResolved = 0xffff + StyleNameResolved = 0x10000, + AllPropertiesResolved = 0x1ffff }; QFont(); @@ -168,6 +169,9 @@ public: QString family() const; void setFamily(const QString &); + QString styleName() const; + void setStyleName(const QString &); + int pointSize() const; void setPointSize(int); qreal pointSizeF() const; diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index d36518ee4b..8eeae6ffc1 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -80,6 +80,7 @@ struct QFontDef } QString family; + QString styleName; #ifdef Q_WS_X11 QString addStyle; diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index 6fdaf06c8b..724dbf6c4a 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -249,6 +249,63 @@ static inline float weightToFloat(unsigned int weight) return (weight - 50) / 100.0; } +static QFontEngine *loadFromDatabase(const QFontDef &req, const QFontPrivate *d) +{ +#if defined(QT_MAC_USE_COCOA) + QCFString fontName = NULL; +#else + ATSFontFamilyRef familyRef = 0; + ATSFontRef fontRef = 0; +#endif + + QStringList family_list = familyList(req); + + const char *stylehint = styleHint(req); + if (stylehint) + family_list << QLatin1String(stylehint); + + // add QFont::defaultFamily() to the list, for compatibility with previous versions + family_list << QApplication::font().defaultFamily(); + + QMutexLocker locker(fontDatabaseMutex()); + QFontDatabasePrivate *db = privateDb(); + if (!db->count) + initializeDb(); + for (int i = 0; i < family_list.size(); ++i) { + for (int k = 0; k < db->count; ++k) { + if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { + QByteArray family_name = db->families[k]->name.toUtf8(); +#if defined(QT_MAC_USE_COCOA) + QCFType ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); + if (ctFont) { + fontName = CTFontCopyFullName(ctFont); + goto found; + } +#else + familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + if (familyRef) { + fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + goto found; + } +#endif + } + } + } +found: +#ifdef QT_MAC_USE_COCOA + if (fontName) + return new QCoreTextFontEngineMulti(fontName, req, d->kerning); +#else + if (familyRef) { + QCFString actualName; + if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) + req.family = actualName; + return new QFontEngineMacMulti(familyRef, req, fontDef, d->kerning); + } +#endif + return NULL; +} + void QFontDatabase::load(const QFontPrivate *d, int script) { // sanity checks @@ -289,69 +346,38 @@ void QFontDatabase::load(const QFontPrivate *d, int script) return; // the font info and fontdef should already be filled } - //find the font - QStringList family_list = familyList(req); - - const char *stylehint = styleHint(req); - if (stylehint) - family_list << QLatin1String(stylehint); - - // add QFont::defaultFamily() to the list, for compatibility with - // previous versions - family_list << QApplication::font().defaultFamily(); - + QFontEngine *engine = NULL; #if defined(QT_MAC_USE_COCOA) - QCFString fontName = NULL, familyName = NULL; -#else - ATSFontFamilyRef familyRef = 0; - ATSFontRef fontRef = 0; -#endif + // Shortcut to get the font directly without going through the font database + if (!req.family.isEmpty() && !req.styleName.isEmpty()) { + QCFString expectedFamily = QCFString(req.family); + QCFString expectedStyle = QCFString(req.styleName); - QMutexLocker locker(fontDatabaseMutex()); - QFontDatabasePrivate *db = privateDb(); - if (!db->count) - initializeDb(); - for(int i = 0; i < family_list.size(); ++i) { - for (int k = 0; k < db->count; ++k) { - if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { - QByteArray family_name = db->families[k]->name.toUtf8(); -#if defined(QT_MAC_USE_COCOA) - QCFType ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); - if (ctFont) { - fontName = CTFontCopyFullName(ctFont); - familyName = CTFontCopyFamilyName(ctFont); - goto FamilyFound; - } -#else - familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - if (familyRef) { - fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - goto FamilyFound; - } -#endif + QCFType attributes = CFDictionaryCreateMutable(NULL, 0, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, expectedFamily); + CFDictionaryAddValue(attributes, kCTFontStyleNameAttribute, expectedStyle); + + QCFType descriptor = CTFontDescriptorCreateWithAttributes(attributes); + CGAffineTransform transform = qt_transform_from_fontdef(req); + QCFType ctFont = CTFontCreateWithFontDescriptor(descriptor, req.pixelSize, &transform); + if (ctFont) { + QCFString familyName = CTFontCopyFamilyName(ctFont); + // Only accept the font if the family name is exactly the same as we specified + if (CFEqual(expectedFamily, familyName)) { + engine = new QCoreTextFontEngineMulti(ctFont, req, d->kerning); } } } -FamilyFound: - //fill in the engine's font definition - QFontDef fontDef = d->request; //copy.. - if(fontDef.pointSize < 0) - fontDef.pointSize = qt_mac_pointsize(fontDef, d->dpi); - else - fontDef.pixelSize = qt_mac_pixelsize(fontDef, d->dpi); - -#ifdef QT_MAC_USE_COCOA - fontDef.family = familyName; - QFontEngine *engine = new QCoreTextFontEngineMulti(fontName, fontDef, d->kerning); -#else - QCFString actualName; - if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) - fontDef.family = actualName; - QFontEngine *engine = new QFontEngineMacMulti(familyRef, fontRef, fontDef, d->kerning); #endif - d->engineData->engine = engine; - engine->ref.ref(); //a ref for the engineData->engine - QFontCache::instance()->insertEngine(key, engine); + if (!engine) + engine = loadFromDatabase(req, d); + + if (engine) { + d->engineData->engine = engine; + engine->ref.ref(); + QFontCache::instance()->insertEngine(key, engine); + } } static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index a5fdcb5216..754334c0c4 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -1452,6 +1452,35 @@ static const char *styleHint(const QFontDef &request) void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontDef &request) { + double size_value = qMax(qreal(1.), request.pixelSize); + FcPatternDel(pattern, FC_PIXEL_SIZE); + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); + + if (X11->display && QX11Info::appDepth(screen) <= 8) { + FcPatternDel(pattern, FC_ANTIALIAS); + // can't do antialiasing on 8bpp + FcPatternAddBool(pattern, FC_ANTIALIAS, false); + } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { + FcPatternDel(pattern, FC_ANTIALIAS); + FcPatternAddBool(pattern, FC_ANTIALIAS, + !(request.styleStrategy & QFont::NoAntialias)); + } + + if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { + Q_ASSERT(script < QUnicodeTables::ScriptCount); + FcLangSet *ls = FcLangSetCreate(); + FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); + FcPatternDel(pattern, FC_LANG); + FcPatternAddLangSet(pattern, FC_LANG, ls); + FcLangSetDestroy(ls); + } + + if (!request.styleName.isEmpty()) { + QByteArray cs = request.styleName.toUtf8(); + FcPatternAddString(pattern, FC_STYLE, (const FcChar8 *) cs.constData()); + return; + } + int weight_value = FC_WEIGHT_BLACK; if (request.weight == 0) weight_value = FC_WEIGHT_MEDIUM; @@ -1474,34 +1503,11 @@ void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontD FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, slant_value); - double size_value = qMax(qreal(1.), request.pixelSize); - FcPatternDel(pattern, FC_PIXEL_SIZE); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); - int stretch = request.stretch; if (!stretch) stretch = 100; FcPatternDel(pattern, FC_WIDTH); FcPatternAddInteger(pattern, FC_WIDTH, stretch); - - if (X11->display && QX11Info::appDepth(screen) <= 8) { - FcPatternDel(pattern, FC_ANTIALIAS); - // can't do antialiasing on 8bpp - FcPatternAddBool(pattern, FC_ANTIALIAS, false); - } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { - FcPatternDel(pattern, FC_ANTIALIAS); - FcPatternAddBool(pattern, FC_ANTIALIAS, - !(request.styleStrategy & QFont::NoAntialias)); - } - - if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { - Q_ASSERT(script < QUnicodeTables::ScriptCount); - FcLangSet *ls = FcLangSetCreate(); - FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); - FcPatternDel(pattern, FC_LANG); - FcPatternAddLangSet(pattern, FC_LANG, ls); - FcLangSetDestroy(ls); - } } static bool preferScalable(const QFontDef &request) @@ -2049,7 +2055,8 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) return; FcPatternDel(pattern, FC_FILE); - FcPatternAddString(pattern, FC_FILE, (const FcChar8 *)fnt->fileName.toUtf8().constData()); + QByteArray cs = fnt->fileName.toUtf8(); + FcPatternAddString(pattern, FC_FILE, (const FcChar8 *) cs.constData()); FcChar8 *fam = 0, *familylang = 0; int i, n = 0; @@ -2135,7 +2142,8 @@ QString QFontDatabase::resolveFontFamilyAlias(const QString &family) if (!pattern) return family; - FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) family.toUtf8().data()); + QByteArray cs = family.toUtf8(); + FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData()); FcConfigSubstitute(0, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index eedcc69a81..a68a1551d9 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -116,17 +116,11 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const QCFString &name, const init(kerning); } -QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning) +QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning) : QFontEngineMulti(0) { this->fontDef = fontDef; - - transform = CGAffineTransformIdentity; - if (fontDef.stretch != 100) { - transform = CGAffineTransformMakeScale(float(fontDef.stretch) / float(100), 1); - } - - ctfont = CTFontCreateWithGraphicsFont(cgFontRef, fontDef.pixelSize, &transform, NULL); + ctfont = (CTFontRef) CFRetain(ctFontRef); init(kerning); } @@ -149,6 +143,9 @@ void QCoreTextFontEngineMulti::init(bool kerning) } QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef); + fontDef.family = fe->fontDef.family; + fontDef.styleName = fe->fontDef.styleName; + transform = fe->transform; fe->ref.ref(); engines.append(fe); } @@ -405,7 +402,7 @@ void QCoreTextFontEngineMulti::loadEngine(int) extern int qt_antialiasing_threshold; // from qapplication.cpp -static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef) { CGAffineTransform transform = CGAffineTransformIdentity; if (fontDef.stretch != 100) @@ -416,7 +413,7 @@ static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); ctfont = font; CFRetain(ctfont); cgFont = CTFontCopyGraphicsFont(font, NULL); @@ -426,7 +423,7 @@ QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) QCoreTextFontEngine::QCoreTextFontEngine(CGFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); cgFont = font; // Keep reference count balanced CFRetain(cgFont); @@ -464,6 +461,9 @@ void QCoreTextFontEngine::init() QCFString family = CTFontCopyFamilyName(ctfont); fontDef.family = family; + QCFString styleName = (CFStringRef) CTFontCopyAttribute(ctfont, kCTFontStyleNameAttribute); + fontDef.styleName = styleName; + synthesisFlags = 0; CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont); if (traits & kCTFontItalicTrait) diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h index 98d3b50c66..3ca8a0ad60 100644 --- a/src/gui/text/qfontengine_coretext_p.h +++ b/src/gui/text/qfontengine_coretext_p.h @@ -113,7 +113,7 @@ class QCoreTextFontEngineMulti : public QFontEngineMulti { public: QCoreTextFontEngineMulti(const QCFString &name, const QFontDef &fontDef, bool kerning); - QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning); + QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning); ~QCoreTextFontEngineMulti(); virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, @@ -141,6 +141,8 @@ private: friend class QFontDialogPrivate; }; +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef); + #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) #endif // QFONTENGINE_CORETEXT_P_H diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 39abbd6f58..9a5d9d6f2e 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -758,6 +758,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, } #endif + fontDef.styleName = QString::fromUtf8(face->style_name); + unlockFace(); fsType = freetype->fsType(); diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h index 1238cba4da..37a724ec7c 100644 --- a/src/gui/text/qfontinfo.h +++ b/src/gui/text/qfontinfo.h @@ -61,6 +61,7 @@ public: QFontInfo &operator=(const QFontInfo &); QString family() const; + QString styleName() const; int pixelSize() const; int pointSize() const; qreal pointSizeF() const; diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 481180ec78..71762df09f 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -403,6 +403,19 @@ QString QRawFont::familyName() const return d->fontEngine->fontDef.family; } +/*! + Returns the style name of this QRawFont. + + \sa QFont::styleName() +*/ +QString QRawFont::styleName() const +{ + if (!isValid()) + return QString(); + + return d->fontEngine->fontDef.styleName; +} + /*! Returns the style of this QRawFont. diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h index 3857da35e0..aca33af127 100644 --- a/src/gui/text/qrawfont.h +++ b/src/gui/text/qrawfont.h @@ -84,6 +84,7 @@ public: bool operator==(const QRawFont &other) const; QString familyName() const; + QString styleName() const; QFont::Style style() const; int weight() const; diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index cfafa78684..711ffc0b53 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -77,6 +77,7 @@ private slots: void insertAndRemoveSubstitutions(); void serializeSpacing(); void lastResortFont(); + void styleName(); }; // Testing get/set functions @@ -612,5 +613,17 @@ void tst_QFont::lastResortFont() QVERIFY(!font.lastResortFont().isEmpty()); } +void tst_QFont::styleName() +{ +#if !defined(Q_WS_MAC) + QSKIP("Only tested on Mac", SkipAll); +#else + QFont font("Helvetica Neue"); + font.setStyleName("UltraLight"); + + QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); +#endif +} + QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" From afd5d43b0ca77f1cf27bc4e0a05bce6570edb0c9 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 8 Jun 2011 17:10:19 +0100 Subject: [PATCH 33/34] tst_qnetworkreply: Fix divide by zero crash on MacOS X Change-Id: Ie1b6d5aa25a745eb6c16041151141efe99c051aa Reviewed-on: http://codereview.qt.nokia.com/422 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Petersson --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 7219e71898..3b31e84556 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -5970,7 +5970,7 @@ public slots: void onReadAndReschedule() { const qint64 bytesReceived = m_reply->bytesAvailable(); - if (bytesReceived) { + if (bytesReceived && m_reply->readBufferSize()) { QByteArray data = m_reply->read(bytesReceived); // reschedule read const int millisecDelay = static_cast(bytesReceived * 1000 / m_reply->readBufferSize()); From db37aa1004f1e2489b94f1d9cc21630b62e03552 Mon Sep 17 00:00:00 2001 From: Tapani Mikola Date: Fri, 10 Jun 2011 09:25:54 +0300 Subject: [PATCH 34/34] Fontengine buildfix for xcb platform plugin. Change-Id: Ic909e1ac08163e62634643c68862e802a016b911 Reviewed-on: http://codereview.qt.nokia.com/442 Reviewed-by: Gunnar Sletta --- src/gui/text/qfontengine_ft.cpp | 1 - src/gui/text/qfontengine_ft_p.h | 6 +----- src/gui/text/qharfbuzz_copy_p.h | 5 +++++ src/gui/text/qtextengine_p.h | 6 +----- src/plugins/platforms/fontdatabases/basicunix/basicunix.pri | 2 ++ 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 9a5d9d6f2e..dd30a15030 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -51,7 +51,6 @@ #include "qabstractfileengine.h" #include "qthreadstorage.h" #include -#include #include "qfontengine_ft_p.h" #include diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 4ee26582b4..bd8e24a3fe 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -70,11 +70,7 @@ #include -#if defined (QT_BUILD_GUI_LIB) -# include "private/qharfbuzz_p.h" -#else -# include "private/qharfbuzz_copy_p.h" -#endif +#include "private/qharfbuzz_copy_p.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h index 07503240a2..74b824ab35 100644 --- a/src/gui/text/qharfbuzz_copy_p.h +++ b/src/gui/text/qharfbuzz_copy_p.h @@ -34,6 +34,9 @@ headers for font and text classes without having to pull in the full harfbuzz library under QTDIR/src/3rdparty/harfbuzz/src */ +#if defined(QT_BUILD_GUI_LIB) || defined(QT_COMPILES_IN_HARFBUZZ) +#include +#else extern "C" { @@ -98,4 +101,6 @@ typedef struct { } +#endif // ifdef QT_BUILD_GUI_LIB + #endif // QHARFBUZZ_COPY_P_H diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 44e38e7343..f4752288c2 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -71,11 +71,7 @@ #include "private/qtextdocument_p.h" #endif -#if defined (QT_BUILD_GUI_LIB) -# include "private/qharfbuzz_p.h" -#else -# include "private/qharfbuzz_copy_p.h" -#endif +#include "private/qharfbuzz_copy_p.h" #include "private/qfixed_p.h" diff --git a/src/plugins/platforms/fontdatabases/basicunix/basicunix.pri b/src/plugins/platforms/fontdatabases/basicunix/basicunix.pri index da4698df0d..c1fbf3e411 100644 --- a/src/plugins/platforms/fontdatabases/basicunix/basicunix.pri +++ b/src/plugins/platforms/fontdatabases/basicunix/basicunix.pri @@ -7,6 +7,8 @@ SOURCES += \ $$QT_SOURCE_TREE/src/plugins/platforms/fontdatabases/basicunix/qbasicunixfontdatabase.cpp \ $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft.cpp +DEFINES += QT_COMPILES_IN_HARFBUZZ + INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/platforms/fontdatabases/basicunix