Solved Docking QTabWidget to top of main window?
-
I'm trying to make a quick and simple ribbon bar at the top side of the main window. I'm trying to use QTabWidget to do this. However the QTabWidget does not seem to dock (and fix) to the main window. How do I dock the QTabWidget and let it stay there on top of anything? Thank you.
-
@Pauly
Hi
Only Docks can , well, dock.http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html
Im not sure if u really mean dock or just place.
-
Did you use something like follows ?
QDockWidget * dockWidget=new QDockWidget ;
dockWidget->setFeatures(QDockWidget::AllDockWidgetFeatures);
dockWidget.setWidget(tabWidget)
mainWindows.dockWidget(dockWidget) -
Thanks for the quick reply. Yes, silly me... I was trying to dock the tab widget directly instead of putting it inside a dock widget for docking. Thanks!