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 the file in the same instance of the application
Forum Updated to NodeBB v4.3 + New Features

Open the file in the same instance of the application

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.4k Views 2 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.
  • vivianV Offline
    vivianV Offline
    vivian
    wrote on last edited by
    #1

    I have written an application in Qt where it reads an xml file (file with diagrams and scene). I had registered the extension to open with my application on double clicking in Windows.
    This file would open a new tab (which is a feature of the application. So I could open several files together in tabs. This behaviour seemed to have disappeared. Now each time I double click on the file it opens a new instance. The difference I noticed when I upgraded to 5.7.0 (Sorry but during the several upgrades might have missed which upgrades had this broken).

    Not sure if this is a setting in Qt which can be triggered back. Windows OS questions seem like this has to be baked within the application since the OS does not handle this.

    If I need to provide more information please let me know. I hope I have framed the question correctly.

    Thanks in advance.

    jsulmJ A 2 Replies Last reply
    0
    • vivianV vivian

      I have written an application in Qt where it reads an xml file (file with diagrams and scene). I had registered the extension to open with my application on double clicking in Windows.
      This file would open a new tab (which is a feature of the application. So I could open several files together in tabs. This behaviour seemed to have disappeared. Now each time I double click on the file it opens a new instance. The difference I noticed when I upgraded to 5.7.0 (Sorry but during the several upgrades might have missed which upgrades had this broken).

      Not sure if this is a setting in Qt which can be triggered back. Windows OS questions seem like this has to be baked within the application since the OS does not handle this.

      If I need to provide more information please let me know. I hope I have framed the question correctly.

      Thanks in advance.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @vivian Are you sure it was working before as you described?
      Actually you have to implement this in your app. I don't think Qt ever supported this without additional implementation.
      There is something you can use for this: https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • vivianV vivian

        I have written an application in Qt where it reads an xml file (file with diagrams and scene). I had registered the extension to open with my application on double clicking in Windows.
        This file would open a new tab (which is a feature of the application. So I could open several files together in tabs. This behaviour seemed to have disappeared. Now each time I double click on the file it opens a new instance. The difference I noticed when I upgraded to 5.7.0 (Sorry but during the several upgrades might have missed which upgrades had this broken).

        Not sure if this is a setting in Qt which can be triggered back. Windows OS questions seem like this has to be baked within the application since the OS does not handle this.

        If I need to provide more information please let me know. I hope I have framed the question correctly.

        Thanks in advance.

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @vivian Yea that should never have worked without you adding in support for it.

        You need a singleton application like @jsulm posted. Then you need to handle getting the filename via the shell and code it to open a new tab.

        That's really odd that ever worked before. It's certainly not part of Qt.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        vivianV 1 Reply Last reply
        0
        • A ambershark

          @vivian Yea that should never have worked without you adding in support for it.

          You need a singleton application like @jsulm posted. Then you need to handle getting the filename via the shell and code it to open a new tab.

          That's really odd that ever worked before. It's certainly not part of Qt.

          vivianV Offline
          vivianV Offline
          vivian
          wrote on last edited by
          #4

          @ambershark @jsulm Thank you for your input. I am trying my best to get the oldest version of my application to confirm that.
          I will keep you posted on this. Hoping to add this as part of the application.

          A 1 Reply Last reply
          0
          • vivianV vivian

            @ambershark @jsulm Thank you for your input. I am trying my best to get the oldest version of my application to confirm that.
            I will keep you posted on this. Hoping to add this as part of the application.

            A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            @vivian The good news is it's quite easy to add using that qtsingleapplication @jsulm mentioned.

            Then you just need to deal with the extra tab being opened which should also be quite trivial.

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            1 Reply Last reply
            2

            • Login

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