Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using background picture for QScrollBar::handle

Using background picture for QScrollBar::handle

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.7k Views
  • 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 Offline
    T Offline
    ThaRez
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      ThaRez
      wrote on last edited by
      #2

      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
      0

      • Login

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