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

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -