I tried with the following code
{
return ( p1.x() < p2.x() );
}
{
qSort(un.begin(),un.end(),lessThanPoint);
return un;
}
bool MyPlot::lessThanPoint(const QPointF &p1, const QPointF &p2)
{
return ( p1.x() < p2.x() );
}
QPolygonF MyPlot::combine(const QPolygonF &p1, const QPolygonF &p2)
{
QPolygonF un(p1.united(p2));
qSort(un.begin(),un.end(),lessThanPoint);
return un;
}
To copy to clipboard, switch view to plain text mode
but I get
myplot.cpp:943: error: no matching function for call to ‘qSort(QPointF*, QPointF*, <unresolved overloaded function type>)’
/usr/local/Trolltech/Qt-4.4.0/include/QtCore/qalgorithms.h:203: note: candidates are: void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QPointF*, LessThan = bool (MyPlot::*)(const QPointF&, const QPointF&)]
Bookmarks