Results 1 to 2 of 2

Thread: Qwt: Unable to draw the label from qwtplotmarker?

  1. #1
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Lightbulb Qwt: Unable to draw the label from qwtplotmarker?

    Sir, this is my code:-
    in .h file
    Qt Code:
    1. class Marker:public QwtPlotMarker{
    2.  
    3.  
    4. public:
    5. virtual void drawLabel(QPainter *painter, const QRectF &, const QPointF &pt) const{
    6. painter=new QPainter;
    7. QImage pixx(":/Images/AlarmEvent.png");
    8. QRectF r(1,1,10,10);
    9. painter->drawImage(r,pixx);
    10. }
    11. };
    To copy to clipboard, switch view to plain text mode 

    in .cpp file

    Qt Code:
    1. Marker *mark;
    2. mark=new Marker;
    3. mark->setValue(xData_1.at(0),yData_1.at(0));//this is where i want to place the marker.
    4. mark->attach(plot);
    To copy to clipboard, switch view to plain text mode 

    Sir, it is not showing any label on the marker. Why is this happening? Is something wrong in the code? Please Guide Me.

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: Unable to draw the label from qwtplotmarker?

    This is wrong as i am creating an object of the QPainter. Sorry but now it is solved.

Similar Threads

  1. Replies: 15
    Last Post: 31st January 2020, 19:25
  2. Unable to get my spinbox to display (all that shows is the associated label)
    By bschumacher in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 17th May 2012, 03:32
  3. how to draw background color of a label
    By gauravg in forum Qt Programming
    Replies: 1
    Last Post: 1st November 2011, 04:46
  4. make label of QwtPlotMarker invisible
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 26th November 2009, 13:39
  5. Draw a line in a Label
    By sabeesh in forum Qt Programming
    Replies: 4
    Last Post: 23rd July 2007, 14:27

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.