Pregunta

On this site there is a picture with two "tab-systems". I would like to have the second one, which is described as "A truncated tab bar shown in the Plastique widget style." There you have arrows, which allow you to slide through the tabs.

I have implented a "tab-system" which looks like this:

QTabWidget *tabWidget = new QTabWidget();

tabWidget->addTab(ToolGroupBox(),"Toolbox");
tabWidget->addTab(CameraGroupBox(),"Camera");
...
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(tabWidget);

As I understand it is possible to create the truncated tabs if I use the tabRect-function of the QTabBar-class. I have tried several things but unfortunately its not working.

¿Fue útil?

Solución

You want the usesScrollButtons property of the QTabBar. You can access the QTabBar of your QTabWidget via the tabBar method.

You don't need to get involved with tabRect at all. The documentation just before the picture of the two tab systems is not directly related to it. The figure is just showing you two possible tab styles.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top