diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-28 11:07:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-05 00:57:22 +0100 |
commit | bc84e7cd436e81563191ec546109391678794537 (patch) | |
tree | 4eaf7172ed18b09e5c6ee87e0a9638f27b9b591a /src/widgets/dialogs/qwizard.cpp | |
parent | d85983ece7223d733ab87b0b9a8cca3aa246a406 (diff) |
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>
Diffstat (limited to 'src/widgets/dialogs/qwizard.cpp')
-rw-r--r-- | src/widgets/dialogs/qwizard.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<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()); |