[Qt-creator] Q_PROPERY magic goodness

Kevin Krammer kevin.krammer at kdab.com
Thu Feb 13 14:46:24 CET 2014


On Wednesday, 2014-02-12, 07:26:24, Jason H 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)

Just in case:

There is a variation of Q_PROPERTY which only requires you to declare the 
member and, optionally, the notification signal

Q_PROPERTY(int emitRate MEMBER m_emitRate NOTIFY emitRateChanged)

and

private:
    int m_emitRate;

Q_SIGNALS:
    void emitRateChanged();

Cheers,
Kevin

-- 
Kevin Krammer | kevin.krammer at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5918 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140213/cfbdbb9f/attachment.bin>


More information about the Qt-creator mailing list