Try describing your problem again in some simpler words and proper sentences. It is hard to understand what you have, what you need and what doesn't work.
I have catalog where only one file:
My program display it via QTreeView + QDirModel:
But I need display second file in QTreeView without creation this file:
I think modification method insertRow () and then manually add it:
insertRow( 1, rootIndex );
setData
( this
->index
( 1,
0, rootIndex
),
QVariant("N:/File2.txt"), FilePathRole
);
setData
( this
->index
( 1,
0, rootIndex
),
QVariant("File2.txt"), FileNameRole
);
insertRow( 1, rootIndex );
setData( this->index( 1, 0, rootIndex), QVariant("N:/File2.txt"), FilePathRole);
setData( this->index( 1, 0, rootIndex), QVariant("File2.txt"), FileNameRole);
To copy to clipboard, switch view to plain text mode
But I`am don’t know how modification method:
bool insertRow ()
{
……
}
bool insertRow ()
{
……
}
To copy to clipboard, switch view to plain text mode
Bookmarks