Qt Code:
  1. tabBar_[tabIndex].setObjectName("Tab_" + QString::number(docketIndex+1) + "_Control");
  2. // This code compiles fine, but gives SEGMENTATION FAULT error.
To copy to clipboard, switch view to plain text mode 

I don't see how this code compiles. QTabBar does not have an operator[](int) method, and even if it did, it would return a pointer to some QWidget class which would be dereferenced using the "->" operator, not ".".

In any case, the individual tabs on a QTabBar are not widgets, so you cannot set an object name for them. If you need to set some unique identifier for them (other than the name that is displayed on the tab), then you could try using the QTabBar::setTabData() method, using the tab index and a QString as the QVariant data to be set.

Note that the QTabBar::tabButton() method does not return a QWidget representing the tab; it is a QWidget that the program places there using a call to QTabBar::setTabButton() and is a functional decoration in addition to the tab label and icon. The QTabBar simply manages and draws this widget.