diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-04 09:52:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-05 10:56:12 +0200 |
commit | 8759ac2fc072738ac841117de2cda1c7f4fb5c55 (patch) | |
tree | 689b66459edc1f80df4aba63097b90441917ecf1 /src/winextras/qwinfunctions.cpp | |
parent | ab683bcbde7e01c74a46d7b6222fd406c9325428 (diff) |
Introduce nullptr
Apply Fixits by Qt Creator.
Introduce more member initialization.
Change-Id: I81c6860188f0e1592c4df2435ff7f91500456741
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/winextras/qwinfunctions.cpp')
-rw-r--r-- | src/winextras/qwinfunctions.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp index 82fd25b..e891ad6 100644 --- a/src/winextras/qwinfunctions.cpp +++ b/src/winextras/qwinfunctions.cpp @@ -209,9 +209,9 @@ HRGN QtWin::toHRGN(const QRegion ®ion) { const int size = region.rectCount(); if (size == 0) - return 0; + return nullptr; - HRGN resultRgn = 0; + HRGN resultRgn = nullptr; const auto rects = region.begin(); resultRgn = qt_RectToHRGN(rects[0]); for (int i = 1; i < size; i++) { @@ -231,7 +231,7 @@ HRGN QtWin::toHRGN(const QRegion ®ion) */ QRegion QtWin::fromHRGN(HRGN hrgn) { - DWORD regionDataSize = GetRegionData(hrgn, 0, NULL); + DWORD regionDataSize = GetRegionData(hrgn, 0, nullptr); if (regionDataSize == 0) return QRegion(); @@ -1738,10 +1738,10 @@ void QtWin::enableBlurBehindWindow(QWindow *window, const QRegion ®ion) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; + DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; dwmbb.dwFlags = DWM_BB_ENABLE; dwmbb.fEnable = TRUE; - HRGN rgn = 0; + HRGN rgn = nullptr; if (!region.isNull()) { rgn = toHRGN(region); if (rgn) { @@ -1788,7 +1788,7 @@ void QtWin::enableBlurBehindWindow(QWindow *window) void QtWin::disableBlurBehindWindow(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; + DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; dwmbb.dwFlags = DWM_BB_ENABLE; DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); } @@ -1859,12 +1859,12 @@ void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) */ ITaskbarList3 *qt_createITaskbarList3() { - ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); + ITaskbarList3 *pTbList = nullptr; + HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); - pTbList = 0; + pTbList = nullptr; } } return pTbList; @@ -1875,12 +1875,12 @@ ITaskbarList3 *qt_createITaskbarList3() */ ITaskbarList2 *qt_createITaskbarList2() { - ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); + ITaskbarList3 *pTbList = nullptr; + HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); - pTbList = 0; + pTbList = nullptr; } } return pTbList; |