mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Check the validity of an item before querying its tooltip
In case data() does not handle invalid items.
This commit is contained in:
parent
03a0e983bc
commit
851ed60e49
@ -52,6 +52,8 @@ bool ToolTipFormatter::eventFilter(QObject * o, QEvent * e)
|
||||
// on the screen.
|
||||
QPoint pos = static_cast<QHelpEvent *>(e)->pos();
|
||||
QModelIndex item = iv->indexAt(pos);
|
||||
if (!item.isValid())
|
||||
return false;
|
||||
QVariant data = iv->model()->data(item, Qt::ToolTipRole);
|
||||
if (data.isValid() && data.typeName() == toqstr("QString"))
|
||||
// Unchanged if empty or already formatted
|
||||
|
Loading…
Reference in New Issue
Block a user