Commit 0fc18188 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

QCMakeWidgets: replace QDirModel

parent 736fb342
......@@ -4,9 +4,9 @@
#include <utility>
#include <QDirModel>
#include <QFileDialog>
#include <QFileInfo>
#include <QFileSystemModel>
#include <QResizeEvent>
#include <QToolButton>
......@@ -88,20 +88,20 @@ void QCMakePathEditor::chooseFile()
}
}
// use same QDirModel for all completers
static QDirModel* fileDirModel()
// use same QFileSystemModel for all completers
static QFileSystemModel* fileDirModel()
{
static QDirModel* m = nullptr;
static QFileSystemModel* m = nullptr;
if (!m) {
m = new QDirModel();
m = new QFileSystemModel();
}
return m;
}
static QDirModel* pathDirModel()
static QFileSystemModel* pathDirModel()
{
static QDirModel* m = nullptr;
static QFileSystemModel* m = nullptr;
if (!m) {
m = new QDirModel();
m = new QFileSystemModel();
m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
}
return m;
......@@ -110,7 +110,7 @@ static QDirModel* pathDirModel()
QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs)
: QCompleter(o)
{
QDirModel* m = dirs ? pathDirModel() : fileDirModel();
QFileSystemModel* m = dirs ? pathDirModel() : fileDirModel();
this->setModel(m);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment