QWidget resize signal ?

QWidget resize signal ?

Asked on January 8, 2019 in Qt.
Add Comment


  • 3 Answer(s)

    QWidget resize signal:

            In the  QObject   have the tough relation to that QWidget and  use QObject::installEventFilter QObject * filter and overload bool eventFilter(QObject *, QEvent *.  Qt docs

     

    Answered on January 8, 2019.
    Add Comment

    The simple statement is:

    The given derive from the  widget class and complement the resizeEvent event

    Answered on January 8, 2019.
    Add Comment

    By using the Python with PyQt4,  and set widget.resizeEvent without using subclass:

    #!/usr/bin/env python
    import sys
    from PyQt4 import QtCore, QtGui
     
    def onResize(event):
    print event
     
    if __name__ == "__main__":
        app = QtGui.QApplication(sys.argv)
         widget = QtGui.QPushButton('Test')
         widget.resizeEvent = onResize
         widget.resize(640, 480)
         widget.show()
         sys.exit(app.exec_())
    
    Answered on January 8, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.