Commits

Aleš Erjavec committed 3c4b5ab

Ignore wheel events in organism combo box.

Comments (0)

Files changed (1)

orangecontrib/bio/widgets/OWSelectGenes.py

         b = button(moreaction, popupMode=QToolButton.InstantPopup)
         layout.addWidget(b)
 
-        self.organismsCombo = QComboBox()
+        self.organismsCombo = ComboBox(focusPolicy=Qt.StrongFocus)
         self.organismsCombo.addItem("...")
         self.organismsCombo.model().item(0).setEnabled(False)
         self.organismsCombo.setMinimumWidth(200)
         return var in self._filterFixedSet
 
 
+class ComboBox(QComboBox):
+    """
+    A combo box ignoring mouse wheel events.
+    """
+    def wheelEvent(self, event):
+        event.ignore()
+        return
+
 # All control character categories.
 _control = set(["Cc", "Cf", "Cs", "Co", "Cn"])
 
         self._stack.setContentsMargins(0, 0, 0, 0)
         self._stack.setSizePolicy(QSizePolicy.MinimumExpanding,
                                   QSizePolicy.Fixed)
-        self.orgcombo = QComboBox(minimumWidth=150)
+        self.orgcombo = ComboBox(minimumWidth=150, focusPolicy=Qt.StrongFocus)
         self.orgcombo.activated[int].connect(self._on_organismSelected)
         self._stack.addWidget(self.orgcombo)