Utils: Modernize

range-based for, nullptr, member initializers, override.

Change-Id: I21ac5b23883c08dbd75819bb3298bc956cdb972c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Orgad Shaneh
2018-09-21 01:15:38 +03:00
committed by Orgad Shaneh
parent 9364e4b8ec
commit d88a0d8e68
10 changed files with 52 additions and 64 deletions

View File

@@ -236,7 +236,7 @@ void FancyLineEdit::updateButtonPositions()
{
QRect contentRect = rect();
for (int i = 0; i < 2; ++i) {
Side iconpos = (Side)i;
Side iconpos = Side(i);
if (layoutDirection() == Qt::RightToLeft)
iconpos = (iconpos == Left ? Right : Left);
@@ -473,9 +473,9 @@ void FancyLineEdit::validate()
// Check buttons.
if (d->m_oldText.isEmpty() || t.isEmpty()) {
for (int i = 0; i < 2; ++i) {
if (d->m_iconbutton[i]->hasAutoHide())
d->m_iconbutton[i]->animateShow(!t.isEmpty());
for (auto &button : qAsConst(d->m_iconbutton)) {
if (button->hasAutoHide())
button->animateShow(!t.isEmpty());
}
d->m_oldText = t;
}