From 36a2782a38ff16736b9dedf8fe3c00af4d0597db Mon Sep 17 00:00:00 2001 From: ShaopengLin Date: Thu, 7 Nov 2024 02:34:55 -0500 Subject: [PATCH] Add Tooltip to TOC Elided item text is expanded here. --- src/tableofcontentbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tableofcontentbar.cpp b/src/tableofcontentbar.cpp index aa9ecdeb0..97c2f8819 100644 --- a/src/tableofcontentbar.cpp +++ b/src/tableofcontentbar.cpp @@ -45,6 +45,7 @@ QTreeWidgetItem* createChildItem(QTreeWidgetItem* parent, const QString& childNo item->setExpanded(true); const auto display = childNo + " " + headerObj["text"].toString(); + item->setToolTip(0, display); item->setData(0, Qt::DisplayRole, display); item->setData(0, Qt::FontRole, QFont("Selawik", 12)); item->setData(0, Qt::UserRole, headerObj["anchor"].toString());