Results 1 to 2 of 2

Thread: Placing multiple QwtText or QString at different heights on a QwtPlot

  1. #1
    Join Date
    Jun 2024
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Placing multiple QwtText or QString at different heights on a QwtPlot

    Hello everyone! Please help, I'm trying to place different inscriptions on a QwtPlot object. I can't find in the documentation how to place inscriptions using a QPoint object. I could only find how to place QwtText using Qt::AlignmentFlag, in which case it is impossible to place one inscription above another.

    I am attaching an example of what I would like to receive.

    Снимок экрана 2025-03-12 192228.jpg

    This is a code snippet from the documentation that I used as a reference and tried to find similar methods to set text at the desired position in other classes (e.g. QwtPlotTextLabel, QwtText, QwtTextLabel, QwtPlotItem, QwtLegend, QwtLegendLabel etc.)

    Снимок экрана 2025-03-12 193004.png

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

    Default Re: Placing multiple QwtText or QString at different heights on a QwtPlot

    You can control the position using the margin property of the item and the alignment ( QwtText::renderFlags ) of the text.
    If this is not good enough you can also overload QwtPlotTextLabel::textRect() and return the bounding rectangle for the text being calculated from whatever you like.

    HTH,
    Uwe

Similar Threads

  1. Replies: 2
    Last Post: 1st September 2022, 21:41
  2. Replies: 3
    Last Post: 2nd May 2015, 18:14
  3. Replies: 0
    Last Post: 21st November 2013, 07:39
  4. QwtPlotRenderer for multiple QwtPlot
    By Momergil in forum Qwt
    Replies: 1
    Last Post: 18th January 2013, 12:09
  5. QwtPlot - multiple axis
    By MukundanAR in forum Qwt
    Replies: 1
    Last Post: 7th March 2012, 08:53

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.