[Qt-interest] making QPushButton appear next to the selected item in a QTableView

TP paratribulations at free.fr
Thu Nov 11 22:21:54 CET 2010


Hello,

I am trying to figure out how to make a widget like a QPushButton appear 
next to the selected item in a QTableView.

Up to now, my approach is to create a QPushButton in the paint() method of a 
custom QItemDelegate set on the QTableView.
The parent of the QPushButton is the QTableView.
I use the QStyleOptionViewItem QRect to determine how to move() the 
QPushButton next to the selected item in the QTableView.

The biggest problem is that I want to put the QPushButton not really in the 
viewport of the QTableView, but rather in the table! This means, that if I 
scroll down the table to the bottom, and make the QPushButton appear by 
clicking on a cell, and then I scroll up the table, I want the QPushButton 
to disappear.
But on the contrary, with my current code, it remains in the viewport. I 
don't know how to do that. What is the best method to use?

Thanks

Julien

-- 
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)




More information about the Qt-interest-old mailing list