forked from github_mirror/framelesshelper
Remove QPointer usages.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
a0eeab1ff7
commit
904bbb8576
|
@ -204,7 +204,7 @@ QList<QObject *> FramelessHelper::getIgnoreObjects(QObject *obj) const
|
|||
{
|
||||
Q_ASSERT(obj);
|
||||
QList<QObject *> ret{};
|
||||
const QList<QPointer<QObject>> objs = m_ignoreObjects.value(obj);
|
||||
const QList<QObject *> objs = m_ignoreObjects.value(obj);
|
||||
if (!objs.isEmpty()) {
|
||||
for (auto &&_obj : qAsConst(objs)) {
|
||||
if (_obj) {
|
||||
|
@ -218,7 +218,7 @@ QList<QObject *> FramelessHelper::getIgnoreObjects(QObject *obj) const
|
|||
void FramelessHelper::addIgnoreObject(QObject *obj, QObject *val)
|
||||
{
|
||||
Q_ASSERT(obj);
|
||||
QList<QPointer<QObject>> objs = m_ignoreObjects[obj];
|
||||
QList<QObject *> objs = m_ignoreObjects[obj];
|
||||
objs.append(val);
|
||||
m_ignoreObjects[obj] = objs;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ QList<QObject *> FramelessHelper::getDraggableObjects(QObject *obj) const
|
|||
{
|
||||
Q_ASSERT(obj);
|
||||
QList<QObject *> ret{};
|
||||
const QList<QPointer<QObject>> objs = m_draggableObjects.value(obj);
|
||||
const QList<QObject *> objs = m_draggableObjects.value(obj);
|
||||
if (!objs.isEmpty()) {
|
||||
for (auto &&_obj : qAsConst(objs)) {
|
||||
if (_obj) {
|
||||
|
@ -241,7 +241,7 @@ QList<QObject *> FramelessHelper::getDraggableObjects(QObject *obj) const
|
|||
void FramelessHelper::addDraggableObject(QObject *obj, QObject *val)
|
||||
{
|
||||
Q_ASSERT(obj);
|
||||
QList<QPointer<QObject>> objs = m_draggableObjects[obj];
|
||||
QList<QObject *> objs = m_draggableObjects[obj];
|
||||
objs.append(val);
|
||||
m_draggableObjects[obj] = objs;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QRect>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -86,7 +85,7 @@ private:
|
|||
// platforms through native API.
|
||||
int m_borderWidth = 8, m_borderHeight = 8, m_titleBarHeight = 30;
|
||||
QHash<QObject *, QList<QRect>> m_ignoreAreas = {}, m_draggableAreas = {};
|
||||
QHash<QObject *, QList<QPointer<QObject>>> m_ignoreObjects = {}, m_draggableObjects = {};
|
||||
QHash<QObject *, QList<QObject *>> m_ignoreObjects = {}, m_draggableObjects = {};
|
||||
QHash<QObject *, bool> m_fixedSize = {}, m_disableTitleBar = {};
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -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<QPointer<QObject>> &objects,
|
||||
const QList<QObject *> &objects,
|
||||
const qreal dpr) -> bool {
|
||||
if (!objects.isEmpty()) {
|
||||
for (auto &&object : qAsConst(objects)) {
|
||||
|
|
|
@ -26,11 +26,12 @@
|
|||
|
||||
#include "framelesshelper_global.h"
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QPointer>
|
||||
#include <QList>
|
||||
#include <QRect>
|
||||
|
||||
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<QRect> ignoreAreas = {}, draggableAreas = {};
|
||||
QList<QPointer<QObject>> ignoreObjects = {}, draggableObjects = {};
|
||||
QList<QObject *> ignoreObjects = {}, draggableObjects = {};
|
||||
QSize maximumSize = {}, minimumSize = {};
|
||||
QString currentScreen = {};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue