Results 1 to 3 of 3

Thread: Showing a label in a QwtPlot

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Showing a label in a QwtPlot

    Hello!

    I want to show some text label inside a QwtPlot but I'm not sure how to do it. I found three classes that may fit (QwtPlotMarker, QwtPotTextLabel and QwtTextLabel), but none of them worked till now. The last two I simply can't find a way how to put it in the desired coordinates, and I can't find a way to show the text with QwtPlotMarker without showing a line (which I don't want to do; I just want the text).


    I'm glad for any help,


    Momergil

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

    Default Re: Showing a label in a QwtPlot

    QwtPlotMarker is for showing a text label at a specific plot coordinate ( the default setting is without any lines, so don't tell me that you can't find a way without it ), QwtPotTextLabel is a text at a widget ( = canvas ) coordinate ( f.e. in the top/left corner ).

    Uwe

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

    Momergil (22nd November 2013)

  4. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Showing a label in a QwtPlot

    Thanks, Uwe.

    Now that was interesting: the problem was a matter of color; I was trying to paint a black label in a graph with a black background, without noticing that the place where I was telling the color was wrong - should have been the QwtText's color, not the line's one.

Similar Threads

  1. Replies: 4
    Last Post: 16th July 2013, 03:27
  2. QwtPlot x axis label
    By ldg20 in forum Qwt
    Replies: 5
    Last Post: 17th July 2012, 07:02
  3. Replies: 6
    Last Post: 14th May 2009, 12:02
  4. Replies: 1
    Last Post: 11th September 2008, 09:07
  5. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 09:03

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.