How to make scrollbar always visible on Flckable in QML



  • I would like to make Scrollbar.vertical in Flickable area is always visible. currently it is visible upon clicking. Also the text area is overlapping with scroll bar. How can i sepearate scrollbar with text area in the following qml code

    //your code here
    import QtQuick 2.0
    import QtQuick.Controls 2.0
    
    Flickable {
        id: flickable
        anchors.fill: parent
    
    
        TextArea.flickable: TextArea {
            text: "The Qt QML module provides a framework for developing applications and libraries with the QML language.
    It defines and implements the language and engine infrastructure, and provides an API to enable application developers to
    extend the QML language with custom types and integrate QML code with JavaScript and C++.
    
    The Qt QML module provides both a QML API and a C++ API.
    Note that while the Qt QML module provides the language and infrastructure for QML applications,
    the Qt Quick module provides many visual components, model-view support, an animation framework,
    and much more for building user interfaces.
    For those new to QML and Qt Quick, please see QML Applications for an introduction to writing QML applications."
            wrapMode: TextArea.Wrap
            font.pixelSize: 20
        }
        ScrollBar.vertical: ScrollBar {
            width: 40
        }
    }
    




  • agreed, But i do not think so that it is proper way of handling, Because scrollbar visible on mouse click and disappears after certain time. So here every time we are are changing active set to true, which continuously happens at a certain timeout. It may be a overhead which does not encourage by Qt. I am open for suggestions



  • @DonCoder I agree its not very correct, but as far as I can see from the documentation there is currently no official correct way of doing it sadly :(



  • It will take a while until Qt 5.9 is released, but then you'll be able to use ScrollBar::policy.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.