Windows QPA: Use nullptr consistently
Change-Id: I09297e34bd62359e31c483199ade1d7a0baf7195 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
parent
1f6ac40ff6
commit
98f9d4a029
|
|
@ -87,8 +87,8 @@ private:
|
|||
|
||||
QWindowsClipboardRetrievalMimeData m_retrievalData;
|
||||
QWindowsOleDataObject *m_data = nullptr;
|
||||
HWND m_clipboardViewer = 0;
|
||||
HWND m_nextClipboardViewer = 0;
|
||||
HWND m_clipboardViewer = nullptr;
|
||||
HWND m_nextClipboardViewer = nullptr;
|
||||
bool m_formatListenerRegistered = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -180,11 +180,11 @@ public:
|
|||
|
||||
QString registerWindowClass(const QWindow *w);
|
||||
QString registerWindowClass(QString cname, WNDPROC proc,
|
||||
unsigned style = 0, HBRUSH brush = 0,
|
||||
unsigned style = 0, HBRUSH brush = nullptr,
|
||||
bool icon = false);
|
||||
HWND createDummyWindow(const QString &classNameIn,
|
||||
const wchar_t *windowName,
|
||||
WNDPROC wndProc = 0, DWORD style = WS_OVERLAPPED);
|
||||
WNDPROC wndProc = nullptr, DWORD style = WS_OVERLAPPED);
|
||||
|
||||
HDC displayContext() const;
|
||||
int screenDepth() const;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public:
|
|||
QWindow *parent) override;
|
||||
void hide() override;
|
||||
|
||||
virtual bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const { return true; }
|
||||
virtual bool supportsNonModalDialog(const QWindow * /* parent */ = nullptr) const { return true; }
|
||||
|
||||
protected:
|
||||
QWindowsDialogHelperBase() = default;
|
||||
|
|
@ -91,7 +91,7 @@ private:
|
|||
void cleanupThread();
|
||||
|
||||
QWindowsNativeDialogBasePtr m_nativeDialog;
|
||||
HWND m_ownerWindow = 0;
|
||||
HWND m_ownerWindow = nullptr;
|
||||
int m_timerId = 0;
|
||||
QThread *m_thread = nullptr;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ struct QOpenGLContextData
|
|||
QOpenGLContextData(HGLRC r, HWND h, HDC d) : renderingContext(r), hwnd(h), hdc(d) {}
|
||||
QOpenGLContextData() {}
|
||||
|
||||
HGLRC renderingContext = 0;
|
||||
HWND hwnd = 0;
|
||||
HDC hdc = 0;
|
||||
HGLRC renderingContext = nullptr;
|
||||
HWND hwnd = nullptr;
|
||||
HDC hdc = nullptr;
|
||||
};
|
||||
|
||||
class QOpenGLStaticContext;
|
||||
|
|
@ -89,7 +89,7 @@ struct QWindowsOpenGLContextFormat
|
|||
|
||||
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
|
||||
int version = 0; //! majorVersion<<8 + minorVersion
|
||||
QSurfaceFormat::FormatOptions options = 0;
|
||||
QSurfaceFormat::FormatOptions options = nullptr;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
|
@ -222,7 +222,7 @@ private:
|
|||
typedef GLenum (APIENTRY *GlGetGraphicsResetStatusArbType)();
|
||||
|
||||
inline void releaseDCs();
|
||||
bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = 0);
|
||||
bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = nullptr);
|
||||
|
||||
QOpenGLStaticContext *m_staticContext;
|
||||
QOpenGLContext *m_context;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class QWindowsInputContext : public QPlatformInputContext
|
|||
|
||||
struct CompositionContext
|
||||
{
|
||||
HWND hwnd = 0;
|
||||
HWND hwnd = nullptr;
|
||||
QString composition;
|
||||
int position = 0;
|
||||
bool isComposing = false;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
|
||||
// Convenience.
|
||||
QVariant convertToMime(const QStringList &mimeTypes, IDataObject *pDataObj, QVariant::Type preferredType,
|
||||
QString *format = 0) const;
|
||||
QString *format = nullptr) const;
|
||||
|
||||
void registerMime(QWindowsMime *mime);
|
||||
void unregisterMime(QWindowsMime *mime) { m_mimes.removeOne(mime); }
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public:
|
|||
|
||||
static Qt::MouseButtons queryMouseButtons();
|
||||
QWindow *windowUnderMouse() const { return m_windowUnderMouse.data(); }
|
||||
void clearWindowUnderMouse() { m_windowUnderMouse = 0; }
|
||||
void clearWindowUnderMouse() { m_windowUnderMouse = nullptr; }
|
||||
void clearEvents();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
// If the windowing system interface needs explicitly created window surfaces (like EGL),
|
||||
// reimplement these.
|
||||
virtual void *createWindowSurface(void * /*nativeWindow*/, void * /*nativeConfig*/, int * /*err*/) { return 0; }
|
||||
virtual void *createWindowSurface(void * /*nativeWindow*/, void * /*nativeConfig*/, int * /*err*/) { return nullptr; }
|
||||
virtual void destroyWindowSurface(void * /*nativeSurface*/) { }
|
||||
|
||||
protected:
|
||||
|
|
@ -82,7 +82,7 @@ public:
|
|||
|
||||
// These should be implemented only for some winsys interfaces, for example EGL.
|
||||
// For others, like WGL, they are not relevant.
|
||||
virtual void *nativeDisplay() const { return 0; }
|
||||
virtual void *nativeDisplay() const { return nullptr; }
|
||||
virtual void *nativeConfig() const { return 0; }
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
|
|||
<< " message=" << Qt::hex << msg.message
|
||||
<< " count=" << Qt::dec << count;
|
||||
|
||||
Qt::TouchPointStates allStates = 0;
|
||||
Qt::TouchPointStates allStates = nullptr;
|
||||
|
||||
for (quint32 i = 0; i < count; ++i) {
|
||||
if (QWindowsContext::verbose > 1)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
|
||||
|
||||
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = 0) const override;
|
||||
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = nullptr) const override;
|
||||
|
||||
void windowsThemeChanged(QWindow *window);
|
||||
void displayChanged() { refreshIconPixmapSizes(); }
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ bool QWindowsVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
|
|||
|
||||
VkSurfaceKHR QWindowsVulkanInstance::createSurface(HWND win)
|
||||
{
|
||||
VkSurfaceKHR surface = 0;
|
||||
VkSurfaceKHR surface = VK_NULL_HANDLE;
|
||||
|
||||
if (!m_createSurface) {
|
||||
m_createSurface = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>(
|
||||
|
|
|
|||
|
|
@ -1303,7 +1303,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
|
|||
m_cursor(new CursorHandle),
|
||||
m_format(aWindow->requestedFormat())
|
||||
#if QT_CONFIG(vulkan)
|
||||
, m_vkSurface(0)
|
||||
, m_vkSurface(VK_NULL_HANDLE)
|
||||
#endif
|
||||
{
|
||||
QWindowsContext::instance()->addWindow(m_data.hwnd, this);
|
||||
|
|
@ -1404,14 +1404,14 @@ void QWindowsWindow::destroyWindow()
|
|||
QVulkanInstance *inst = window()->vulkanInstance();
|
||||
if (inst)
|
||||
static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
|
||||
m_vkSurface = 0;
|
||||
m_vkSurface = VK_NULL_HANDLE;
|
||||
}
|
||||
#endif
|
||||
#ifndef QT_NO_OPENGL
|
||||
if (m_surface) {
|
||||
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
|
||||
staticOpenGLContext->destroyWindowSurface(m_surface);
|
||||
m_surface = 0;
|
||||
m_surface = nullptr;
|
||||
}
|
||||
#endif
|
||||
DestroyWindow(m_data.hwnd);
|
||||
|
|
@ -2943,14 +2943,14 @@ void QWindowsWindow::invalidateSurface()
|
|||
QVulkanInstance *inst = window()->vulkanInstance();
|
||||
if (inst)
|
||||
static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
|
||||
m_vkSurface = 0;
|
||||
m_vkSurface = VK_NULL_HANDLE;
|
||||
}
|
||||
#endif
|
||||
#ifndef QT_NO_OPENGL
|
||||
if (m_surface) {
|
||||
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
|
||||
staticOpenGLContext->destroyWindowSurface(m_surface);
|
||||
m_surface = 0;
|
||||
m_surface = nullptr;
|
||||
}
|
||||
#endif // QT_NO_OPENGL
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ struct QWindowsWindowData
|
|||
QRect geometry;
|
||||
QMargins fullFrameMargins; // Do not use directly for windows, see FrameDirty.
|
||||
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
|
||||
HWND hwnd = 0;
|
||||
HWND hwnd = nullptr;
|
||||
bool embedded = false;
|
||||
bool hasFrame = false;
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ private:
|
|||
inline void setParent_sys(const QPlatformWindow *parent);
|
||||
inline void updateTransientParent() const;
|
||||
void destroyWindow();
|
||||
inline bool isDropSiteEnabled() const { return m_dropTarget != 0; }
|
||||
inline bool isDropSiteEnabled() const { return m_dropTarget != nullptr; }
|
||||
void setDropSiteEnabled(bool enabled);
|
||||
void updateDropSite(bool topLevel);
|
||||
void handleGeometryChange();
|
||||
|
|
@ -368,7 +368,7 @@ private:
|
|||
mutable QWindowsWindowData m_data;
|
||||
QPointer<QWindowsMenuBar> m_menuBar;
|
||||
mutable unsigned m_flags = WithinCreate;
|
||||
HDC m_hdc = 0;
|
||||
HDC m_hdc = nullptr;
|
||||
Qt::WindowStates m_windowState = Qt::WindowNoState;
|
||||
qreal m_opacity = 1;
|
||||
#ifndef QT_NO_CURSOR
|
||||
|
|
@ -378,15 +378,15 @@ private:
|
|||
unsigned m_savedStyle = 0;
|
||||
QRect m_savedFrameGeometry;
|
||||
const QSurfaceFormat m_format;
|
||||
HICON m_iconSmall = 0;
|
||||
HICON m_iconBig = 0;
|
||||
HICON m_iconSmall = nullptr;
|
||||
HICON m_iconBig = nullptr;
|
||||
void *m_surface = nullptr;
|
||||
|
||||
static bool m_screenForGLInitialized;
|
||||
|
||||
#if QT_CONFIG(vulkan)
|
||||
// note: intentionally not using void * in order to avoid breaking x86
|
||||
VkSurfaceKHR m_vkSurface = 0;
|
||||
VkSurfaceKHR m_vkSurface = VK_NULL_HANDLE;
|
||||
#endif
|
||||
static bool m_borderInFullScreenDefault;
|
||||
};
|
||||
|
|
@ -471,11 +471,11 @@ inline void QWindowsWindow::destroyIcon()
|
|||
{
|
||||
if (m_iconBig) {
|
||||
DestroyIcon(m_iconBig);
|
||||
m_iconBig = 0;
|
||||
m_iconBig = nullptr;
|
||||
}
|
||||
if (m_iconSmall) {
|
||||
DestroyIcon(m_iconSmall);
|
||||
m_iconSmall = 0;
|
||||
m_iconSmall = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue