Details
Description
Below is an example that paints three rectangles with fixed sizes & positions in a QQuickWindow.
When I resize the window I expect the rectangles not to change.
Instead, the rectangles seem to change their size & position as I resize the window.
Note: this artefact does not appear if the graphics API is set to OpenGL.
Example:
#include <QGuiApplication> #include <QQuickPaintedItem> #include <QQuickWindow> #include <QPainter> class Paintable final : public QQuickPaintedItem { public: explicit Paintable(QQuickItem* parent = nullptr) : QQuickPaintedItem(parent) { setOpaquePainting(true); } void paint(QPainter* painter) override { QColor highlight{255, 0, 0, 50}; painter->fillRect(QRect{QPoint{10, 0}, QSize{100, 100}}, highlight); painter->fillRect(QRect{QPoint{20, 20}, QSize{100, 100}}, highlight); painter->fillRect(QRect{QPoint{100, 100}, QSize{100, 100}}, highlight); } }; int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); // QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL); auto* qquickWindow = new QQuickWindow(); auto* paintable = new Paintable(qquickWindow->contentItem()); paintable->setSize(QSize{1000, 1000}); paintable->setVisible(true); qquickWindow->show(); return app.exec(); }
Attachments
Issue Links
- is duplicated by
-
QTBUG-93084 Very glitching resizing with Quick applications with some backends
- Closed
-
QTBUG-98473 Render glitch while resizing QML Window (flicker and content offset)
- Closed
- relates to
-
QTBUG-99602 Permanent graphical glitches when resizing QtQuick window with Direct3D 11 backend
- Reported
For Gerrit Dashboard: QTBUG-99637 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
391842,5 | rhi: d3d11: Switch the default swap effect and scaling mode | dev | qt/qtbase | Status: MERGED | +2 | 0 |
393304,3 | rhi: d3d11: Switch the default swap effect and scaling mode | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |