[Qt-interest] setMouseTracking

"Alexander Carôt" alexander_carot at gmx.net
Thu Jan 6 16:39:12 CET 2011


> Does your main window derive from QMainWindow or just QWidget?  If not, 
> what happens if you create a QMainWindow and set your current "main 
> window" widget as the QMainWindow's centralWidget()?  I believe this 
> should work (and is the common way of implementing a top level 
> application window.)

In fact my window derives from QWidget. Changing it to QMainWindow makes it receive mouseMoveEvents without clicking as desired - thank you ! 

However, it does not work if the mouse resides outside the window. So I changed my class back to QWidget and followed your suggestion of creating an extra QMainWindow and set my widget as the central widget via setCentralWidget(); In that context I also overwrote the mouse event handler of the QMainWindow with mouse pos messages. Unfortunately this didn't solve the problem either: Only the central widget's handler fired only when placing the mouse on it and not outside the widget's boundaries.

Did I correctly follow you suggestion or am I possibly mistaken ?

Thanks and best

Alex
 
-- 
http://www.carot.de
http://www.triologue.de
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797



Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail



More information about the Qt-interest-old mailing list