Krita-PythonPluginDeveloperTools
Krita-PythonPluginDeveloperTools copied to clipboard
Cusor inspector bug
when using the cursor inspector on mouse release it throws me a error message as follows
TypeError
Python 3.10.7: C:\Program Files\Krita (x64)\bin\krita.exe
Sun Dec 17 07:52:09 2023
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in tabChanged(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget object>, idx=1)
78
79 if self.currentTab:
80 self.t[self.currentTab].unselected()
81 self.currentTab = self.centralWidget.tabWidget.currentWidget().objectName().replace('Tab','')
82 print ("ON", self.currentTab)
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget object>
self.t = {'actions': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsActions object>, 'console': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsConsole object>, 'icons': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsIcons object>, 'inspector': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, 'kritaapi': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsKritaAPI object>, 'selector': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>, 'welcome': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsWelcome object>}
self.currentTab = 'selector'
].unselected undefined
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in unselected(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>)
976
977 def unselected(self):
978 self.stopSampling()
979
980 def startSampling(self, window):
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>
self.stopSampling = <bound method PluginDevToolsWidget.PluginDevTool...ginDevToolsWidget.PluginDevToolsSelector object>>
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in stopSampling(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>, localCall=True)
1024 self.caller.t['inspector'].loadItemInfo(self.currentWidget)
1025 self.caller.t['inspector'].firstRun = True
1026 self.caller.t['inspector'].refreshItems(self.currentWidget, currentWindow)
1027 #self.caller.t['inspector'].selectItemByRef(self.currentWidget)
1028 self.currentWidget = None
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>
self.caller = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget object>
self.caller.t = {'actions': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsActions object>, 'console': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsConsole object>, 'icons': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsIcons object>, 'inspector': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, 'kritaapi': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsKritaAPI object>, 'selector': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsSelector object>, 'welcome': <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsWelcome object>}
].refreshItems undefined
self.currentWidget = <PyQt5.QtWidgets.QLabel object>
currentWindow = <PyQt5.QtWidgets.QMainWindow object>
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in refreshItems(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, currentItem=<PyQt5.QtWidgets.QLabel object>, currentWindow=<PyQt5.QtWidgets.QMainWindow object>)
1286 for win in QApplication.instance().topLevelWidgets():
1287 if isinstance(win, QMainWindow) or (currentWindow and win is currentWindow):
1288 self.loadTreeItems(win, 0, 'topLevelWidgets', None, currentItem)
1289 if self.currentWidget:
1290 self.loadItemInfo( self.currentWidget )
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>
self.loadTreeItems = <bound method PluginDevToolsWidget.PluginDevTool...inDevToolsWidget.PluginDevToolsInspector object>>
win = <PyQt5.QtWidgets.QMainWindow object>
currentItem = <PyQt5.QtWidgets.QLabel object>
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in loadTreeItems(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, pObj=<PyQt5.QtWidgets.QMainWindow object>, depth=1, objType='children', parentItem=<PyQt5.QtGui.QStandardItem object>, currentItem=<PyQt5.QtWidgets.QLabel object>)
1751 #print ("CH", cObj.children())
1752
1753 self.loadTreeItems(cObj, depth + 1, 'children', item, currentItem)
1754
1755 def setItem(self, obj, parentItem, depth, objType):
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>
self.loadTreeItems = <bound method PluginDevToolsWidget.PluginDevTool...inDevToolsWidget.PluginDevToolsInspector object>>
cObj = <timer_watch.timer_watch_docker.TimerWatch_Docker object>
depth = 1
item = <PyQt5.QtGui.QStandardItem object>
currentItem = <PyQt5.QtWidgets.QLabel object>
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in loadTreeItems(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, pObj=<timer_watch.timer_watch_docker.TimerWatch_Docker object>, depth=2, objType='children', parentItem=<PyQt5.QtGui.QStandardItem object>, currentItem=<PyQt5.QtWidgets.QLabel object>)
1751 #print ("CH", cObj.children())
1752
1753 self.loadTreeItems(cObj, depth + 1, 'children', item, currentItem)
1754
1755 def setItem(self, obj, parentItem, depth, objType):
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>
self.loadTreeItems = <bound method PluginDevToolsWidget.PluginDevTool...inDevToolsWidget.PluginDevToolsInspector object>>
cObj = <PyQt5.QtWidgets.QWidget object>
depth = 2
item = <PyQt5.QtGui.QStandardItem object>
currentItem = <PyQt5.QtWidgets.QLabel object>
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in loadTreeItems(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, pObj=<PyQt5.QtWidgets.QWidget object>, depth=3, objType='children', parentItem=<PyQt5.QtGui.QStandardItem object>, currentItem=<PyQt5.QtWidgets.QLabel object>)
1743 cObjType = "viewport/children"
1744
1745 item = self.setItem(cObj, parentItem, depth, cObjType)
1746
1747 #if self.hasMethod(cObj,'viewport'):
item = <PyQt5.QtGui.QStandardItem object>
self = <PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>
self.setItem = <bound method PluginDevToolsWidget.PluginDevTool...inDevToolsWidget.PluginDevToolsInspector object>>
cObj = <PyQt5.QtWidgets.QLCDNumber object>
parentItem = <PyQt5.QtGui.QStandardItem object>
depth = 3
cObjType = 'children'
C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py in setItem(self=<PluginDevTools.PluginDevToolsWidget.PluginDevToolsWidget.PluginDevToolsInspector object>, obj=<PyQt5.QtWidgets.QLCDNumber object>, parentItem=<PyQt5.QtGui.QStandardItem object>, depth=3, objType='children')
1770 QStandardItem( obj.metaObject().className() ),
1771 QStandardItem( objType ),
1772 QStandardItem( text )
1773 ])
1774
global QStandardItem = <class 'PyQt5.QtGui.QStandardItem'>
text = 0.0
TypeError: arguments did not match any overloaded call:
QStandardItem(): too many arguments
QStandardItem(str): argument 1 has unexpected type 'float'
QStandardItem(QIcon, str): argument 1 has unexpected type 'float'
QStandardItem(int, columns: int = 1): argument 1 has unexpected type 'float'
QStandardItem(QStandardItem): argument 1 has unexpected type 'float'
__cause__ = None
__class__ = <class 'TypeError'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of TypeError object>
__dict__ = {}
__dir__ = <built-in method __dir__ of TypeError object>
__doc__ = 'Inappropriate argument type.'
__eq__ = <method-wrapper '__eq__' of TypeError object>
__format__ = <built-in method __format__ of TypeError object>
__ge__ = <method-wrapper '__ge__' of TypeError object>
__getattribute__ = <method-wrapper '__getattribute__' of TypeError object>
__gt__ = <method-wrapper '__gt__' of TypeError object>
__hash__ = <method-wrapper '__hash__' of TypeError object>
__init__ = <method-wrapper '__init__' of TypeError object>
__init_subclass__ = <built-in method __init_subclass__ of type object>
__le__ = <method-wrapper '__le__' of TypeError object>
__lt__ = <method-wrapper '__lt__' of TypeError object>
__ne__ = <method-wrapper '__ne__' of TypeError object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of TypeError object>
__reduce_ex__ = <built-in method __reduce_ex__ of TypeError object>
__repr__ = <method-wrapper '__repr__' of TypeError object>
__setattr__ = <method-wrapper '__setattr__' of TypeError object>
__setstate__ = <built-in method __setstate__ of TypeError object>
__sizeof__ = <built-in method __sizeof__ of TypeError object>
__str__ = <method-wrapper '__str__' of TypeError object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__suppress_context__ = False
__traceback__ = <traceback object>
args = ("arguments did not match any overloaded call:\n Q...dardItem): argument 1 has unexpected type 'float'",)
with_traceback = <built-in method with_traceback of TypeError object>
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 80, in tabChanged
self.t[self.currentTab].unselected()
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 978, in unselected
self.stopSampling()
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1026, in stopSampling
self.caller.t['inspector'].refreshItems(self.currentWidget, currentWindow)
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1288, in refreshItems
self.loadTreeItems(win, 0, 'topLevelWidgets', None, currentItem)
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1753, in loadTreeItems
self.loadTreeItems(cObj, depth + 1, 'children', item, currentItem)
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1753, in loadTreeItems
self.loadTreeItems(cObj, depth + 1, 'children', item, currentItem)
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1745, in loadTreeItems
item = self.setItem(cObj, parentItem, depth, cObjType)
File "C:\Users\EyeOd\AppData\Roaming\krita\pykrita\PluginDevTools\PluginDevToolsWidget.py", line 1772, in setItem
QStandardItem( text )
TypeError: arguments did not match any overloaded call:
QStandardItem(): too many arguments
QStandardItem(str): argument 1 has unexpected type 'float'
QStandardItem(QIcon, str): argument 1 has unexpected type 'float'
QStandardItem(int, columns: int = 1): argument 1 has unexpected type 'float'
QStandardItem(QStandardItem): argument 1 has unexpected type 'float'
I pushed a fix, tell me if the fix still gets any errors