qt5 - Using setCellWidget to insert a QTextEdit into a QTableWidget loses keyboard and mouse events -
i trying insert pretty, html text qtablewidget cells using setcellwidget , qtextedit objects. works great, table doesn't mouse clicks (for selection, etc.) or keypresses (for selection, navigation, etc.).
here how i'm setting cells:
ui.mytablewidget->insertrow(rowcount); qtablewidgetitem *srcitem = new qtablewidgetitem(); ui.mytablewidget->setitem(rowcount, 0, srcitem); qtextedit *text = new qtextedit(); text->inserthtml( _gethtml() ); text->setframestyle( qframe::noframe ); text->setreadonly( true ); ui.mytablewidget->setcellwidget( rowcount, 0, text );
thanks suggestions.
i solved problem creating delegate , painting cell myself. used qtextdocument object painting.
i referenced example on delegates: http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.html
Comments
Post a Comment