PySide Qt for Python : How to Window Close Button Event

in #pyside7 years ago

Learn PySide Qt for Python : How to Window Close Button Event

If you like this video then Do share the video in the article to your friends or in your social media accounts. You can also subscribe to the YouTube channel.

If you wish to learn through course, then check out Python Tool Development with PySide & PyQt on Udemy. There are very few good courses out there. So the linked here is one good course to save your time and money.

I recommend checking out GUI Programming With PySide Qt for Python. This course is definitely something you can start with if you are planning on creating some serious application. You can get a lot of answers to your Python for QT questions.

How to Window Close Button Event in PySide Qt for Python Examples

In order to set the close event for your window with say button or even without it. You have to make use of the QWidgets closeevent. I think it'd be definitely interesting to check this example out.

For example:

class MainWindow(QWidget): # or QMainWindow
    ...

    def closeEvent(self, event):
        # do stuff
        if can_exit:
            event.accept() # let the window close
        else:
            event.ignore()

So this is a good example for the video that you can check in action.

Check out the video for How to Window Close Button Event in PySide Qt for Python.

I recommend checking out GUI Programming With PySide Qt for Python book.

Let me know if you like the video.

I hope the information here helps you. I'd appreciate if you like the video and share it with others.

Coin Marketplace

STEEM 0.05
TRX 0.32
JST 0.082
BTC 65535.22
ETH 1791.47
USDT 1.00
SBD 0.42