Cannot start QML apps from Remote desktop connection
-
Hello Team,
I am running QT creator from a remote machine where I am working on a QML application. When I launch the application, I get a blank screen as shown below.
But it runs when I run it locally.
Any issues with rendering ? Please help.Both machines local and remote are Windows 10 machine.
Qt 5.7 & QT Creator 4.0.2import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4 -
Hello,
This could be because of the software you are using to work remotely.
Are you using microsofts own remote access, or are you using VNC etc?
-
@Uday-More Hello, I think the problem is that OpenGL is not well supported by MicroSoft RemoteDesktop.
Which Qt Kit are you using?
If you are using Qt 5.14.x or higher, you can force Qt to use Direct3D 11 backend. I think this is better supported by MicroSoft RemoteDesktop. Take a look at:- https://www.qt.io/blog/qt-quick-on-vulkan-metal-direct3d
- https://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html#rendering-via-the-qt-rendering-hardware-interface
Or disable OpenGL and use Raster/Software Backend with
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL );
-
@Uday-More said in Cannot start QML apps from Remote desktop connection:
Where exactly to use this statement "QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL );" ?
Like written in Qt documentation
Forces the usage of a software based OpenGL implementation on platforms that use dynamic loading of the OpenGL implementation. This will typically be a patched build of Mesa llvmpipe, providing OpenGL 2.1. The value may have no effect if no such OpenGL implementation is available. The default name of this library is opengl32sw.dll and can be overridden by setting the environment variable QT_OPENGL_DLL. See the platform-specific pages, for instance Qt for Windows, for more information. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.4.
This has to be called be QGuiApplication is created.
int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); QGuiApplication app(argc, argv); ... }
-
@KroMignon said in Cannot start QML apps from Remote desktop connection:
Qt
I've kept this flag exactly where you've mentioned. But didn't work.
Anyways it is said "The value may have no effect if no such OpenGL implementation is available."For this :
"The default name of this library is opengl32sw.dll and can be overridden by setting the environment variable QT_OPENGL_DLL".Where should this dll and environment be set ? In the remote machine or the local machine.
-
@Uday-More said in Cannot start QML apps from Remote desktop connection:
Where should this dll and environment be set ? In the remote machine or the local machine.
This DLL must be on the machine which runs the application ==> so the remote one.
And you should find the DLL in the Qt Kit bin directory ==>C:\Qt\5.7.xx\msvcXXX\bin\
But I would suggest you to switch you application to Qt 5.14 (if you can), so you could use Direct3D11 as backend, which, I think, will better supported by MS RemoteDesktop.