Results 1 to 4 of 4

Thread: set QHeaderView background image?

  1. #1
    Join Date
    Feb 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question set QHeaderView background image?

    Hello
    I want to set a background image for a QHeaderView.
    Preferably through a stylesheet, if possible.

    I can set background-color in a stylesheet, but background-image does not work.
    This is what I've got right now:
    Qt Code:
    1. QHeaderView::section
    2. {
    3. background-image:url(:/topgradient.png);
    4. background-repeat:repeat-x;
    5. }
    To copy to clipboard, switch view to plain text mode 

    Any ideas?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: set QHeaderView background image?

    background-image:url(":/topgradient.png");
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: set QHeaderView background image?

    Quote Originally Posted by high_flyer View Post
    background-image:url(":/topgradient.png");
    No, thats not it
    I believe doing it without the quotes is valid syntax. I usually do it with them though, for good practice.
    Any other ideas?

  4. #4
    Join Date
    Aug 2009
    Posts
    1

    Default Re: set QHeaderView background image?

    you can do it with

    border-image: url(treeWidget_header.png);


Similar Threads

  1. Replies: 2
    Last Post: 17th July 2010, 21:07
  2. Adding image in background
    By A.H.M. Mahfuzur Rahman in forum Qt Programming
    Replies: 6
    Last Post: 9th August 2009, 16:39
  3. QHeaderView: background of selected header item with CSS
    By antarctic in forum Qt Programming
    Replies: 5
    Last Post: 8th June 2009, 07:37
  4. No Background Image on Example
    By igor in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2007, 12:41
  5. [QT4.1.1 XP] background image
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 1st March 2006, 13:02

Tags for this Thread

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.