Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-125058

QtTest log QCRITICAL due to QApplication::regClass: Registering window class 'Qt662dScreenChangeObserverWindow' failed. (Class already exists.)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.7, 6.7.2, 6.8.0 FF
    • 6.6.0
    • QPA: Windows
    • None
    • Windows, Visual Studio 2019. My version of Qt at the moment is 6.6.2
    • Windows
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            eelcopeacs Eelco van Dam
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes