summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-08 00:39:05 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-17 16:17:25 +0000
commit66e26430727bc76557b99c8e2b136901c5a38f90 (patch)
tree992642c10ac4782eea4265aac2cae8a7eb9fb739 /src/widgets
parentefcf1dec4992bf7aab5bf1f0f4c0ee8c54030465 (diff)
QDialogButtonBox: replace a QList copy + pop_front() with mid(1)
Simplifies the code and is also more efficient, because it copies less data. Change-Id: I9ad0c372fb4fa6f5818d9d6cb7b7cf35935f8565 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 00e0774012..6fc8cb5e26 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -288,13 +288,8 @@ void QDialogButtonBoxPrivate::layoutButtons()
}
break;
case QPlatformDialogHelper::AlternateRole:
- {
- if (acceptRoleList.size() < 2)
- break;
- QList<QAbstractButton *> list = acceptRoleList;
- list.removeFirst();
- addButtonsToLayout(list, reverse);
- }
+ if (acceptRoleList.size() > 1)
+ addButtonsToLayout(acceptRoleList.mid(1), reverse);
break;
case QPlatformDialogHelper::DestructiveRole:
{