Here is the answer to your question:
tabWidget->addTab(btn, tr("newTab"));
qDebug() << tabWidget;
qDebug() << btn->parent()->parent();
tabWidget = new QTabWidget(this);
btn = new QPushButton;
tabWidget->addTab(btn, tr("newTab"));
qDebug() << tabWidget;
qDebug() << btn->parent()->parent();
To copy to clipboard, switch view to plain text mode
prints this
QTabWidget(0x51a33a0)
QTabWidget(0x51a33a0)
To copy to clipboard, switch view to plain text mode
btn's parent is QStackedWidget, while the QStackedWidget's parent is tabWidget.
Bookmarks