[Interest] [OS X] maintaining a list of own WIds

René J. V. Bertin rjvbertin at gmail.com
Fri Mar 4 20:24:23 CET 2016


John Weeks wrote:


>> That's what I was really asking about: how
>> to get notified each time something is created that has a WId.
> 
> Which is complicated by Qt's insistence on creating the platform-specific
> thing (wID as NSView, HWND, etc.) only when the QWidget becomes visible.

Indeed. But it seems it *is* possible to be notified when the widget (finally) 
does become visible using something like

[[NSNotificationCenter defaultCenter] addObserver:self
	selector:@selector(windowChangedOcclusionState:)
            name:NSWindowDidChangeOcclusionStateNotification object:nil];

this will give you the NSWindow* instance that just had a change in occlusion 
state (e.g. it was just mapped for the 1st time); chances are good that that 
window's contentView is the QNSView corresponding to a WId.

Cf. https://git.reviewboard.kde.org/r/126291/


R.




More information about the Interest mailing list