QDockWidget setTabPosition does not work
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::TopDockWidgetA rea, QTabWidget::TabPosition::North);
Qt::DockWidgetArea::TopDockWidgetArea is not a class or namespace
QTabWidget::TabPosition is not a class or namespace.
Thanks.
Re: QDockWidget setTabPosition does not work
Try this
setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::VerticalTabs);
Re: QDockWidget setTabPosition does not work
Quote:
Originally Posted by
Cassilio
In the examples, provided by Qt (dockwindgets.pro), I can access the setTabPosition method but compiler returns:
Code:
ui
->setTabPosition
(Qt
::DockWidgetArea::TopDockWidgetArea,
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.
Code:
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.
Re: QDockWidget setTabPosition does not work
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.
Re: QDockWidget setTabPosition does not work
Indeed. Didn't notice that the poster before me had resurrected the thread
simonWirex's suggestion is not the answer either.