diff --git a/setup/qt-workarounds.txt b/setup/qt-workarounds.txt deleted file mode 100644 index e2776fbcbc..0000000000 --- a/setup/qt-workarounds.txt +++ /dev/null @@ -1,3 +0,0 @@ -Undo the workaround for WindowBlocked/Unblocked in Qt >= 5.6 -https://bugreports.qt-project.org/browse/QTBUG-42281 - diff --git a/src/calibre/gui2/dbus_export/widgets.py b/src/calibre/gui2/dbus_export/widgets.py index 958cd9baf5..d3f0926379 100644 --- a/src/calibre/gui2/dbus_export/widgets.py +++ b/src/calibre/gui2/dbus_export/widgets.py @@ -31,6 +31,7 @@ class MenuBarAction(QAction): def menu(self): return self.parent() + menu_counter = 0 @@ -58,10 +59,6 @@ class ExportedMenuBar(QMenuBar): # {{{ self.dbus_menu.publish_new_menu(self) self.register() parent.installEventFilter(self) - # See https://bugreports.qt-project.org/browse/QTBUG-42281 - if hasattr(parent, 'window_blocked'): - parent.window_blocked.connect(self._block) - parent.window_unblocked.connect(self._unblock) def register(self, menu_registrar=None): self.menu_registrar = menu_registrar or self.menu_registrar @@ -103,13 +100,6 @@ class ExportedMenuBar(QMenuBar): # {{{ def eventFilter(self, obj, ev): etype = ev.type() - # WindowBlocked and WindowUnblocked aren't delivered to event filters, - # so we have to rely on co-operation from the mainwindow class - # See https://bugreports.qt-project.org/browse/QTBUG-42281 - # if etype == QEvent.WindowBlocked: - # self._block() - # elif etype == QEvent.WindowUnblocked: - # self._unblock() if etype == QEvent.Show: # Hiding a window causes the registrar to auto-unregister it, so we # have to re-register it on show events. @@ -254,6 +244,7 @@ class Factory(QObject): self.bus # TODO: have the created widgets also handle bus disconnection + _factory = None diff --git a/src/calibre/gui2/main_window.py b/src/calibre/gui2/main_window.py index 7f5d94de94..fd71725f44 100644 --- a/src/calibre/gui2/main_window.py +++ b/src/calibre/gui2/main_window.py @@ -8,7 +8,7 @@ __copyright__ = '2008, Kovid Goyal ' import StringIO, traceback, sys, gc, weakref from PyQt5.Qt import (QMainWindow, QTimer, QAction, QMenu, QMenuBar, QIcon, - pyqtSignal, QObject) + QObject) from calibre.utils.config import OptionParser from calibre.gui2 import error_dialog from calibre import prints @@ -90,10 +90,6 @@ class MainWindow(QMainWindow): ___menu = None __actions = [] - # See https://bugreports.qt-project.org/browse/QTBUG-42281 - window_blocked = pyqtSignal() - window_unblocked = pyqtSignal() - @classmethod def create_application_menubar(cls): if not cls.__actions: @@ -156,15 +152,6 @@ class MainWindow(QMainWindow): except: pass - def event(self, ev): - # See https://bugreports.qt-project.org/browse/QTBUG-42281 - etype = ev.type() - if etype == ev.WindowBlocked: - self.window_blocked.emit() - elif etype == ev.WindowUnblocked: - self.window_unblocked.emit() - return QMainWindow.event(self, ev) - def clone_menu(menu): # This is needed to workaround a bug in Qt 5.5+ and Unity. When the same