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. QDeclarativeItem: why does the state property use private headers?

QDeclarativeItem: why does the state property use private headers?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 3.7k 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.
  • B Offline
    B Offline
    bundickt
    wrote on last edited by
    #1

    I was just wondering if there was a reason the state accessor functions were in the private headers?
    Is it a bad Idea for me to use the state property in the my plugin code?
    I want to be able to read what state my QDeclarativeItem is in; I guess I will have to use property(const char *) and setProperty(...).

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      These properties defined with Q_PRIVATE_PROPERTY() macro.. and tried searching for the definition of this macro, but could not find it anywhere ...

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbrasser
        wrote on last edited by
        #3

        In general properties have been marked private with Q_PRIVATE_PROPERTY() when they are meant to be used from QML only (usually because they return a private type, or sometimes because they offer a rather poor C++ API). I wouldn't have thought that state fell into either category, however.

        I'll follow up and see if there is any issue with making it a regular Q_PROPERTY for Qt 5.

        Regards,
        Michael

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          [quote author="Vijay Bhaska Reddy" date="1311061589"]These properties defined with Q_PRIVATE_PROPERTY() macro.. and tried searching for the definition of this macro, but could not find it anywhere ...[/quote]

          Because those macros are replaced by moc instead of the preprocessor (like Q_OBJECT).

          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