double clic sur un QlistView?
bonjour,
j'ai faits une liste de fichier dans un dock ainsi :
Code:
1 2 3 4
| model = new QDirModel();
CurPath= new QDir()
tree = new QListView(this);
tree->setRootIndex(model->index(CurPath->currentPath())); |
j'ai ajouter un bouton pour pouvoir remonter d'un niveau en créant mon propre slot :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| void DockExplorer::GoToParent()
{
if (CurPath->isRoot())
{
cout<<endl<<"Warning: ne peut remonter au parent car il semblerait qu'on soit dans le dossier root"<<endl;
return;
}
cout<<endl<<"Path avant: "<<CurPath->path().toStdString()<<endl;
CurPath->cdUp();
cout<<endl<<"Path après: "<<CurPath->path().toStdString()<<endl;
tree->setRootIndex(model->index(CurPath->path()));
} |
et maintenant je cherche a descendre dans l'arborescence en double cliquant sur un dossier. je vois comment procèder pour naviger, mais je n'arrive pas à trouver quel signal il faut lire.
Donc ma question est comment on réagit au double clic sur un item d'un QListView ?