Deleting needed widget from Layout PyQt / Maya

python
qt
maya

#1

HI Guys, I’m writing quick selection tool for Maya using Python and Qt. And stuck with one thing.
I have an option (context menu) to delete selected widget from layout. But I don’t know how to do it right way.
Deleting by index doesn’t work, cause every time you delete something it reassigns indicies again and I have different indicies each time.
What would be better? Maybe adding every widget to some dictionary and then deleting it by name from this dictionary? Or maybe Qt somehow stores initial name/index permanently ?

Thanks for reply!


#2

I’ve managed to find out how to do it myself through custom Qt signals QtCore.Signal()
And it works !
So question is closed :slight_smile: