You will need to subclass QTabWidget and QTabBar. In the reimplemented version of QTabBar you can changed the color of any tab.

Use the protected function - setTabBar() of QTabWidget to set your custom tab.