Results 1 to 7 of 7

Thread: QPalette::brush

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: QPalette::brush

    Quote Originally Posted by tpf80 View Post
    so all I need to know really, is how to create a brush from the color used in QPalette::AlternateBase and QPalette::Base
    Ask QPalette to give you one.

  2. #2
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    48
    Thanked 4 Times in 4 Posts

    Default Re: QPalette::brush

    I actually tried this (see above) but I got errors. (this was the way I really wanted to do it)
    Qt Code:
    1. tableNoHighlight = QPalette::brush(QPalette::AlternateBase);
    2. tableNoHighlight = QPalette::brush(QPalette::Base);
    To copy to clipboard, switch view to plain text mode 
    it asks for an object, but I am not quite sure what object its asking for.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: QPalette::brush

    Quote Originally Posted by tpf80 View Post
    it asks for an object, but I am not quite sure what object its asking for.
    QPalette::brush() isn't a static method, so you have to create a QPalette object first:
    Qt Code:
    1. tableNoHighlight = p.brush(QPalette::Base);
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to jacek for this useful post:

    tpf80 (18th July 2007)

  5. #4
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    48
    Thanked 4 Times in 4 Posts

    Smile Re: QPalette::brush

    ah I see.. I knew it was something simple that I was missing...

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.