0

I want to display TeX-like expressions on a pyqt table widget. All the answers I came up with tell that I need to create a new widget to show those expressions correctly, but I want to know if it's possible to include them inside a cell of a table widget on pyqt5.

Here's a picture of what I want to accomplish:

case

So basically i want to display self.General_Table.item(0, 0).setText('m^2') as a TeX-like expression.

Thanks in advance!

rwp
  • 1,786
  • 2
  • 17
  • 28
tomas-silveira
  • 593
  • 3
  • 5
  • 14
  • 1
    What is the relevance of the screenshot? It appears to show normal ascii text, which doesn't require any special formatting. – ekhumoro May 10 '18 at 17:23
  • I know, but i would like that m^2 to display as a TeX-like expression instead of just "m^2", if that's possible. The screenshot was to illustrate what i wanted to change. – tomas-silveira May 10 '18 at 17:44
  • 1
    Why not just use unicode, like this: `m²`? – ekhumoro May 10 '18 at 17:50
  • I didn't knew i could just set the text to `m²`! It works now. Thanks! – tomas-silveira May 10 '18 at 17:54
  • 1
    PS: for other mathematical unicode characters, see [here](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) and [here](https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts). – ekhumoro May 10 '18 at 17:58

0 Answers0