[Qt-interest] Widget transparent to input events

Fabio Dago fabio.dago at sir.to.it
Mon Apr 20 09:37:49 CEST 2009


Hi.

I need to create a particular tree widget in which on top I draw a 
vertical line that user can move frome left to right (and viceversa) 
with the mouse. I need also a particular header for the tree widget, 
that shows a time axis with seconds, minutes etc.. (something like a 
Nero Wave Editor, or other similar software, time axis).

I tried several solutions... Now I want to create a widget, child of 
QTreeWidget, that display the header and the vertical line. The problem 
is that in this way I can't interact with the QTreeWidget with mouse or 
keyboard. I've also reimplement all this method:

void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void wheelEvent(QWheelEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);

In the implementation simply I ignore the event (e->ignore()). The event 
may be passsed to the parent widget, but it doesn't work...

I must reimplement some other method?

Some other idea to implement my widget is also well accepted. :)

Thanks!

Fabio.



More information about the Qt-interest-old mailing list