Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. QAbstractItemModel * model = ui->treeView->model();
  2. m_proxyModel = new FilterProxyModel(this);
  3. m_proxyModel->setSourceModel(ui->treeView->model());
  4. ui->treeView->setModel(m_proxyModel);
  5.  
  6. string currentType = model->data(model->index(row, CONFUSION_COLUMN),Qt::DisplayRole).toString().toUtf8().constData();
  7.  
  8. QModelIndex FilterProxyModel::mapToSource(const QModelIndex &proxy) const {
  9. if(!proxy.isValid()){
  10. return QModelIndex();
  11. }
  12. return sourceModel()->index(proxy.row(), proxy.column(), proxy.parent() ) ;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement