DirModel multithread loading

This commit is contained in:
cutefishd 2021-04-24 01:46:27 +08:00
parent 8879e12625
commit dfa6a29907

View file

@ -85,6 +85,7 @@ FolderModel::FolderModel(QObject *parent)
m_dirModel = new KDirModel(this);
m_dirModel->setDirLister(dirLister);
m_dirModel->setDropsAllowed(KDirModel::DropOnDirectory | KDirModel::DropOnLocalExecutable);
m_dirModel->moveToThread(qApp->thread());
m_selectionModel = new QItemSelectionModel(this, this);
connect(m_selectionModel, &QItemSelectionModel::selectionChanged, this, &FolderModel::selectionChanged);