[Interest] porting Qt4 -> 5, QDesktopServices::openUrl() fails

Shantanu Tushar shaan7in at gmail.com
Wed Apr 8 11:30:14 CEST 2015


Works fine for me, I tried this-

QDesktopServices::openUrl(QUrl::fromLocalFile("c:/Qt"));

and it opened up Windows Explorer with that directory. On Qt5.4.1 MSVC 2010
32bit.

On Wed, Apr 8, 2015 at 2:51 PM, Felix morack <felixover at gmail.com> wrote:

> Hi,
>
> I am porting code from Qt4 to Qt5 and the behavior of
> QDesktopServices::openUrl() seems to have changed.
>
> We want to open a folder/path in the default explorer shell, which was
> done like so:
>
>  QDesktopServices::openUrl(QUrl::fromLocalFile("c:/testdir/");
>
> Even though it says "from local file" it would open the directory just
> fine, and there are several forum entries online that recommend doing just
> that.
>
> However, in Qt5 the same code fails silently at runtime due to it not
> pointing to a valid file. The documentation has remained the same.
>
>
> Was there a silent change in behavior? Is this a regression? What is the
> recommended way to open a path in the default shell?
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>


-- 
Shantanu Tushar    (UTC +0530)
shantanu.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150408/01908c0b/attachment.html>


More information about the Interest mailing list