Show tooltips in DB Structure views

When hovering over an item in the tree views of the Database Structure tab
or DB Schema pane, show a tooltip with the contents of that field.

See issue #139.
This commit is contained in:
Martin Kleusberg
2014-10-30 18:32:10 +01:00
parent 3d5fc6ee8d
commit daa7b7f16e

View File

@@ -38,6 +38,8 @@ QVariant DbStructureModel::data(const QModelIndex& index, int role) const
// Depending on the role either return the text or the icon
if(role == Qt::DisplayRole)
return PreferencesDialog::getSettingsValue("db", "hideschemalinebreaks").toBool() ? item->text(index.column()).replace("\n", " ") : item->text(index.column());
else if(role == Qt::ToolTipRole)
return item->text(index.column()); // Don't modify the text when it's supposed to be shown in a tooltip
else if(role == Qt::DecorationRole)
return item->icon(index.column());
else