This way seems to be more robust than the previous way for displaying tooltip in HTML table for stats. It is also more self-explanatory for a user to use.
I have created a new class "MyTextEdit" in "generalTest" which is derived from "QTextEdit".
"MyTextEdit" is able to show separate tooltips for different words. At an internal level, it stores the ranges of the cursor on which tooltip is to be shown in AVL Tree and then reproduces the tooltip whenever the mouse hovers on that range.
I have used AVLTree because it is self-balanced Binary Search Tree. Here insertions operations are limited but the number of search operations are huge. This gives us the performance of O(logn). The reason for not using a simple map to store range and tooltips is the huge number of search operations.
I have introduced new tags to represent tooltips in the feature-rich string. This makes all insert operations in avl tree object abstract to the user of MyTextEdit.
The tags can be used as
[tooltip][data]"data to present"[/data][tip]"tool tip for data"[/tip][/tooltip]
"The data to present" and "tooltip for data" can by feature rich string