Results 1 to 7 of 7

Thread: QDesktopServices or QProcess for launching external applications

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Oulu, Finland
    Posts
    23
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices or QProcess for launching external applications

    My opinion is that if you have set some special file handler for the .exe files (which I think is quite rare occasion) then it should be opened with that handler (for example that hex editor), otherwise it should just be executed (as there's no file handlers assigned for the type). And again this is just my humble opinion and the first impression which I had when I tried the QDesktopServices

    Btw, on Windows it launches the .exe file automatically if you haven't changed the handler for the .exe files. So this is why i was assuming the same functionality for the Linux systems... I don't know if this is a distribution dependent issue, but at least with Ubuntu it won't launch it.

    And thanks again for the comments Wysota.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDesktopServices or QProcess for launching external applications

    Quote Originally Posted by Tepi View Post
    My opinion is that if you have set some special file handler for the .exe files (which I think is quite rare occasion) then it should be opened with that handler (for example that hex editor), otherwise it should just be executed (as there's no file handlers assigned for the type). And again this is just my humble opinion and the first impression which I had when I tried the QDesktopServices
    And if we were talking about an image type? Should the image be executed too if there was no handler assigned to it? What purpose would it serve?

    Btw, on Windows it launches the .exe file automatically if you haven't changed the handler for the .exe files.
    "It" meaning what? QDesktopServices? Maybe there's a handler installed for executable files on Windows. There is no such handler on Unix systems, it wouldn't make much sense. It is the executable bit that marks if the file can be executed or not and not the file type.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2009
    Location
    Oulu, Finland
    Posts
    23
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices or QProcess for launching external applications

    And if we were talking about an image type? Should the image be executed too if there was no handler assigned to it? What purpose would it serve?
    Nope, of course not. That's not the point. In the case some image type doesn't have handler assigned, system would ask user with what program the file should be opened, as it is doing now by default. Why would the image file type have "execute" permissions? I see no point on that...

    So when we have some executable file with "execute" permissions which has no hadler assigned to it, wouldn't it seem logical just to launch it?

    "It" meaning what? QDesktopServices?
    Yep, "it" meaning QDesktopServices.

    I looked the "File types" list on Windows and there wasn't anything assigned to the .exe files. So to test it I assigned a Hex Editor for handling the .exe files. It did the job as expected, opened .exe files with Hex Editor. But before I added the handler I noticed that there wasn't any special handler assigned to the .exe files but it was marked as "Type of File: Application" and I quess this is the reason why the Windows understands that the file is meant to be executed.

    So here I come back to the argument that if in unix system we have a file that hasn't got any handler assigned to it and it still has "execute" permissions allowed, why shouldn't it be launched by the QDesktopServices? Same manner as it is launched when you double click the icon on your file system.

    And these replies aren't meant for offence by any means, on the contrary. Just wanted to know about this issue which bothered me...

    -Tepi

Similar Threads

  1. Problems launching a windows exe from Qt (using QProcess)
    By smacchia in forum Qt Programming
    Replies: 8
    Last Post: 21st March 2012, 10:05
  2. running external applications via QT?
    By cruisx in forum Newbie
    Replies: 1
    Last Post: 11th August 2009, 06:34
  3. Replies: 1
    Last Post: 1st December 2008, 21:02
  4. Replies: 7
    Last Post: 19th January 2008, 15:29
  5. Launching external web browser from within Qt App
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 18:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.