diff options
author | Liang Qi <liang.qi@qt.io> | 2019-08-05 13:47:15 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-08-06 06:31:04 +0200 |
commit | 6c19dd8989895b29a3f0b46871ed5f360e7b3440 (patch) | |
tree | 957378bd2c8a07d60147b963fcf580920fb1581e | |
parent | aeec2f94c376c9a0e84bbbb3be4652384c7da113 (diff) | |
parent | 28ce9711b23cd526c6f5627f750fed840bed2d32 (diff) | |
download | qtdeclarative-6c19dd8989895b29a3f0b46871ed5f360e7b3440.tar.gz |
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
6 files changed, 44 insertions, 12 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index a1b5eb1faf..3b2c5ef19e 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/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. 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: "<table><tr><td/><td valign=\"top\"><img src=\"images/face-sad.png\"></td></tr></table>" + } +} diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index fd0ba0f49b..97107694bd 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -162,6 +162,8 @@ private slots: void initialContentHeight(); + void verticallyAlignedImageInTable(); + private: QStringList standard; QStringList richText; @@ -4415,6 +4417,18 @@ void tst_qquicktext::implicitSizeChangeRewrap() QVERIFY(text->contentWidth() < window->width()); } +void tst_qquicktext::verticallyAlignedImageInTable() +{ + QScopedPointer<QQuickView> 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: "<table><tr><td/><td valign=\"top\"><img src=\"data/logo.png\"></td></tr></table>" + } +} diff --git a/tools/qmlcachegen/qtquickcompiler.prf b/tools/qmlcachegen/qtquickcompiler.prf index 24cbe7f2e5..2f98aadefe 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) |