Yes, but, as you said, it's just a hack meant to circumvent C++'s member
visibility system. A rather ugly hack easily detectable by simply grepping
the source code (in a pre-commit hook, for example -- presence of
QMetaObject::invokeMethod() calls outside some parts of Qt itself may be a
good sign that somebody wants to do something weird).
Direct method call, on the other hand, is less likely to both cause
suspicion in anyone looking at the code and to be found by automatic tools.
On Mar 17, 2016 6:37 PM, "Thiago Macieira" <thiago.macie...@intel.com>
wrote:

> On quinta-feira, 17 de março de 2016 08:23:48 PDT Constantin Makshin wrote:
> > Another thing I personally don't like in the new connection syntax is
> > that it forces signals to be public, making it possible to do all type
> > of wonders by faking/simulating events on behalf of other objects.
> >
> > For example:
> > QLineEdit* edit = new QLineEdit("foo");
> > // ...
> > edit->textChanged("bar");
>
> You could do it in a round-about way in Qt 4 by using
> QMetaObject::invokeMethod.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to