Display database path in root group tooltip

When mousing over the root group entry, show the file path for the current database.

Fixes #4038
This commit is contained in:
Andrew Meyer 2020-02-16 01:57:36 -05:00 committed by Jonathan White
parent 50e52df04b
commit ca471e9986

View File

@ -142,6 +142,13 @@ QVariant GroupModel::data(const QModelIndex& index, int role) const
font.setStrikeOut(true);
}
return font;
} else if (role == Qt::ToolTipRole) {
QString tooltip;
if (!group->parentGroup()) {
// only show a tooltip for the root group
tooltip = m_db->filePath();
}
return tooltip;
} else {
return QVariant();
}