#14104 Add minimum size floor to property view dialog

Override sizeHint() and minimumSizeHint() in PdmUiPropertyViewDialog so the dialog cannot open collapsed. The inner scroll area reports an artificially small minimum size hint that some window managers honor literally, shrinking the dialog to an unusable size (issue #14104). The floor is capped by the content's preferred size so intentionally small dialogs are not enlarged.
This commit is contained in:
Magne Sjaastad committed 2026-06-04 21:06:38 +02:00
1 parent af1cdbd546
commit 9c857288da
2 files changed
+25

No files matched your search

@@ -88,6 +88,28 @@ QDialogButtonBox* PdmUiPropertyViewDialog::dialogButtonBox()
return m_buttonBox;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QSize PdmUiPropertyViewDialog::sizeHint() const
{
// Ensure the preferred size is never degenerate, regardless of how the contained scroll area
// reports its hints.
return QDialog::sizeHint().expandedTo( QSize( 300, 200 ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QSize PdmUiPropertyViewDialog::minimumSizeHint() const
{
// The inner scroll area reports an artificially small minimum width, which lets some window
// managers open the dialog collapsed (issue #14104). Provide a sensible floor, capped by the
// content's preferred size so intentionally small dialogs are not enlarged.
QSize floor = QSize( 300, 150 ).boundedTo( QDialog::sizeHint() );
return QDialog::minimumSizeHint().expandedTo( floor );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -57,6 +57,9 @@ public:
QDialogButtonBox* dialogButtonBox();
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
private:
void initialize( PdmObject* object, const QString& windowTitle, const QString& uiConfigName );
void setupUi();