[SOLVED]How to set the position of progress bar at right corner of statusbar
-
I don't know your specific use case but you could use "a permanent widget":http://qt-project.org/doc/qt-4.8/qstatusbar.html#addPermanentWidget
Which is situated at the right. -
[quote author="adnan" date="1345363580"]@progressBar=new QProgressBar(ui->statusBar);
progressBar->setMaximumSize(170,19);
// position of progress bar should be extreme right
ui->statusBar->addWidget(progressBar);@ [/quote]For some reason mine is at the extreme left:
@
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
progressBar = new QProgressBar(ui->statusBar);
progressBar->setAlignment(Qt::AlignRight);
progressBar->setMaximumSize(180, 19);
ui->statusBar->addWidget(progressBar);
progressBar->setValue(50);
}@
I Guess addPermanentWidget is the ticket.