Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Create QtQuick application from External Win32 window
Forum Updated to NodeBB v4.3 + New Features

Create QtQuick application from External Win32 window

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 373 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.
  • A Offline
    A Offline
    Arthapz
    wrote on last edited by
    #1

    Hi,
    Is it possible to create an QQmlApplicationEngine with a external winID ?
    I have a Win32 API created Window and i want to display QtQuick in it, but without QtWidget.

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      I've not tried it but I believe getting a QWindow by using QWindow::fromWinId and then using that as the parent window of the window you want to embed would work.

      That doesn't seem to be possible from QML straight away though, possible solutions are:

      • get the window you created from QML with QQmlApplicationEngine::objectCreated signal and call setParent on it (only works if your window is the root component of your qml file).
      • create a C++ helper callable from QML, a attached type would be a good choice. usage in QML would be like so: ParentWindow.parent: theWindowYouExposedFromC++
      • use QQuickView instead of QQmlApplicationEngine and call setParent on it.
      A 1 Reply Last reply
      1
      • GrecKoG GrecKo

        I've not tried it but I believe getting a QWindow by using QWindow::fromWinId and then using that as the parent window of the window you want to embed would work.

        That doesn't seem to be possible from QML straight away though, possible solutions are:

        • get the window you created from QML with QQmlApplicationEngine::objectCreated signal and call setParent on it (only works if your window is the root component of your qml file).
        • create a C++ helper callable from QML, a attached type would be a good choice. usage in QML would be like so: ParentWindow.parent: theWindowYouExposedFromC++
        • use QQuickView instead of QQmlApplicationEngine and call setParent on it.
        A Offline
        A Offline
        Arthapz
        wrote on last edited by
        #3

        @GrecKo Thx, i will try these solutions

        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