Python and Qt (PyQt) - calling method before resize event
-
06-09-2019 - |
Question
i have a question. There is application class in my program. It is inherited from QtGui.QMainWindow. In ini I call my own method which works with graphic. And it should be called before resize event. How can i do that? Thanks.
EDIT: As you can se here the value of resize event is 14, and show event is 17. So i should find event with less than 14 value.
I found my problem. In constructor before creating handle of image i'm moving window to some position... So during that action resizeEvent calls. Sorry for this question.
Solution
You could override in your class the resizeEvent
method (which QMainWindows
inherits from QWidget
), see http://doc.trolltech.com/4.4/qwidget.html#resizeEvent -- in your override, call your other code, then delegate the rest of the work to the parent's version of the method.