mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More multiple inheritance porting
This commit is contained in:
parent
53991dc588
commit
4ff0c73b1a
@ -26,15 +26,6 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
# 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.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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user