diff options
author | Liang Qi <liang.qi@qt.io> | 2018-06-07 19:10:53 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-06-07 19:10:53 +0200 |
commit | 096e37910d93f9c52976600e985c615ea36fe291 (patch) | |
tree | 713d020f4a04f03d8ca6e111055e7eebe85953a8 /src/corelib/global/qglobal.cpp | |
parent | 88eda007a3b5046999dd0b287634765efcd8934d (diff) | |
parent | a14a943f9ac3d1e85514d7fb6688c84e624ac850 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
.qmake.conf
src/corelib/kernel/qeventdispatcher_cf.mm
src/gui/kernel/qguiapplication_p.h
src/gui/kernel/qwindowsysteminterface.cpp
src/gui/kernel/qwindowsysteminterface.h
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/cocoa/qnswindowdelegate.mm
src/plugins/platforms/ios/qioseventdispatcher.mm
src/plugins/platforms/windows/qwindowsdrag.h
src/plugins/platforms/windows/qwindowsinternalmimedata.h
src/plugins/platforms/windows/qwindowsmime.cpp
src/plugins/platforms/winrt/qwinrtscreen.cpp
Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index ea62c8247a..b654f5863a 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -940,6 +940,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value)); Rounds \a d to the nearest integer. + Rounds half up (e.g. 0.5 -> 1, -0.5 -> 0). + Example: \snippet code/src_corelib_global_qglobal.cpp 11A @@ -950,6 +952,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value)); Rounds \a d to the nearest integer. + Rounds half up (e.g. 0.5f -> 1, -0.5f -> 0). + Example: \snippet code/src_corelib_global_qglobal.cpp 11B @@ -960,6 +964,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value)); Rounds \a d to the nearest 64-bit integer. + Rounds half up (e.g. 0.5 -> 1, -0.5 -> 0). + Example: \snippet code/src_corelib_global_qglobal.cpp 12A @@ -970,6 +976,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value)); Rounds \a d to the nearest 64-bit integer. + Rounds half up (e.g. 0.5f -> 1, -0.5f -> 0). + Example: \snippet code/src_corelib_global_qglobal.cpp 12B @@ -4048,7 +4056,7 @@ Q_GLOBAL_STATIC(QInternal_CallBackTable, global_callback_table) bool QInternal::registerCallback(Callback cb, qInternalCallback callback) { - if (cb >= 0 && cb < QInternal::LastCallback) { + if (unsigned(cb) < unsigned(QInternal::LastCallback)) { QInternal_CallBackTable *cbt = global_callback_table(); cbt->callbacks.resize(cb + 1); cbt->callbacks[cb].append(callback); @@ -4059,7 +4067,7 @@ bool QInternal::registerCallback(Callback cb, qInternalCallback callback) bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback) { - if (cb >= 0 && cb < QInternal::LastCallback) { + if (unsigned(cb) < unsigned(QInternal::LastCallback)) { if (global_callback_table.exists()) { QInternal_CallBackTable *cbt = global_callback_table(); return (bool) cbt->callbacks[cb].removeAll(callback); |