Feature request: 'del app' automatically

BPL <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CAAfY3fb-i59SM3xi8tsehT47t=1kZr1imWrBdz=XsRG1G1jDZg@mail.gmail.com>
Phil,

A while ago I'd posted you a bug that happened when copying content to the
clipboard and the information copied being lost when exiting the app... at
that time you'd provided a fast hack that "solved" the issue, let me bring
back your answer here at that time:

Ok I can now reproduce the problem. It also happens with C++ when the
> QApplication is created on the heap and not explicitly destroyed.
> The workaround in your test is to 'del app' at the end of the script.
> Tonight's PyQt snapshot adds support for using QCoreApplication (and
> sub-classes) as a context manager which calls the C++ dtor when exiting
> the context. So...
> with QApplication([]) as app:
>      ....
>      app->exec()
> Phil


Thing is, in pyside2 you don't need to use any context manager to provide
clipboard reliable behaviour so my question is, how hard would be for you
to fix this issue properly without forcing the user to use this context
manager at all?

Asking cos I have apps where everything is a plugin, even QApplication &
subclasses are just plugins so I don't even know how or when they'll be
instantiated... being forced to use this context manager is really
inconvenient and ugly in many cases (not just mine) so having a reliable
behaviour of the clipboard without these context managers like pyside2
would be awesome!!! :)

Thanks in advance.

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.