Results 1 to 3 of 3

Thread: no matching function for call to 'PlotPicker::invTransform(QPointF)'

  1. #1
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default no matching function for call to 'PlotPicker::invTransform(QPointF)'

    Hi,
    I am new to C++ and QT, I am trying to use qwt plot picker with invTrasform, but I cannot manage it. User draws a rectangular with the mouse on the plot and I try to get the actual x,y coordinates.

    I created a plot picker:

    Qt Code:
    1. picker = new PlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,QwtPicker::RectRubberBand, QwtPicker::AlwaysOn, myPlot->canvas());
    To copy to clipboard, switch view to plain text mode 

    I am trying to get the coordinates from a QRect that the user draws with mouse

    Qt Code:
    1. connect(continuum_picker, SIGNAL(selected(QRectF&)), this, SLOT(onContinuumAreaSelected(const QRectF&)));
    To copy to clipboard, switch view to plain text mode 

    Implementing the SLOT
    Qt Code:
    1. void my2dPlot::onContinuumAreaSelected(const QRectF& selectedRect)
    2. {
    3. ...
    4. float w = QwtPlotPicker::invTransform(selectedRect.bottomRight()).x();
    5.  
    6. ....
    7. }
    To copy to clipboard, switch view to plain text mode 
    I get the error:
    Qt Code:
    1. error: no matching function for call to 'PlotPicker::invTransform(QPointF)'
    2. candidates are: QRectF QwtPlotPicker::invTransform(const QRect&) const
    3. note: QPointF QwtPlotPicker::invTransform(const QPoint&) const
    To copy to clipboard, switch view to plain text mode 

    Any ideas?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: no matching function for call to 'PlotPicker::invTransform(QPointF)'

    The function expects a rectangle and not a point.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: no matching function for call to 'PlotPicker::invTransform(QPointF)'

    thank you very much, it was so obvious, but after some hours you can't really see the simplest things( perhaps in life too )
    Today I realised that the selected(QRectF&) SIGNAL, sends the actual plot points to the slot and not the mouse position (that should later be converted to plot points with invTransform())

    Qt Code:
    1. QPointF tempPoint(selectedRect.bottomRight().x(), selectedRect.bottomRight().y() ) ;
    To copy to clipboard, switch view to plain text mode 

    but there is some kind of magic here. While debugging I see that when you call the bottomRight() you receive the topRight() and when you call the bottomLeft() you get the topLeft()!!
    Is it possible? Does it have to do with the way the user makes the rect on screen?
    I am using Qwt-6.0.0-rc5.

Similar Threads

  1. Replies: 5
    Last Post: 11th March 2015, 09:30
  2. Replies: 7
    Last Post: 23rd September 2012, 16:53
  3. about no matching function for call to
    By Alain Delon in forum General Programming
    Replies: 1
    Last Post: 5th March 2011, 21:30
  4. no matching function for call to setupUi
    By ctote in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2010, 15:20
  5. No Matching function to call...
    By weepdoo in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 17:30

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.