Qt Code:
  1. QWidget* stretchWidget = new QWidget(toolBar);
  2. stretchWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  3.  
  4. toolBar->addAction(...); // actions before stretch
  5. toolBar->addWidget(stretchWidget); // stretch
  6. toolBar->addAction(...); // actions after stretch
To copy to clipboard, switch view to plain text mode 
PS. Please search the forums. This has been asked before.