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. how to start other Application(eg.Photoshop) in my Qt app?

how to start other Application(eg.Photoshop) in my Qt app?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 2.4k Views 4 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    how to start other Application(eg.Photoshop) in my Qt app?
    i want to start Photoshop to open a image which is on local network in my Qt app...
    thank you

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by
      #2

      I would use QProcess::execute to do the job.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      O 1 Reply Last reply
      0
      • JohanSoloJ JohanSolo

        I would use QProcess::execute to do the job.

        O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        @JohanSolo
        thank you.
        how can i know there is Photoshop installed on their PC, and if not, how can i open a dialog in which the user can choose the exe to do their things if the default app is not installed on there PC.

        1 Reply Last reply
        0
        • JohanSoloJ Offline
          JohanSoloJ Offline
          JohanSolo
          wrote on last edited by
          #4

          Well, it depends a lot on the target platform. On windows I have no smart idea. You can of course decide to look for the exe in C:/Program Files and C:/Program Files (x86) but this will fail when people use other install path. Maybe there's a preference folder in %APPDATA% which you could detect.

          `They did not know it was impossible, so they did it.'
          -- Mark Twain

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            As @JohanSolo says, it -really- depend on what platform.

            If windows, you can also go look at registry
            HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Photoshop
            Somewhere - there is even listed where its installed so plug-ins can find the folder.

            On windows, you could also, just open what ever app that is listed to open the .XXX of your file.

            Like
            ShellExecute(0, 0, L"c:\outfile.txt", 0, 0 , SW_SHOW );

            Opens what ever text editor .txt is assigned too.

            If you want it to be cross platform, you should use a QFileOpen Dialog to allow user to select
            the exe file to use.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              opengpu2
              wrote on last edited by
              #6

              thank you for all.
              the best solution i think is directly open the file with the related EXE, if there is no related EXE, then open a dialog which allow the user to choose a exe to open it.
              and there should be a "Open With..." menu which allow the user to choose the Defalut related EXE.

              of course, i want this cross-platform. however, now i am on Windows.

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

                Hi,

                QDesktopServices::openUrl is the tool for that

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

                O 2 Replies Last reply
                1
                • SGaistS SGaist

                  Hi,

                  QDesktopServices::openUrl is the tool for that

                  O Offline
                  O Offline
                  opengpu2
                  wrote on last edited by opengpu2
                  #8

                  @SGaist thank you, it works!
                  but now i want to open a file on server, eg. it's address is "//server/folder/abc/imgae.jpg", i tried, but it failed and return value is false.
                  //
                  thank you , got it.
                  fromLocalFile works!!!

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    QDesktopServices::openUrl is the tool for that

                    O Offline
                    O Offline
                    opengpu2
                    wrote on last edited by opengpu2
                    #9

                    @SGaist Help!
                    how to drag from a Qt app to OS(eg. Windows) explorer or desktop ?

                    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