QStyleOption: return Q_NULLPTR from qstyleoption_cast instead of 0

qstyleoption_cast should use Q_NULLPTR to represent a null pointer.

Task-number: QTBUG-45291
Change-Id: I85078ceb435b310daf63db2ed771be2f36cf3e4f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Dyami Caliri 2016-09-07 11:05:51 -07:00
parent 3370ab9119
commit 7529c39ba3

View File

@ -664,7 +664,7 @@ T qstyleoption_cast(const QStyleOption *opt)
|| (int(Opt::Type) == QStyleOption::SO_Complex
&& opt->type > QStyleOption::SO_Complex)))
return static_cast<T>(opt);
return 0;
return Q_NULLPTR;
}
template <typename T>
@ -676,7 +676,7 @@ T qstyleoption_cast(QStyleOption *opt)
|| (int(Opt::Type) == QStyleOption::SO_Complex
&& opt->type > QStyleOption::SO_Complex)))
return static_cast<T>(opt);
return 0;
return Q_NULLPTR;
}
// -------------------------- QStyleHintReturn -------------------------------
@ -725,7 +725,7 @@ T qstyleoption_cast(const QStyleHintReturn *hint)
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
return 0;
return Q_NULLPTR;
}
template <typename T>
@ -735,7 +735,7 @@ T qstyleoption_cast(QStyleHintReturn *hint)
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
return 0;
return Q_NULLPTR;
}
#if !defined(QT_NO_DEBUG_STREAM)