macOS: Fix warning about comparing different types in QCocoaScreen::isOnline

Change-Id: Ieb70108d22bf254c69665e5b3e3a2988703e26a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 640eb55c130c6c2c982dc212a8a5bd2b8fb7a225)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2021-05-19 15:23:12 +02:00 committed by Qt Cherry-pick Bot
parent 1b26b5bc2c
commit e8a2985650

View File

@ -710,8 +710,8 @@ bool QCocoaScreen::isOnline() const
// returning -1 to signal that the displayId is invalid. Some functions
// will also assert or even crash in this case, so it's important that
// we double check if a display is online before calling other functions.
auto isOnline = CGDisplayIsOnline(m_displayId);
static const uint32_t kCGDisplayIsDisconnected = int32_t(-1);
int isOnline = CGDisplayIsOnline(m_displayId);
static const int kCGDisplayIsDisconnected = 0xffffffff;
return isOnline != kCGDisplayIsDisconnected && isOnline;
}