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 change mouse message routing?
Forum Updated to NodeBB v4.3 + New Features

How to change mouse message routing?

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kathy
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chuck Gao
      wrote on last edited by
      #2

      Where is your MouseArea ?

      Chuck

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kathy
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chuck Gao
          wrote on last edited by
          #4

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

          Chuck

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kathy
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kathy
              wrote on last edited by
              #6

              Does any know how can mouse event routed into widget?

              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