Results 1 to 2 of 2

Thread: Stylesheet for QSlider

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Stylesheet for QSlider

    Hi! I'm trying to use a stylesheet for a QSlider. I've been able to do anything but placing an image for the QSlider::sub-page:horizontal so that it is resized only in width. I need the image I place to be resized so that the width is from the beginning to the handle, but the height is always the same.

    I tried this way, forcing the height to what I need:

    QSlider::sub-page:horizontal {image: url(image.png); height: 11px;

    but it keeps resizing the whole image. Is it possible to keep its height always the same?
    Thanks!

  2. #2
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Stylesheet for QSlider

    In case anyone else need this, I found out a good solution: I used an image as large as the groove and the stylesheet

    "QSlider::sub-page:horizontal {border-image: url(...);"
    "border-top: 5px transparent; border-bottom: 5px transparent;"
    "border-right: 10px transparent; border-left: 10px transparent;"
    "}";

    This way the result is exactly what I was looking for!

Similar Threads

  1. QSlider
    By mickey in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2009, 17:21
  2. Help Qslider
    By superteny in forum Qt Programming
    Replies: 5
    Last Post: 9th July 2009, 10:03
  3. QSlider tickInterval
    By yogeshgokul in forum Qt Programming
    Replies: 3
    Last Post: 16th September 2008, 11:29
  4. QSlider
    By merry in forum Qt Programming
    Replies: 22
    Last Post: 27th June 2007, 07:42
  5. QSlider
    By ToddAtWSU in forum Qt Programming
    Replies: 3
    Last Post: 10th May 2006, 16:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.