framelesswidget + qwebview 无边框鼠标偏移问题

作者: august295创建于 2025年4月3日更新于 2025年4月3日

Environment - qt5.15.2 - msvc2019 32-bit # Problem Hi, I am using the framelesswidget class to add a title bar and a window, and the window is loaded by QWebView. When I drag the window to another window, the mouse position will shift (drag the same window will not cause any problem). The sample code using Qwidget will not cause any problem. # Preliminary Judgment 50 lines of code: ::SetWindowLong(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION); - After removing WS_CAPTION (the title bar seems to have no effect), the mouse offset position becomes smaller, but there is still an offset. - After removing WS_THICKFRAME (adjusting the size), the mouse will not offset, but the window cannot be stretched. I guess there may be some mechanism in QWebview that affects this, so is there any way to solve the above problem?

内容来源: feiyangqingyun/QWidgetDemo