Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to send click signal to a XYSeries under a MouseArea
Qt 6.11 is out! See what's new in the release blog

How to send click signal to a XYSeries under a MouseArea

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 600 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtLove
    wrote on last edited by qtLove
    #1

    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
         }
    
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved