Qt Widgets App that uses QPainter to draw random rectangles generated on each click within the main window.
CMake
Random Rectangles
This Qt Widgets Project uses the C++ random library to generate random rectangles within a Qt Widgets MainWindow. Users can regenerate them simply by clicking within the window or resizing.
Thus, you experience pleasing output as such:
The number of rectangles drawn can be adjusted by changing the for loop in the paintEvent function. The geometry of the rectangles and color range can also be adjusted here.