top of page
Search
hardpuncpuncpronel

Pyqt-close-window-event

PySide / PyQt detect if user trying to close window ... def closeEvent(self, event): # do stuff if can_exit: event.accept() # let the window close else: event.ignore().












pyqt-close-window-event


May 11, 2020 — class MainWindow(QWidget): # or QMainWindow ... def closeEvent(self, event): # do stuff if can_exit: event.accept() # let the window close else: .... exit() to close everything. Now, since the close_application method is a part of our Window class, to call it, all we need to do is self .... Qt.WindowFlags f = 0 (where available) sets the window flags; the default is suitable for almost all widgets, ... The parent argument, if not None, causes self to be owned by Qt instead of PyQt. ... The widget is hidden if it accepts the close event. 939c2ea5af





0 views0 comments

Recent Posts

See All

Comments


bottom of page