title: Deactivate scrolling in parentwidget while mouse is in childwidget in python and PyQt5
body: <p>I create a widget which is to big to show complete on the screen, so i put it in a scrollbox.
  In this widget is a listwidget which is scrollable as well.
  What can i do to disable scrollfunction in the outer widget, if the mouse is in the listwidget, and enable the scrollingfunction if i move the mouse out of the listwidget?
  I tried something out with an eventFilter, but nothing works.</p>
  <p><strong>scroll.py</strong></p>
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(&quot;MainWindow&quot;)
          MainWindow.resize(500, 500)
          MainWindow.setMaximumSize(QtCore.QSize(500, 500))
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName(&quot;centralwidget&quot;)
          self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
          self.horizontalLayout.setObjectName(&quot;horizontalLayout&quot;)
          self.scrollArea = QtWidgets.QScrollArea(self.centralwidget)
          self.scrollArea.setWidgetResizable(True)
          self.scrollArea.setObjectName(&quot;scrollArea&quot;)
          self.scrollAreaWidgetContents = QtWidgets.QWidget()
          self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, -158, 463, 915))
          self.scrollAreaWidgetContents.setObjectName(&quot;scrollAreaWidgetContents&quot;)
          self.verticalLayout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
          self.verticalLayout.setObjectName(&quot;verticalLayout&quot;)
          self.frame = QtWidgets.QFrame(self.scrollAreaWidgetContents)
          self.frame.setMinimumSize(QtCore.QSize(0, 200))
          self.frame.setStyleSheet(&quot;background-color: rgb(255, 255, 127);&quot;)
          self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame.setObjectName(&quot;frame&quot;)
          self.verticalLayout.addWidget(self.frame)
          self.listWidget = QtWidgets.QListWidget(self.scrollAreaWidgetContents)
          font = QtGui.QFont()
          font.setPointSize(14)
          self.listWidget.setFont(font)
          self.listWidget.setObjectName(&quot;listWidget&quot;)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          item = QtWidgets.QListWidgetItem()
          self.listWidget.addItem(item)
          self.verticalLayout.addWidget(self.listWidget)
          self.frame_2 = QtWidgets.QFrame(self.scrollAreaWidgetContents)
          self.frame_2.setMinimumSize(QtCore.QSize(0, 200))
          self.frame_2.setStyleSheet(&quot;background-color: rgb(85, 255, 255);&quot;)
          self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_2.setObjectName(&quot;frame_2&quot;)
          self.verticalLayout.addWidget(self.frame_2)
          self.frame_3 = QtWidgets.QFrame(self.scrollAreaWidgetContents)
          self.frame_3.setMinimumSize(QtCore.QSize(0, 200))
          self.frame_3.setStyleSheet(&quot;background-color: rgb(255, 170, 255);&quot;)
          self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_3.setObjectName(&quot;frame_3&quot;)
          self.verticalLayout.addWidget(self.frame_3)
          self.frame_4 = QtWidgets.QFrame(self.scrollAreaWidgetContents)
          self.frame_4.setMinimumSize(QtCore.QSize(0, 200))
          self.frame_4.setStyleSheet(&quot;background-color: rgb(85, 170, 127);&quot;)
          self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_4.setObjectName(&quot;frame_4&quot;)
          self.verticalLayout.addWidget(self.frame_4)
          self.scrollArea.setWidget(self.scrollAreaWidgetContents)
          self.horizontalLayout.addWidget(self.scrollArea)
          MainWindow.setCentralWidget(self.centralwidget)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate(&quot;MainWindow&quot;, &quot;MainWindow&quot;))
          __sortingEnabled = self.listWidget.isSortingEnabled()
          self.listWidget.setSortingEnabled(False)
          item = self.listWidget.item(0)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 1&quot;))
          item = self.listWidget.item(1)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 2&quot;))
          item = self.listWidget.item(2)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 3&quot;))
          item = self.listWidget.item(3)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 4&quot;))
          item = self.listWidget.item(4)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 5&quot;))
          item = self.listWidget.item(5)
          item.setText(_translate(&quot;MainWindow&quot;, &quot;Item 6&quot;))
          self.listWidget.setSortingEnabled(__sortingEnabled)
  
  
  if __name__ == &quot;__main__&quot;:
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  <p>with the eventFilter i tried something like this.
  <strong>This is from my code.</strong> NOT FROM THE EXAMPLE ABOVE</p>
  <pre><code>#...
  self.stack.listWidget_2.installEventFilter(self)
  #...
  #...
  </code></pre>
  <p>and</p>
  <pre><code>def eventFilter(self, source, event):
      if source is self.listwidget_2 and event.type() == QtCore.QEvent.Enter:
          self.wheelEvent = lambda event: None
      return super(mainwindow, self).eventFilter(source, event)
  </code></pre>
  <p>I also tried with other event.types but nothing works like i wanne to have.</p>