Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Q_PROPERTY NOTIFY uses
Forum Updated to NodeBB v4.3 + New Features

Q_PROPERTY NOTIFY uses

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.0k 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.
  • E Offline
    E Offline
    Elegant
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      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.

      --- 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
      • E Offline
        E Offline
        Elegant
        wrote on last edited by
        #3

        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 =(

        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