Ehm, why not? QTabWidget::addPage() takes a pointer to a QWidget and since QMainWindow inherits QWidget it is perfectly possible.
Hmm, when I add the QmainWindow with addTab(), it works fine indeed, thanks.
I had the same idea, too, but tried to add it to an existing tab by setting the tabs wiget as parent:
QMainWindow *mw = new QMainWindow( myTabWidget->widget( tabNr ) )
For QWidgets, that's enough to embedd the content into the tab. But QMainWindows are still shown as separate windows...
Is there something else I have to do to embedd them ? Is there a deeper reason (apart from the fact that they are different classes) why QWidgets and QMainWindows behave differently here ?
Bookmarks