Results 1 to 9 of 9

Thread: Change the position of Label of the QwtPlotMarker

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jun 2013
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Change the position of Label of the QwtPlotMarker

    Hello i am using qwt 5.2 and qt 4.6 versions.

    1) I checked the itemeditor example and hence qwt_widget_overlay class does not exist in qwt 5.2 i copied it to my project and tried to compile it.

    But when i compile it i get a linking error for the line "QMetaObject::invokeMethod" line. I think the method trying to be invoked does not exist in my qwt version, right? (QwtPlotCanvas::borderPath).

    What can i do in this situation? Please help, i have written everything for moving label, only this left.

    Qt Code:
    1. void QwtWidgetOverlay::draw( QPainter *painter ) const
    2. {
    3. QWidget *widget = const_cast< QWidget *>( parentWidget() );
    4. if ( widget )
    5. {
    6. painter->setClipRect( parentWidget()->contentsRect() );
    7.  
    8. // something special for the plot canvas
    9. QPainterPath clipPath;
    10.  
    11. ( void )QMetaObject::invokeMethod(
    12. widget, "borderPath", Qt::DirectConnection,
    13. Q_RETURN_ARG( QPainterPath, clipPath ), Q_ARG( QRect, rect() ) );
    14.  
    15. if (!clipPath.isEmpty())
    16. {
    17. painter->setClipPath( clipPath, Qt::IntersectClip );
    18. }
    19. }
    20.  
    21. drawOverlay( painter );
    22. }
    To copy to clipboard, switch view to plain text mode 

    2) in the QwtWidgetOverlay class it calls "QwtPlotCanvas::invalidateBackingStore" method. Again this method does not exist in qwt 5.2. There is a method called "invalidateCache" in qwt 5.2.
    Does it do the similar things? Can i use it?
    Last edited by kerberos84; 27th June 2013 at 14:35.

Similar Threads

  1. QwtPlotMarker label position
    By mole in forum Qwt
    Replies: 4
    Last Post: 21st May 2013, 07:27
  2. Replies: 2
    Last Post: 7th June 2012, 13:04
  3. Qwt: Unable to draw the label from qwtplotmarker?
    By sonulohani in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2012, 13:55
  4. Replies: 5
    Last Post: 11th January 2011, 06:37
  5. make label of QwtPlotMarker invisible
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 26th November 2009, 12:39

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
  •  
Qt is a trademark of The Qt Company.