[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: *** GMX Spamverdacht *** [PyQt] Getting mouse and key event with
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-03-15 17:10:21
Message-ID: 20070315171021.GB18330 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On 15.03.07 16:51:13, duncan duncan wrote:
> I'd like to be able to process the mouse and key pressed event with a
> qtablewidget
> The goal is to have a table in which the number of rows and columns are
> dinamically
> created when certain keys are pressed and that had a context menu to delete
> the
> row/column.
> 
> An example can be: if I press the tab key on the last column, a column is
> added to the table or if I press the
> arrow down on the last row, a new row is added.
> 
> Any hints ?

For the context menu there exists the contextMenuEvent() member in
QWidget, so you can subclass QTableWidget and re-implement that method.

For the key-features you can override the keyPressEvent member function
and properly react on Tab and arrow key if you're in the "right"
position.

Andreas

-- 
Don't look back, the lemmings are gaining on you.

[Attachment #5 (application/pgp-signature)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic