Well, there are two options:
1st - subclass QTreeView and add a signal with necessary signature or
2nd - catch "clicked" signal and get necessary FileInfo and then emit a signal with this value. Something like this:
...
connect(this,
SIGNAL(clickedFileInfo
(QFileInfo)),ui
->widget,
SLOT(UpdateDetails
(QFileInfo)));
...
{
//obtaining necessary FileInfo by QModelIndex or whatever...
emit clickedFileInfo(obtainedFileInfo);
}
...
...
connect(ui->treeView,SIGNAL(clicked(QModelIndex)), SLOT(handleClick(QModelIndex)));
connect(this,SIGNAL(clickedFileInfo(QFileInfo)),ui->widget, SLOT(UpdateDetails(QFileInfo)));
...
void MyWidget::handleClick(const QModelIndex &index)
{
//obtaining necessary FileInfo by QModelIndex or whatever...
emit clickedFileInfo(obtainedFileInfo);
}
...
To copy to clipboard, switch view to plain text mode
Bookmarks