Nominate our 2022 Qt Champions!

Internal properties in Qt Quick Controls

  • Looking at Qt Quick Controls code I see internal property declaration with a comment /*! \internal */. For example, in CombBox code:

    @ /*! \internal */
    property var __popup: popup@

    Seems, Qt documentation does not provide any options to declare internal properties in QML and the declaration looks like ordinary property declaration. So, the questions are:

    What makes these properties internal?

    Is it possible to get/set such properties from custom code without any troubles?

    Does the engine distinguish internal and not internal properties?

    If it does, how?


    1. Nothing. It is simply a convention to make it clear to the user that these properties are not part of the public API and should not be used in third party software.

    2. In principle yes. But there are no guarantees that those properties will exist in a future Qt release or keep the same behaviour. If you make use of those properties, your code might stop working with a future Qt release.

    3. Not really. More recent versions of Qt Creator might hide them from code completion or code browsing and qdoc will skip those properties while generating documentation. Aside from that they are just regular properties.

    4. It doesn't. We were discussing the possibility of introducing private property scopes at the Qt Contributors Summit this week but there are currently no concrete plans. Regardless, just like in C++, we will always need to declare some public functions that we want to keep outside of the public API.

Log in to reply