[Development] Avoid overloading of 'error'

Sze Howe Koh szehowe.koh at gmail.com
Tue Jun 16 13:50:27 CEST 2015


On 16 June 2015 at 19:28, Kurt Pattyn <pattyn.kurt at gmail.com> wrote:
> Well,
>
> you can also think of “on” + <event>, like in: onWindowClosed, onMouseClicked, onBytesReceived, …
> In the same analogy, you could have onErrorOccurred.
>
> Seems very intuitive to me.
>
> It depends if you want to react to a state or to the event causing that state.

The QML spec says "on" + <signal>, not <state>:
http://doc.qt.io/qt-5/qtqml-syntax-signals.html#receiving-signals-with-signal-handlers

You can call connect() on the thing after "on":
http://doc.qt.io/qt-5/qtqml-syntax-signals.html#connecting-signals-to-methods-and-signals

The thing after "on" is also exposed to C++ as a signal; it can be
passed to QObject::connect() in the SIGNAL() macro.

So, we need to use signal names (which are past tense verbs).


Regards,
Sze-Howe



More information about the Development mailing list