i'm showing a dir content by:

Qt Code:
  1. QDirModel *model = new QDirModel;
  2. QTreeView *tree = new QTreeView();
  3. tree->setModel(model);
  4. tree->setRootIndex(model->index(QDir::currentPath()));
  5. layout->addWidget(tree,0,0,1,1);
To copy to clipboard, switch view to plain text mode 

And the question is - how to "run" a file whith is clicked in application depend of the filetype (example like in windows)