diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-09-28 15:59:39 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-09-28 14:10:11 +0000 |
commit | c5050daa16860b800dbc9782e94e0bacffd6bbf2 (patch) | |
tree | bbe8d3cadb3c1d130fc9b0b33a197e6347440938 /tests | |
parent | ed9a677c3a27d1c2eeddb71b66f00bfc691df3fd (diff) |
QQuickScrollView: fix binding loop with wrapping TextArea
Start keeping track of the content size only after the component is
complete, to avoid creation time ping pong with content size updates
and content item resizing.
Task-number: QTBUG-62325
Change-Id: I4b75dc398d0b746dd7e0b04291270f47f91bb7e6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_scrollview.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml index c0b1a401..80110b5a 100644 --- a/tests/auto/controls/data/tst_scrollview.qml +++ b/tests/auto/controls/data/tst_scrollview.qml @@ -129,6 +129,16 @@ TestCase { } } + Component { + id: scrollableTextArea + ScrollView { + TextArea { + text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas id dignissim ipsum. Nam molestie nisl turpis." + wrapMode: TextArea.WordWrap + } + } + } + function test_scrollBars() { var control = createTemporaryObject(scrollView, testCase, {width: 200, height: 200}) verify(control) @@ -339,4 +349,19 @@ TestCase { } compare(horizontal.position, 0.0) } + + function test_textArea() { + // TODO: verify no binding loop warnings (QTBUG-62325) + var control = createTemporaryObject(scrollableTextArea, testCase) + verify(control) + + var flickable = control.contentItem + verify(flickable && flickable.hasOwnProperty("contentX")) + + var textArea = flickable.contentItem.children[0] + verify(textArea && textArea.hasOwnProperty("text")) + + compare(control.contentWidth, flickable.contentWidth) + compare(control.contentHeight, flickable.contentHeight) + } } |