Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qwidget height() and width() changing
Drj312 last edited by
I'm trying to learn how to draw using QPainter. I'm basing the renderarea class off the basic drawing example. I'm making a QPainterPath with this
@ void RenderArea::Path()
void RenderArea::paintEvent(QPaintEvent * /* event */)
The issue is that when I click the push button that triggers Path(), the first time it runs, the line does not extend the entire height of the renderarea widget. The same happens if I try to draw across using width(). However, if I click the push button again, height() and width() will extend across the widget as expected. What am I missing? I don't understand why height() and width() change.