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. Embedding a external Qt widget application in QML window.

Embedding a external Qt widget application in QML window.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.0k 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.
  • R Offline
    R Offline
    reshmi
    wrote on last edited by
    #1

    Hi

    I am using Qt 5.3 in ubuntu. I have a Qt Widget application. This application has to be embedded in my QML application. I tried to use QWidget::createwindowcontainer() for doing this. But the embedding window is coming as a seperate window.

    Can you suggest whether there is any way I can do this correctly so that the external application opens inside my QML window.

    Regards,
    Reshmi.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Welcome the forum. You can embed the QML Window into QWidget app. That is what createWinContainer is meant for. Hope you are setting the parent widget when you are creating. Hope you are not showing the new window separately. If you can post sample source, it will help as well.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • R Offline
        R Offline
        reshmi
        wrote on last edited by
        #3

        Thanks for your reply.

        But I have to embed my Qt Widget app into my QML application.

        How can I do that?

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          You can't embed Qt Widget into QML in 5.x. You can do other way round only. If you are pre Qt 5.x you can make it happen.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bootchk
            wrote on last edited by
            #5

            Doesn't embedding QML controls (say Toolbar) inside a QWidget (say QMainWindow) mean that you lose the benefit of QML that automatically places the toolbar in the appropriate place (say at the top for Android, at the bottom for iOS)? (You get that benefit if you use a QML Application Window control.) Because you are responsible for laying out the QWidget container of the QML Toolbar control. I suppose it is no big deal.

            More specific example of "you can't embed QWidget in QML in Qt5": a QML ApplicationWindow.contentItem can only be a QQuickWindow or subclass.

            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