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 <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
d85983ece7
commit
bc84e7cd43
@ -1475,7 +1475,7 @@ void QWizardPrivate::updateButtonTexts()
|
||||
void QWizardPrivate::updateButtonLayout()
|
||||
{
|
||||
if (buttonsHaveCustomLayout) {
|
||||
QVarLengthArray<QWizard::WizardButton> array(buttonsCustomLayout.count());
|
||||
QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array(buttonsCustomLayout.count());
|
||||
for (int i = 0; i < buttonsCustomLayout.count(); ++i)
|
||||
array[i] = buttonsCustomLayout.at(i);
|
||||
setButtonLayout(array.constData(), array.count());
|
||||
|
Loading…
Reference in New Issue
Block a user