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 create Qt widgets inside existing native window?

How to create Qt widgets inside existing native window?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 855 Views 3 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.
  • J Offline
    J Offline
    jiandingzhe
    wrote on last edited by
    #1

    I want to use Qt to develop audio plugins (VST2/VST3/AudioUnit) (actually I'm using JUCE). The plugins would have native window handles created by hosts, and how can I create QWidgets inside it?

    I found there's QWindow::fromWinId that creates a QWindow wrapper, and QWidget::createWindowContainer that creates a QWidget. However it says createWindowContainer is used for embedding an alien native window inside Qt widget hierarchy, which is in reverse of what I want (embedding Qt widget hierarchy inside existing native window).

    JonBJ 1 Reply Last reply
    0
    • J jiandingzhe

      I want to use Qt to develop audio plugins (VST2/VST3/AudioUnit) (actually I'm using JUCE). The plugins would have native window handles created by hosts, and how can I create QWidgets inside it?

      I found there's QWindow::fromWinId that creates a QWindow wrapper, and QWidget::createWindowContainer that creates a QWidget. However it says createWindowContainer is used for embedding an alien native window inside Qt widget hierarchy, which is in reverse of what I want (embedding Qt widget hierarchy inside existing native window).

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @jiandingzhe
      I could be wrong(!), but I cannot imagine that can be done. The functions you mention allow Qt to take ownership of and show a native window. But (surely?) that window is then opaque to Qt, a native window cannot somehow have Qt widgets on it and I presume you cannot do such a thing.

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

        Hi,

        If you need to provide a native handle to the core application, you should check QWidget::winId.
        I think it should provide what you need. You would only need to call it on the widget that you need to pass to the application.

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

        J 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          If you need to provide a native handle to the core application, you should check QWidget::winId.
          I think it should provide what you need. You would only need to call it on the widget that you need to pass to the application.

          J Offline
          J Offline
          jiandingzhe
          wrote on last edited by
          #4

          @SGaist Nope. The application pass a handle to me.

          1 Reply Last reply
          0
          • JonBJ JonB

            @jiandingzhe
            I could be wrong(!), but I cannot imagine that can be done. The functions you mention allow Qt to take ownership of and show a native window. But (surely?) that window is then opaque to Qt, a native window cannot somehow have Qt widgets on it and I presume you cannot do such a thing.

            J Offline
            J Offline
            jiandingzhe
            wrote on last edited by
            #5

            @JonB So it seems the only way is to firstly add the widget to desktop, then manage its native handle to be transient for the parent window from the host.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              seelenakimmma
              Banned
              wrote on last edited by
              #6
              This post is deleted!
              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