QML Button onClicked doesn't work while onHoveredChanged does.
-
Hello everyone,
I wanted to try QT Design Studio 4.2 for a desktop application that requires 3D animation. I want to trigger the animation by pressing a button.
I can not trigger the animation(or trigger any other event) when i click the button however, when i use onHoveredChanged instead of onClicked, it works. I opened this issue under QT Design Studio since i didn't have the same problem on QT Creator->QTQuick project. There, onClicked method works as expected
imports are auto generated to Screen01.ui.qml as;
import QtQuick 6.4
import QtQuick.Controls 6.4
import QtQuick3D 6.4And here is the button i made under the same file;
Button {
id: button
x: 276
y: 393
text: qsTr("Button")
//focusPolicy: Qt.TabFocus
//hoverEnabled: true
//enabled:true
//onHoveredChanged: anim1.running = true
onClicked: anim1.running = true
}
}Is this a known bug? Or am i missing something.
-
I hope nobody will make the same silly mistake i did in here :)
The parent rectangle was set to be disabled! When enabled, all works as expected.
So anybody in the future who face the same issue, i suggest you to look for the parent object's enable/disable state first.
-