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. Qt Quick applications do not repaint on window resize
Forum Updated to NodeBB v4.3 + New Features

Qt Quick applications do not repaint on window resize

Scheduled Pinned Locked Moved Unsolved General and Desktop
windowresizerepaintfreezeqt quick
1 Posts 1 Posters 540 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Kevinb9c
    wrote on 23 Jun 2021, 20:01 last edited by Kevinb9c
    #1

    As shown below, I'm having an issue where Qt applications do not continue rendering once the window is resized. Dragging the window larger shows white in the newly exposed space, and dragging it smaller than the initial size overwrites that area with white.

    alt text

    This is an example application created using the "Qt Quick Application - Empty" template in Qt Creator. The problem also happens with three other Qt Quick applications I develop, but does not happen for a legacy Widgets application. All other non-QT applications can be resized without issue.

    Multiple other computers I have tried do not have this problem. The only computer that has the problem is a 2017 iMac running Windows 10 Pro through Boot Camp. The issue arose after I reinstalled Windows 10 Pro; before the reinstallation, the computer was running Windows 10 Enterprise and had no problem resizing these applications.

    Though the application appears to freeze once the window has been resized, it continues running in the background. I can press keyboard shortcuts and see the expected messages log to the debug console.

    I realize the problem is with this particular computer, not the Qt application itself. But I haven't been able to find anything like this online and it only happens with Qt applications, so I'm asking here in case anyone has run into this before.

    I have provided the example application's code below just for completeness.

    Qt Creator 4.15.1
    Built with Qt 5.15.1

    main.cpp

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    
    int main(int argc, char *argv[])
    {
    #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    #endif
    
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    
        return app.exec();
    }
    

    main.qml

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        color: "#000"
    
        Rectangle {
            width: 50
            height: 50
            anchors.left: parent.left
            anchors.top: parent.top
            color: "#f00"
        }
    
        Rectangle {
            width: 50
            height: 50
            anchors.right: parent.right
            anchors.top: parent.top
            color: "#0f0"
        }
    
        Rectangle {
            width: 50
            height: 50
            anchors.left: parent.left
            anchors.bottom: parent.bottom
            color: "#00f"
        }
    
        Rectangle {
            width: 50
            height: 50
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            color: "#ff0"
        }
    }
    
    
    1 Reply Last reply
    0

    1/1

    23 Jun 2021, 20:01

    • Login

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