Maximize table cell leads to segmentation fault
Unsolved
General and Desktop
-
I have QTableWidget that gets its data from std::vector<MyCustomWidget *mywidget>
I want to make one MyCustomWidget when double clicked to take the full size of QTableWidget and return to its default size when double clicked again.
MyCustomWidget emit this signalemit maximizationRequested(this);
to the QTableWidget
The problem is when I try to maximize the widget with the following codethis->setRowCount(1); this->setColumnCount(1); this->setCellWidget(0,0, maxiWidget); this->resizeColumnsToContents(); this->resizeRowsToContents();
All other MyCustomWidget are destroyed So When I try to access them again It leads to segmentation fault.
I want to keep my vector of MyCustomWidget intact and I shouldn't modify MyCustomWidget what your opinions are? -
Use a QStackedLayout where you show your QTableWidget and another widget where you show your data when double clicked.