@@ -141,32 +141,34 @@ LayoutViewer::LayoutViewer(
141141 focus_nets_(focus_nets),
142142 route_guides_(route_guides),
143143 net_tracks_(net_tracks),
144- viewer_thread_(this ),
145- loading_timer_(new QTimer(this ))
144+ viewer_thread_(this )
146145{
147146 setMouseTracking (true );
148147
149148 addMenuAndActions ();
150149
151- loading_timer_-> setInterval (300 /* ms*/ );
150+ loading_timer_. setInterval (300 /* ms*/ );
152151
153152 connect (
154153 &viewer_thread_, &RenderThread::done, this , &LayoutViewer::updatePixmap);
155154
156- connect (loading_timer_,
155+ connect (& loading_timer_,
157156 &QTimer::timeout,
158157 this ,
159158 &LayoutViewer::handleLoadingIndication);
160159
161160 connect (&search_, &Search::modified, this , &LayoutViewer::fullRepaint);
162161
163162 connect (&search_, &Search::newChip, this , &LayoutViewer::setChip);
163+
164+ repaint_timer_.setSingleShot (true );
165+ repaint_timer_.callOnTimeout (this , &LayoutViewer::fullRepaint);
164166}
165167
166168void LayoutViewer::handleLoadingIndication ()
167169{
168170 if (!viewer_thread_.isRendering ()) {
169- loading_timer_-> stop ();
171+ loading_timer_. stop ();
170172 return ;
171173 }
172174
@@ -176,7 +178,7 @@ void LayoutViewer::handleLoadingIndication()
176178void LayoutViewer::setLoadingState ()
177179{
178180 loading_indicator_.clear ();
179- loading_timer_-> start ();
181+ loading_timer_. start ();
180182}
181183
182184void LayoutViewer::setChip (odb::dbChip* chip)
@@ -1933,8 +1935,7 @@ void LayoutViewer::paintEvent(QPaintEvent* event)
19331935void LayoutViewer::fullRepaint ()
19341936{
19351937 if (command_executing_ && !paused_) {
1936- QTimer::singleShot (
1937- 5 /* ms*/ , this , &LayoutViewer::fullRepaint); // retry later
1938+ repaint_timer_.start (5 /* ms */ );
19381939 return ;
19391940 }
19401941
0 commit comments