Invalid signal type: MouseEvent

If I try to use MouseEvent

as arg in a QML defined signal, I get the following error when loading:

Invalid signal parameter type: MouseEvent

There is conflicting information in the Qt docs about this, in the QML signal syntax documentation it says that:

The allowed parameter types are the same as those listed under Defining Property Attributes [...]. Any type of QML object can be used as a property type.

So far, the QML / C ++ interoperability documentation says that:

When a QML object type is used as a signal parameter, the parameter must use var as a type

Setting the argument to use var

does work, but it seems unnecessary according to the QML documentation. In the distant past, there was a bug in relation , but it was apparently resolved in version 5.0. So am I doing something wrong, or is this a regression?


Simple demo:

import QtQuick 2.3

Item {
    signal sig( MouseEvent mouse )



source to share

All Articles