PDA

View Full Version : QTableWidget



abrou
25th July 2008, 00:42
Hello,

Quick question. I am currently using cellClicked(int,int) as a signal, and it works just fine. When i click on a cell in my QTableWidget, a signal is properly connected. I would like the user to be able to navigate through my QTableWidget with their arrow keys though. I thougt cellActivated might work, but nothing happens. I can only find one reference to a problem like this though google, and the only suggestion that someone has was that maybe it is a bug.

Am I trying the wrong signal? Am I doing something wrong? Like I said, the below code works, but it doesn't quite accomplish what I want.


connect(this->commandList1, SIGNAL(cellClicked(int,int)), this, SLOT(paint()));

Thanks a bunch.

edit: I am using Qt 4.3.3 with Visual Studio Express on windows XP

munna
25th July 2008, 06:32
Can you not use QTableWidget::currentCellChanged (http://doc.trolltech.com/4.4/qtablewidget.html#currentCellChanged) ?

abrou
25th July 2008, 20:04
Thank you! I don't know how I missed it....

But out of curiosity, does anyone know what I was doing from with cellActivated()?

Also, I am not sure what any of these actually differ (highlighted, activated, changed). Qt only defines it self with the term. Is there a reference somewhere that might tell me this?

Just curious. Thanks!

jpn
25th July 2008, 20:09
Activating an item is not same as navigating in the table. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.