Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.1
-
-
1029b2b9f3d0ff88c0900fbfec2fac873aa6bcd4
Description
When Q_GADGET class inherits other Q_GADGET class, some Q_INVOKABLE methods in derived class are inaccessible in QML code. Attached program produces the following output:
qml: item.prop1: 1 qml: item.prop2: 2 qml: item.prop3: 3 qml: item.prop4: 4 qml: item.prop5: 5 qml: item.method1: function() { [native code] } qml: item.method2: function() { [native code] } qml: item.method3: function() { [native code] } qml: item.method4: undefined qml: item.method5: function() { [native code] }
If line (1) in Items.h is uncommented, method4 becomes accessible:
qml: item.prop1: 1 qml: item.prop2: 2 qml: item.prop3: 3 qml: item.prop4: 4 qml: item.prop5: 5 qml: item.method1: function() { [native code] } qml: item.method2: function() { [native code] } qml: item.method3: function() { [native code] } qml: item.method4: function() { [native code] } qml: item.method5: function() { [native code] }
Results may vary, depending on how many methods are in the base class.
Qt 5.14.1 is not the first version with this bug. It was at least in Qt 5.9.x and later.