Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
6.5.2
-
None
Description
When using an as-cast to deal with qmllint warnings, the follow example works with the linter but fails at runtime:
import QtQuick.Controls as CON2 Item { CON2.Button { text: "Launch dialog" onClicked: { d_dialogLoader.active = true (d_dialogLoader.item as CON2.Dialog).open() } } Loader { id: d_dialogLoader active: false sourceComponent: CON2.Dialog { standardButtons: CON2.Dialog.Ok | CON2.Dialog.Cancel contentItem: Rectangle { implicitWidth: 200 implicitHeight: 200 color: "green" } } } }
The following runtime error is generated when the button is clicked: "TypeError: true is not a function"
The following does work (removing the as-cast)
d_dialogLoader.item.open()