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. Listening to attached Component.onCompleted and Component.onDestroyed from C++ Q_OBJECT.
Qt 6.11 is out! See what's new in the release blog

Listening to attached Component.onCompleted and Component.onDestroyed from C++ Q_OBJECT.

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

    I have a C++ Q_OBJECT that I'd like to perform some actions on Component.onCompleted and Component.onDestroyed.

    Is there a way to subscribe to those handlers, without writing any QML?

    It looks like I could use QQmlEnginePrivate::registerFinalizeCallback, but it would depend on private headers.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      StoneJ
      wrote on last edited by
      #2

      Is this what you're looking for?

      https://doc.qt.io/qt-5/qtqml-cppintegration-definetypes.html#receiving-notifications-for-object-initialization

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved