<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>I've managed to get a sample of the code together to show all the class inheritance which produces exactly the same error as in the application with PyQt5.  They PyQt4 version doesn't error.</div><div><br></div><div>The red line is the one throwing the error.</div><div><br></div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><div style="margin: 0px;"><div style="margin: 0px;"><span style="color: #0433ff">from</span> __future__ <span style="color: #0433ff">import</span> division, print_function, unicode_literals</div><div style="margin: 0px;"><span style="color: #0433ff">from</span> PyQt5 <span style="color: #0433ff">import</span> QtCore, QtWidgets</div><div style="margin: 0px;"><span style="color: #0433ff">from</span> PyQt5.QtCore <span style="color: #0433ff">import</span> Qt, pyqtSignal</div><div style="margin: 0px;"><span style="color: #0433ff">import</span> weakref</div><div style="margin: 0px; color: rgb(203, 203, 203);">#from PyQt4 import  QtCore, QtGui </div><div style="margin: 0px; color: rgb(203, 203, 203);">#from PyQt4.QtCore import pyqtSignal, <span style="text-decoration: underline">Qt</span></div></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> IViewModel(object):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Interface for a generic model in a model/view pattern</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, session, data):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Constructor accepts the database session to be used to update the items</div><div style="margin: 0px; color: rgb(0, 180, 0);">        in case of a database's change received by the ``databaseChanged()``</div><div style="margin: 0px; color: rgb(0, 180, 0);">        signal and the user defined initial data.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> data: The view model data to display</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> session: The database' session</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type session: sqlalchemy.orm.session.Session</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type data: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">raise</span> NotImplementedError(self)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> indentation(self):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Return the current indentation value</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">rtype</span>: <span style="text-decoration: underline">int</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">raise</span> NotImplementedError(self)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> BaseViewModel(QtCore.QAbstractItemModel, IViewModel):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Base view model implementation.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    In the concrete implementation of this class you can define a custom size</div><div style="margin: 0px; color: rgb(0, 180, 0);">    and resize mode for every column of the model but only in x* controls.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Also set the :py:attr:`.BaseViewModel.orm_classes` static attribute to a</div><div style="margin: 0px; color: rgb(0, 180, 0);">    tuple of classed to be used to filter incoming `databaseChanged` signals.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    To do that you just need to re-implement the</div><div style="margin: 0px; color: rgb(0, 180, 0);">    :py:meth:`.BaseViewModel.columnWidth()` and</div><div style="margin: 0px; color: rgb(0, 180, 0);">    :py:meth:`.BaseViewModel.columnWidthMode()` methods with your custom column</div><div style="margin: 0px; color: rgb(0, 180, 0);">    sizes and resize modes.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Custom signals:</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    * databaseChanged(PyQt_PyObject)</div><div style="margin: 0px; color: rgb(0, 180, 0);">      Emitted from the QCoreApplication's instance after changes in the</div><div style="margin: 0px; color: rgb(0, 180, 0);">      database, an instance of :py:class:`.SessionStatusVO` will be sent within</div><div style="margin: 0px; color: rgb(0, 180, 0);">      the signal</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    INDENTATION_CHAR = <span style="color: #00b400">"  "</span></div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Character to be used during indentation indentation</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    :type: string</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #00b400">    """</span><span style="color: #000000">  </span># <span style="text-decoration: underline">pylint</span>: disable=W0105</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    INDENTATION_LEVEL = -<span style="color: #941100">1</span></div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Number of columns starting from the left side which will be indented.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    A value of -1 means all values in every column will be indented; a value of</div><div style="margin: 0px; color: rgb(0, 180, 0);">    0 (zero) means no indentation will be applied.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    :type: <span style="text-decoration: underline">int</span></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #00b400">    """</span><span style="color: #000000">  </span># <span style="text-decoration: underline">pylint</span>: disable=W0105</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    orm_classes = ()</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Class level variable which stores the list of ORM classes to be used as a</div><div style="margin: 0px; color: rgb(0, 180, 0);">    filter when a databaseChanged() signal is received.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Only the changes on the classes listed in this variable will be forwarded</div><div style="margin: 0px; color: rgb(0, 180, 0);">    to the update/add/remove item's code.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    :type: list</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #00b400">    """</span><span style="color: #000000">  </span># <span style="text-decoration: underline">pylint</span>: disable=W0105</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, session, data):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        See :py:class:`.IViewModel`</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;"><font color="#ff4013">        </font><font color="#aaaaaa"># Call superclass</font></div><div style="margin: 0px;"><font color="#ff4013">        QtCore.QAbstractItemModel.__init__(self)     </font> </div><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span>#super(BaseViewModel, self).__init__(session, data)</div><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Protected attributes</div><div style="margin: 0px;">        self._indentation = self.INDENTATION_LEVEL</div><div style="margin: 0px;">        self._data = data</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Public attributes</div><div style="margin: 0px;">        self.session = session    </div><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px;"><span style="color: #0433ff">class</span> ContextHelpMixin(object):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    <span style="text-decoration: underline">Mixin</span> class to add support for a context help activated by pressing the F1</div><div style="margin: 0px; color: rgb(0, 180, 0);">    key</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    DEFAULT = <span style="color: #00b400">"</span><span style="text-decoration: underline ; color: #00b400"><not_set></span><span style="color: #00b400">"</span></div><div style="margin: 0px;">    trigger = pyqtSignal()</div><div style="margin: 0px;">    helpIdentifierVisible = pyqtSignal(bool)</div><p style="margin: 0px; min-height: 15px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, *args, **kwds):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Empty constructor</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Public attributes</div><div style="margin: 0px;">        self._context_help_name = self.DEFAULT</div><div style="margin: 0px;">        self._overlay = <span style="color: #0433ff">None</span></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Connect signals</div><div style="margin: 0px; color: rgb(203, 203, 203);">#         self.trigger.connect(</div><div style="margin: 0px; color: rgb(203, 203, 203);">#             QtWidgets.QApplication.instance(),</div><div style="margin: 0px; color: rgb(203, 203, 203);">#             QtCore.pyqtSignal(b"helpIdentifierVisible(<span style="text-decoration: underline">bool</span>)"),</div><div style="margin: 0px; color: rgb(203, 203, 203);">#             self._on_identifier_visible_signal</div><div style="margin: 0px; color: rgb(203, 203, 203);">#         )</div><div style="margin: 0px;">        self.trigger.connect(self._on_identifier_visible_signal)</div><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px;"><span style="color: #0433ff">class</span> xDialog(ContextHelpMixin, QtWidgets.QDialog):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Custom dialog class which supports the contextual help and display it as</div><div style="margin: 0px; color: rgb(0, 180, 0);">    window modal, which blocks the interaction only on the dialog's parent and</div><div style="margin: 0px; color: rgb(0, 180, 0);">    its ancestors but not to other windows in the same <span style="text-decoration: underline">Qt</span> application's loop.</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, *args, **kwds):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        See QDialog</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Call <span style="text-decoration: underline">superclasses</span></div><div style="margin: 0px;">        QtWidgets.QDialog.__init__(self, *args, **kwds)</div><div style="margin: 0px;">        ContextHelpMixin.__init__(self)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Set up dialog</div><div style="margin: 0px;">        self.setWindowModality(Qt.WindowModal)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> BaseViewMixin(object):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    <span style="text-decoration: underline">Mixin</span> implementation for a base view class.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Protected attributes are added to the class only if they are set.</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> data(self):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Return current window data</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">rtype</span>: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">return</span> self._data <span style="color: #0433ff">if</span> hasattr(self, <span style="color: #00b400">"_data"</span>) <span style="color: #0433ff">else</span> <span style="color: #0433ff">None</span></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> setData(self, value):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Set current window data</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> value: The per view data</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type value: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        self._data = value  <span style="color: #cbcbcb"># </span><span style="text-decoration: underline ; color: #cbcbcb">pylint</span><span style="color: #cbcbcb">: disable=W0201</span></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> delegate(self):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Returns the view's delegate</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">rtype</span>: puremvc.interfaces.IMediator</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">if</span> hasattr(self, <span style="color: #00b400">"_delegate"</span>) <span style="color: #0433ff">and</span> self._delegate <span style="color: #0433ff">is</span> <span style="color: #0433ff">not</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px;">            <span style="color: #0433ff">return</span> self._delegate()</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(4, 51, 255);"><span style="color: #000000">        </span>return<span style="color: #000000"> </span>None</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> setDelegate(self, value):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Keeps a weak reference of the view's delegate</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> <span style="text-decoration: underline">mediator</span>: The view's <span style="text-decoration: underline">mediator</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type <span style="text-decoration: underline">mediator</span>: puremvc.interfaces.IMediator</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># <span style="text-decoration: underline">pylint</span>: disable=W0201</div><div style="margin: 0px;">        self._delegate = weakref.ref(value) <span style="color: #0433ff">if</span> value <span style="color: #0433ff">is</span> <span style="color: #0433ff">not</span> <span style="color: #0433ff">None</span> <span style="color: #0433ff">else</span> <span style="color: #0433ff">None</span></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># <span style="text-decoration: underline">pylint</span>: enable=W0201</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> Enumerator(object):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    An enumerator class is a class which cannot be instantiated and offers only</div><div style="margin: 0px; color: rgb(0, 180, 0);">    a set of static constants</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(144, 144, 144);"><span style="color: #000000">    </span>@classmethod</div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> members(cls):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Class method that returns a list with the enumerator members</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">rtype</span>: list( object )</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">return</span> [getattr(cls, member_name) <span style="color: #0433ff">for</span> member_name <span style="color: #0433ff">in</span> sorted(vars(cls))</div><div style="margin: 0px;">                <span style="color: #0433ff">if</span> <span style="color: #0433ff">not</span> member_name.startswith(<span style="color: #00b400">"__"</span>)]</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">    </span><span style="color: #0433ff">def</span><span style="color: #000000"> __init__(self):  </span># <span style="text-decoration: underline">pylint</span>: disable=W0231</div><div style="margin: 0px; color: rgb(0, 180, 0);"><span style="color: #000000">        </span><span style="color: #0433ff">raise</span><span style="color: #000000"> SyntaxError(</span>"You cannot create an instance of this class"<span style="color: #000000">)</span></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> CustomItemRoles(Enumerator):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Enumerates the custom item roles used by the application</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    IDENTIFIER_ROLE = Qt.UserRole + <span style="color: #941100">1</span></div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Returns a unique identifier for the model index item</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    :<span style="text-decoration: underline">rtype</span>: object</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #00b400">    """</span><span style="color: #000000">  </span># <span style="text-decoration: underline">pylint</span>: disable=W0105</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> BaseViewModelItem(object):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Base view model item implementation</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, value, parent=<span style="color: #0433ff">None</span>):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Constructor accepts the user defined data and the optional item's</div><div style="margin: 0px; color: rgb(0, 180, 0);">        parent</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> value: The data displayed by this model item</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> parent: The optional item's parent</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type value: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type parent: :py:class:`.BaseViewModelItem`</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Public attributes</div><div style="margin: 0px;">        self.value = value</div><div style="margin: 0px;">        self.parent = parent</div><div style="margin: 0px;">        self.children = []</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> setData(self, index, value, role):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Sets data for the column index and role.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        See QAbstractItemModel.setData()</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> index: The column index</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> value: The value to be set</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> role: The item's role</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type index: <span style="text-decoration: underline">int</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type value: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type role: <span style="text-decoration: underline">Qt</span>::ItemDataRole</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">pass</span></div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> data(self, index, role):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Returns data for the column index and role.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        In details:</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        * for <span style="text-decoration: underline">Qt</span>::UserRole returns the value referenced by the model view item</div><div style="margin: 0px; color: rgb(0, 180, 0);">        * for :py:attr:`.CustomItemRoles.IDENTIFIER_ROLE` returns the</div><div style="margin: 0px; color: rgb(0, 180, 0);">          ID of the object if any</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        See QAbstractItemModel.data()</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> index: The column index</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> role: The requested role</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type index: <span style="text-decoration: underline">int</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type role: <span style="text-decoration: underline">Qt</span>::ItemDataRole</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">rtype</span>: object</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px;">        <span style="color: #0433ff">if</span> role == CustomItemRoles.IDENTIFIER_ROLE:</div><div style="margin: 0px;">            <span style="color: #0433ff">return</span> self.identifier()</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">        <span style="color: #0433ff">if</span> role == Qt.UserRole:</div><div style="margin: 0px;">            <span style="color: #0433ff">return</span> self.value</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> UsernameItem(BaseViewModelItem):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Single <span style="text-decoration: underline">Username</span> item</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> data(self, index, role):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        See QAbstractItemModel.data()</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Display role</div><div style="margin: 0px;">        <span style="color: #0433ff">if</span> role <span style="color: #0433ff">in</span> (Qt.DisplayRole, Qt.EditRole) <span style="color: #0433ff">and</span> index == <span style="color: #941100">0</span>:</div><div style="margin: 0px;">            <span style="color: #0433ff">return</span> self.value.username</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Default</div><div style="margin: 0px;">        <span style="color: #0433ff">return</span> super(UsernameItem, self).data(index, role)</div><p style="margin: 0px; min-height: 15px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px;"><span style="color: #0433ff">class</span> UsernamesModel(BaseViewModel):</div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    Model for <span style="text-decoration: underline">usernames</span> list view</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    COLUMNS = (<span style="color: #00b400">"</span><span style="text-decoration: underline ; color: #00b400">Username</span><span style="color: #00b400">"</span>,)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> __init__(self, session, users, current_user=<span style="color: #0433ff">None</span>):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Constructor accepts the database session, the list of users and the</div><div style="margin: 0px; color: rgb(0, 180, 0);">        optional current logged user</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> session: The database session</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> users: The list of users</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> current_user: The current logged user</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type session: sqlachemy.orm.session</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type users: list( :py:class:`.User` )</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type current_user: :py:class:`.User`</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Call superclass</div><div style="margin: 0px;">        super(UsernamesModel, self).__init__(</div><div style="margin: 0px;">            session, [UsernameItem(user) <span style="color: #0433ff">for</span> user <span style="color: #0433ff">in</span> users])</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Protected attributes</div><div style="margin: 0px;">        self._current_user = current_user</div><p style="margin: 0px; min-height: 15px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;"><span style="color: #0433ff">class</span> LogonView(BaseViewMixin, xDialog): <span style="color: #cbcbcb">#, Ui_LogonDialog):</span></div><div style="margin: 0px;">    <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    <span style="text-decoration: underline">Logon</span> dialog which let the user to choose the user name and input enter the</div><div style="margin: 0px; color: rgb(0, 180, 0);">    password to <span style="text-decoration: underline">logon</span> into the application.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    If the Cancel button is pressed the application will be closed.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    If the <span style="text-decoration: underline">logon</span> fails an error message appears on the screen.</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">    The user cannot close the dialog unless press the Cancel button or <span style="text-decoration: underline">logon</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">    into the application.</div><div style="margin: 0px; color: rgb(0, 180, 0);">    """</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">    </span><span style="color: #0433ff">def</span><span style="color: #000000"> __init__(self):  </span># <span style="text-decoration: underline">pylint</span>: disable=W0231</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Empty constructor</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Call <span style="text-decoration: underline">superclasses</span></div><div style="margin: 0px;">        BaseViewMixin.__init__(self)</div><div style="margin: 0px;">        xDialog.__init__(</div><div style="margin: 0px;">            self, flags=(Qt.CustomizeWindowHint | Qt.WindowTitleHint</div><div style="margin: 0px;">                         | Qt.WindowStaysOnTopHint)</div><div style="margin: 0px;">        )</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Setup UI</div><div style="margin: 0px;">        self.setupUi(self)</div><div style="margin: 0px;">        self.password.setFocus(Qt.OtherFocusReason)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">    <span style="color: #0433ff">def</span> setData(self, users):</div><div style="margin: 0px;">        <span style="color: #00b400">"""</span></div><div style="margin: 0px; color: rgb(0, 180, 0);">        Show the users by the current system location</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(0, 180, 0);">        :<span style="text-decoration: underline">param</span> users: The list of current system location's users</div><div style="margin: 0px; color: rgb(0, 180, 0);">        :type users: list( :py:class:`.User` )</div><div style="margin: 0px; color: rgb(0, 180, 0);">        """</div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Call superclass</div><div style="margin: 0px;">        super(LogonView, self).setData(users)</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(203, 203, 203);"><span style="color: #000000">        </span># Set data</div><div style="margin: 0px;">        self.username.setModel(</div><div style="margin: 0px;">            <span style="text-decoration: underline">SortViewModelProxy</span>(UsernamesModel(self.delegate().session, users)))</div><div style="margin: 0px;">        self.password.setText()</div><p style="margin: 0px; min-height: 15px;">               </p><div style="margin: 0px;"><span style="color: #0433ff">if</span> __name__ == <span style="color: #00b400">'__main__'</span>:</div><div style="margin: 0px;">    users=[[<span style="color: #00b400">'1'</span>,<span style="color: #00b400">'a'</span>],[<span style="color: #00b400">'2'</span>,<span style="color: #00b400">'b'</span>],[<span style="color: #00b400">'3'</span>,<span style="color: #00b400">'c'</span>],[<span style="color: #00b400">'4'</span>,<span style="color: #00b400">'d'</span>]]</div><div style="margin: 0px;">    a = UsernamesModel(<span style="color: #941100">1</span>, users)</div><div style="margin: 0px;">    <span style="color: #0433ff">pass</span></div><div><span style="color: #0433ff"><br></span></div></div></div><div><span style="color: #0433ff"><br></span></div><div>The error message is:-</div><div><br></div><div><div style="margin: 0px;"><span style="color: rgb(255, 38, 0); font-family: Monaco; font-size: 11px;">  </span><font color="#0433ff" face="Monaco"><u><span style="font-size: 11px;">File "/Users/CC/Documents/work/CC.code.trunk/splash_example.py", line 390, in <module></span></u></font></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);">    a = UsernamesModel(1, users)</div><div style="margin: 0px;"><span style="color: rgb(255, 38, 0); font-family: Monaco; font-size: 11px;">  </span><font color="#0433ff" face="Monaco"><u><span style="font-size: 11px;">File "/Users/CC/Documents/work/CC.code.trunk/splash_example.py", line 337, in __init__</span></u></font></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);">    session, [UsernameItem(user) for user in users])</div><div style="margin: 0px;"><span style="color: rgb(255, 38, 0); font-family: Monaco; font-size: 11px;">  </span><font color="#0433ff" face="Monaco"><u><span style="font-size: 11px;">File "/Users/CC/Documents/work/CC.code.trunk/splash_example.py", line 95, in __init__</span></u></font></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);">    QtCore.QAbstractItemModel.__init__(self)      </div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);">TypeError: __init__() takes exactly 3 arguments (1 given)</div></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">If you rem out the PyQt5 imports and unrem the PyQt4 imports then you'll see that there isn't a problem.</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(255, 38, 0);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">I have seen the post by </div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><div style="margin: 0px; font-size: 12px; font-family: Helvetica;"><b>Chris O'Halloran   - 28 May 00:47 </b>[PyQt] Addition of parent argument when subclassing with super.</div><div style="margin: 0px; text-indent: 4px; font-size: 12px; font-family: Helvetica;"><br></div><div style="margin: 0px; text-indent: 4px; font-size: 12px; font-family: Helvetica;">And wondered if he was also having a similar issue but managed to get around it.</div><div style="margin: 0px 0px 0px 4px; font-size: 12px; font-family: Helvetica;"><br></div><div style="margin: 0px 0px 0px 4px; font-size: 12px; font-family: Helvetica;"><br></div><div style="margin: 0px 0px 0px 4px; font-size: 12px; font-family: Helvetica;">I have tried the super() function but to no avail.</div><div style="margin: 0px 0px 0px 4px; font-size: 12px; font-family: Helvetica;"><br></div></div><div style="margin: 0px;">I've also looked at <a href="http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#cooperative-multi-inheritance">http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#cooperative-multi-inheritance</a> for clues</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><br></div><div style="margin: 0px;">Many thanks in advance</div><div style="margin: 0px;">Rob</div></body></html>