Api call to get and set current selected tool?

I need to retrieve the currently selected tool, but every approach I’ve tried so far only returns memory addresses or similar pointer values.

Sadly i dont think it exists. I have been searching for it too.

I’ve used this workaround made by Grum999 a bunch of times in plugins, tested previously on 5.2.9.

Every tool is part of the toolbox’s button group, so…

from krita import *

qdock = next((w for w in Krita.instance().dockers() if w.objectName() == 'ToolBox'), None)
wobj = qdock.findChild(QButtonGroup)

print (wobj.checkedButton().objectName())

thanx brother ! thats it. :folded_hands::folded_hands::folded_hands: