Question

I have QTableView - mainTableView, in some cells of which I need to show another QTableView - cellTableView.
Actually I found 2 ways:
1) Use pTableView->setIndexWidget
2) Use pTableView->openPersistentEditor and implement an ItemDelegate.
I have tried both ways and the problem is just the same. When I use an ItemDelegate without openPersistentEditor everything works good. Otherwise, as I understand, there is a problem with focus and with HeaderView of the table in a cell.

I would like to solve the following problems:

  • sometimes instead of a HeaderView of cellTableView, background of mainTableView is shown.
  • When I press a key on a cell of cellTableView, editor for this cell is not opened but the pressed symbol is set to the cell (editor opened->editor receives "FocusOut" signal->editor is closed, pressed value is stored to the cell).
    With space key or double click editing works good.

Someone could me explain how to solve this behavior?

Was it helpful?

Solution

I have found this solution.
http://qtadventures.wordpress.com/2012/02/04/adding-button-to-qviewtable/
For my case I need even less and it works just great! I switch a cell to the edit mode manually, when the cell is selected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top