Details

    • 89b589c0e (master)

    Description

      It would be useful to have a feature that automatically creates field definitions.

      E.g. if you write:
      this->mLabel = new QLabel();

      and then call such an feature "auto create private field" for mLabel, it should:

      1. infer from the assignment that the type of mLabel must be QLabel*
      2. determine which class this belong to
      3. automatically create a private field "QLabel* mLabel" in the header
      4. create a forward class definition "class QLabel;" before the this-class in the header
      5. include the <QLabel>-header in the cpp

      The last two steps should of course only be performed, if the definitions aren't already there, and if the type is a pointer. For non pointer types, Qt Creator has to include the required header in the corresponding header. It is also important that it finds the correct header (for non qt-types it could look at the includes of other files in the project), and that it chooses between struct/class forward definitions.

      This could also be done for different classes than the this-class above. E.g:
      MyStrangeClass foo;
      foo->bar = new QLabel();

      could auto create a field QLabel* bar in the class MyStrangeClass.

      (this is like 1532, but for fields instead of methods)

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            benibela Benito van der Zander
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes