[GH-ISSUE #77] UI lag when resizing UI #48

Closed
opened 2026-05-05 11:01:29 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @codec-abc on GitHub (Nov 4, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/77

Hi,

I wanted to try this out and ran into performance issues when resizing a very basic app.

Disclaimer, I don't know QML/QT, and have little experience with on .Net Core.

Basically, I created a simple .Net Core app with the following single cs file:

using Qml.Net;
using System;

namespace qmlTest
{
    class Program
    {
        static int Main(string[] args)
        {
            using (var app = new QGuiApplication(args))
            {
                using (var engine = new QQmlApplicationEngine())
                {
                    // TODO: Register your .NET types.
                    // Qml.RegisterType<NetObject>("test");

                    engine.Load(@"Q:\dev2\qml.net\qmlTest\qmlTest\Main.qml");

                    return app.Exec();
                }
            }
        }
    }
}

and my Main.qml contains the following:

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtGraphicalEffects 1.0

ApplicationWindow {
    id: window
    visible: true
    width: 640
    height: 480
    title: qsTr("PhotoFrame")
	Rectangle {
		id: page
		width: 320; height: 480
		color: "lightgray"

		Text {
			id: helloText
			text: "Hello world!"
			y: 30
			anchors.horizontalCenter: page.horizontalCenter
			font.pointSize: 24; font.bold: true
		}
	}
}

When resizing the UI lags quite heavily because the window cannot keep the resizing movement. By the way, I am running Windows 10.

Originally created by @codec-abc on GitHub (Nov 4, 2018). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/77 Hi, I wanted to try this out and ran into performance issues when resizing a very basic app. Disclaimer, I don't know QML/QT, and have little experience with on .Net Core. Basically, I created a simple .Net Core app with the following single cs file: ```cs using Qml.Net; using System; namespace qmlTest { class Program { static int Main(string[] args) { using (var app = new QGuiApplication(args)) { using (var engine = new QQmlApplicationEngine()) { // TODO: Register your .NET types. // Qml.RegisterType<NetObject>("test"); engine.Load(@"Q:\dev2\qml.net\qmlTest\qmlTest\Main.qml"); return app.Exec(); } } } } } ``` and my `Main.qml` contains the following: ```qml import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import QtGraphicalEffects 1.0 ApplicationWindow { id: window visible: true width: 640 height: 480 title: qsTr("PhotoFrame") Rectangle { id: page width: 320; height: 480 color: "lightgray" Text { id: helloText text: "Hello world!" y: 30 anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true } } } ``` When resizing the UI lags quite heavily because the window cannot keep the resizing movement. By the way, I am running Windows 10.
Author
Owner

@pauldotknopf commented on GitHub (Nov 4, 2018):

You are currently running pure QML, so the problem isn't related to this project.

With that said, there is probably an issue with your Windows install. What graphics card are you using? Are you drivers updated?

Do you run into perf problems running this project?

<!-- gh-comment-id:435698438 --> @pauldotknopf commented on GitHub (Nov 4, 2018): You are currently running pure QML, so the problem isn't related to this project. With that said, there is probably an issue with your Windows install. What graphics card are you using? Are you drivers updated? Do you run into perf problems running [this](https://github.com/qmlnet/qmlnet-examples) project?
Author
Owner

@pauldotknopf commented on GitHub (Nov 4, 2018):

Read this: http://doc.qt.io/qt-5/windows-requirements.html

Try to set QT_OPENGL=angle before launching the app.

<!-- gh-comment-id:435698555 --> @pauldotknopf commented on GitHub (Nov 4, 2018): Read this: http://doc.qt.io/qt-5/windows-requirements.html Try to set ```QT_OPENGL=angle``` before launching the app.
Author
Owner

@codec-abc commented on GitHub (Nov 4, 2018):

The sample crash with an Access Violation message. I have a GTX 1070 with version 388.43 for the driver.

<!-- gh-comment-id:435698870 --> @codec-abc commented on GitHub (Nov 4, 2018): The sample crash with an Access Violation message. I have a GTX 1070 with version 388.43 for the driver.
Author
Owner

@codec-abc commented on GitHub (Nov 4, 2018):

The QT_OPENGL=angle solved the lag. However, it is a bit disappointing that a QT (a framework that is a few decade old) does not run well out of the box.

Thanks for the help.

<!-- gh-comment-id:435699656 --> @codec-abc commented on GitHub (Nov 4, 2018): The `QT_OPENGL=angle` solved the lag. However, it is a bit disappointing that a QT (a framework that is a few decade old) does not run well out of the box. Thanks for the help.
Author
Owner

@pauldotknopf commented on GitHub (Nov 4, 2018):

Glad you got it sorted!

<!-- gh-comment-id:435700154 --> @pauldotknopf commented on GitHub (Nov 4, 2018): Glad you got it sorted!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#48
No description provided.