From bc84e7cd436e81563191ec546109391678794537 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 28 Aug 2012 11:07:52 +0200 Subject: [PATCH] QWizard: use less stack space There will hardly ever be 512 buttons in a wizard dialog, so specify a somewhat saner preallocation number for the QVarLengthArray, e.g. the number of available buttons. Yes, there's also Stretch, but it's unlikely that _all_ buttons plus stretch are used in one dialog, and QVarLengthArray will fall back to the heap in that case, of course. Change-Id: Ida09ab73340e9fb2aa80db37aeed8b8476ffe7fe Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index b294e98c30..15f922a5b8 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1475,7 +1475,7 @@ void QWizardPrivate::updateButtonTexts() void QWizardPrivate::updateButtonLayout() { if (buttonsHaveCustomLayout) { - QVarLengthArray array(buttonsCustomLayout.count()); + QVarLengthArray array(buttonsCustomLayout.count()); for (int i = 0; i < buttonsCustomLayout.count(); ++i) array[i] = buttonsCustomLayout.at(i); setButtonLayout(array.constData(), array.count());