Add note about multiple inheritance issues in PyQt5

This commit is contained in:
Kovid Goyal 2014-04-22 17:17:58 +05:30
parent 0f3138bbdb
commit 9ed39c3d6a
2 changed files with 12 additions and 3 deletions

View File

@ -22,10 +22,19 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
# QT5XX: Test touchscreen support on windows 8 in the viewer
# Look for obsolete classes and functions from the list here:
# QT5XX: Look for obsolete classes and functions from the list here:
# 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

View File

@ -163,7 +163,7 @@ class Node(object):
for child in self.children:
yield child
class ConfigModel(QAbstractItemModel, SearchQueryParser):
class ConfigModel(SearchQueryParser, QAbstractItemModel):
def __init__(self, keyboard, parent=None):
QAbstractItemModel.__init__(self, parent)
@ -556,7 +556,7 @@ class Delegate(QStyledItemDelegate): # {{{
def setModelData(self, editor, model, index):
self.closeEditor.emit(editor, self.NoHint)
custom_keys = editor.custom_keys
sc = index.data(Qt.UserRole).toPyObject().data
sc = index.data(Qt.UserRole).data
if custom_keys is None:
candidates = []
for ckey in sc['default_keys']: