PDA

View Full Version : Problems with QTableItem



villy
31st July 2006, 12:54
Hello everybody. I'm a new entry in this forum :D

I have a "problem" when I insert a QTableItem in a table.

I've defined a my Item (is a simple combo: QComboTableItem doesn't work for my application) deriving it from QTableItem, and i have reimplemented createEditor() for this. Well... because I want do something when the user select an item from the combo, I've connected activated(int) signal of the combo with doValueChange slot of my table. I've also connected valueChaged(int, int) signal of the table with the slot "doSomething(int, int)" slot. The problem is that if i create the Item with QTableItem::Always the doSomething(int, int) slot receives (-1, -1) as parameters, insead of the correct row, col. If I create the Item with QTableItem::WhenCurrent, the slot receives the correct (row, col). Is it possible to have the correct (row, col) even if I create the item with QTableItem::Always?

Thanks...

wysota
19th August 2006, 12:19
Hard to say. You could look at the source code of methods which emit the signal to check when -1, -1 are used as parameters. But maybe you don't need "Always" as the type? You can have an item which **looks like** a combobox and only when it is edited it **becomes** a combobox (for example using a pixmap and grabWidget() call).