How to make a fast QTableView with HTML-formatted and clickable cells?

后端 未结 4 1111

I\'m making a dictionary program that displays word definitions in a 3-column QTableView subclass, as user types them, taking data from a QAbstractTableModel<

4条回答
  •  情歌与酒
    2021-01-31 01:08

    In your case QLabel (re)painting is slow, not QTableView. On other hand, QTableView does not support formated text at all.

    Probably, your only way, is to create your own delegate, QStyledItemDelegate, and make your own painting and click processing in it.

    PS: yes, you can use QTextDocument for rendering html inside delegate, but it will be slow too.

提交回复
热议问题