Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2, 6.1.2, 6.5.2, 6.6.0 Beta2
Description
Please try the example code.
Slowly drag the SplitView handle downwards: Although the ScrollView is correctly resized, the text that becomes visible is not rendered until some drag distance is reached:
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") SplitView { anchors.fill: parent orientation: Qt.Vertical ScrollView { SplitView.preferredHeight: 30 TextArea { id: editor selectByMouse: true wrapMode: Text.NoWrap text: "Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nLine1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\n" } } Rectangle { SplitView.preferredHeight: root.height - 30 color: "blue" } } }
It seems this has something to do with the special Flickable handling in TextArea. The following code uses a basic Flickable instead of ScrollView. Text rendering issues are gone when the TextArea.flickable attached property is not used - however cursor based scrolling then no longer works.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") SplitView { anchors.fill: parent orientation: Qt.Vertical Flickable { id: flick SplitView.preferredHeight: 30 // if this is attached property is used to enable cursor based scrolling // the rendering bug occurs again // TextArea.flickable: editor TextArea { id: editor selectByMouse: true wrapMode: Text.NoWrap text: "Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nLine1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\n" } } Rectangle { SplitView.preferredHeight: root.height - 30 color: "blue" } } }
Instead of the SplitView other means of layout can be used, that does not make any difference.