[LyX/master] GuiDelimiter: store delimiter name in UserRole
Juergen Spitzmueller
spitz at lyx.org
Sat Feb 6 14:30:55 UTC 2021
commit 7c33e2fc0857d45ab78dfc226ac712ff4c13ba8e
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sat Feb 6 15:33:13 2021 +0100
GuiDelimiter: store delimiter name in UserRole
---
src/frontends/qt/GuiDelimiter.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/frontends/qt/GuiDelimiter.cpp b/src/frontends/qt/GuiDelimiter.cpp
index 1626b56..cc980bc 100644
--- a/src/frontends/qt/GuiDelimiter.cpp
+++ b/src/frontends/qt/GuiDelimiter.cpp
@@ -169,13 +169,13 @@ string const & texName(char_type math_symbol)
void setDelimiterName(QListWidgetItem * lwi, string const & name)
{
- lwi->setToolTip(toqstr(name));
+ lwi->setData(Qt::UserRole, toqstr(name));
}
string getDelimiterName(QListWidgetItem const * lwi)
{
- return fromqstr(lwi->data(Qt::ToolTipRole).toString());
+ return fromqstr(lwi->data(Qt::UserRole).toString());
}
@@ -219,6 +219,7 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
QListWidgetItem * lwi = new QListWidgetItem(QIcon(pixmap), QString());
setDelimiterName(lwi, delim);
left_list_items_[ms.unicode] = lwi;
+ lwi->setToolTip(toqstr(delim));
lwi->setSizeHint(icon_size);
leftLW->addItem(lwi);
}
@@ -232,10 +233,10 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
// The last element is the empty one.
QListWidgetItem * lwi = new QListWidgetItem(qt_("(None)"));
- lwi->setToolTip(qt_("(No Delimiter)"));
+ lwi->setToolTip(qt_("No Delimiter"));
left_list_items_['?'] = lwi;
QListWidgetItem * rwi = new QListWidgetItem(qt_("(None)"));
- rwi->setToolTip(qt_("(No Delimiter)"));
+ rwi->setToolTip(qt_("No Delimiter"));
right_list_items_['?'] = rwi;
leftLW->addItem(lwi);
rightLW->addItem(rwi);
More information about the lyx-cvs
mailing list