How to send click signal to a XYSeries under a MouseArea



  • Hi

    I am trying to catch the event when user click on a SplineSeries which there is a MouseArea above it ( on the Plot)
    The line can not detect clicked signal , even if I set the propagateComposedEvents to true in MouseArea and I set the mouse.accepted to false in onClicked in the MouseArea.

    My code as below

    Plot.qml

    Item
    { 
    id:root
       function addLine(name)
        {
            var line = chart.createSeries(ChartView.SeriesTypeSpline , name, chart.xAxis, chart.yAxis)
            line.clicked.connect( clickLine)
            line.useOpenGL = true      
            return line
        }
       function clickLine()
       {  
         console.log(  "click Line")
        }
        ChartView
        { 
              id:chart
    
         }
    
    }
    

    ====================
    main.qml

    Plot{
         MouseArea
         {
             anchor.fill :parent
             propagateComposedEvents : true
    
              onClicked:  mouse.accepted=false
         }
    
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.