简体   繁体   中英

Image or text in between items in QTreeWidget

I was wondering what would be the way to put an image or a little bit of text between items in QTreeWidget. In particular, I would like to have 'OR' and 'AND' show up, to indicate a query structure... is this possible. Any advice would be very much appreciated! Preferably, I was hoping for a pyqt solution.

The only way I can think to do this would be to insert another QTreeWidget item in-between the items at the location you want the text to appear. QTreeWidgetItem has some methods like setDisabled() , etc. which would allow you to customise the item so it wasn't selectable, had a different colour, or whatever you wanted.

If that isn't good enough, I think you would have to do down the route of changing how the widget is painted, and that will not be easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM