From 51a1dfe72ddd922cd6caf28d532b3311db767989 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 11 Jan 2024 13:23:21 +0100 Subject: Doc: complete the snippet for a dialog with extension Add the setting of the layout's size constraint to 'fixed' back to the snippet, so that the dialog automatically resizes when the extension gets hidden. The user won't be able to resize the dialog, but allowing the user to resize the dialog and to show and hide the extension anyway leads to unpredictable results for the user. Amends 11da92ba94570e5eec01597fe09f0a9a48acc677. Pick-to: 6.7 6.6 Change-Id: Ie74ca36eaa1a8e9567e0d5826f91f8633e5cbc05 Reviewed-by: David Faure --- src/widgets/doc/snippets/dialogs/dialogs.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/doc/snippets/dialogs/dialogs.cpp') diff --git a/src/widgets/doc/snippets/dialogs/dialogs.cpp b/src/widgets/doc/snippets/dialogs/dialogs.cpp index 16b136df4b8..0990d7d7c46 100644 --- a/src/widgets/doc/snippets/dialogs/dialogs.cpp +++ b/src/widgets/doc/snippets/dialogs/dialogs.cpp @@ -236,6 +236,8 @@ void extension() QVBoxLayout *mainLayout; //! [extension] + mainLayout->setSizeConstraint(QLayout::SetFixedSize); + findButton = new QPushButton(tr("&Find")); moreButton = new QPushButton(tr("&More...")); moreButton->setCheckable(true); -- cgit v1.2.3