-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.10.0
-
None
-
macOS High Sierra (v10.13.2)
Qt 5.10.0
Brief story:
Usage of the following code snippet leads to severe performance losses in Qt applications.
window.styleMask |= NSFullSizeContentViewWindowMask;
Long story:
I was trying to develop better-looking macOS apps, hence I decided to use native Objective-C codes to get rid of the titlebar of my application with full size content view like below:
I'm using following method to achive my goal:
auto mainWindow = new QWindow;
auto nsView = (NSView*) mainWindow->winId();
auto window = [nsView window];
[window setTitlebarAppearsTransparent: YES];
[window setTitleVisibility: NSWindowTitleHidden];
[window setAppearance: [NSAppearance appearanceNamed:NSAppearanceNameAqua]];
window.styleMask |= NSFullSizeContentViewWindowMask; //Problematic line
Usage of the last line of the code is affecting the general application painting performance. I did a performance compare with a very simple test application (which I've attached below). I have several AnimatedImage objects in my simple qml application to inspect general rendering performance of Qt applications with and without usage of above problematic code.
Test results
Before:
After:
You can see the CPU usage of the "macforce" app. Cpu load changes from %2.6 to %50.7 with the usage of a single line in the code.