Reduce the scope of variable in focusInEvent()
The scope of the variable 'frm' can be reduced if the variable 'd->formatExplicitlySet' is true. So declare the variable when the variable 'd->formatExplicitlySet' is false. Change-Id: I27cea412af827d30ad9188106b7f14025e5ddb68 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
21e7777230
commit
9341f2e3d0
|
|
@ -1295,9 +1295,9 @@ void QDateTimeEdit::focusInEvent(QFocusEvent *event)
|
|||
{
|
||||
Q_D(QDateTimeEdit);
|
||||
QAbstractSpinBox::focusInEvent(event);
|
||||
QString *frm = nullptr;
|
||||
const int oldPos = d->edit->cursorPosition();
|
||||
if (!d->formatExplicitlySet) {
|
||||
QString *frm = nullptr;
|
||||
if (d->displayFormat == d->defaultTimeFormat) {
|
||||
frm = &d->defaultTimeFormat;
|
||||
} else if (d->displayFormat == d->defaultDateFormat) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue