Possible bug: `showView` does not appear to work

Open two documents in Krita, open the scripter and paste this code in:

w=Krita.instance().activeWindow()
print(len(w.views()))
w.showView(w.views()[0])

Press “run” and nothing happens. Replace the 0 with a 1 and try again – still nothing happens. Is this a bug? Is there some workaround I can use to change tab programatically or am I stuck here?

A suitable workaround would be if I could close a view somehow. But I can only close documents and windows AFAICT, not views.

Krita version: 5.2.9

Not sure why Window.showView() doesn’t seem to do anything.
But View.setVisible() seems to work for this, though it might need the window to be activated to take effect.

1 Like

Why thank you, that works perfectly!

I’ll leave this open for a bit, since it may be worth reporting the bug.

I reported the bug: 499777 – `Window.showView` does not appear to work