Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Open File like double clicking it
Qt 6.11 is out! See what's new in the release blog

Open File like double clicking it

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fuel
    wrote on last edited by
    #1

    In Windows i can open any File by double clicking it. It will be opened with the Favourit Programm, like images or Videos. Now i have a Listbox with Items, like Images. And i want to trigger an Event that open me the Item with a double click. The Items are Files on my PC. Anyone know how i can solve this? Maybe with QProcess?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QDesktopService::openUrl is likely what you are looking for.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • Z Offline
        Z Offline
        ZiJia
        wrote on last edited by
        #3

        Here is a static method which can deal with it.

        QDesktopService::openUrl(const QUrl &url);

        The url is location of your file.

        1 Reply Last reply
        1
        • F Offline
          F Offline
          Fuel
          wrote on last edited by
          #4

          nice thx

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved