Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11620

Add SIGNAL option to Getter/Setter generator (for Q_PROPERTY matching)

    XMLWordPrintable

Details

    • 5b5ae971045adebe40209150cf9e1cac6cc62191 (qt-creator/qt-creator/master)

    Description

      After implementing QTCREATORBUG-1890 the getter and setter work quite nice.

      But there is the pattern of the setter emitting a signal, currently the pattern is:

      void setSomething(type something) {
          m_something = something;
      }
      

      This could be easily extended to:

      void setSomething(type something) {
          if (something == m_something)
              return;
          m_something = something;
          emit somethingChanged()   
      }
      

      Of course the signal somethingChanged() would be also autocreated.

      This is not a reopen on QTCREATORBUG-1890, because you wont always (but very often) want to emit a signal.

      Also, this fix, in conjunction with the wonderfully auto Q_PROPERTY creator already in place would make life even easier as the pattern of creating properties is very common.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            desert Ariel Molina R.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: