I'm using sub-classed QGraphicsView's in an MDIArea I want to be able to change the icon of the window from 'within' the object, but it just seems to ignore me... no errors or warnings... it just doesn't do it.
if self.world.is_dirty:
self.setWindowIcon( QtGui.QIcon ( 'images/dirty.png' ) )
self.setWindowTitle('dirty')
else:
self.setWindowIcon( QtGui.QIcon ( 'images/clean.png' ) )
self.setWindowTitle('clean')
Using the above, the WindowTitle changes perfectly and as expected, but the icon remains stubbornly fixed as the MainWindow icon. I thought it might be stuggling with the QIcon, but I've checked the isNull() and that's false.. so not Null.
As I test, I tried the changing the icon from the MainWindow object and that works fine...
self.mdiArea.activeSubWindow().setWindowIcon(QtGui.QIcon ('images/dirty.png'))
So why is it ignoring me when i try it from the View?