I have some QWidget (QLineEdit), and I would like to align it to the right of my QToolbar.
Is there any simple way to do it?
Try putting a spacer widget before it:
QToolBar* toolBar = new QToolBar("Toolbar");
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolBar->addWidget(spacer);
// now add your actions or widgets after the spacer widget