Hi André,

On Wednesday 15 April 2015 11:49:56 André Somers wrote:
> void MyClass::setFoo(QString value)
> {
>    PropertyGuard guard(this, "foo");  //foo is the name of the Q_PROPERTY
>    Q_UNUSED(guard);
> 
>    m_foo = value;
> }

This is an interesting idea, though I don't think I have encountered the 
problems with which you motivate PropertyGuard.

For use in a library, though, I fear the string-based mechanism is too 
inefficient. For use within QtWidgets, say, I'd suggest a mechanism that works 
on the member data directly.

Thanks,
Marc

-- 
Marc Mutz <[email protected]> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to