How to recent signal from proxyModel to model?
Solved
General and Desktop
-
Hello, i have next problem "QObject::connect(QItemSelectionModel, mainForm): invalid null parameter"
I just tried to connect signal, want to make some manipulations with form on selection, my code:
connect(tbSC->selectionModel(), &QItemSelectionModel::selectionChanged, this, &mainForm::enableButtons); void mainForm::enableButtons(const QItemSelection &selected, const QItemSelection &) { foreach(QModelIndex index, selected.indexes()) { if(mdlSC->Columns[index.row()][0].toString()=="") continue; else { ui->btnMS->setEnabled(true); break; } } }
slot is not called
I have next structure:
tbSC = new tableSM(this); proxySM = new ProxyModelSM(tbSC); mdlSC = new modelSM(proxySM); ... proxySM->setSourceModel(mdlSC); tbSC->setModel(proxySM);
class tableSM : public QTableView
class modelSM : public QAbstractTableModel
class ProxyModelSM : public QSortFilterProxyModelI think i must make smth like mapToSource, but idk how it make with signals, please help
-
@zloi_templar said in How to recent signal from proxyModel to model?:
connect(tbSC->selectionModel(), &QItemSelectionModel::selectionChanged, this, &mainForm::enableButtons);
Sounds like tbSC->selectionModel() returns a null pointer