Exactly how you do the plumbing depends on exactly how you want things arranged. However, it's something along these lines:
- Open your project in Qt Creator
- "Add New...", "Designer Form Class", type is "Main Window", and provide some names to add another QMainWindow derivative to your project. I'll use a class called ThingyTabInnerWindow as an example.
- Design the new inner form.
- Go to the source for the UI class that contains your tab widget (e.g. MainWindow)
- In the constructor (or somewhere else that makes sense) try something like the code below. It's exactly the same as adding any other widget to a tab widget.
#include "thingytabinnerwindow.h"
MainWindow::MainWindow(...) {
setupUi(this); // the main window's Designer UI
...
// Patch in your inner window using the Designer created class
ThingyTabInnerWindow *tTIW = new ThingyTabInnerWindow(this);
ui->tabWidget->addTab(tTIW, tr("Thingy Tab Heading"));
// connect any inner window signals to slots as needed
...
}
#include "thingytabinnerwindow.h"
MainWindow::MainWindow(...) {
setupUi(this); // the main window's Designer UI
...
// Patch in your inner window using the Designer created class
ThingyTabInnerWindow *tTIW = new ThingyTabInnerWindow(this);
ui->tabWidget->addTab(tTIW, tr("Thingy Tab Heading"));
// connect any inner window signals to slots as needed
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks