in each tab in my QTabWidget, I have an array. For each tab I define a class named "TabView" that contain this array and a QGraphicsScene to draw line on it and some other element. When I open a new tab I do this by my class TabView like this:
void MainWindow::on_actionOpen_triggered(){
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath());
if (!fileName.isEmpty()) {
tabView = new TabView(fileName);
ui->tabWidget->addTab(tabView,"someTab");
QFileInfo fileInfo = fileName;
ui->tabWidget->setTabText(ui->tabWidget->count()-1,fileInfo.baseName());
ui->tabWidget->setCurrentIndex(ui->tabWidget->count()-1);
}
There is a button outside of QTabWidget. I want by click this button store each array on each tab in a 2D array. but I just access to last opened tab array.
tabsArray[index] = tabView->getArray();
I need something like this:
tabWidget->tab(index)->getArray()
Any idea is really appreciated. Thank you.