Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to ingore specific image copy in QTextBrowser?
dscyw last edited by dscyw
I have a
ChatViewwidget based on
QTextBrowser, where I put two image anchors to achieve click event. I want copy and paste action to ignore these two items. How can I achieve it?
select and copy:
paste to a widget based on
what I want to achieve without any extra editor action:
KillerSmath last edited by KillerSmath
Maybe you can reimplement the Clipboard of aplication to ignore these imagens (removing them of plain text).
But also, you can reimplement the paste action of QTextBrowser class and remove these image of plaintext.
Either you recreate the whole mime-data yourself or you call the base-class implementation and remove the <img> elements from the text/html data.
Actually you can also completely create your own mime-type and store anything you like in there. Then reimplement
insertFromMimeData()and handle your custom mime-type.
dscyw last edited by