Question

I'm trying to stretch QProgressBar to fill with QTableWidgetItem, I have not found any solution about this, do anyone know how? Thanks!

...
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
...
QProgressBar *bar = new QProgressBar(ui->tableWidget);
ui->tableWidget->setCellWidget(0, 0, bar);

What should I do to make QProgressBar to fit on QTableWidgetItem? My problem is related to this.

Was it helpful?

Solution

If I understand your problem correctly, that blank area is where the % value will go. You can hide it with bar->setTextVisible(false). You can also try to change its position with stylesheets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top