<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>Woooohooooo....I got a custom delegate installed....at least partially, lol...<br>Using the basic QItemDelegate<br>I've first tried a comboBox, which seems a little more straightforward,..<br><br>When using QTableView,...the "index.column()" calls want text matching<br>the column headings,...but in QTreeView, the same call wants an integer index#...so my code looks like...<br><br><br> def createEditor(self, parent, option, index):<br> if index.column() == 0: # Thumbnail<br> button = QPushButton(parent)<br> return button<br> if index.column() ==
4: # Format<br> comboBox = QComboBox(parent)<br> comboBox.addItem("ma")<br> comboBox.addItem("mb")<br> comboBox.addItem("obj")<br> comboBox.setEditable(True)<br> return comboBox<br> return QItemDelegate.createEditor(self, parent, option, index)<br><br>I was all in celebration mode,...until I began to add the initial<br>pushbutton/icon in the first column.....Right now, I'm just using<br>QPushButton and will add the
image/pixmap later...<br><br>Well..the danged curious thing is....that when I run the code,<br>and double-click on the cells of the first column, the custom<br>delegate dutifully returns a nice PushButton....but my conundrum<br>is that I still can't figure out how to add the PushButton to the<br>QTreeView on startup!...<sigh>....<br><br>You may recall the data layout I'm going for is something like...<br><br>1 [icon1] data data data etc <br>2 [icon2] data data data etc<br>3 etc<br>4 etc<br><br>...and later,...when a user binks on the icon, it will need to execute<br>a
command...<br><br>So,...some progress, but still more jungle ahead,lol...<sigh><br>Maybe I'll go reread your stardelegate code again ;-)<br>Cheers,<br><br><br><br></td></tr></table><br>