summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-15 14:22:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-15 14:22:31 (GMT)
commit268aaf4d5857b8230d6e849b42d2ba1a10bdfc2d (patch)
tree19197d00ef081041dcb793f34a6668ed798c030a /Source
parent148a5c2d42059289f2af3376b844ba53b5e12f13 (diff)
parent0fc181883127f77401ac4b6686c7016ee7752876 (diff)
downloadCMake-268aaf4d5857b8230d6e849b42d2ba1a10bdfc2d.zip
CMake-268aaf4d5857b8230d6e849b42d2ba1a10bdfc2d.tar.gz
CMake-268aaf4d5857b8230d6e849b42d2ba1a10bdfc2d.tar.bz2
Merge topic 'avoid-qt5-deprecation-warnings'
0fc1818831 QCMakeWidgets: replace QDirModel 736fb34294 QCMake: use loadRelaxed if available Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4894
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/QCMake.cxx4
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx18
2 files changed, 13 insertions, 9 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index a631404..f0b967b 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -340,7 +340,11 @@ void QCMake::interrupt()
bool QCMake::interruptCallback()
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
return this->InterruptFlag.load();
+#else
+ return this->InterruptFlag.loadRelaxed();
+#endif
}
void QCMake::progressCallback(const std::string& msg, float percent)
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 332a770..d16ea58 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -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);
}