[PyKDE] setMouseTracking

Frederick Polgardy Jr polgardy at bodacion.com
Wed Apr 9 22:10:00 BST 2003


Huh, it's true.  This code only shows me mouse tracking when the mouse is 
down:

import sys

from qt import *
from qtcanvas import *

class MyCanvasView(QCanvasView):
   def __init__(self, *args):
      QCanvasView.__init__(self, QCanvas(), *args)
      self.resize(200, 200)
      self.setMouseTracking(True)

   def mouseMoveEvent(self, e):
      self.parentWidget().statusBar().message("(%d, %d)" % (e.x(), e.y()))

app = QApplication(sys.argv)
w = QMainWindow()
app.setMainWidget(w)

c = MyCanvasView(w)
w.setCentralWidget(c)
w.statusBar()

w.show()
app.exec_loop()

Shouldn't this work?

Fred

On Wednesday 09 April 2003 02:51 pm, you wrote:
> hi,
>
> I have both and... neither of them "work"
>
> I am editing the canvas.py file directly (I'm not even opening the qt
> designer ui for the canvas tests, I don't really need it)...
>
>
> I receive mouse events ok...but there are no mouse move events unless I
> press any of the three buttons on my mouse... :-(
>
>
>
> -max

-- 
F R E D E R I C K   P O L G A R D Y   J R.
Bodacion Technologies
18-3 E Dundee Road - Suite 300 - Barrington, IL 60010
Phone: 847/842.9008 - Fax: 847/842-1731
Web: http://www.bodacion.com




More information about the PyQt mailing list