Tooltips in Html Table
ClosedPublic

Authored by devanshuagarwal on Aug 4 2019, 11:14 PM.

Details

Reviewers
sgerlach
asemke
Summary

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.

Diff Detail

Repository
R262 LabPlot
Lint
Lint Skipped
Unit
Unit Tests Skipped
Restricted Application added a project: KDE Edu. · View Herald TranscriptAug 4 2019, 11:14 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
devanshuagarwal requested review of this revision.Aug 4 2019, 11:14 PM
devanshuagarwal edited the summary of this revision. (Show Details)

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

sgerlach added inline comments.Aug 18 2019, 10:03 PM
src/CMakeLists.txt
248

MyTextEdit is not a good name for a special text edit. Please choose another name that reflects how this text edit extends QTextEdit.

src/CMakeLists.txt
248

This MyTextEdit is extended to add tooltip functionality. So what about TextEditWithTooltip or ToolTipTextEdit ??

ToolTipTextEdit sound good to me.

sgerlach accepted this revision.Aug 29 2019, 3:33 PM

Please rename MyTextEdit and commit.

This revision is now accepted and ready to land.Aug 29 2019, 3:34 PM
sgerlach closed this revision.Aug 29 2019, 4:11 PM