Skip to content

Commit

Permalink
Merge pull request #5439 from povik/navigation-perks
Browse files Browse the repository at this point in the history
gui: Make critical path inspection ergonomic
  • Loading branch information
maliberty authored Jul 24, 2024
2 parents adf2bb3 + 906b24d commit 74ff70b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/src/inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,16 @@ void Inspector::clicked(const QModelIndex& index)
// timer to be able to tell the difference
if (!mouse_timer_.isActive()) {
clicked_index_ = index;

// Bypass the timer for those items for which there's
// no double click handling
QStandardItem* item = model_->itemFromIndex(index);
QVariant edit_data = item->data(EditorItemDelegate::editor_);
if (!edit_data.isValid()) {
indexClicked();
return;
}

mouse_timer_.start();
}
}
Expand Down
29 changes: 29 additions & 0 deletions src/gui/src/timingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ void TimingWidget::init(sta::dbSta* sta)
this,
&TimingWidget::selectedCaptureRowChanged);

connect(path_details_table_view_,
&QTableView::doubleClicked,
this,
&TimingWidget::detailRowDoubleClicked);

connect(capture_details_table_view_,
&QTableView::doubleClicked,
this,
&TimingWidget::detailRowDoubleClicked);

clearPathDetails();
}

Expand Down Expand Up @@ -618,6 +628,25 @@ void TimingWidget::selectedCaptureRowChanged(
highlightPathStage(capture_details_model_, top_sel_index);
}

void TimingWidget::detailRowDoubleClicked(const QModelIndex& index)
{
auto model = static_cast<const TimingPathDetailModel*>(index.model());

if (!index.isValid() || !model->hasNodes()
|| model->isClockSummaryRow(index)) {
return;
}

auto* node = model->getNodeAt(index);
auto* gui = Gui::get();

if (auto iterm = node->getPinAsITerm()) {
emit inspect(gui->makeSelected(iterm));
} else if (auto bterm = node->getPinAsBTerm()) {
emit inspect(gui->makeSelected(bterm));
}
}

void TimingWidget::copy()
{
QTableView* focus_view
Expand Down
2 changes: 2 additions & 0 deletions src/gui/src/timingWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class TimingWidget : public QDockWidget
void selectedCaptureRowChanged(const QItemSelection& prev_index,
const QItemSelection& curr_index);

void detailRowDoubleClicked(const QModelIndex& index);

void handleDbChange();
void setBlock(odb::dbBlock* block);

Expand Down

0 comments on commit 74ff70b

Please sign in to comment.