Results 1 to 3 of 3

Thread: Scale size of QwtPlotMarker/QwtSymbol

  1. #1
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Scale size of QwtPlotMarker/QwtSymbol

    Is there an easy way to scale the size of a QwtPlotMarker, that is a QwtSymbol? I'd like it scaled corresponding to my axes.

    Thanks,
    Joey

  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: Scale size of QwtPlotMarker/QwtSymbol

    Try one of the following:


    • Enable the QwtPlotItem::ScaleInterest flag and overload QwtPlotItem::updateScaleDiv()
    • Overload QwtPlotMarker::draw()
    • Use QwtPlotShapeItem


    Uwe

  3. #3
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Scale size of QwtPlotMarker/QwtSymbol

    I thought I would try the QwtPlotShapeItem, and that worked great!

    However, I wanted to attach a label to it as well. That API (setLabel) doesn't exist, so I thought I would create another QwtPlotShapeItem using addText of the QPainterPath. This sort of works. If I add a text, I have to set my point size to a large number (i.e. the size of the bounding rectangle) to see the text, but the text is also flipped! I notice none of the examples have a QwtPlotShapeItem with a text so maybe that was not supported? Or I'm missing something.

    Anyway, I used a combination of QwtPlotShapeItem and QwtPlotMarker to do what I needed, so thank you for the help!

    Joey

Similar Threads

  1. Replies: 2
    Last Post: 20th July 2015, 07:14
  2. Scale individual QGraphicsItem's size and position
    By klep in forum Qt Programming
    Replies: 1
    Last Post: 17th December 2011, 09:29
  3. How to re-scale or changing the size of a QGrapicsScene
    By KristianKarl in forum Qt Programming
    Replies: 2
    Last Post: 9th August 2010, 18:34
  4. Replies: 4
    Last Post: 11th July 2010, 10:47
  5. Scale size of QGraphicsItem without scaling pen width
    By Lodorot in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2009, 01:18

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.