Unsolved [QTest][GUI] Is possible to show and set window's background?
-
Hi!
I found QTest useful for DirectX compute shader's output test, but for that purpose I need a fully initialized windows.
I tried in several ways but it seems like I'm unable to create a simple QMainWindow.
Main.CPP
#include "DirectX11TestShader.h" QTEST_MAIN(DirectX11TestShader)
TestScreen.H
class TestScreen : public QMainWindow { Q_OBJECT public: };
DirectX11TestShader.H
class DirectX11TestShader: public QObject { Q_OBJECT private slots: void initTestCase(); private: TestScreen mScreen; };
DirectX11TestShader.CPP
#include "DirectX11TestShader.h" void DirectX11TestShader::initTestCase() { mScreen.show(); mScreen.setStyleSheet("background-color: black;"); }
This windows is always shown white, and my test always throw DXGI_ERROR_DEVICE_REMOVED / DXGI_ERROR_DEVICE_HUNG. The code is working ok in normal workflow only in QTest is failing.
I want to guarantee the window creation, what can I do?
-
Hi,
Did you try to use qWaitForWindowExposed ?