[PyQt] QPushButton embeded in QTableView (like forever)

Linos info at linos.es
Mon Apr 26 08:28:11 BST 2010


Hi,
	if you want to use real widget all the time you can use 
QAbstractItemView.setIndexWidget but when you have many rows this is a 
performance problem, the usual method it is emulate the widget with 
QStyle.drawControl in the paint method of the delegate and load the real widget 
when editrole is active (like you have done), you can see here an example:

www.qtcentre.org/threads/26916-inserting-custom-Widget-to-listview

and you have many others of the same in the same forum, just search for drawControl.

Regards,
Miguel Angel.


El 26/04/10 07:03, AON LAZIO escribió:
> Hi,
>      We know how we can use delegate to create a button in QTableView
> right? So it's like when the user double-click at an index in the table,
> the button will pop up and when the user click elsewhere, it won't be a
> push button anymore. Now my question is how to make a QPushButton stay
> there in QTableView forever (no double click), so the user can click at
> it anytime.
>      Thanks
>
> --
> Passion is my style
>
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list