Quote Originally Posted by Maxilys
Qt Code:
  1. const QToolBox* tb = (const QToolBox*) widget;
  2. int count = tb->count();
  3. int index = tb->indexOf( (QWidget*)widget );
To copy to clipboard, switch view to plain text mode 
It looks like you are trying to get the index of the toolbox itself (widget == tb). In the third line you should use the variable that points to the tab instead of widget.