Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to make scrollbar always visible on Flckable in QML
Forum Updated to NodeBB v4.3 + New Features

How to make scrollbar always visible on Flckable in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 4.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DonCoderD Offline
    DonCoderD Offline
    DonCoder
    wrote on last edited by
    #1

    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
        }
    }
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      stcorp
      wrote on last edited by
      #2

      Take a look here: https://forum.qt.io/topic/76436/scrollbar-visibility-in-qml-qridview-and-flickable

      1 Reply Last reply
      1
      • DonCoderD Offline
        DonCoderD Offline
        DonCoder
        wrote on last edited by DonCoder
        #3

        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

        S 1 Reply Last reply
        1
        • DonCoderD DonCoder

          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

          S Offline
          S Offline
          stcorp
          wrote on last edited by
          #4

          @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 :(

          1 Reply Last reply
          1
          • jpnurmiJ Offline
            jpnurmiJ Offline
            jpnurmi
            wrote on last edited by jpnurmi
            #5

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

            1 Reply Last reply
            3

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved