diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qdnd.cpp | 9 | ||||
-rw-r--r-- | src/gui/kernel/qdnd_p.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qdrag.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 17 |
5 files changed, 29 insertions, 11 deletions
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index 5c5f166554..dd541af3b8 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -113,11 +113,12 @@ Qt::DropAction QDragManager::drag(QDrag *o) m_object->d_func()->target = 0; - QGuiApplicationPrivate::instance()->notifyDragStarted(o); + QGuiApplicationPrivate::instance()->notifyDragStarted(m_object.data()); const Qt::DropAction result = m_platformDrag->drag(m_object); - m_object = 0; - if (!m_platformDrag->ownsDragObject()) - o->deleteLater(); + if (!m_object.isNull() && !m_platformDrag->ownsDragObject()) + m_object->deleteLater(); + + m_object.clear(); return result; } diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index b1219c8658..abb30986a5 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -101,13 +101,13 @@ public: void setCurrentTarget(QObject *target, bool dropped = false); QObject *currentTarget() const; - QDrag *object() const { return m_object; } + QPointer<QDrag> object() const { return m_object; } QObject *source() const; private: QObject *m_currentDropTarget; QPlatformDrag *m_platformDrag; - QDrag *m_object; + QPointer<QDrag> m_object; static QDragManager *m_instance; Q_DISABLE_COPY_MOVE(QDragManager) diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp index dcd0d13d5c..8e2f7be23e 100644 --- a/src/gui/kernel/qdrag.cpp +++ b/src/gui/kernel/qdrag.cpp @@ -279,8 +279,11 @@ Qt::DropAction QDrag::exec(Qt::DropActions supportedActions, Qt::DropAction defa } d->supported_actions = supportedActions; d->default_action = transformedDefaultDropAction; - d->executed_action = QDragManager::self()->drag(this); - + QPointer<QDrag> self = this; + auto executed_action = QDragManager::self()->drag(self.data()); + if (self.isNull()) + return Qt::IgnoreAction; + d->executed_action = executed_action; return d->executed_action; } diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 71780ed609..286dfaa8cc 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -828,7 +828,8 @@ void QWindowSystemInterface::handleScreenAdded(QPlatformScreen *ps, bool isPrima */ void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen) { - // Important to keep this order since the QSceen doesn't own the platform screen + // Important to keep this order since the QSceen doesn't own the platform screen. + // The QScreen destructor will take care changing the primary screen, so no need here. delete platformScreen->screen(); delete platformScreen; } diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 2f25aea92b..9c8582b43d 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2013 Konstantin Ritt ** Contact: https://www.qt.io/licensing/ ** @@ -216,7 +216,20 @@ static const hb_script_t _qtscript_to_hbscript[] = { HB_SCRIPT_MASARAM_GONDI, HB_SCRIPT_NUSHU, HB_SCRIPT_SOYOMBO, - HB_SCRIPT_ZANABAZAR_SQUARE + HB_SCRIPT_ZANABAZAR_SQUARE, + + // Unicode 12.1 additions (not present in harfbuzz-ng 1.7.4) + hb_script_t(HB_TAG('D', 'o', 'g', 'r')), // Script_Dogra + hb_script_t(HB_TAG('G', 'o', 'n', 'g')), // Script_GunjalaGondi + hb_script_t(HB_TAG('R', 'o', 'h', 'g')), // Script_HanifiRohingya + hb_script_t(HB_TAG('M', 'a', 'k', 'a')), // Script_Makasar + hb_script_t(HB_TAG('M', 'e', 'd', 'f')), // Script_Medefaidrin + hb_script_t(HB_TAG('S', 'o', 'g', 'o')), // Script_OldSogdian + hb_script_t(HB_TAG('S', 'o', 'g', 'd')), // Script_Sogdian + hb_script_t(HB_TAG('E', 'l', 'y', 'm')), // Script_Elymaic + hb_script_t(HB_TAG('N', 'a', 'n', 'd')), // Script_Nandinagari + hb_script_t(HB_TAG('H', 'm', 'n', 'p')), // Script_NyiakengPuachueHmong + hb_script_t(HB_TAG('W', 'c', 'h', 'o')), // Script_Wancho }; Q_STATIC_ASSERT(QChar::ScriptCount == sizeof(_qtscript_to_hbscript) / sizeof(_qtscript_to_hbscript[0])); |