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
parent
efcf1dec49
commit
66e2643072
|
|
@ -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:
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue