As d_stranz mentioned, you probably need to loop through all the child widgets.
"mainWidget" here can be anything, either your main window, in which case this code will color all child widgets in your app (this is how you create a "color theme"), or it can be your QTabWidget, in which case it should solve your problem.
// Loop through all child widgets of the main widget and apply the color settings
QList<QWidget*> widgets = mainWidget->findChildren<QWidget*>();
{
w->setPalette(p);
w->update();
}
// Loop through all child widgets of the main widget and apply the color settings
QList<QWidget*> widgets = mainWidget->findChildren<QWidget*>();
foreach (QWidget* w, widgets)
{
w->setPalette(p);
w->update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks