Skip to content

Commit 4814a5d

Browse files
author
Subaru Arai
committed
added tooltip to port id and desription
1 parent a40e25c commit 4814a5d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: bt_editor/sidepanel_editor.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SidepanelEditor::SidepanelEditor(QtNodes::DataModelRegistry *registry,
2222
_tree_nodes_model(tree_nodes_model),
2323
_model_registry(registry)
2424
{
25-
ui->setupUi(this);
25+
ui->setupUi(this);
2626
ui->paramsFrame->setHidden(true);
2727
ui->paletteTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
2828

@@ -121,8 +121,16 @@ void SidepanelEditor::on_paletteTreeWidget_itemSelectionChanged()
121121
for (const auto& port_it: model.ports)
122122
{
123123
ui->portsTableWidget->setItem(row,0, new QTableWidgetItem( QString::fromStdString(toStr(port_it.second.direction))));
124-
ui->portsTableWidget->setItem(row,1, new QTableWidgetItem( port_it.first ));
125-
ui->portsTableWidget->setItem(row,2, new QTableWidgetItem( port_it.second.description) );
124+
QTableWidgetItem *port_id = new QTableWidgetItem( port_it.first );
125+
#ifndef QT_NO_TOOLTIP
126+
port_id->setToolTip("<p style='white-space:pre'>" + port_id->text().toHtmlEscaped() + "</p>");
127+
#endif
128+
ui->portsTableWidget->setItem(row,1, port_id);
129+
QTableWidgetItem *description = new QTableWidgetItem( port_it.second.description);
130+
#ifndef QT_NO_TOOLTIP
131+
description->setToolTip("<p style='white-space:pre'>" + description->text().toHtmlEscaped() + "</p>");
132+
#endif
133+
ui->portsTableWidget->setItem(row,2, description);
126134
row++;
127135
}
128136
ui->portsTableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);

0 commit comments

Comments
 (0)