问题 I have a QTabWidget like this one: But I want to expand the tabs to "fill" the entire widget width, like this: How can I do that? I am using Qt 5.3.2 and Qt Creator 3.2.1 Update : I tried to use the setExpanding function: ui->myTabWidget->tabBar()->setExpanding(true); But it didn't work. 回答1: I found that QTabBar has a setExpanding method, which appears to do exactly what you want, but I tried it (on Windows), and it doesn't work. This is the code: ui->tabWidget->tabBar()->setExpanding (true)