Important: Please read the Qt Code of Conduct -


  • Hi, I'm currently trying to use notify to call a function within the same class as opposed to sending a signal to a slot and having to use connect. Is this possible?

    I need to constantly check for hp changes and would prefer to do it using this method to catch all the exceptions.

  • Moderators

    i think you misunderstood the usage of NOTIFY in Q_PROPERTY macros?
    NOTIFY just specifies the name of the signal which is emitted whenever the value changes.
    You need to take care to emit the signal in your setter method.

    And also you need to do the connection of this signal to your custom slot yourself.

  • I understand how it works just I was wanting to avoid connecting signals and slots completely since they're in the same class. I'd sooner use a local function and was hoping that'd work =(

Log in to reply