Some spreadsheet applications (notably MS Excel, Google Sheets, etc.) have a 
mechanism for indicating that a cell has a comment attached to it (see attached 
screenshot, the red triangle in the upper corner of the cell A1). Is there a 
way to do something similar with a QTableWidgetItem?

The only method I'm seeing at the moment is to create my own custom widget, 
like something that inherits from QLabel for example, that has this indicator, 
and then use QTableWidget::setCellWidget() to insert it where I want in the 
table. Am I missing some other method?

Other (possibly) important notes:
- the table is read-only, so I don't need to worry about making the 
QTableWidgetItem editable, so that's why my approach above suggest QLabel, not 
QLineEdit
- If there is a way to do it without a custom widget, I'd like to be able to do 
it via a custom Role (i.e. QTableWidgetItem::setData(myCommentRole, bool 
commentEnabled) ) if possible, but that's not really critical

Sean



This message has been scanned for malware by Forcepoint. www.forcepoint.com
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to