diff options
Diffstat (limited to 'src/gui/dialogs/qwizard.cpp')
-rw-r--r-- | src/gui/dialogs/qwizard.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 4ed20a4..dc91603 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1703,16 +1703,29 @@ void QWizardPrivate::_q_updateButtonStates() void QWizardPrivate::_q_handleFieldObjectDestroyed(QObject *object) { + int destroyed_index = -1; QVector<QWizardField>::iterator it = fields.begin(); while (it != fields.end()) { const QWizardField &field = *it; if (field.object == object) { + destroyed_index = fieldIndexMap.value(field.name, -1); fieldIndexMap.remove(field.name); it = fields.erase(it); } else { ++it; } } + if (destroyed_index != -1) { + QMap<QString, int>::iterator it2 = fieldIndexMap.begin(); + while (it2 != fieldIndexMap.end()) { + int index = it2.value(); + if (index > destroyed_index) { + QString field_name = it2.key(); + fieldIndexMap.insert(field_name, index-1); + } + ++it2; + } + } } void QWizardPrivate::setStyle(QStyle *style) |