Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.2.1
-
macOS 11, 12
Description
When two widgets are created and one moves under the second widget, the second widget's drawing will be incorrect.
The attaches sample project draws objects as below.
void MdiChild::paintEvent(QPaintEvent* /*pPaintEvent*/) { QPainter painter(this); QPoint origin = mapToParent(QPoint(0,0)); painter.translate(-origin); painter.setBrush(QBrush(QColor(Qt::darkGray))); QRectF rect(geometry()); // On Intel or Rosetta, draws incorrectly after moving. painter.drawRect(rect); // On Intel or Rosetta, with a High DPI display, both draw incorrectly after moving. painter.drawLine(rect.toRect().topLeft(), rect.toRect().bottomRight()); painter.drawLine(rect.topRight(), rect.bottomLeft()); }
How to reproduce
1. Build Qt with the following configuration
-static -debug-and-release -commercial -platform macx-clang -nomake examples -nomake tests -skip multimedia -no-dbus -cmake-generator "Ninja Multi-Config" -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64";
2. Use qtbug98911-mdi-incorrectDrawing.zip (modified version of Qt mdi example) and run with #1
3. Click on the New tool button to create two widgets.
4. Click on the Cut tool button to move the first widget.
5. As it moves under the second widget, the second widget's drawing will be incorrect.
6. Resize the window to force both widgets to repaint correctly.
7. Click Copy to move the first widget so that its top left is offscreen, and it will now be drawn incorrectly. Resizing the window does not produce the correct result in this case.
Expected result (and also in M1 (ARM))
Actual result (Intel or Rosetta 2)
Static Qt build environment : Qt6.2.1, M1, Xcode 13.1, macOS 11.6.
Project build environment : Qt6.2.1, M1, Xcode 13.1, macOS 11.6.
What is known
- This does NOT happen with pre-build Qt 6.2.1
- This does NOT happen on M1(ARM) with the static libs.
Attachments
Issue Links
- duplicates
-
QTBUG-98388 Vertical QPainter::drawLine() result on QWidget is skewed
- Closed
- is duplicated by
-
QTBUG-98912 QTabWidget drawing issue with Qt static lib on Intel Mac when using stylesheet adjusting the border
- Closed