mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 19:03:18 +02:00
More multiple inheritance porting
This commit is contained in:
parent
53991dc588
commit
4ff0c73b1a
3 changed files with 12 additions and 11 deletions
|
|
@ -26,15 +26,6 @@
|
|||
# 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
|
||||
|
|
|
|||
|
|
@ -23,7 +23,12 @@
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@
|
|||
|
||||
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 @@ def update(self, varmap):
|
|||
|
||||
# }}}
|
||||
|
||||
class Tweaks(QAbstractListModel, SearchQueryParser): # {{{
|
||||
class Tweaks(QAbstractListModel, AdaptSQP): # {{{
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QAbstractListModel.__init__(self, parent)
|
||||
|
|
|
|||
Loading…
Reference in a new issue