[PyQt] Segfault with QDesktopServices.openUrl

Kovid Goyal kovid at kovidgoyal.net
Thu Aug 21 16:19:59 BST 2014


On Thu, Aug 21, 2014 at 01:42:02PM +0000, David Boddie wrote:
> There's some code in openUrl() that expects to find a platform integration
> instance to use, which I believe only exists if you create a QApplication
> instance first:

Oh I know that the code as is *requires* QApplication. My point was that
it doesn't actually *need* QApplication. The dependency on QApplication is
a (probably) unintended side effect of the move to the QPA architecture.

> 
> QPlatformServices *platformServices = QGuiApplicationPrivate::platformIntegration()->services();
> if (!platformServices) {
>     qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO);
>     return false;
> }
> 
> > Not to mention that in most other places where you try to use
> > functionality from Qt that requires QApplication, you get a clean erorr
> > message and a call to _exit(), not a segfault.
> 
> Please file a bug against Qt for this. At the very least, openUrl() should
> check that a platform integration instance exists before checking for its
> services.

I have half a dozen bug reports filed for Qt 5 regressions, most of
which have been ignored for months, I'd rather not spend the time on any
more, for issues that I can workaround easily, but feel free to file one
yourself, if this issue affects you.

Kovid.

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140821/2b8c38a2/attachment.sig>


More information about the PyQt mailing list