focus thems in Qtoolbar
General and Desktop
7
Posts
2
Posters
1.7k
Views
2
Watching
-
This is the pincture , i work with qt4 i want to center QAction exist in QtoolBar
http://server.mediazain.com/capture.png -
This is the pincture , i work with qt4 i want to center QAction exist in QtoolBar
http://server.mediazain.com/capture.png -
@AichaDev Ok. You can add dummy widget or spacers before and after. Something like this
QToolBar *toolBar = addToolBar(("Toolbar")); QWidget *spacer1 = new QWidget(this); spacer1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); spacer1->setVisible(true); QWidget *spacer2 = new QWidget(this); spacer2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); spacer2->setVisible(true); QAction *act = new QAction("Item", this); toolBar->addWidget(spacer1); toolBar->addAction(act); toolBar->addWidget(spacer2);This code will add action named
Itemand the rest will move it to center.