From ec7057eb78c74a2d79202b78d29796cbdcf9f7d4 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 6 Jul 2012 12:29:36 +0200 Subject: [PATCH 1/2] Use copy ctor instead of conversion through QChar* Versions of Qt < 4.7 do not have a QString constructor from QChar* without specifying the size of the string. However, since the QString is copy-on-write, the QString object can be passed to the copy constructor of the return value directly! --- ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp index 696198fbb3..efdb089621 100644 --- a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp @@ -295,7 +295,7 @@ QString RifEclipseOutputFileTools::fileNameByType(const QStringList& fileSet, ec int reportNumber = -1; if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType) { - return QString(fileSet.at(i).data()); + return fileSet.at(i); } } @@ -319,7 +319,7 @@ QStringList RifEclipseOutputFileTools::fileNamesByType(const QStringList& fileSe int reportNumber = -1; if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType) { - fileNames.append(QString(fileSet.at(i).data())); + fileNames.append(fileSet.at(i)); } } From 0d17997eb3e08552caf48c31eb9ca7de20359140 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 6 Jul 2012 12:33:54 +0200 Subject: [PATCH 2/2] Probe only for OpenGL levels available in this Qt version Each version of Qt supports a set of OpenGL levels; the level displayed to the user is only as high as what was supported at compile-time. Hence it should be harmless to degrade gracefully to previous Qt versions. --- VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp b/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp index fd168a5e5c..ecd353f497 100644 --- a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp +++ b/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp @@ -347,10 +347,13 @@ QString BasicAboutDialog::openGLVersionString() const QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags(); - if (flags & QGLFormat::OpenGL_Version_4_0 ) versionString += "4.0"; + if (false) ; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) + else if (flags & QGLFormat::OpenGL_Version_4_0 ) versionString += "4.0"; else if (flags & QGLFormat::OpenGL_Version_3_3 ) versionString += "3.3"; else if (flags & QGLFormat::OpenGL_Version_3_2 ) versionString += "3.2"; else if (flags & QGLFormat::OpenGL_Version_3_1 ) versionString += "3.1"; +#endif /* QT_VERSION > 4.7 */ else if (flags & QGLFormat::OpenGL_Version_3_0 ) versionString += "3.0"; else if (flags & QGLFormat::OpenGL_ES_Version_2_0 ) versionString += "ES_Version 2.0"; else if (flags & QGLFormat::OpenGL_ES_CommonLite_Version_1_1) versionString += "ES_CommonLite_Version 1.1";