Results 1 to 4 of 4

Thread: QListView & backgroundBrush -> Houston we hv a problem

  1. #1
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QListView & backgroundBrush -> Houston we hv a problem

    I am using QListView ( in IconMode ... QT 4.2 ). I need to have a QPixmap tiled over QListView Background ... some thing similar to what QGraphicsView's setBackgroundBrush() achieves ... can some one guide me plz ...

    Thanx

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QListView & backgroundBrush -> Houston we hv a problem

    If I have understood you correclty, then the following code should work.

    Qt Code:
    1. pal.setBrush(QPalette::Window,QBrush(yourPixmapHere));
    2. listView->viewport()->setPalette(pal);
    To copy to clipboard, switch view to plain text mode 

    I have not tested this one, so please let me know if this works or not.

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

    travis (31st July 2006)

  4. #3
    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: QListView & backgroundBrush -> Houston we hv a problem

    For QListView it could be QPalette::Base and not QPalette::Window.

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

    travis (31st July 2006)

  6. #4
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QListView & backgroundBrush -> Houston we hv a problem

    it worked like a charm ... on the first short i.e ... thanx a lot ... u saved me a lot of hassle ... else i would be using QGraphicsView in conjunction with Scene ... Btw i used QPalette::Base and it worked .... QPalette::Window doesnt .... Thanx for the help ...

    http://ankur.wordpress.com

Similar Threads

  1. Replies: 16
    Last Post: 7th March 2006, 15:57

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.