Stop disabled tab from greying out icon
-
Hello,
I have a QTabWidget containing multiple different tabs each having their own icons. I have disabled 1 of these tabs using setTabEnabled() but the icon within the tab is now greyed out, is there any way to prevent the icon from being greyed out while still having the tab be disabled?
The code I use to disable the tab and set the icon:
ui->tabWidget->setTabEnabled(0, false); QIcon QMI_logo; QMI_logo.addPixmap(QPixmap(":/images/Images/MI_LOGO_SMALL.svg"), QIcon::Normal); ui->tabWidget->setTabIcon(0,QMI_logo);
Thank you.
-
Hello,
I have a QTabWidget containing multiple different tabs each having their own icons. I have disabled 1 of these tabs using setTabEnabled() but the icon within the tab is now greyed out, is there any way to prevent the icon from being greyed out while still having the tab be disabled?
The code I use to disable the tab and set the icon:
ui->tabWidget->setTabEnabled(0, false); QIcon QMI_logo; QMI_logo.addPixmap(QPixmap(":/images/Images/MI_LOGO_SMALL.svg"), QIcon::Normal); ui->tabWidget->setTabIcon(0,QMI_logo);
Thank you.
@TimoKn
Not ideal, but if nobody suggests a way of tellingQTabWidget
not to show disabled tabs' icons as disabled I think you could addQMI_logo.addPixmap(QPixmap(":/images/Images/MI_LOGO_SMALL.svg"), QIcon::Disabled);
to make it use that explicitly as-is (instead of greying it) for the
Disabled
state? -
@TimoKn
Not ideal, but if nobody suggests a way of tellingQTabWidget
not to show disabled tabs' icons as disabled I think you could addQMI_logo.addPixmap(QPixmap(":/images/Images/MI_LOGO_SMALL.svg"), QIcon::Disabled);
to make it use that explicitly as-is (instead of greying it) for the
Disabled
state? -