From 0944ff26223bd2c809025c9f42bc9935213f0d43 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 25 Jul 2019 16:37:43 +0200 Subject: Doc: Fix QtQuick.Shapes::ShapePath::strokeWidth property type Fixes: QTBUG-73541 Change-Id: Icb15cee3c49f142ef3634e35427dbbc0b9a2183e Reviewed-by: Laszlo Agocs --- src/quickshapes/qquickshape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp index 74cbf52a95..0ae16313ca 100644 --- a/src/quickshapes/qquickshape.cpp +++ b/src/quickshapes/qquickshape.cpp @@ -200,7 +200,7 @@ void QQuickShapePath::setStrokeColor(const QColor &color) } /*! - \qmlproperty color QtQuick.Shapes::ShapePath::strokeWidth + \qmlproperty real QtQuick.Shapes::ShapePath::strokeWidth This property holds the stroke width. -- cgit v1.2.3 From dfc6dc1d94a729f701172861a196b4b34bcd7518 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 30 Jul 2019 14:14:50 +0200 Subject: Fix possible crash with top/bottom aligned images An image inside at the end of a text block which did not start at text position 0 would resolve to an invalid QTextLine, since we passed the document position to lineForTextPosition(), which expects the relative block position. If the image was aligned to top or bottom, so that the extracted QTextLine was actually accessed, this would cause a crash. [ChangeLog][QtQuick][Text] Fixed a bug where aligning an image to "top" or "bottom" could cause a crash under certain circumstances. Task-number: QTBUG-77217 Change-Id: Iaa239ba482f2a765703656e4116cbebb8435a66e Reviewed-by: Simon Hausmann --- src/quick/items/qquicktextnodeengine.cpp | 2 +- .../qquicktext/data/verticallyAlignedImageInTable.qml | 14 ++++++++++++++ tests/auto/quick/qquicktext/tst_qquicktext.cpp | 14 ++++++++++++++ .../data/text/text_table_vertically_aligned_image.qml | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/auto/quick/qquicktext/data/verticallyAlignedImageInTable.qml create mode 100644 tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index 36fc168ec2..5a4ef2b686 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -477,7 +477,7 @@ void QQuickTextNodeEngine::addTextObject(const QTextBlock &block, const QPointF } qreal ascent; - QTextLine line = block.layout()->lineForTextPosition(pos); + QTextLine line = block.layout()->lineForTextPosition(pos - block.position()); switch (format.verticalAlignment()) { case QTextCharFormat::AlignTop: diff --git a/tests/auto/quick/qquicktext/data/verticallyAlignedImageInTable.qml b/tests/auto/quick/qquicktext/data/verticallyAlignedImageInTable.qml new file mode 100644 index 0000000000..4c00362d15 --- /dev/null +++ b/tests/auto/quick/qquicktext/data/verticallyAlignedImageInTable.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Text { + anchors.centerIn: parent + font.family: "Arial" + font.pixelSize: 16 + textFormat: Text.RichText + text: "
" + } +} diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index a9c35e0cc4..eafa6cb052 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -161,6 +161,8 @@ private slots: void initialContentHeight(); + void verticallyAlignedImageInTable(); + private: QStringList standard; QStringList richText; @@ -4414,6 +4416,18 @@ void tst_qquicktext::implicitSizeChangeRewrap() QVERIFY(text->contentWidth() < window->width()); } +void tst_qquicktext::verticallyAlignedImageInTable() +{ + QScopedPointer window(new QQuickView); + window->setSource(testFileUrl("verticallyAlignedImageInTable.qml")); + QTRY_COMPARE(window->status(), QQuickView::Ready); + + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + + // Don't crash +} + QTEST_MAIN(tst_qquicktext) #include "tst_qquicktext.moc" diff --git a/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml b/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml new file mode 100644 index 0000000000..d712f94572 --- /dev/null +++ b/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Text { + anchors.centerIn: parent + font.family: "Arial" + font.pixelSize: 16 + textFormat: Text.RichText + text: "
" + } +} -- cgit v1.2.3 From 0647df8c88d4eaeedd19456b6e382308208e2be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Bornemann?= Date: Fri, 2 Aug 2019 11:03:06 +0000 Subject: Revert "Yield error if qtquickcompiler is used in non-QML projects" This reverts commit c5578b16d6454e708c8ce12661a85d41eeaaa758, because it prevents enabling the qtquickcompiler feature globally. Fixes: QTBUG-77277 Change-Id: Ic80835c462570a67ae3105bb3d1b6452800d2c94 Reviewed-by: Kai Koehne --- tools/qmlcachegen/qtquickcompiler.prf | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/qmlcachegen/qtquickcompiler.prf b/tools/qmlcachegen/qtquickcompiler.prf index 967d55a5bd..b98d8a0198 100644 --- a/tools/qmlcachegen/qtquickcompiler.prf +++ b/tools/qmlcachegen/qtquickcompiler.prf @@ -1,15 +1,5 @@ if(qtc_run|lupdate_run): return() -!contains(QT, qml) { - qt_modules = \ - $$replace(QT, -private$, _private) \ - $$replace(QT_PRIVATE, -private$, _private) - qt_modules = $$resolve_depends(qt_modules, "QT.", ".depends" ".run_depends") - !contains(qt_modules, qml): \ - error("The qtquickcompiler feature cannot be used without the QML module.") - unset(qt_modules) -} - qtPrepareTool(QML_CACHEGEN, qmlcachegen, _FILTER) qtPrepareTool(QMAKE_RCC, rcc, _DEP) -- cgit v1.2.3