How to connect QStandardItem checkbox to a slot
Solved
General and Desktop
-
Requires Qt >= 5.11
connect(model,&QAbstractItemModel::dataChanged,[](const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles){ if(!roles.isEmpty() && !roles.contains(Qt::CheckStateRole)) return; for(int i=topLeft.row();i<=bottomRight.row();++i){ for(int j=topLeft.column();j<=bottomRight.column();++j){ qDebug() << "CheckBox Changed: Item data" << topLeft.model()->index(i,j,topLeft.parent()).data(); } } });