I wrote QML like this:
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import App 0.1
ApplicationWindow {
id: appWindow
visible: true
width: 300
height: 500
ColumnLayout {
ScrollView {
ColumnLayout {
Text {
width: 250
text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
wrapMode: Text.WrapAnywhere
}
}
}
}
AppController {
id: controller
}
}
and this is the visual outcome:
I want to wrap Text
inside ScrollView
. I've tried many patterns but I failed to achieve the desired result. How can I do that?
Just remove
ColumnLayout
, that's not necessary here. This works for me (if that's what you're looking for):Try to avoid fixed sizes where possible. In your case the
Text
doesn't react to window resizing. Also when providing code snippets, just remove specific fragments like your AppController for example (even if it's no big deal in this case but it's easier for anyone to run and test your code) :)Hope this helps!