View Single Post
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#40
Originally Posted by Markkyboy View Post
Hi,

How to add a short vibration to a Rectangle Button?,

thanks, . .
Code:
import QtFeedback 5.0

HapticsEffect {
	id: activeEffect
	duration: 500 // in ms
	intensity: 0.2 // from 0 to 1 with 0.1 step-size
	running: button.pressed
}
Button {
        id: button
	width: text.width
	text: "Test"					 
        anchors.horizontalCenter: parent.horizontalCenter
	onClicked: activeEffect.start()          
}

Last edited by Ancelad; 2019-11-12 at 19:49.
 

The Following 6 Users Say Thank You to Ancelad For This Useful Post: