Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtQuickView performance problem.
Qt 6.12 LTS is out! See what's new in the release blog

QtQuickView performance problem.

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 257 Views
  • 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.
  • M Offline
    M Offline
    mano233
    wrote on last edited by mano233
    #1

    When a QtQuickView is overlaid on other views, the graphics performance drops severely(unless that view is not visible).
    **I built on macos 10.15.7 with qt 6.0.0 beta3 and used metalRHI **

    In fact, 5.15 also has the same problem, but the fps value cannot be displayed in xcode

    qml01.qml

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    
    Window{
        id:root
        visible: true
        width: 800
        height: 480
        Button{
            onClicked:{
                var component = Qt.createComponent("file:/Users/mano233/Documents/c_projects/untitled3/qml/qml02.qml")
                var window    = component.createObject(root)
                window.show()
            }
        }
    }
    

    qml02.qml

    import QtQuick 2.15
    import QtQuick.Controls 1.0
    import QtQuick.Window 2.15
    
    Window {
        visible:true;
        width:720;
        height:640;
        Rectangle{
                width:100;height:100;
                color:"black";
                RotationAnimation on rotation {
                    loops: Animation.Infinite
                    from: 0
                    to: 360
                }
            }
    }
    

    main.cpp

    #include <Qtqml>
    #include <QtGui/QGuiApplication>
    #include <QtQuick/QQuickWindow>
    #include <QtCore/QUrl>
    #include <QDebug>
    
    int main(int argc, char* argv[]){
        QQuickWindow::setGraphicsApi(QSGRendererInterface::MetalRhi);
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        const QUrl url("file:/Users/mano233/Documents/c_projects/untitled3/qml/qml01.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 QGuiApplication::exec();
    }
    
    

    When the views overlap,FPS is 40-45

    c9f3fd97-85ef-4525-8b85-91d392ccec2c-image.png

    unless that view is not visible,FPS is 60
    b19561ef-7819-4c85-8c0b-ec7c8aa0d0fd-image.png

    1 Reply Last reply
    0

    • Login

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