Important: Please read the Qt Code of Conduct -

QTabWidget - Icons disappear when tab selected

  • Hi all,

    I am using Ui Designer. I am building a QTabWidget. I have added my icons to the tabs, and added an icon for each state, yet when built when the tab is selected, it goes grey and the icon disappears. I could mess about with this for a few hours and make it work, however, i want to know if there is something I am missing in UI designer.

    Any suggestions?

  • Code, we need code!!! More code.

    1. In which way do you link icon (absolute way or resource) - maybe icon's way is broken.
    2. Maybe you have some external code which remove it (review yourself).

  • Hi, sorry, the functionality was created entirely with UI designer so below I include my ui file
    to answer your question, I am using a resource file for the icons

    Below is my UI file

    @<widget class="QWidget" name="tab_2">
    <attribute name="icon">
    <iconset resource="Icons.qrc">

Log in to reply