I have a QMap defined as
QMap<QString, QString> design;
QMap<QString, QString> design;
To copy to clipboard, switch view to plain text mode
and that (in part) am populating with the following:
foreach
(QTabWidget *tab, ui
->MainWidget
->findChildren<QTabWidget
*>
()) { design.
insert(tab
->objectName
() + ".index",
QString::number(tab
->currentIndex
()));
// design.insert(tab->objectName() + ".string", tab->currentWidget()->objectName());
}
foreach (QTabWidget *tab, ui->MainWidget->findChildren<QTabWidget*>()) {
design.insert(tab->objectName() + ".index", QString::number(tab->currentIndex()));
// design.insert(tab->objectName() + ".string", tab->currentWidget()->objectName());
}
To copy to clipboard, switch view to plain text mode
The first line in the foreach loop saves the currentIndex of the corresponding tab as a QString value using a key formed by the tab's objectName + ".index". The purpose of the second line is to save the currentTabText property of the currently selected tab but I can't seem to find the appropriate property, i.e., tab->currentTabText() does not exist. The above is an attempt in lieu of this missing property.
Is there another route that I can use to access the currentTabText via the above?
Thanks!
Bookmarks