Drawing lines between points entered on a mouse click.
-
Hi,
I’m working on a qt project. The user should input points to a screen on a mouse click. These points are braille dots, I want to translate these points to real characters. I'm thinking of a way to do that but I'm a beginner in qt and I need help.
Braille dots are arranged in 2 columns and 3 rows I'm thinking of drawing lines between braille dots then a shape will be produced some dots will create a horizontal line, vertical line, angles, diagonal lines, rectangles and diagonal polygon. Can I do that in qt ? (how can I draw lines between points on a mouse click? how can I recognize each shape after drawing ?) and If I can what functions should I use. -
Hi,
"QGraphicsPathItem":http://doc.qt.io/qt-5/qgraphicspathitem.html comes to mind with "QPainterPath":http://doc.qt.io/qt-5/qpainterpath.html
-
Hi,
You will need to create a custom widget for this. Subclass the QWidget class, and override the paintEvent method. Then you can paint whatever you want :)
Read this:
http://qt-project.org/doc/qt-4.8/qwidget.html#paintEvent