Where is the problem?
I would like to have background picture and fast response on clicking.
I am running this example on Raspberry Pi 3.
Code: Select all
import QtQuick 2.3
Item {
id: root
visible: true
width: 800
height: 480
Rectangle {
id: background
anchors.fill: parent
smooth: true
}
Rectangle {
id: button
width: 200 ; height: 123
anchors.centerIn: parent
smooth: true
radius: 8
//color the button with a gradient
gradient: Gradient {
GradientStop {
position: 1.0
color: {
if (mouseArea.pressed)
return "red"
else
return "chartreuse"
}
}
GradientStop {position: 0.0; color: "paleturquoise" }
}
MouseArea {
id:mouseArea
anchors.fill: parent
onPressed: {
//handler.turnOn()
}
onReleased: {
// handler.turnOff()
}
}
}
}
UPDATE: When running this example with qmlviewer from terminal it works fast as expected (in that case have to use "import QtQuick 1.1" instead "2.3". When running with qmlscene from terminal or with QQuickView from C++ this app respond very bad on clicking button.