I didn't misinterpret your question, I misinterpreted the documentation for the function. I expected a way to influence the behavior of the QTabBar but couldn't find any either.
I didn't misinterpret your question, I misinterpreted the documentation for the function. I expected a way to influence the behavior of the QTabBar but couldn't find any either.
I'm struggling with this as well in 4.5.2. I've added a second QDockWidget to the main window and successfully tabbed it as I desire using QMainWindow::tabifyDockWidget. However, the last dock widget added is NEVER selected. In my application the new dock widget represents the last open file so I always want that one to be active. I have tried using raise(), activateWindow(), and show(). Nothing has worked. I also tried reversing the order that the dock widgets are listed in my call to QMainWindow::tabifyDockWidget. I've tried calling raise() before tabifying the dock widget. Nothing is allowing me to programatically select a specific tabbed dock widget.
Has anyone found a solution or workaround for this problem? It's going to be a major annoyance to my users for them to have to select that tab in order to see the last file they opened.
Thanks
I've found a solution. If you want to put created dock widget in a foreground tab, you should do this:
main_window->tabifyDockWidget(old_dock_widget, new_dock_widget);
QApplication::processEvents();
new_dock_widget->raise();
Bookmarks