May 19, 2011

kathy kathy
Lab Rat
50 posts

how to change mouse message routing?

 

I have a QML file:

  1. import QtQuick 1.0
  2. import Plot 1.0
  3.  
  4. Rectangle {
  5.     id: page1
  6.     color: "#646464"
  7.     width: parent.width
  8.     height: parent.height
  9.  
  10.     MyPlot {
  11.         id: thePlot
  12.         width: parent.width
  13.         height: parent.height
  14.         anchors.left: parent.left
  15.         anchors.top: parent.top
  16.     }
  17. }

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?

5 replies

May 20, 2011

Chuck Gao Chuck Gao
Lab Rat
342 posts

Where is your MouseArea ?

 Signature 

Chuck

May 20, 2011

kathy kathy
Lab Rat
50 posts

I have tried:

  1. import QtQuick 1.0
  2. import Plot 1.0
  3.  
  4. Rectangle {
  5.     id: page_7_1
  6.     color: "#646464"
  7.     width: parent.width
  8.     height: parent.height
  9.  
  10.     MyPlot {
  11.         id: thePlot
  12.         width: parent.width
  13.         height: parent.height
  14.         anchors.left: parent.left
  15.         anchors.top: parent.top
  16.  
  17.         MouseArea {
  18.             anchors.fill: parent
  19.         }
  20.     }
  21. }

and
  1. import QtQuick 1.0
  2. import Plot 1.0
  3.  
  4. Rectangle {
  5.     id: page_7_1
  6.     color: "#646464"
  7.     width: parent.width
  8.     height: parent.height
  9.  
  10.     MyPlot {
  11.         id: thePlot
  12.         width: parent.width
  13.         height: parent.height
  14.         anchors.left: parent.left
  15.         anchors.top: parent.top
  16.  
  17.     }
  18.     MouseArea {
  19.         anchors.fill: parent
  20.     }
  21. }

neither works.

May 21, 2011

Chuck Gao Chuck Gao
Lab Rat
342 posts

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

 Signature 

Chuck

May 22, 2011

kathy kathy
Lab Rat
50 posts

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

May 23, 2011

kathy kathy
Lab Rat
50 posts

Does any know how can mouse event routed into widget?

 
  ‹‹ WebView Clear history      [solved] How to change line spacing in Flow? ››

You must log in to post a reply. Not a member yet? Register here!