PDA

View Full Version : Toolbar



assismvla
17th July 2008, 17:08
sorry, because my english is not very well.

I have a toolbar in my app. and I want to put a icon in the right side of the toolbar , near the close button (X) at the form.

what should I do ?

thanks !

jpn
17th July 2008, 18:42
QWidget* stretchWidget = new QWidget(toolBar);
stretchWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

toolBar->addAction(...); // actions before stretch
toolBar->addWidget(stretchWidget); // stretch
toolBar->addAction(...); // actions after stretch

PS. Please search the forums. This has been asked before.