Il 17/03/2016 06:23, Constantin Makshin ha scritto:
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");

A good counterpart of this is that now a private "slot" is truly private, i.e. it's impossible to invoke it externally:

class Foo : public QObject {
    Q_OBJECT

    Foo() {
         connect(something, &Signal, this, &Foo::doFoo);
    }
private slots:
    void doFoo(); // still reachable and invokable via QMetaObject

private:
    void doFoo(); // unreachable from outside
};

Making the signals public is a tradeoff for ease of implementation and usage (you would not otherwise be allowed to simply take the address of a MF). A check about this could be added to clazy.

Cheers,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to