i am making a software in which paint event painting a widget as per my need but the problem
is that when i re-size my application window it painted it again so please tell me the way
to stop paint event from painting my widget on resizing the main window.
my file are:
v_lab.h(http://qt.pastebin.com/tjHAWkPH)
v_lab.cpp(http://qt.pastebin.com/teJDmMmt)
main.cpp(http://qt.pastebin.com/gsUytaCN)
Thanks
No, you do want to redraw every time the main window resizes. But your design is somewhat weird, as you are creating random stuff inside the
paintEventfunction. You should create that stuff elsewhere as needed, store that stuff in a QPixmap or something and just redraw the image in thepaintEventfunction.In other words,
paintEventshould only repaint the view in its current state and should not contain anything that changes the state.