[Interest] [OS X] maintaining a list of own WIds
John Weeks
john at wavemetrics.com
Tue Mar 1 18:24:19 CET 2016
> Actually, I'm also seeing QNSWindows (even the occasional QNSPanel). I'm not
> perfectly sure if I've ever seen instances of those because of a WId I received;
> can you be that all WIds are always and exclusively of the (Q)NSView persuasion?
Well, my experience is only with our application that doesn't use sheets, drawers or other such things. When we get a wID, it is always an NSView.
> internalWinId() is defined as `inline WId internalWinId() const { return data-
>> winid; }` in the QWidget class definition, so I doubt that calling the function
> will have a lot of side-effects if no winid was created yet ;)
Right- which is exactly why we use it. Calling QWidget::winID() will create the wID if it doesn't already exist, and that's not necessarily a good thing!
> 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.
Or are you writing a plug-in using Qt that is to work with a non-Qt application?
This:
http://stackoverflow.com/questions/20453965/how-to-get-notified-when-nswindow-opens
seems to indicate that you're not the only one that can't figure this out.
-John Weeks
More information about the Interest
mailing list