[PyQt] QApplication.clipboard() segfault on GNU/Linux

BPL spscener84 at gmail.com
Wed Jul 24 09:27:44 BST 2019


That's right, inheritance goes like this:

QCoreApplication -> QGuiApplication -> QApplication

And clipboard is a public static member of QGuiApplication

On Wed, Jul 24, 2019 at 10:13 AM Tiger-222 <contact at tiger-222.fr> wrote:

> Oh I see what is missing from my original message :o
> This is the snippet that fails on a segfault:
>
>     >>> from PyQt5.QtCore import QCoreApplication
>     >>> from PyQt5.QtWidgets import QApplication
>     >>> with QCoreApplication([]) as app:
>     ...    print(QApplication.clipboard().text())
>
> And using QApplication.instance().clipboard().text() will return
> "AttributeError: 'QCoreApplication' object has no attribute 'clipboard'".
>
> The clipboard is only something used in the GUI world? And so it is not
> accessible via QCoreApplication?
>
>
>
> -----
> Mickaƫl Schoentgen.
> [FR] Personal blog: http://www.tiger-222.fr
> --
> Sent from: http://python.6.x6.nabble.com/PyQt-f1792048.html
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190724/4fc7c500/attachment.html>


More information about the PyQt mailing list