Another mysterious instance of Qt delivering resize events with type set to that of mouse events.

Fixes #1714353 [series name change](https://bugs.launchpad.net/calibre/+bug/1714353)
This commit is contained in:
Kovid Goyal 2017-09-01 05:39:11 +05:30
parent 08471c12a4
commit 6f9214d5a7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -266,7 +266,7 @@ class Completer(QListView): # {{{
# See https://bugreports.qt-project.org/browse/QTBUG-41806
e.accept()
return True
elif etype == e.MouseButtonPress and not self.rect().contains(self.mapFromGlobal(e.globalPos())):
elif etype == e.MouseButtonPress and hasattr(e, 'globalPos') and not self.rect().contains(self.mapFromGlobal(e.globalPos())):
# A click outside the popup, close it
if isinstance(widget, QComboBox):
# This workaround is needed to ensure clicking on the drop down
@ -518,6 +518,7 @@ class EditWithComplete(EnComboBox):
return True
return EnComboBox.eventFilter(self, obj, e)
if __name__ == '__main__':
from PyQt5.Qt import QDialog, QVBoxLayout
app = QApplication([])