Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Using background picture for QScrollBar::handle

    General and Desktop
    1
    2
    2572
    Loading More Posts
    • 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.
    • T
      ThaRez last edited by

      Hello
      I'm creating a list that is supposed to have a styled scrolling handle. I have a static picture which I want to apply to the handle, meaning it should not be stretched, nor repeated. I've tried to apply the following style sheet without success:

      @*{background-image: url(:/middle/03_Middle/ksw_dc_middle_bgr.png); border:0px;}
      QScrollBar:vertical { background: black; width: 10px; margin: 0px 0px 0px 0px;}
      QScrollBar::handle:vertical {background-image: url(:/list/05_List_items/ksw_dc_list_scroll_bgr.png); max-height: 20px;}@

      The result is as wanted, except that the picture is tiled upon itself. With other words, the max height doesn't have any effect, instead the handled is streched according to the amount of items in the list. How can I prevent this and use it, kinda like a QSlider? (using an actual QSlider is unfortunately not an option at this point) Thank you!

      Best regards
      Richard

      1 Reply Last reply Reply Quote 0
      • T
        ThaRez last edited by

        Is this even possible, and if not, is there a way to create a similar effect or to somehow reasonably scale the image?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post