Despite some searchs, I wasn't able to find a way to auto-generate getters and setters for a C++ class, using QT Creator 2.3.1. Would you guys know some way to do so ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Do a right click on your member then Refactor
then Generate Getter and Setter member function
and you're done :)
On Qt Creator 3.2.x, create the member, then click on it and press alt+Enter :
回答2:
Position your text cursor at the member variable in class definition, then hit Alt+Enter.
回答3:
For me, right-click, Refactor, Create Getter and Setter member functions works, except when the member is a bool.