@@ -0,0 +1,1444 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# See https://doc.qt.io/qt-5/qpainter.html#drawText%0A%0Aimport sys%0Aimport datetime%0A%0Afrom PyQt5.QtWidgets import QApplication, QWidget, QAction%0Afrom PyQt5.QtCore import Qt%0A%0Aclass MainWindow(QWidget):%0A%0A    def __init__(self):%0A        super().__init__()%0A%0A        # see https://stackoverflow.com/a/17631703  and  http://doc.qt.io/qt-5/qaction.html#details%0A%0A        action = QAction(self)%0A        action.setShortcut(Qt.Key_F)%0A%0A        action.triggered.connect(self.fullscreen_toggle_key_callback)%0A        self.addAction(action)%0A%0A%0A    def fullscreen_toggle_key_callback(self):%0A        if self.windowState() & Qt.WindowFullScreen:         # https://stackoverflow.com/questions/17834835/test-if-qquickview-qwindow-is-full-screen-in-qt-5-0-x%0A            self.showNormal()                                # %3C- NORMAL SCREEN%0A        else:%0A            self.showFullScreen()                            # %3C- FULL SCREEN%0A%0A%0Aif __name__ == '__main__':%0A    app = QApplication(sys.argv)%0A%0A    main_window = MainWindow()%0A    main_window.show()%0A%0A    # The mainloop of the application. The event handling starts from this point.%0A    # The exec_() method has an underscore. It is because the exec is a Python keyword. And thus, exec_() was used instead.%0A    exit_code = app.exec_()%0A%0A    # The sys.exit() method ensures a clean exit.%0A    # The environment will be informed, how the application ended.%0A    sys.exit(exit_code)%0A

Add a snippet.