1
이 간단한 응용 프로그램에 문제가 있습니다. 배경 그림이 있거나 버튼 앞에 순수 직사각형 (ID : 배경 그림의 배경)이 있으면 매우 느리게 반응합니다 (프로세서 사용률이 90 % 이상입니다.)이 배경 사각형에 주석을 달면 응용 프로그램이 빠르게 반응하지만, enable.layers : true "를 선택하면 느린 응답이 반환됩니다. 어디에 문제가 있습니까?성능 문제
나는 클릭 할 때 배경 그림과 빠른 응답을 갖고 싶습니다. 내가 라즈베리 파이 3.
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()
}
}
}
}
업데이트 :이 예제를 터미널에서 qmlviewer로 실행하면 예상대로 빠르게 작동합니다 (이 경우 "2.3"대신 "import QtQuick 1.1"을 사용해야합니다.) 터미널에서 qmlscene 또는 C++에서 QQuickView를 실행할 때이 응용 프로그램은 매우 응답합니다 버튼을 클릭하면 안된다. – Shiro