Hi! I have exactly the same problem. My code works fine under cygwin, but crashes with the same assertion under windows. The index I receive from indexAt() or currentIndex() is valid, I can call fileName(), but when I call filePath() I get the following assertion:
ASSERT: "index.model() == q" in file dialogs/qfilesystemmodel.cpp, line 1301
{
QModelIndex index
= indexAt
(event
->pos
());
//this->currentIndex(); QFileSystemModel mod;
qDebug() << index.isValid();
qDebug() << mod.fileName(index);
qDebug() << mod.filePath(index);
}
void TreeView::contextMenuEvent(QContextMenuEvent *event)
{
QModelIndex index = indexAt(event->pos()); //this->currentIndex();
QFileSystemModel mod;
qDebug() << index.isValid();
qDebug() << mod.fileName(index);
qDebug() << mod.filePath(index);
}
To copy to clipboard, switch view to plain text mode
Any ideas?
Bookmarks