Recently, a rather interesting question appeared on the forum, about how you can visualize formulas in Qt. Unfortunately, I did not have the opportunity to deal with the site and the forum for a long time, but decided that presenting my possible vision of the problem even after a while would be useful.
The question is to visualize the formula, which is written in the form of a line.
For example, you type
in some input field, and in some widget you will display a graphical display of the square root of 5, that is, not the result, but the formula itself. Similar functionality is implemented in
It will look like this.
By itself, the task of writing such a functional in my opinion can be quite difficult and time consuming, especially if it comes to implementing a functional with embedded formulas, etc. Therefore, I will focus on the concept that occurred to me to implement the mapping of the simplest variants of formulas, i.e. without nested subformulas.