diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.cpp index f0f7210b8e..6d4da6cabe 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.cpp @@ -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 ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.h index 24643046c1..e5d59ab908 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyViewDialog.h @@ -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();