How to change mouse message routing?



  • I have a QML file:
    @import QtQuick 1.0
    import Plot 1.0

    Rectangle {
    id: page1
    color: "#646464"
    width: parent.width
    height: parent.height

    MyPlot {
        id: thePlot
        width: parent.width
        height: parent.height
        anchors.left: parent.left
        anchors.top: parent.top
    }
    

    }@
    Inside the QML file, a Qt Widget is called. The Widget is QWT plot widget which can display data and zoom in/out. But the problem is zoom not working any more. The mouse move event seems not send to the widget, it only send to QML Rectangle itself. So how can mouse event routed into widget, not the Rectangle itself?



  • Where is your MouseArea ?



  • I have tried:
    @import QtQuick 1.0
    import Plot 1.0

    Rectangle {
    id: page_7_1
    color: "#646464"
    width: parent.width
    height: parent.height

    MyPlot {
        id: thePlot
        width: parent.width
        height: parent.height
        anchors.left: parent.left
        anchors.top: parent.top
    
        MouseArea {
            anchors.fill: parent
        }
    }
    

    }@
    and
    @import QtQuick 1.0
    import Plot 1.0

    Rectangle {
    id: page_7_1
    color: "#646464"
    width: parent.width
    height: parent.height

    MyPlot {
        id: thePlot
        width: parent.width
        height: parent.height
        anchors.left: parent.left
        anchors.top: parent.top
    
    }
    MouseArea {
        anchors.fill: parent
    }
    

    }@
    neither works.



  • Do you try send the MouseEvent from MouseArea to Widget itself?



  • How? for mouse up / mouse down / mouse move / etc.



  • Does any know how can mouse event routed into widget?


Log in to reply
 

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