Results 1 to 3 of 3

Thread: multiple images in style sheet

  1. #1
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default multiple images in style sheet

    hi,

    ok i wasnt sure wether to put this in programming or here but its more design so i put it here as it effects both vs and qt designer.

    can anyone tell me how to use multiple images in a style sheet?
    i seen in the qt documentation it had this in the image* example:
    Qt Code:
    1. QTextEdit { image: url(x1.png) url(x2.png) }
    To copy to clipboard, switch view to plain text mode 

    basicly, what i want to do is have 3 images in total on the handle element of a scoll bar. (QScrollBar::handle:vertical)

    one image at the top left (:/Scroller/Resources/ScrollerBarCap.bmp)
    one image at the bottom left (:/Scroller/Resources/ScrollerBarCap.bmp)
    one background-image repeated (:/Scroller/Resources/ScrollerBarMid.bmp)

    can anyone tell me if this is possable, been searching and trying for a couple of hours and not yet managed to find a way.

    [edit] im using QT 4.3

    thanks,
    Philly

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: multiple images in style sheet

    I think you should use border-image instead of image. Of course the image will have to be modified.

  3. The following user says thank you to wysota for this useful post:

    CopyrightPhilly (2nd October 2007)

  4. #3
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiple images in style sheet

    thanks wysota

    I never thought of that, worked a treat, basicly i just used
    border-top: 5px
    border-bottom: 5px;
    border-image: url(:/Scroller/Resources/ScrollerBarCap.bmp);

    and presto, exaclty what i wanted,

    thanks again,
    Philly

Similar Threads

  1. Vertical Scroll Bar - Style Sheet
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2007, 19:03
  2. QToolBox qss style sheet problem
    By eskil in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 17:45
  3. Style Sheet color of QComboBox
    By tpf80 in forum Qt Programming
    Replies: 6
    Last Post: 25th June 2007, 02:55
  4. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22
  5. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.