I want to increase the selected area:

ChartView{ id: chart Rectangle{ id: rect color: "white" visible: false } ScatterSeries{ // какие-тт точки } MouseArea{ anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.AllButtons onPressed: {rect.x = mouseX; rect.y = mouseY; rect.visible = true} onMouseXChanged: {rect.width = mouseX - rect.x} onMouseYChanged: {rect.height = mouseY - rect.y} onReleased: {chart.zoomIn(rect); rect.visible = false} //нет никакой реакции } } 

Tell ChartView::zoomIn(rect rectangle) how to properly use ChartView::zoomIn(rect rectangle)

    1 answer 1

    The following things helped:

     Rectangle{ id: rectang ... } onReleased: { chart.zoomIn(Qt.rect(rectang.x, rectang.y, rectang.width, rectang.height)) rectang.visible = false } 

    I mistakenly thought that rect and Rectangle are the same types.