How to implement Grid/Dots in Qwidget background
-
wrote on 6 May 2014, 12:59 last edited by
!http://i.imgur.com/I7HR9is.png(http://i.imgur.com/I7HR9is)!
can any body help me with how to implement this dots or gris form in backround or Qwidget or any other ?
-
wrote on 6 May 2014, 14:59 last edited by
You could look at how QtDesigner does it, but it seems simple enough to me. Subclass a QWidget, reimplement the paintEvent, and simply fill the widget area with a pattern. You can do that by creating a small QImage in which you draw a single dot, set that image on a QBrush, and use that brush to fill the widget rect with QPainter.
-
wrote on 6 May 2014, 15:50 last edited by
Take a look on "Undo Framework example":http://qt-project.org/doc/qt-5/qtwidgets-tools-undo-example.html they show grid background.
You can do something similar to have dotted background.
1/3