Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.9.0 Beta1
Description
Draggable Icons example app does not work with Qt 6.9.0 beta1 on macOS while it works Qt 6.8.1.
How to reproduce the issue :
- Run Draggable Icons example application with Qt 6.9.0 beta1 on macOS.
- Try to drag any icons on the window. You will not be able to drag any of them.
This issue is reproduced with Qt 6.9.0 beta 1 built from source as well, and if you apply the workaround below, the issue will be solved somehow.
<qtbase/src/corelib/kernel/qcore_mac_p.h>
void trackObjectLifetime() { if (!m_object) return; auto *lifetimeTracker = [WeakPointerLifetimeTracker new]; lifetimeTracker.pointer = reinterpret_cast<QObjCWeakPointer<NSObject>*>(this); NSObject * wtf = m_object; // <— added by jaf objc_setAssociatedObject(m_object, this, lifetimeTracker, OBJC_ASSOCIATION_RETAIN); // <—— somehow this sets m_object to NULL!!! --jaf m_object = wtf; // <— added by jaf [lifetimeTracker release]; }