Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWindowsContext::windowsProc: No Qt Window found for event

QWindowsContext::windowsProc: No Qt Window found for event

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 4.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dagginio
    wrote on last edited by
    #1

    Hello,

    I built an Qt for Python application. Unfortunately I have quite a lot of warnings (see below) during execution:

    QWindowsContext::windowsProc: No Qt Window found for event 0x1c (WM_ACTIVATEAPP), hwnd=0x0x90e72.
    QWindowsContext::windowsProc: No Qt Window found for event 0x46 (WM_WINDOWPOSCHANGING), hwnd=0x0x90e72.
    QWindowsContext::windowsProc: No Qt Window found for event 0x83 (WM_NCCALCSIZE), hwnd=0x0x90e72.
    

    Does anyone has an idea what could cause this warnings. I can not really give an example, since the application is too huge and do not know what to show.
    Sometime, when we open a popup window, the application is sent to the back, so is not visible anymore. It is basically minimized. Is it possible that there is a correlation to the warnings?
    Sometimes the app also does not start. Just loading for a few seconds and it is closed again. Very strange behavior.

    We are using python 3.7 and pyside2 5.12.1. However, the warnings also occur with python 3.6 and older qt versions.

    As I said, would be great, if I could get some hints on what might cause such warnings and the problems?

    Thanks
    Daniel

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Searching for bugs i found
      https://bugreports.qt.io/browse/QTBUG-26933
      should be fixed.
      https://bugreports.qt.io/browse/QTBUG-32588
      which seems to be related to QDesktopWidget

      So not sure what else would cause such warning.

      Seems to be related to child windows.

      where does these warning show ?

      D 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Searching for bugs i found
        https://bugreports.qt.io/browse/QTBUG-26933
        should be fixed.
        https://bugreports.qt.io/browse/QTBUG-32588
        which seems to be related to QDesktopWidget

        So not sure what else would cause such warning.

        Seems to be related to child windows.

        where does these warning show ?

        D Offline
        D Offline
        Dagginio
        wrote on last edited by Dagginio
        #3

        @mrjj
        Thanks for your fast reply. I start the application from console and they are prompted there.
        Yes, I think it is realted to child windows. New warnings are added when I switch to another application (any program) and go back to my program, or when I open a popup and switch back to the main window.

        I did not use the Class QDesktopWidget. So no clue

        mrjjM 1 Reply Last reply
        0
        • D Dagginio

          @mrjj
          Thanks for your fast reply. I start the application from console and they are prompted there.
          Yes, I think it is realted to child windows. New warnings are added when I switch to another application (any program) and go back to my program, or when I open a popup and switch back to the main window.

          I did not use the Class QDesktopWidget. So no clue

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Dagginio
          Did you use nativeEvent filter or anything like that ?

          D 1 Reply Last reply
          0
          • mrjjM mrjj

            @Dagginio
            Did you use nativeEvent filter or anything like that ?

            D Offline
            D Offline
            Dagginio
            wrote on last edited by
            #5

            @mrjj
            No, no event filter. I use a splash screen (app logo with a progress bar) during startup while the application load some data. This splash screen is not my main window of course. After disabling the splash screen, the warnings disappear. Any idea on that? I could imagine that it has something to do with window modality.

            However, the problem that the application is send to background remains. For instance, when executing a message box, the main window is sent to background. Really strange. I thought there might be a link to the warnings but obviously there is not. But I think this is new and came with the last qt update. Will downgrade to 5.11.x to see if the behavior is there the same.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Can you show how you handle your splash screen ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Can you show how you handle your splash screen ?

                D Offline
                D Offline
                Dagginio
                wrote on last edited by Dagginio
                #7

                @SGaist

                from PySide2 import QtWidgets, QtCore
                
                class WidgetInitLoading(QtWidgets.QWidget):
                    def __init__(self):
                        super().__init__()
                
                        self.setWindowFlags(QtCore.Qt.SplashScreen)
                        self.setFixedWidth(400)
                        self.setFixedHeight(400)
                
                        self.setStyleSheet("WidgetInitLoading {"
                                           "background-color: white;}")
                
                        self.setWindowModality(QtCore.Qt.ApplicationModal)
                
                class WidgetWithLogoAndProgressBar(WidgetInitLoading):
                    def __init__(self, app):
                        super().__init__()
                        self.verticalLayout = self.createVerticalLayout()
                        self.verticalLayout.setContentsMargins(20,20,20,20)
                        self.setLayout(self.verticalLayout)
                
                        self.verticalLayout.addSpacing(20)
                        self.labelWithPixmap = self.createLabelWithPixmap()
                        self.verticalLayout.addWidget(self.labelWithPixmap)
                
                        spacer = SpacerItem(None, None)
                        self.verticalLayout.addSpacerItem(spacer)
                
                        self.statusLabel = self.createStatusLabel()
                        self.verticalLayout.addWidget(self.statusLabel)
                
                        self.progressBar = self.createProgressBar()
                        self.verticalLayout.addWidget(self.progressBar)
                        spacer = SpacerItem(None, None)
                        self.verticalLayout.addSpacerItem(spacer)
                
                        app.processEvents()
                
                
                    def createVerticalLayout(self):
                        verticalLayout = QtWidgets.QVBoxLayout()
                        return verticalLayout
                
                    def createLabelWithPixmap(self):
                        labelWithPixmap = LabelWithPixmap(None, None, None, ":/logoLoading.png")
                        return labelWithPixmap
                
                    def createStatusLabel(self):
                        label = QtWidgets.QLabel()
                        label.setAlignment(QtCore.Qt.AlignCenter)
                        return label
                
                    def createProgressBar(self):
                        progressBar = ProgressBar()
                        return progressBar
                
                

                Just downgraded to PySide2 5.11.2. There I do not have the problem that the app is send to the back. However, the warnings are back, also with disabled splash screen.

                Daniel

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  Dagginio
                  wrote on last edited by Dagginio
                  #8

                  Actually the warnings are not nice but also not that big problem if everything seems work fine. However, that the app is sent to the back for instance by executing a message box is really a problem. This is only on 5.12.1/0, not on 5.11.x. Thus it seems to be a bug.

                  Daniel

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Looks like there's some kind regression indeed.

                    Out of curiosity, why not use QSplashScreen ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • D Offline
                      D Offline
                      Dagginio
                      wrote on last edited by Dagginio
                      #10

                      I testet now PyQt5 (5.12.1) instead of PySide2 (5.12.1). Also with PyQt5, the app is sent sometimes to the back. This was not the case for Qt 5.11.x. Is it possible, that this a Qt bug?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Since both have the same behavior, that's likely the case.

                        You should take a look at the bug report system to see if it's something known. If not, please open a new report providing a minimal complete example project.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved