Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 10

Qt-interest Archive, March 2002
right mouse click on table headers...


Message 1 in thread

So in qtable.cpp, within QTableHeader::mousePressEvent(...)
I find the following:

if( e->button() != LeftButton )
	return;


I want to do something when someone clicks the right mouse button on a 
header, so I'd like to reimplement QTableHeader within my QTable.  

Is that possible?  
If so, how?
If not, is there some other way to do this?  I already have a class that 
inherits QTable...

perhaps if I made a class that inherited QTableHeader, then reimplemented 
QTable::init()  to use the new headers...gulp...:(
an awful lot of work just to get a stupid mouse click

Thanks for your time
Jeremy


Message 2 in thread

use an eventFilter on the Header

Grettings
Heiko

> -----Original Message-----
> From: owner-qt-interest@trolltech.com
> [mailto:owner-qt-interest@trolltech.com]On Behalf Of Jeremy Webster
> Sent: Friday, March 29, 2002 3:50 AM
> To: qt-interest@trolltech.com
> Subject: right mouse click on table headers...
>
>
> So in qtable.cpp, within QTableHeader::mousePressEvent(...)
> I find the following:
>
> if( e->button() != LeftButton )
> 	return;
>
>
> I want to do something when someone clicks the right mouse button on a
> header, so I'd like to reimplement QTableHeader within my QTable.
>
> Is that possible?
> If so, how?
> If not, is there some other way to do this?  I already have a class that
> inherits QTable...
>
> perhaps if I made a class that inherited QTableHeader, then reimplemented
> QTable::init()  to use the new headers...gulp...:(
> an awful lot of work just to get a stupid mouse click
>
> Thanks for your time
> Jeremy
>
> --
> List archive and information: http://lists.trolltech.com/qt-interest/