Skip to content

Commit

Permalink
Add Tooltip to TOC
Browse files Browse the repository at this point in the history
Elided item text is expanded here.
  • Loading branch information
ShaopengLin committed Nov 11, 2024
1 parent d3f6f50 commit c6aac3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tableofcontentbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ QTreeWidgetItem* createChildItem(QTreeWidgetItem* parent, const QJsonObject& hea

const auto itemNum = numberList.join(".");
const auto display = itemNum + " " + headerObj["text"].toString();
item->setToolTip(0, display);
item->setData(0, Qt::DisplayRole, display);
item->setData(0, Qt::FontRole, QFont("Selawik", 12));
item->setData(0, LevelRole, headerObj["level"].toInt());
Expand Down

0 comments on commit c6aac3f

Please sign in to comment.