How to remove an icon from a QTabWidget?
Unsolved
General and Desktop
-
I've got QTabWidgets which are getting little icons, as per https://doc.qt.io/qt-5/qtabwidget.html#setTabIcon
However there are situations where I want to remove the icon, so the tab goes back to what it looked like before the icon was set.
With PyQt5 if I do
thisWidget.setTabIcon(None)
it fails, with the errorargument 2 has unexpected type 'NoneType'
.If it's not None, then what should I be feeding to setTabIcon() in order to remove the icon please? Is there some method like removeTabIcon() which I haven't found?
Thanks
-
@donquibeats Did you try to set a null icon? You can construct one using default constructor: https://doc.qt.io/qt-5/qicon.html#QIcon
-
That works, thanks. I should've thought of trying
thisWidget.setTabIcon(QIcon())