Solved How to Insert different window within tabwidget of mainwindow
-
Hi have two gui in my application
- In my mainwindow, i have tab widget.
- 1st tab contains some widget.
- i want to display new window(my second gui) inside 2nd tab of mainwindow
I am unable to figure it out how get second gui insde 2nd tab of mainwindow.
-
@Shankar-B said in How to Insert different window within tabwidget of mainwindow:
i want to display new window(my second gui) inside 2nd tab of mainwindow
You want to show a window inside another window?
Are you talking about MDI or do I misunderstand you? -
Hi jsulm,
I want to show window inside tabwidget of mainwindow -
@Shankar-B A window is usually not inside another window - that's why it is called window. Do you maybe mean that you want to show a widget in your tabwidget? You should really use correct terminology and explain exactly what you want to do.
-
Sorry for mistake.How to show widget in side tabwidget.
-
@Shankar-B said in How to Insert different window within tabwidget of mainwindow:
How to show widget in side tabwidget
Take a look at this example: https://doc.qt.io/qt-5/qtwidgets-dialogs-tabdialog-example.html
Especially this part:TabDialog::TabDialog(const QString &fileName, QWidget *parent) : QDialog(parent) { QFileInfo fileInfo(fileName); tabWidget = new QTabWidget; tabWidget->addTab(new GeneralTab(fileInfo), tr("General")); tabWidget->addTab(new PermissionsTab(fileInfo), tr("Permissions")); tabWidget->addTab(new ApplicationsTab(fileInfo), tr("Applications"));
Here GeneralTab, PermissionsTab and ApplicationsTab are widgets (derived from QWidget).