Results 1 to 2 of 2

Thread: QwtPlotMarker with "non-transparent" background?

  1. #1
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    34
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QwtPlotMarker with "non-transparent" background?

    Hi

    This really feels like a question which I should not need to ask. Probably the answer is right in front of my nose... Anyhow, I have a couple of marker texts (QwtPlotMarker) in my plot and when two of them sometime partly overlap due to plot size etc, I would prefer to have one of them cover the other (in the overlapping area), instead of seeing the texts from both markers.

    If I could make sure the markers have a (white) background and really have that backgound cover the other marker (which has a lower z-value), I would be really glad. I tried setting the backgound brush of the QwtText (which I use as marker label) to QBrush(Qt::white) but still I see the text from both markers even in the overlapping area. What am I missing?

    Thanks in advance!

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotMarker with "non-transparent" background?

    Quote Originally Posted by dobedidoo View Post
    I tried setting the backgound brush of the QwtText (which I use as marker label) to QBrush(Qt::white) but still I see the text from both markers even in the overlapping area.
    The following code results in a opaque white background for the text:

    Qt Code:
    1. QwtText text( ... );
    2. text.setBackgroundBrush( Qt::white );
    3. ...
    To copy to clipboard, switch view to plain text mode 
    Then all what's left is to adjust the z values of the plot items, so that the marker with the background is rendered on top of the other.

    Uwe

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 11:02
  2. Replies: 2
    Last Post: 27th April 2015, 12:36
  3. Replies: 3
    Last Post: 16th March 2015, 08:31
  4. Replies: 1
    Last Post: 22nd January 2010, 15:45
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20: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.