Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
6.5.1, 6.6.1
-
None
-
Qt/PyQt > 6.4.2
Windows 10 22H2
-
-
5f7b4c045 (dev), 2b18f6c7b (6.7), 19a473137 (6.6), 27c8d61e9 (tqtc/lts-6.5)
Description
When draw FramelessWindow using Qt6.6.1 with this method:
- Set window flags through setWindowFlags(this->windowFlags() | Qt::Window | Qt::FramelessWindowHint)
- Using windows api GetWindowLong and SetWindowLong add GWL_STYLE with WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | CS_DBLCLKS flags
- Using native event WM_NCCALCSIZE to tell windows client rect
This method works fine with Qt <= 6.4.2, but in Qt6.6.1, the right and bottom exceed the drawable range.
This is a simple example window create with Qt6.4.2, it's correct
And this is the effect of the same code on QT 6.6.1, with both the right and bottom exceeding the drawable area.
When using the overloaded function changeEvent to print the geometry of the widget,it will get quiet different answer between these two version
Test Code:
void MainWindow::changeEvent(QEvent *e) { if (e->type() == QEvent::WindowStateChange) { qDebug() << "Qt version =" << QT_VERSION_STR << "," << this->geometry(); } }
With click custom maximize button twice, the result is:
Qt version = 6.4.2 , QRect(515,210 709x519)
Qt version = 6.4.2 , QRect(0,0 1739x939)
With Qt 6.6.1
Qt version = 6.6.1 , QRect(515,210 709x519)
Qt version = 6.6.1 , QRect(-7,-7 1753x954)
This result can be reproduced both on Qt Cpp version and PyQt