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

moc should warn if Q_PROPERTY read/write methods conflict with the property

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • Not Evaluated
    • None
    • None
    • Build tools: moc
    • Foundation Sprint 72

    Description

      moc should warn if I try to do something stupid like this:

      class MyClass : public QObject
      {
          Q_OBJECT
          Q_PROPERTY(bool prop READ prop)
          bool m_prop;
      public:
          Q_INVOKABLE bool prop() { return m_prop; }
      }
      

      And likewise if the bool prop() method were a slot since in both cases the method name will clash with the property name when used from a QML/Javascript context.

      Attachments

        For Gerrit Dashboard: QTBUG-57688
        # Subject Branch Project Status CR V

        Activity

          People

            saghinet Samuel Ghinet
            nocnokneo Taylor Braun-Jones
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change