Results 1 to 15 of 15

Thread: Change the color of QRubberBand

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Default Re: Change the color of QRubberBand

    Quote Originally Posted by Lykurg View Post
    Use QPainter instead of QStylePainter since you don't use it's possibilities. And then use QPainter::setBrush() to define the fill color.
    It works,
    thank you
    Franco Amato

  2. #2
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: Change the color of QRubberBand

    Hi

    just for those not wanting to re-implement a paint event for changing colors:

    calling
    Qt Code:
    1. setStyleSheet("selection-background-color: yellow");
    To copy to clipboard, switch view to plain text mode 
    on a QRubberBand changes the background color of the selected area to yellow as expected.

    Hope this will help someone.

    Clément.

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

    mvuori (4th August 2011)

Similar Threads

  1. Replies: 2
    Last Post: 30th June 2009, 18:08
  2. Change database data in the QTabelView
    By sophister in forum Qt Programming
    Replies: 3
    Last Post: 9th April 2009, 17:40
  3. Change cursor & status during Drag & Drop
    By ronlongo in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2008, 17:56
  4. statusBar() message color change
    By mclark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2007, 00:20
  5. Can't change the text display of a QTreeview item.
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 2nd June 2006, 02:03

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.