How to scroll two text areas, individually?
-
Given that QML ScrollBars are attached to one instance of a Flickable, I'm not sure this is possible. There's also the matter of determining which text area you wish to scroll.
As far as when the ScrollBar is displayed, that's controlled by the policy property (another reason why this might be difficult).
May I ask why you want such functionality? If possible, a sketch of what you're trying to do might be useful.
-
Given that QML ScrollBars are attached to one instance of a Flickable, I'm not sure this is possible. There's also the matter of determining which text area you wish to scroll.
As far as when the ScrollBar is displayed, that's controlled by the policy property (another reason why this might be difficult).
May I ask why you want such functionality? If possible, a sketch of what you're trying to do might be useful.
@mzimmers
I wanted to display a screen which shows cause and remedy like below
Ex: Cause Remedy
1.xyz 1. RRRR
2.xxxxx
3.jjjjjjjjjjjj
4.llllllllllllllll
5.uuuuuuuSo, remedy has more points compared to cause. If I scroll vertical scroll bar only remedy should scroll not cause.
Vice versa if cause is having more points(Exceeding height) cause should scroll not remedy.
I have created separate text area for cause and remedy, So need solution to scroll action should be individual to each text area but controlled by one scroll bar. -
@mzimmers
I wanted to display a screen which shows cause and remedy like below
Ex: Cause Remedy
1.xyz 1. RRRR
2.xxxxx
3.jjjjjjjjjjjj
4.llllllllllllllll
5.uuuuuuuSo, remedy has more points compared to cause. If I scroll vertical scroll bar only remedy should scroll not cause.
Vice versa if cause is having more points(Exceeding height) cause should scroll not remedy.
I have created separate text area for cause and remedy, So need solution to scroll action should be individual to each text area but controlled by one scroll bar.@Shankar-B The documentation gives example on how to use a standalone https://doc.qt.io/qt-6/qml-qtquick-controls2-scrollbar.html#non-attached-scroll-bars
you could adapt it to work with 2 flickable
-
@Shankar-B The documentation gives example on how to use a standalone https://doc.qt.io/qt-6/qml-qtquick-controls2-scrollbar.html#non-attached-scroll-bars
you could adapt it to work with 2 flickable
-
@GrecKo
I have tried adding two scrollview's inside flickable, am getting individual scrollbar, if height exceeds. I don't need individual scrollbar. I need only one scroll which handle text area when height exceeds with vice versa.@Shankar-B can you post some code? I don't see how you'd be getting individual scrollbars. If you're explicitly declaring them, the policy property should cause them not to appear (though it's kind of a weird way of achieving that).
As @GrecKo pointed out, you can declare independent scroll bars. Just follow the directions in the link he posted.