c++qtqt-creatorauto-generate

Auto-generate setters/getters with Qt Creator


I am unable to find a way to auto-generate getters and setters for a C++ class, using Qt Creator 2.3.1.

How do I do that?


Solution

  • Do a right click on your member then Refactor then Generate Getter and Setter member function and you're done :)

    example


    On Qt Creator 3.2.x, create the member, then click on it and press alt+Enter :

    enter image description here