Results 1 to 2 of 2

Thread: How to rotate QwtSymbol

  1. #1
    Join Date
    Jul 2014
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to rotate QwtSymbol

    Hello,
    I am beginner in qt and i would like it know if i can rotate a QwtSymbol. My code is as follows:

    QwtSymbol *statesym1 = new QwtSymbol();
    statesym1->setStyle(QwtSymbol::Rect);
    statesym1->setPen(QColor(Qt::black));
    statesym1->setBrush(Qt::black);
    statesym1->setSize(30,15);

    QwtPlotMarker * marker = new QwtPlotMarker;
    marker->setSymbol(statesym1);
    marker->setXValue(2);
    marker->setYValue(3);
    marker->attach(this);

    I am using Qwt 6.1.1 and qt4.8.6

  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: How to rotate QwtSymbol

    Quote Originally Posted by Suchitra View Post
    I am beginner in qt and i would like it know if i can rotate a QwtSymbol.
    All simple symbol types ( Ellipse-> Hexagon ) can't be rotated easily, but those are convenience only.

    But using a QPainter with a transformation matrix ( QTransform ) you can create rotated graphics easily and pass them as QPixmap, SVG document or QwtGraphic ( preferable as this one is scalable ! ).
    Another solution might be to create a QPainterPath and to rotate it using QTransform::map() before passing it as symbol.

    Uwe

Similar Threads

  1. Replies: 2
    Last Post: 28th February 2014, 16:04
  2. Tooltip to QwtSymbol ???
    By jesse_mark in forum Qwt
    Replies: 15
    Last Post: 17th October 2012, 10:49
  3. Replies: 4
    Last Post: 29th March 2011, 21:33
  4. Alignment of QwtSymbol
    By FelixB in forum Qwt
    Replies: 2
    Last Post: 11th January 2011, 09:40
  5. QwtSymbol highlighting?
    By shud in forum Qwt
    Replies: 1
    Last Post: 2nd October 2009, 22:42

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.