It is hard to understand what you are saying but your code where you add new tab is wrong. For what do you need new QTabBar?
It should be like this:
Qt Code:
  1. main_tab_widget->insertTab(0, new plcconfiguration(main_tab_widget), "PLC");
  2. main_tab_widget->setCurrentIndex(0);
To copy to clipboard, switch view to plain text mode