PyQt/partner_625781186/QML_QtQuick_PY/python_QML调用基础/5-信号、槽 机制/test5.qml
2018-04-16 23:17:02 +08:00

25 lines
No EOL
540 B
QML

import Charts 1.0
import QtQuick 2.0
Item {
width: 300; height: 200
PieChart {
id: aPieChart
anchors.centerIn: parent
width: 100; height: 100
color: "red"
onChartCleared: console.log("The chart has been cleared") //?
}
MouseArea {
anchors.fill: parent
onClicked: aPieChart.clearChart()
}
Text {
anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
text: "Click anywhere to clear the chart"
}
}