Qt 6.11 is out! See what's new in the release
blog
How to emit a keyspress signal ?
-
Hi there, I'm trying to emit a Keys.leftpressed signal after a mouse click.
This is what I try.MouseArea { anchors.fill: parent onClicked: { if (_state == 0) { Keys.leftPressed() } } }But Keys.leftPressed require a argument.
I try thisMouseArea { property KeyEvent _event anchors.fill: parent onClicked: { if (_state == 0) { Keys.leftPressed(_event) } } }And I got an error: "KeyEvent is not a type"
What I have to do now?
-
-
What. Why? You're (IMO) making this way too hard on yourself.
Bind both left pressed & mouse click to the same <signal | action> - keep it simple.
Don't try remote control calling things as you do, that's just going to hurt you 2*, now and in the future.@6thC
Because I'm using PC and wanna test the Gestures.
I want to emit a "Pinch" signal by using the wheel on mouse.