Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.9.0 Beta 3
-
None
-
Mac
Description
The `CC_ToolButton` code in the 5.9.0 release candidate (beta3?) has
NSView *view = window ? (NSView *)window->winId() : nil;
bool isKey = false;
if (view)
isKey = [view.window isKeyWindow];
Apart from the fact that this could probably be an unconditional `isKey = [[view window] isKeyWindow];` it also assumes that winId() is always an instance inheriting NSView. That wasn't always true in the past even with the Cocoa QPA. I haven't checked in detail whether it is true now (there is still a QNSWindow class) but it certainly won't be true if the style is somehow used with another QPA.
I don't know if the official stance is still that Qt should be usable on all platforms with any of the QPA plugins that build but if so it could be a thought to check QCoreApplication::platformName() when the style instance is created and set a flag whether or not the Cocoa QPA is being used.
Just a suggestion, but inexpensive to implement. Doing that in my personal fork allows continued use of the style with the XCB plugin (and one day maybe with Wayland)