Results 1 to 2 of 2

Thread: Closing an external application with qt

  1. #1
    Join Date
    Oct 2012
    Location
    Ghana
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Closing an external application with qt

    Hello everyone,
    Please how do i close an application i previously opened with
    Qt Code:
    To copy to clipboard, switch view to plain text mode 
    in qt c++.
    Because i need to update text in a pdf i already opened outside my application at a point in time.
    And also i would like to know the difference between
    Qt Code:
    1. [DOCS]QDesktopServices::OpenURL[/DOCS]
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. [DOCS]Qt::openUrlExternally[/DOCS]
    To copy to clipboard, switch view to plain text mode 
    and basically when to use them.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,594
    Thanks
    13
    Thanked 1,588 Times in 1,517 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Closing an external application with qt

    Quote Originally Posted by Capton View Post
    Please how do i close an application i previously opened with QDesktopServices::OpenURL
    You don't. QDesktopServices::openUrl() is fire-and-forget. Your program has only knows whether the operating system successfully opened something to handle the URL you gave it (return value), not how that process might be identified, or whether there was actually a unique process and not, for example, another tab in existing process. If you need that sort of control you should look at QProcess.
    i would like to know the difference between QDesktopServices::OpenURL and Qt::openUrlExternally and basically when to use them.
    Ignoring the typos... QDesktopServices::openUrl() is a C++ construct, and Qt.openUrlExternally() is QML. They both do the same thing in different environments.

Similar Threads

  1. Access violation when closing application
    By doggrant in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2012, 15:07
  2. QDockWidget gets hidden when closing application
    By Boron in forum Qt Programming
    Replies: 3
    Last Post: 11th February 2010, 09:00
  3. Application Closing
    By manti_madhu in forum Qt Programming
    Replies: 2
    Last Post: 27th November 2009, 09:55
  4. Problem with closing the application
    By macbeth in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2008, 15:02
  5. application freezes without crashing (and closing)
    By nass in forum Qt Programming
    Replies: 15
    Last Post: 25th September 2007, 11:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.