Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.0
-
None
-
Windows, Visual Studio 2019. My version of Qt at the moment is 6.6.2
-
-
48cc43a1e (dev), 107f76f29 (6.7), 36102e08e (tqtc/lts-6.5)
Description
I have some unit tests that instantiates, within one test class, in multiple test functions a QApplication object. In Qt 6 I now receive the following log line for each subsequent test function, except the first one,:
QCRITICAL: TestClass::testFunction_X() QApplication::regClass: Registering window class 'Qt662dScreenChangeObserverWindow' failed. (Class already exists.)
This error is raised because the QWindowsScreenManager object that is created for the QApplication class on Windows systems is not being destroyed before the QWindowsContext::unregisterWindowClasses() is being called.
This might also be a problem outside the QtTest framework and in normal Windows execution