@@ -90,7 +90,9 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
9090 charts_widget_(new ChartsWidget(this )),
9191 help_widget_(new HelpWidget(this )),
9292 find_dialog_(new FindObjectDialog(this )),
93- goto_dialog_(new GotoLocationDialog(this , viewers_))
93+ goto_dialog_(new GotoLocationDialog(this , viewers_)),
94+ selection_timer_(std::make_unique<QTimer>()),
95+ highlight_timer_(std::make_unique<QTimer>())
9496{
9597 // Size and position the window
9698#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@@ -389,6 +391,13 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
389391 &MainWindow::displayUnitsChanged,
390392 goto_dialog_,
391393 &GotoLocationDialog::updateUnits);
394+ connect (selection_timer_.get (), &QTimer::timeout, [this ]() {
395+ emit selectionChanged ();
396+ });
397+ connect (highlight_timer_.get (),
398+ &QTimer::timeout,
399+ this ,
400+ &MainWindow::highlightChanged);
392401
393402 createActions ();
394403 createToolbars ();
@@ -436,6 +445,12 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
436445 = [this ](const std::string& value, bool * ok) -> int {
437446 return convertStringToDBU (value, ok);
438447 };
448+
449+ selection_timer_->setSingleShot (true );
450+ highlight_timer_->setSingleShot (true );
451+
452+ selection_timer_->setInterval (100 /* ms */ );
453+ highlight_timer_->setInterval (100 /* ms */ );
439454}
440455
441456MainWindow::~MainWindow ()
@@ -1117,7 +1132,7 @@ void MainWindow::addSelected(const SelectionSet& selections, bool find_in_cts)
11171132 }
11181133 status (std::string (" Added " )
11191134 + std::to_string (selected_.size () - prev_selected_size));
1120- emit selectionChanged ();
1135+ selection_timer_-> start ();
11211136
11221137 if (find_in_cts) {
11231138 emit findInCts (selections);
@@ -1161,7 +1176,7 @@ void MainWindow::addHighlighted(const SelectionSet& highlights,
11611176 group.insert (highlight);
11621177 }
11631178 }
1164- emit highlightChanged ();
1179+ highlight_timer_-> start ();
11651180}
11661181
11671182std::string MainWindow::addLabel (int x,
@@ -1862,4 +1877,4 @@ void MainWindow::reportSlackHistogramPaths(
18621877
18631878 timing_widget_->reportSlackHistogramPaths (report_pins, path_group_name);
18641879}
1865- } // namespace gui
1880+ } // namespace gui
0 commit comments