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. Any way to get a callback when Qml item is created but before properties are accessed?

Any way to get a callback when Qml item is created but before properties are accessed?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 563 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
    patrickkidd
    wrote on last edited by patrickkidd
    #1

    I have a C++ QObject type that can be created in Qml, and I want to be able to initialize the object after it is created by before properties start getting set on it. Is this possible?

    This is because I have an initialize() method that the superclass requires to be called after the subclass constructor is called, and there may be multiple levels of subclasses.

    A QObject::Created event or created() would work if they occurred immediately following the new MyType() call and before the object was used.

    Thanks!

    https://alaskafamilysystems.com/

    raven-worxR 1 Reply Last reply
    0
    • P patrickkidd

      I have a C++ QObject type that can be created in Qml, and I want to be able to initialize the object after it is created by before properties start getting set on it. Is this possible?

      This is because I have an initialize() method that the superclass requires to be called after the subclass constructor is called, and there may be multiple levels of subclasses.

      A QObject::Created event or created() would work if they occurred immediately following the new MyType() call and before the object was used.

      Thanks!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @patrickkidd
      implement the QQmlParserStatus::componentComplete() interface

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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