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. Several versions of Qt coexisting in a single process

Several versions of Qt coexisting in a single process

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 747 Views
  • 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.
  • T Offline
    T Offline
    Tyan
    wrote on last edited by
    #1

    A few questions about several versions of Qt coexisting in a single process.

    In our application we use Qt 5.6 for the GUI (currently, Windows only). The application provides an extension API for DLL plugins, which are supposed to manage their GUI dialogs on their own. The API doesn't expose any Qt types, just plain C++, since we don't want to limit the plugin developers with the choice of GUI frameworks they might want to use, including Qt.

    This raises some questions about the possibility of running several versions of Qt within a single process. Namely:

    1. Is it correct to create a separate QApplication instance in the DLL code?

    2. Is it correct to use both debug and release builds of the same Qt version within a single process? (We tried a setup where the plugin uses a debug version of Qt, while the application uses a release one, it does seem to work.)

    3. In the case where a Qt window is created in the plugin, is it safe to manage relations between the plugin and application windows using the WindowsAPI directly? (I.e. functions like SetParent(), SetWindowLong(), etc.)

    Huge thanks!

    kshegunovK 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2
      1. Not really. If the user creates a QApplication before calling your code then your code will crash as you are trying to create a second one.
      2. It should on windows and mac as the dll name is different, not 100% certain on linux.
      3. This means exposing platform dependant API (i.e. not "plain C+") and quite a bit of overhead.

      Bottom line: it sounds like a bad idea to me.

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • T Tyan

        A few questions about several versions of Qt coexisting in a single process.

        In our application we use Qt 5.6 for the GUI (currently, Windows only). The application provides an extension API for DLL plugins, which are supposed to manage their GUI dialogs on their own. The API doesn't expose any Qt types, just plain C++, since we don't want to limit the plugin developers with the choice of GUI frameworks they might want to use, including Qt.

        This raises some questions about the possibility of running several versions of Qt within a single process. Namely:

        1. Is it correct to create a separate QApplication instance in the DLL code?

        2. Is it correct to use both debug and release builds of the same Qt version within a single process? (We tried a setup where the plugin uses a debug version of Qt, while the application uses a release one, it does seem to work.)

        3. In the case where a Qt window is created in the plugin, is it safe to manage relations between the plugin and application windows using the WindowsAPI directly? (I.e. functions like SetParent(), SetWindowLong(), etc.)

        Huge thanks!

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        @Tyan said in Several versions of Qt coexisting in a single process:

        A few questions about several versions of Qt coexisting in a single process.

        1. Is it correct to create a separate QApplication instance in the DLL code?

        If by "correct" you mean "will it work", then most probably, yes. However it's not the greatest of decisions.

        1. Is it correct to use both debug and release builds of the same Qt version within a single process? (We tried a setup where the plugin uses a debug version of Qt, while the application uses a release one, it does seem to work.)

        No! Don't mix debug and release builds of the same library.

        1. In the case where a Qt window is created in the plugin, is it safe to manage relations between the plugin and application windows using the WindowsAPI directly? (I.e. functions like SetParent(), SetWindowLong(), etc.)

        That would defeat the purpose of using Qt, wouldn't it? I'd rather advise you to use Qt's cross-platform API instead. Plus Qt's parent is the visual parent (just like the WinAPI uses) but not only, it has other uses as well.

        @VRonin said in Several versions of Qt coexisting in a single process:

        Bottom line: it sounds like a bad idea to me.

        I agree.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        1

        • Login

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