Use nested QTabWidgets
: an outer primary tab which contains its own secondary QTabWidget (where one is necessary).
Since you are after specific look, then there are three possible solutions (ordered by complexity) :
See what you can do with Qt style sheets using nested QTabWidgets. See this answer for some example code, and of course reference in docs.
Forget QTabWidget, write your own, containing custom tab bar, and using a QStackedWidget or just nested QStackedLayout for tab contents. You can nest these custom tabbed widgets like you would with QTabWidget, or just have dynamic two-row tab bar in one non-nested custom tab widget, it's your code now.
Start using QML for UI, perhaps just for a custom tab bar, perhaps for the whole central widget, depending on what you have there.