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 draw the border of the hull. Making menu buttons and such is simple enough, but I’m not sure I know the tools to do this.
How do you do this?
You can just create a custom class deriving from
QWidgetwhere you override thevoid paintEvent(QPaintEvent* event)method. In that you put the points into some sort of point list, eitherstd::vector<QPoint>orQList<QPoint>and then paint it with a Polyline method. For instance: