You replace the one it gave you. It's pretty trivial. Odds are you'll only add
to what it gives you, IMHO.
________________________________
From: Jonathan S. Shapiro <[email protected]>
To: Jason H <[email protected]>
Cc: Qt Creator mailing list <[email protected]>
Sent: Wednesday, February 12, 2014 10:36 AM
Subject: Re: [Qt-creator] Q_PROPERY magic goodness
It's an appealing idea, but what happens when a non-trivial getter or setter is
needed?
On Wed, Feb 12, 2014 at 7:26 AM, Jason H <[email protected]> wrote:
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?
>
>
>Q_PROPERTY(int emitRate READ emitRate WRITE setEmitRate)
>
>(in private section)
>\t#t m_#s;
>
>(in public section)
>\t#t #s(); //getter
>\t#t set#S(#t #s); //setter
>
>
>(in cpp file)
>#t #c::#s(){ //getter
>\treturn m_#s;
>}
>#t #c::set#S(#t #s){ //setter
>\tm_#s = #s;
>}
>
>where\t = tab, #s= the property name (emitRate), #S is a cap version
>(EmitRate), and #c is the class name
>
>It's save me a bunch of time setting up trivial properties!
>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
>_______________________________________________
>Qt-creator mailing list
>[email protected]
>http://lists.qt-project.org/mailman/listinfo/qt-creator
>
>_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator