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. Include QML in a Qt Widget application
Forum Updated to NodeBB v4.3 + New Features

Include QML in a Qt Widget application

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 773 Views 1 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.
  • M Offline
    M Offline
    mclaus
    wrote on last edited by
    #1

    Hi - I am attempting to embed a QtQuickView window into a layout on a QMainWindow object via the use of a QWidget::createWindowContainer call. While it is partially working, I am having several difficulties

    1. The QtQuickView application does not respond to mouse events properly when it is embedded in the window, but it does when I display it as a standad-alone window.

    2. I don't seem to be able to control the placement of the embedded widget without the layout properly. The drawing area on the QtQuickView widget seems to spill over the sides of the space allocated for it, and I don't seem able to adjust it.

    Here my code to create and embed the widget - pretty straightforward. The commented out bits are some things I tried to control the placement of the widget - but it didn't seem to work.

    Anybody have any experience working with these QtQuickView widgets?

    // add the QML view to the UI window
    qmlView = new QQuickView(QUrl(qmlFileName));
    QWidget* qmlWidget = QWidget::createWindowContainer(qmlView, this);
    // qmlWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    // qmlWidget->setMinimumWidth(450);
    // qmlWidget->setMinimumHeight(350);
    ui->horizontalLayout->addWidget(qmlWidget);

    1 Reply Last reply
    0
    • X Offline
      X Offline
      Xander84
      wrote on last edited by
      #2

      Why did you write the same post in different forums? anyway I've answered something here http://qt-project.org/forums/viewthread/40749/

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

        Closing

        "Duplicate":http://qt-project.org/forums/viewthread/40749/

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

        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