From 904bbb857673758a946d4a6b8c5ced87fb01b612 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 15 Oct 2020 21:06:58 +0800 Subject: [PATCH] Remove QPointer usages. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- framelesshelper.cpp | 8 ++++---- framelesshelper.h | 3 +-- winnativeeventfilter.cpp | 2 +- winnativeeventfilter.h | 5 +++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framelesshelper.cpp b/framelesshelper.cpp index fcfad39..3b6ada0 100644 --- a/framelesshelper.cpp +++ b/framelesshelper.cpp @@ -204,7 +204,7 @@ QList FramelessHelper::getIgnoreObjects(QObject *obj) const { Q_ASSERT(obj); QList ret{}; - const QList> objs = m_ignoreObjects.value(obj); + const QList objs = m_ignoreObjects.value(obj); if (!objs.isEmpty()) { for (auto &&_obj : qAsConst(objs)) { if (_obj) { @@ -218,7 +218,7 @@ QList FramelessHelper::getIgnoreObjects(QObject *obj) const void FramelessHelper::addIgnoreObject(QObject *obj, QObject *val) { Q_ASSERT(obj); - QList> objs = m_ignoreObjects[obj]; + QList objs = m_ignoreObjects[obj]; objs.append(val); m_ignoreObjects[obj] = objs; } @@ -227,7 +227,7 @@ QList FramelessHelper::getDraggableObjects(QObject *obj) const { Q_ASSERT(obj); QList ret{}; - const QList> objs = m_draggableObjects.value(obj); + const QList objs = m_draggableObjects.value(obj); if (!objs.isEmpty()) { for (auto &&_obj : qAsConst(objs)) { if (_obj) { @@ -241,7 +241,7 @@ QList FramelessHelper::getDraggableObjects(QObject *obj) const void FramelessHelper::addDraggableObject(QObject *obj, QObject *val) { Q_ASSERT(obj); - QList> objs = m_draggableObjects[obj]; + QList objs = m_draggableObjects[obj]; objs.append(val); m_draggableObjects[obj] = objs; } diff --git a/framelesshelper.h b/framelesshelper.h index 7dd6c45..dceb78b 100644 --- a/framelesshelper.h +++ b/framelesshelper.h @@ -29,7 +29,6 @@ #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) #include #include -#include #include QT_BEGIN_NAMESPACE @@ -86,7 +85,7 @@ private: // platforms through native API. int m_borderWidth = 8, m_borderHeight = 8, m_titleBarHeight = 30; QHash> m_ignoreAreas = {}, m_draggableAreas = {}; - QHash>> m_ignoreObjects = {}, m_draggableObjects = {}; + QHash> m_ignoreObjects = {}, m_draggableObjects = {}; QHash m_fixedSize = {}, m_disableTitleBar = {}; }; #endif diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index 8d3dd88..60267d8 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -1725,7 +1725,7 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType, #if defined(QT_WIDGETS_LIB) || defined(QT_QUICK_LIB) const auto isInSpecificObjects = [](const int x, const int y, - const QList> &objects, + const QList &objects, const qreal dpr) -> bool { if (!objects.isEmpty()) { for (auto &&object : qAsConst(objects)) { diff --git a/winnativeeventfilter.h b/winnativeeventfilter.h index dfebc9d..626e697 100644 --- a/winnativeeventfilter.h +++ b/winnativeeventfilter.h @@ -26,11 +26,12 @@ #include "framelesshelper_global.h" #include -#include +#include #include QT_BEGIN_NAMESPACE QT_FORWARD_DECLARE_CLASS(QWindow) +QT_FORWARD_DECLARE_CLASS(QObject) QT_END_NAMESPACE #if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0)) @@ -55,7 +56,7 @@ public: enableLayeredWindow = false, disableTitleBar = false, enableBlurBehindWindow = false; int borderWidth = -1, borderHeight = -1, titleBarHeight = -1; QList ignoreAreas = {}, draggableAreas = {}; - QList> ignoreObjects = {}, draggableObjects = {}; + QList ignoreObjects = {}, draggableObjects = {}; QSize maximumSize = {}, minimumSize = {}; QString currentScreen = {}; };