Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100243

Access modifiers are not handled correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.15.2
    • Quick: Other
    • None
    • Windows10
    • Windows

    Description

      There is a problem with the click processing method access modifier. There is a structure in the controller class that hides its private field.

      class Controller : public QObject
       {
       Q_OBJECT
       public:
       explicit Controller(QObject *parent = nullptr);
      
      struct Test
      
      { private: int m_data; };
      
      Q_INVOKABLE void processClick();
       };
      

       

      In the moc_ file, this field is marked as private, respectively, when called from the QML we get the following error:

      qrc:/main.qml:22: TypeError: Property 'processClick' of object Controller(0x26cd170) is not a function
      

      such behavior is observed both for the build of MINGW and for MSVC2019

      ----------------------------------------

      When placing the structure below the method declaration, or removing the word "private" from it, the defect is not reproduced

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            idaniv Ihor Daniv
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes