i have QCompleter and when i start completion i need to get current(first) item from popup list.

some code :
Qt Code:
  1. //CompleterModel == QStandardItemModel
  2. //mComplet is QCompleter
  3. //
  4. showCompleter();
  5. if (mComplet->popup()->isVisible())
  6. {
  7. QModelIndex index = mComplet->popup()->currentIndex();
  8. if (index.isValid())
  9. {
  10. CompleterModel* model = (CompleterModel*)mComplet->model();
  11. if (model)
  12. {
  13. QStandardItem* item = model->itemFromIndex(index);
  14. if (item)
  15. cout <<"item OK"<<endl;
  16. else
  17. cout <<"item Error"<<endl;
  18. }
  19. }
To copy to clipboard, switch view to plain text mode 
so this function return "item Error" -- what's wrong?? (i think problem from completer sorting, but how to get proxy model?