@@ -1130,7 +1130,9 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11301130 expand_clk_(new QCheckBox(this )),
11311131 from_(new PinSetWidget(false , this )),
11321132 thru_({}),
1133- to_(new PinSetWidget(false , this ))
1133+ to_(new PinSetWidget(false , this )),
1134+ scroll_(new QScrollArea(this )),
1135+ content_widget_(new QWidget)
11341136{
11351137 setWindowTitle (" Timing Controls" );
11361138
@@ -1149,8 +1151,21 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11491151 setUnconstrained (false );
11501152 layout_->addRow (" Unconstrained:" , unconstrained_);
11511153 layout_->addRow (" One path per endpoint:" , one_path_per_endpoint_);
1152-
1153- setLayout (layout_);
1154+ content_widget_->setLayout (layout_);
1155+
1156+ scroll_->setLayout (new QVBoxLayout);
1157+ scroll_->setWidget (content_widget_);
1158+ scroll_->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Expanding);
1159+ scroll_->adjustSize ();
1160+ scroll_->setMinimumWidth (
1161+ scroll_->size ().width ()
1162+ + qApp->style ()->pixelMetric (QStyle::PM_ScrollBarExtent));
1163+
1164+ setLayout (new QVBoxLayout);
1165+ layout ()->addWidget (scroll_);
1166+ setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Expanding);
1167+ setMaximumWidth (layout ()->sizeHint ().width ());
1168+ adjustSize ();
11541169
11551170 connect (path_count_spin_box_,
11561171 QOverload<int >::of (&QSpinBox::valueChanged),
@@ -1182,6 +1197,24 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11821197 sta_->setIncludeCapturePaths (true );
11831198}
11841199
1200+ QSize TimingControlsDialog::sizeHint () const
1201+ {
1202+ int width = minimumWidth ();
1203+ int top = 0 , bottom = 0 ;
1204+ if (layout ())
1205+ {
1206+ layout ()->getContentsMargins (nullptr , &top, nullptr , &bottom);
1207+ }
1208+ int top2 = 0 , bottom2 = 0 ;
1209+ if (scroll_->layout ())
1210+ {
1211+ scroll_->layout ()->getContentsMargins (nullptr , &top2, nullptr , &bottom2);
1212+ }
1213+
1214+ int height = content_widget_->size ().height ()+top+bottom+top2+bottom2;
1215+ return QSize (width, height);
1216+ }
1217+
11851218void TimingControlsDialog::setupPinRow (const QString& label,
11861219 PinSetWidget* row,
11871220 int row_index)
0 commit comments