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. Invoke C++ method from QML with "parent" as QWidget does not seem to work

Invoke C++ method from QML with "parent" as QWidget does not seem to work

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 646 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.
  • P Offline
    P Offline
    philk
    wrote on last edited by
    #1

    When I try to call this
    @Q_INVOKABLE void create(QWidget* parent)@ from my QML with "parent" property of my MouseArea, the parent is always NULL in C++. I think I know the reason for that: The "parent" is just a QML declarative object, not a widget.
    So the question is, how do I get the actual QML "host" widget from within QML code? The "host" widget in my case would be a QQuickView

    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