<div dir="ltr">It's an appealing idea, but what happens when a non-trivial getter or setter is needed?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 7:26 AM, Jason H <span dir="ltr"><<a href="mailto:scorp1us@yahoo.com" target="_blank">scorp1us@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Would it be possible to have in addition to the Q_PROPERTY completion template, to add the member, and getter, and setter in the class?<br>

<br>
<br>
Q_PROPERTY(int emitRate READ emitRate WRITE setEmitRate)<br>
<br>
(in private section)<br>
\t#t m_#s;<br>
<br>
(in public section)<br>
\t#t #s(); //getter<br>
\t#t set#S(#t #s); //setter<br>
<br>
<br>
(in cpp file)<br>
#t #c::#s(){ //getter<br>
\treturn m_#s;<br>
}<br>
#t #c::set#S(#t #s){ //setter<br>
\tm_#s = #s;<br>
}<br>
<br>
where\t = tab, #s= the property name (emitRate), #S is a cap version (EmitRate), and #c is the class name<br>
<br>
It's save me a bunch of time setting up trivial properties!<br>
PS. I used # instead of percent-sign because that tripped a yahoo account hack filter and I had to reset my password and everything. I guess spammers don't test their printfs. LOL<br>
_______________________________________________<br>
Qt-creator mailing list<br>
<a href="mailto:Qt-creator@qt-project.org">Qt-creator@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/qt-creator" target="_blank">http://lists.qt-project.org/mailman/listinfo/qt-creator</a><br>
<br>
</blockquote></div><br></div>