1

This question is regarding QtQuick 1.1, QML, Qt 4.5

I am making a windows style scroll bar for showing text area.

Using Flickable with TextEdit inside, and simple rectangle parts for scrollbar.

Problem is When I flick the text, it shows contents outside the text also

For example see the scrollbar example and picture attached below.

I don't want to show the area outside that image. Stop if reach the border.

Also is there any in-built scrollbar module in QtQuick 1.1

Thanks!!

outside of image boundary is shown

Daniel Sampras
  • 309
  • 2
  • 18
  • Tried to clip it? clip: true. I don't have Qt 4.5, so I can't test it with that version, but QtQuick 1.1 Flickable seems to have the property clip. – derM - not here for BOT dreams Oct 11 '16 at 07:28
  • If the list is long, but parent is small we `clip` the content. Can u imagine in smartphone we swipe the list of items down, even though we reach the top item, it still shows empty space top of the first item and then slowly moves up. – Daniel Sampras Oct 11 '16 at 07:37
  • The Flickable's behavior at boundaries is usually controlled via the boundsBehavior property: http://doc.qt.io/qt-4.8/qml-flickable.html#boundsBehavior-prop Have you tried setting that to `Flickable.StopAtBounds`? – Kevin Krammer Oct 11 '16 at 08:48
  • @KevinKrammer That Worked Perfect. I used as `boundsBehavior: Flickable.StopAtBounds`. Just one more. Do you know any method for scrolling the text down one line at a time if a button i cliked? – Daniel Sampras Oct 11 '16 at 23:45
  • Hmm, nothing concrete, but maybe try to get the delta height from `font.pixelSize` and then adding that to the flickable's `contentY`? – Kevin Krammer Oct 12 '16 at 09:51

1 Answers1

0

It is possible to disable flicking in horizontal direction using

flickableItem.flickableDirection: Flickable.VerticalFlick

inside ScrollView block

HariP
  • 71
  • 6