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>
bb10
Marc Mutz 2016-01-08 00:39:05 +01:00
parent efcf1dec49
commit 66e2643072
1 changed files with 2 additions and 7 deletions

View File

@ -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:
{