I am writing an application in C++ with QT where you have n points and compute the convex hull of this. However, once this is computed I have no idea how to plot the points and
You can just create a custom class deriving from QWidget
where you override the void paintEvent(QPaintEvent* event)
method. In that you put the points into some sort of point list, either std::vector
or QList
and then paint it with a Polyline method. For instance:
void Foo::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
std::vector points;
// Fill points with the points
painter.drawPolyLine(points.data(), static_cast(points.size()));
}