Skip to content

Commit

Permalink
added tooltip to port id and desription
Browse files Browse the repository at this point in the history
  • Loading branch information
Subaru Arai committed Apr 28, 2022
1 parent 05fe640 commit e496634
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bt_editor/sidepanel_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SidepanelEditor::SidepanelEditor(QtNodes::DataModelRegistry *registry,
_tree_nodes_model(tree_nodes_model),
_model_registry(registry)
{
ui->setupUi(this);
ui->setupUi(this);
ui->paramsFrame->setHidden(true);
ui->paletteTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);

Expand Down Expand Up @@ -121,8 +121,16 @@ void SidepanelEditor::on_paletteTreeWidget_itemSelectionChanged()
for (const auto& port_it: model.ports)
{
ui->portsTableWidget->setItem(row,0, new QTableWidgetItem( QString::fromStdString(toStr(port_it.second.direction))));
ui->portsTableWidget->setItem(row,1, new QTableWidgetItem( port_it.first ));
ui->portsTableWidget->setItem(row,2, new QTableWidgetItem( port_it.second.description) );
QTableWidgetItem *port_id = new QTableWidgetItem( port_it.first );
#ifndef QT_NO_TOOLTIP
port_id->setToolTip("<p style='white-space:pre'>" + port_id->text().toHtmlEscaped() + "</p>");
#endif
ui->portsTableWidget->setItem(row,1, port_id);
QTableWidgetItem *description = new QTableWidgetItem( port_it.second.description);
#ifndef QT_NO_TOOLTIP
description->setToolTip("<p style='white-space:pre'>" + description->text().toHtmlEscaped() + "</p>");
#endif
ui->portsTableWidget->setItem(row,2, description);
row++;
}
ui->portsTableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
Expand Down

0 comments on commit e496634

Please sign in to comment.