Black rectangle instead QQuickWidget (specific usecase). OpenGL problems

1.3k Views Asked by At

we use QT version 5.6 We have c++ application on Qt Widgets. In some plugin (created with Q_PLUGIN_METADATA and Q_INTERFACES) of this application we use QML: in some Widget we create QQuickWidget

QQuickWidget* quickWidget = new QQuickWidget(this);

make some operations with context

QQmlContext* ctxt = quickWidget->rootContext();

and set source

quickWidget->setSource(QUrl(QStringLiteral("qrc:/Resources/WebResources/main.qml")));

Sometimes we have problems with this widget displaying - black rectangle appears.

We added libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll and opengl32sw.dll.

Also We try to set Qt::AA_UseSoftwareOpenGL flag for main QApplication (before QApplication construction) but this operation doesn't give results.

Stable reproducing we have on virtual mashine with Win7.

QQuickWidget on Virtual mashine appears good after adding RemoteFX 3D video adapter. But can we show QQuickWidget witout RemoteFX 3D video adapter?

enter image description here

after QQuickWidget creating we have in WinDBG

ModLoad: 6ee10000 6ee18000   C:\Users\admin\Desktop\Release\Win32\QtQuick.2\qtquick2plugin.dll
ModLoad: 66c50000 66cfd000   C:\Users\admin\Desktop\Release\Win32\QtQuick\Controls\qtquickcontrolsplugin.dll
ModLoad: 6ee00000 6ee08000   C:\Users\admin\Desktop\Release\Win32\QtQuick\Window.2\windowplugin.dll
ModLoad: 656a0000 65863000   C:\Windows\system32\d3d9.dll
ModLoad: 749b0000 749b9000   C:\Windows\system32\VERSION.dll
ModLoad: 6edf0000 6edf6000   C:\Windows\system32\d3d8thk.dll
ModLoad: 662f0000 663b8000   C:\Windows\system32\opengl32.dll
ModLoad: 6dc80000 6dca2000   C:\Windows\system32\GLU32.dll
ModLoad: 655b0000 65697000   C:\Windows\system32\DDRAW.dll
ModLoad: 6edd0000 6edd6000   C:\Windows\system32\DCIMAN32.dll
ModLoad: 6d7f0000 6d7f7000   C:\Users\admin\Desktop\Release\Win32\libEGL.DLL
ModLoad: 65420000 655ac000   C:\Users\admin\Desktop\Release\Win32\libGLESv2.dll
ModLoad: 650c0000 65416000   C:\Users\admin\Desktop\Release\Win32\d3dcompiler_47.dll
ModLoad: 74550000 745d3000   C:\Windows\system32\dxgi.dll
ModLoad: 66bc0000 66c43000   C:\Windows\system32\d3d11.dll
ModLoad: 75730000 7575d000   C:\Windows\system32\WINTRUST.dll
ModLoad: 64d60000 650b6000   C:\Users\admin\Desktop\Release\Win32\d3dcompiler_47.dll
ModLoad: 74550000 745d3000   C:\Windows\system32\dxgi.dll
ModLoad: 66260000 662e3000   C:\Windows\system32\d3d11.dll
ModLoad: 650c0000 65416000   C:\Users\admin\Desktop\Release\Win32\d3dcompiler_47.dll
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
ModLoad: 64530000 65411000   C:\Users\admin\Desktop\Release\Win32\opengl32sw.dll
ModLoad: 75a80000 75aaa000   C:\Windows\system32\imagehlp.dll
ModLoad: 6da80000 6db6b000   C:\Windows\system32\dbghelp.dll

Where problem is?

1

There are 1 best solutions below

1
On

I has the same issue with QQuickWidget when:

QQuickWidget * w = new QQuickWidget(this);
w->setSource(QUrl("qrc:///main.qml"));
w->show();

Everything was OK when I compile with QtCreator, but when I run executable into another PC's (with Intel videocards), on some the app crashes, but on some another was a "black screen".

It was because of, for example, the second PC has a graphics card Intel 945. The problem was in OpenGL.

Qt Quick requires OpenGL 2.0 or greater. However, the Intel 945 only supports up to OpenGL 1.4

So... I start using QQuickView instead of QQuickWidget