Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Auto-generate setter/getter limitation
iraytrace79 last edited by
It seems that QtCreator's "generate setter/getter" only works if your member variables start with an underscore or nothing special, not if they use the m_NAME convention. Since this has been a common naming convention, it sure would be nice this was a recognized pattern. Is there an option someplace I haven't set that would allow this? We have a code base that uses this naming convention.
VRonin last edited by
Strange, it works for me. Qt creator 4.0.3 on windows. I'm using the pre-build binary
Works for me on Linux as well (same version).
herlarbee last edited by
I understand what you mean . Whenever you append the "m_" to your class variable names. It automatically skips the "m_" appended and just gives a setter and getter name without the "m_".
This is the default behaviour of Qt Creator. To change this compile Qt Creator from source and in the file tagged /plugins/cppeditor/cppquickfixes.cpp search for the method
( You should consider lines 5963 - 5983 and tweak to suit your needs.)
I personally have not needed this but since you do. I believe this is what you should do
To study the library for reference before manipulation consider
Marked as solved if this helps you