diff --git a/setup/qt5-migrate.py b/setup/qt5-migrate.py index 9fe8a1cc30..53397595fa 100644 --- a/setup/qt5-migrate.py +++ b/setup/qt5-migrate.py @@ -26,15 +26,6 @@ __copyright__ = '2014, Kovid Goyal ' # http://qt-project.org/doc/qt-5/obsoleteclasses.html as these will not be # present in PyQt5 -# QT5XX: For classes that inherit both a QObject based class and -# SearchQueryParser, PyQt5 class the SearchQueryParser __init__ method when -# calling the QObject based classes __init__ method. The simplest fix is to -# make SearchQueryParser the first base class instead of the second. An -# alternative fix is to create a derived class from SearchQueryParser whose -# __init__ method accepts any args and does nothing and inherit from that. Do -# this porting and test the results when possible. Porting already done and -# tested for keyboard.py - # QT5XX: Delete this file after migration is completed import os, re diff --git a/src/calibre/gui2/preferences/plugins.py b/src/calibre/gui2/preferences/plugins.py index 00230970b3..7ca1e0a267 100644 --- a/src/calibre/gui2/preferences/plugins.py +++ b/src/calibre/gui2/preferences/plugins.py @@ -23,7 +23,12 @@ from calibre.utils.search_query_parser import SearchQueryParser from calibre.utils.icu import lower from calibre.constants import iswindows -class PluginModel(QAbstractItemModel, SearchQueryParser): # {{{ +class AdaptSQP(SearchQueryParser): + + def __init__(self, *args, **kwargs): + pass + +class PluginModel(QAbstractItemModel, AdaptSQP): # {{{ def __init__(self, show_only_user_plugins=False): QAbstractItemModel.__init__(self) diff --git a/src/calibre/gui2/preferences/tweaks.py b/src/calibre/gui2/preferences/tweaks.py index f65eb07d28..a76764b0b6 100644 --- a/src/calibre/gui2/preferences/tweaks.py +++ b/src/calibre/gui2/preferences/tweaks.py @@ -25,6 +25,11 @@ from PyQt5.Qt import (QAbstractListModel, Qt, QStyledItemDelegate, QStyle, ROOT = QModelIndex() +class AdaptSQP(SearchQueryParser): + + def __init__(self, *args, **kwargs): + pass + class Delegate(QStyledItemDelegate): # {{{ def __init__(self, view): QStyledItemDelegate.__init__(self, view) @@ -98,7 +103,7 @@ class Tweak(object): # {{{ # }}} -class Tweaks(QAbstractListModel, SearchQueryParser): # {{{ +class Tweaks(QAbstractListModel, AdaptSQP): # {{{ def __init__(self, parent=None): QAbstractListModel.__init__(self, parent)