Reputation: 95
We can use old syntax, like this
connect(sender, SIGNAL(valueChanged(QString, QString)), receiver, SLOT(updateValue(QString));
And new one, like this
connect(sender, &Sender::valueChanged, receiver, &Receiver::updateValue);
New syntax allows us to see errors with connect
on compile time, which is a plus, but is there another differences? I can recall I saw something about it, but can't recall or find it.
Upvotes: 0
Views: 138
Reputation: 194
Thanks to @chehrlic for articles about this question. In summary, differences between these two approaches are:
connect()
will be used correctly.QVariant
can be used as QString
.slots
to be receivers of the signals
, but any function or functor.Upvotes: 1