QTableWidget & cellWidget : some pointers
I am creating a QTableWidget and in each sell I am setting up a custom widget:
Code:
for row in range(4):
This works fine. How ever when I change the value of spinBox, none of the signals
(cell*.* or item*.*) of QTableWidget is emitting. I would prefer this technique compare of another ones.
Another way to solve this problem is to use "setItemDelegate" method and using spinBox
as a delegate. What I don't like here is that when you click in a cell, your widget
will become visible and as soon as cell lost it's focus, delegate widgets become invisible.
Is there a any way I keep the the widget visible all the time and delegate technique?
Re: QTableWidget & cellWidget : some pointers
Quote:
Originally Posted by
prashant
This works fine. How ever when I change the value of spinBox, none of the signals
(cell*.* or item*.*) of QTableWidget is emitting.
That's because those widgets are not related to the model in any way.
Quote:
Another way to solve this problem is to use "setItemDelegate" method and using spinBox
as a delegate. What I don't like here is that when you click in a cell, your widget
will become visible and as soon as cell lost it's focus, delegate widgets become invisible.
Is there a any way I keep the the widget visible all the time and delegate technique?
You can render the looks of spinbox into the cell using QStyle API.