You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://trac.mantidproject.org/mantid/ticket/4311 fixed the issue of missing tab-completion options on our wrapped _qti objects in MantidPlot. By modifying dir to return relevant methods from the wrapped object you see those methods instead of the methods of the proxy object (QtProxyObject).
However, the methods that we've defined are rather swamped by the inherited QObject/QWidget ones and it would be nice to filter those out as users should very rarely need them. Code something like this would filter the list:
heldobjectmethods = dir(self._getHeldObject())
qwidgetmethods = dir(QtGui.QWidget)
return [m for m in heldobjectmethods if m not in qwidgetmethods]
However, this doesn't completely work because IPython explicitly goes looking for base class methods and adds them to its completions options. In this case, it adds all the QObject methods as this is the base of QtProxyObject.
There is a possibility to have IPython look at the all attribute for the completion options - and in this case it would not add base class methods. This requires adjusting the IPython configuration programmatically. In doing so, we would not want to prevent the user from being able to configure their IPython options themselves.
Keywords: IPython
The text was updated successfully, but these errors were encountered:
Original Reporter: Russell Taylor
http://trac.mantidproject.org/mantid/ticket/4311 fixed the issue of missing tab-completion options on our wrapped _qti objects in MantidPlot. By modifying dir to return relevant methods from the wrapped object you see those methods instead of the methods of the proxy object (QtProxyObject).
However, the methods that we've defined are rather swamped by the inherited QObject/QWidget ones and it would be nice to filter those out as users should very rarely need them. Code something like this would filter the list:
However, this doesn't completely work because IPython explicitly goes looking for base class methods and adds them to its completions options. In this case, it adds all the QObject methods as this is the base of QtProxyObject.
There is a possibility to have IPython look at the all attribute for the completion options - and in this case it would not add base class methods. This requires adjusting the IPython configuration programmatically. In doing so, we would not want to prevent the user from being able to configure their IPython options themselves.
Keywords: IPython
The text was updated successfully, but these errors were encountered: