How to use "QWebEngineView" in "NSWindowStyleMaskFullSizeContentView" style window in Mac OS
-
When apply “NSWindowStyleMaskFullSizeContentView” style in Mac OS, the window that has a “QWebEngineView” will show abnormally. The size and layout of all widget are correct, but the content drawn in window is scaled when drag the window from one moitor to other.
The window that not include “QWebEngineView” is all right.
Please help me, because the problem is so strange, and if apply “NSWindowStyleMaskFullSizeContentView” in Qt demo that has a “QWebEngineView” will also encounter this problem.
Here is my code:
The window in origin monitor:
The window in other monitor that dragged to:
-
@TechGhost
This problem is the bug of "WebEngineView" in mac os. When the root "NSView" of window's property "wantsLayer" is "NO", the WebEngineView will cover the corner of window, and affect the effect of the corner.Finally, I change the way for web view. Use objective-c native object "WebView" in mac os, and Use qt "WebEngineView" in other os platform.
The sample code, introduce how to add NSView into QWidget, or add QWidget into NSView, in mac os:
-
(1)case 1: the root "NSView" of window's property "wantsLayer" is "YES", then The size and layout of all widget of window are correct, but the content drawn in window is scaled when drag the window from one moitor to another.
mark: when apply “NSWindowStyleMaskFullSizeContentView” style in Mac OS, the root "NSView" of window's property "wantsLayer" will be auto set to "YES".(2)case 2: the root "NSView" of window's property "wantsLayer" is "NO", then if WebEngineView's content size is equal to window's content size, the WebEngineView will cover the corner of window, and affect the effect of the corner.
so, WebEngineView will cause different problem in different window style, but there is no way to resolve them.