PDA

View Full Version : QDockWidget setTabPosition does not work



Cassilio
8th September 2014, 19:14
Hi all.

I am trying to set tabs on top when QDockWidgets are tabified. However, if I use QtCreator and generate a widget project, I don't have access to setTabPosition.

In the examples, provided by Qt (dockwindgets.pro), I can access the setTabPosition method but compiler returns:

ui->setTabPosition(Qt::DockWidgetArea::TopDockWidgetAr ea, QTabWidget::TabPosition::North);

Qt::DockWidgetArea::TopDockWidgetArea is not a class or namespace
QTabWidget::TabPosition is not a class or namespace.

Thanks.

simonWirex
9th August 2015, 12:56
Try this

setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::VerticalTabs);

ChrisW67
9th August 2015, 22:53
In the examples, provided by Qt (dockwindgets.pro), I can access the setTabPosition method but compiler returns:


ui->setTabPosition(Qt::DockWidgetArea::TopDockWidgetAr ea, QTabWidget::TabPosition::North);

Qt::DockWidgetArea::TopDockWidgetArea is not a class or namespace
QTabWidget::TabPosition is not a class or namespace.

QDockwidget does not have a setTabPosition() member function. I am assuming the ui object is a QMainWindow. Fix your syntax and all should be well.


ui->setTabPosition(Qt::TopDockWidgetArea, QTabWidget::North );

If the code posted actually came from an "example provided by Qt" then you should log it is a bug against Qt specifying exactly where it exists.

Kryzon
10th August 2015, 00:09
You're replying to a year old post.
In my opinion there's nothing wrong with providing a solution to an open problem, obviously, it's just that you're writing as if he's still looking for the answer.

ChrisW67
10th August 2015, 04:18
Indeed. Didn't notice that the poster before me had resurrected the thread
simonWirex's suggestion is not the answer either.