Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt Drawing 2d grid based maze
I need a little bit of advice. I work on a school project where robot goes through grid based maze (5x5) and then he sends coordinates of individual squares and obstacles in the squares to the database from which I read them and then I need to draw map of the maze. So my question is, what is the simplest way to make the grid. I thought the easy way would be to just draw 25 rectangles but I don't know if its possible to adjust the thickness of only one side of the rectangle.
hi @thalorn and welcome,
can you give us some more information?
Like target OS, and if you want to use QWidgets or QML ?
Hello, sure, targeted OS is Windows 10 and I would prefer QWidgets.
alight in that case, you have a couple of options.
The simplest one would be to subclass a QWidget and override the paintEvent and simply draw your maze there.
It's easily done, but not the fastest one (in processing and painting the data)
You can go a bit further and use a QGraphicsView/Scene und do your drawing there.
And there's also QOpenGlWidget, but that's most likely overkill for your situation.
For an example,
take this stack overflow thread
it has nice working examples on how to do it
@J-Hilk Thanks, I'm gonna try that