[PyQt] embedding iconic pushButton in TableView and/or TreeView

Hans-Peter Jansen hpj at urpla.net
Wed Nov 24 09:55:21 GMT 2010

On Wednesday 24 November 2010, 04:00:15 James Polk wrote:
> Hans, I'm sure you're right, but I'm still a little dense about this,
> lol...
> All the examples of spinDelegates that I've seen are using integers,
> and are present in every cell...usually in QTableView...
> I'm using QTreeView, and I only want a pushButton/Icon in the first
> column,...I've spent about six hours trying different things...
> I have a simple example using a TreeWidget just by itself...but I
> can't seem to incorporate that into the larger program (QTreeView,
> and QSortFilterProxyModel).  I guess I'll back to my SummerField book
> and start reading about delegates again...

I've transcoded the stardelegate example a few weeks ago, which uses a 
custom widget in a QTableView, but due to the model/view/delegate 
pattern, that should be easy to map onto your problem.


More information about the PyQt mailing list