Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use "QWebEngineView" in "NSWindowStyleMaskFullSizeContentView" style window in Mac OS
Forum Updated to NodeBB v4.3 + New Features

How to use "QWebEngineView" in "NSWindowStyleMaskFullSizeContentView" style window in Mac OS

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TechGhost
    wrote on last edited by
    #1

    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:

    0_1513317083299_BD9C4715-07A0-4DA0-8472-663D97F655BD.png

    The window in origin monitor:
    0_1513317388021_BD4B026D4502528B6078B64B275B2190.jpg

    The window in other monitor that dragged to:
    0_1513317503287_53C8EBB195C20902C977ED9B793DB7FC.jpg

    T 1 Reply Last reply
    0
    • T TechGhost

      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:

      0_1513317083299_BD9C4715-07A0-4DA0-8472-663D97F655BD.png

      The window in origin monitor:
      0_1513317388021_BD4B026D4502528B6078B64B275B2190.jpg

      The window in other monitor that dragged to:
      0_1513317503287_53C8EBB195C20902C977ED9B793DB7FC.jpg

      T Offline
      T Offline
      TechGhost
      wrote on last edited by
      #2

      @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:
      0_1513908890518_FFB7B64A-C51B-48C0-86FC-96077D090C77.png

      T 1 Reply Last reply
      0
      • T Offline
        T Offline
        TechGhost
        wrote on last edited by
        #3

        If want to use cocoa's object by objective-c, you must import corresponding framework and header file:

        0_1513909445128_7C27E6EB-C408-4050-9503-EAF4A29D57FC.png

        0_1513909110101_D36EF9AC-5443-406F-9DAB-9845E67B34DC.png

        1 Reply Last reply
        0
        • T TechGhost

          @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:
          0_1513908890518_FFB7B64A-C51B-48C0-86FC-96077D090C77.png

          T Offline
          T Offline
          TechGhost
          wrote on last edited by
          #4

          (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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved