Avoid clipped texts in netlist/LVS result browser, text as tool tips

This commit is contained in:
Matthias Koefferlein 2022-02-28 21:19:03 +01:00
parent 42bd12b2db
commit 42fbe7b30a
4 changed files with 19 additions and 5 deletions

View File

@ -40,7 +40,7 @@ HTMLItemDelegate::HTMLItemDelegate (QObject *parent)
m_icon_spacing = 6;
m_text_margin = 4;
m_text_height = -1;
m_text_width = 500;
m_text_width = -1;
m_plain_text = false;
m_anchors_clickable = false;
}

View File

@ -2566,8 +2566,12 @@ NetlistBrowserModel::data (const QModelIndex &index, int role) const
return QVariant (icon_for_status (status (index)));
} else if (role == Qt::DisplayRole) {
return QVariant (text (index));
} else if (role == Qt::ToolTipRole && index.column () == m_status_column) {
return tooltip (index);
} else if (role == Qt::ToolTipRole) {
if (index.column () == m_status_column) {
return tooltip (index);
} else {
return QVariant (text (index));
}
} else if (role == Qt::UserRole) {
return QVariant (search_text (index));
} else if (role == Qt::FontRole) {

View File

@ -168,16 +168,22 @@ NetlistBrowserPage::NetlistBrowserPage (QWidget * /*parent*/)
for (int i = 0; i < 4; ++i) {
delegate = new lay::HTMLItemDelegate (this);
delegate->set_text_margin (2);
delegate->set_plain_text (true);
/* currently, HTML is not used:
delegate->set_anchors_clickable (true);
connect (delegate, SIGNAL (anchor_clicked (const QString &)), this, SLOT (anchor_clicked (const QString &)));
*/
directory_tree->setItemDelegateForColumn (i, delegate);
}
for (int i = 0; i < 2; ++i) {
delegate = new lay::HTMLItemDelegate (this);
delegate->set_text_margin (2);
delegate->set_plain_text (true);
/* currently, HTML is not used:
delegate->set_anchors_clickable (true);
connect (delegate, SIGNAL (anchor_clicked (const QString &)), this, SLOT (anchor_clicked (const QString &)));
*/
hierarchy_tree->setItemDelegateForColumn (i, delegate);
}

View File

@ -164,8 +164,12 @@ NetlistBrowserTreeModel::data (const QModelIndex &index, int role) const
return QVariant (icon_for_status (status (index)));
} else if (role == Qt::DisplayRole) {
return QVariant (text (index));
} else if (role == Qt::ToolTipRole && index.column () == m_status_column) {
return tooltip (index);
} else if (role == Qt::ToolTipRole) {
if (index.column () == m_status_column) {
return tooltip (index);
} else {
return QVariant (text (index));
}
} else if (role == Qt::UserRole) {
return QVariant (search_text (index));
} else if (role == Qt::FontRole) {