0

I was tinkering with Qt's richtext HTML subset. I wanted to add a rounded border on a html table to use with QTextDocument.setHtml() method in QT. But the documentation does not have a "border-radius" property.

Does anyone have suggestions on achieving this?

and if is not possible, which way would be easier to port HTML format?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
lymphatic
  • 91
  • 1
  • 6
  • Why don't you use QtWebEngine? – eyllanesc Oct 04 '21 at 15:25
  • Tried it when searching ways and it worked perfectly which is expected but I've security concerns about using QtWebEngine (which built on Chromium project). The origin of the concern is about handling user inputs. [The documentation](https://doc.qt.io/qt-5/qtwebengine-overview.html#qt-webengine-process) says it runs as another process which is great. But also it does not permit running my application with high privileges without using "--no-sandbox" flag. I'm not sure if both sandbox and other process refers to same thing. I've tried to avoid it as I've no experience with it. – lymphatic Oct 04 '21 at 16:05
  • but if it is not possible as I said; I'm not going to round borders or read along the QtWebEngine. Asked to check if someone has a trick to overcome this, thanks for the feedback. – lymphatic Oct 04 '21 at 16:07
  • @lymphatic there's no "trick", the drawing of a QTextDocument is done internally with the QTextDocumentLayout (which is a private class), the only *proper* option would be to subclass QAbstractTextDocumentLayout and implement *everything* on your own by porting the C++ source (which counts more than 3000 lines) to python. The other alternative would be to create a `QTextObjectInterface`, but that API creates "bundled" embedded objects (it's used to show animations or advanced objects), so using it for a table is not suitable. – musicamante Oct 04 '21 at 16:53
  • @musicamante thanks for clarifying and for your time. – lymphatic Oct 05 '21 at 12:54

0 Answers0