1 : I find out the QDirModel will not update until you call "refresh"
2 : even I do not setup the model for the view, rename the files will affect
the main thread(GUI) seriously.No wonder why even I rename the files
on another thread, the GUI still stall.
int main( int argc, char **argv )
{
QFileSystemModel model;
QString const rootPath
= "E:/file_test/very big";
model.setRootPath(rootPath);
//I haven't set any model for The view, but the program still
//crash if I rename 8448 of my jpg files by other program
splitter.addWidget(&view);
splitter.show();
return app.exec();
}
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QFileSystemModel model;
QString const rootPath = "E:/file_test/very big";
model.setRootPath(rootPath);
QTableView view;
//I haven't set any model for The view, but the program still
//crash if I rename 8448 of my jpg files by other program
QSplitter splitter;
splitter.addWidget(&view);
splitter.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
There are still more than 1XX pages of the model/view architecture I have to studied(advanced Qt programming)
I hope I could know how to prevent the automatic "refresh" function of the QFileSystemModel after
I finish the chapter 4, 5, 6 in the book
QDirModel is not a good solution, but looks like it could solve my problem for now.
Never expect that customize the model/view of Qt4 could be so complicated(2XX pages to study)
And I am still a newbie of Qt...
Bookmarks