mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3752 ResInsight code changes to build on both Qt4 and Qt5
This commit is contained in:
parent
ddb546d877
commit
5c66b901c3
@ -97,7 +97,7 @@ bool RiaArgumentParser::parseArguments()
|
|||||||
#if defined(_MSC_VER) && defined(_WIN32)
|
#if defined(_MSC_VER) && defined(_WIN32)
|
||||||
RiaApplication::instance()->showFormattedTextInMessageBox(helpText);
|
RiaApplication::instance()->showFormattedTextInMessageBox(helpText);
|
||||||
#else
|
#else
|
||||||
fprintf(stdout, "%s\n", helpText.toAscii().data());
|
fprintf(stdout, "%s\n", helpText.toLatin1().data());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
@ -123,7 +123,11 @@ QWidget* RicSummaryCurveCalculatorEditor::createWidget(QWidget* parent)
|
|||||||
m_pdmTableView->enableHeaderText(false);
|
m_pdmTableView->enableHeaderText(false);
|
||||||
|
|
||||||
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
verticalHeader->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
#else
|
||||||
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_pdmTableView->tableView()->resizeColumnsToContents();
|
m_pdmTableView->tableView()->resizeColumnsToContents();
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ void RifCaseRealizationParametersReader::parse()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!RiaStdStringTools::isNumber(strValue.toStdString(), QLocale::c().decimalPoint().toAscii()))
|
if (!RiaStdStringTools::isNumber(strValue.toStdString(), QLocale::c().decimalPoint().toLatin1()))
|
||||||
{
|
{
|
||||||
throw FileParseException(QString("RifEnsembleParametersReader: Invalid number format in line %1").arg(lineNo));
|
throw FileParseException(QString("RifEnsembleParametersReader: Invalid number format in line %1").arg(lineNo));
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ void RifCaseRealizationRunspecificationReader::parse()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!RiaStdStringTools::isNumber(paramStrValue.toStdString(), QLocale::c().decimalPoint().toAscii()))
|
if (!RiaStdStringTools::isNumber(paramStrValue.toStdString(), QLocale::c().decimalPoint().toLatin1()))
|
||||||
{
|
{
|
||||||
throw FileParseException(QString("RifEnsembleParametersReader: Invalid number format in line %1").arg(xml->lineNumber()));
|
throw FileParseException(QString("RifEnsembleParametersReader: Invalid number format in line %1").arg(xml->lineNumber()));
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ bool RifCsvUserDataParser::parseColumnBasedData(const AsciiDataParseOptions& par
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (parseOptions.assumeNumericDataColumns || RiaStdStringTools::isNumber(colData, parseOptions.locale.decimalPoint().toAscii()))
|
if (parseOptions.assumeNumericDataColumns || RiaStdStringTools::isNumber(colData, parseOptions.locale.decimalPoint().toLatin1()))
|
||||||
{
|
{
|
||||||
col.dataType = Column::NUMERIC;
|
col.dataType = Column::NUMERIC;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ void RifEclipseInputFileTools::findKeywordsOnFile(const QString &fileName, std::
|
|||||||
lineLength = data.readLine(buf, sizeof(buf));
|
lineLength = data.readLine(buf, sizeof(buf));
|
||||||
if (lineLength > 0)
|
if (lineLength > 0)
|
||||||
{
|
{
|
||||||
line = QString::fromAscii(buf);
|
line = QString::fromLatin1(buf);
|
||||||
if (line.size() && line[0].isLetter())
|
if (line.size() && line[0].isLetter())
|
||||||
{
|
{
|
||||||
RifKeywordAndFilePos keyPos;
|
RifKeywordAndFilePos keyPos;
|
||||||
@ -400,7 +400,7 @@ void RifEclipseInputFileTools::parseAndReadPathAliasKeyword(const QString &fileN
|
|||||||
qint64 lineLength = data.readLine(buf, sizeof(buf));
|
qint64 lineLength = data.readLine(buf, sizeof(buf));
|
||||||
if (lineLength > 0)
|
if (lineLength > 0)
|
||||||
{
|
{
|
||||||
line = QString::fromAscii(buf);
|
line = QString::fromLatin1(buf);
|
||||||
if (line.size() && (line[0].isLetter() || foundPathsKeyword))
|
if (line.size() && (line[0].isLetter() || foundPathsKeyword))
|
||||||
{
|
{
|
||||||
line = line.trimmed();
|
line = line.trimmed();
|
||||||
|
@ -189,7 +189,7 @@ bool RifEclipseRestartFilesetAccess::results(const QString& resultName, size_t t
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t fileGridCount = ecl_file_get_num_named_kw(m_ecl_files[timeStep], resultName.toAscii().data());
|
size_t fileGridCount = ecl_file_get_num_named_kw(m_ecl_files[timeStep], resultName.toLatin1().data());
|
||||||
|
|
||||||
// No results for this result variable for current time step found
|
// No results for this result variable for current time step found
|
||||||
if (fileGridCount == 0) return true;
|
if (fileGridCount == 0) return true;
|
||||||
|
@ -249,7 +249,7 @@ bool RifEclipseUnifiedRestartFileAccess::results(const QString& resultName, size
|
|||||||
{
|
{
|
||||||
ecl_file_select_block(m_ecl_file, INTEHEAD_KW, static_cast<int>(timeStep * gridCount + i));
|
ecl_file_select_block(m_ecl_file, INTEHEAD_KW, static_cast<int>(timeStep * gridCount + i));
|
||||||
|
|
||||||
int namedKeywordCount = ecl_file_get_num_named_kw(m_ecl_file, resultName.toAscii().data());
|
int namedKeywordCount = ecl_file_get_num_named_kw(m_ecl_file, resultName.toLatin1().data());
|
||||||
for (int iOcc = 0; iOcc < namedKeywordCount; iOcc++)
|
for (int iOcc = 0; iOcc < namedKeywordCount; iOcc++)
|
||||||
{
|
{
|
||||||
std::vector<double> partValues;
|
std::vector<double> partValues;
|
||||||
|
@ -52,7 +52,7 @@ void JsonReader::dumpToFile(std::vector<cvf::Vec3d>& points, QString filePath)
|
|||||||
cvf::Vec3d point = points[idx];
|
cvf::Vec3d point = points[idx];
|
||||||
QString string;
|
QString string;
|
||||||
string.sprintf("(%0.10e, %0.10e, %0.10e)\n", point.x(), point.y(), point.z());
|
string.sprintf("(%0.10e, %0.10e, %0.10e)\n", point.x(), point.y(), point.z());
|
||||||
QByteArray byteArray(string.toAscii());
|
QByteArray byteArray(string.toLatin1());
|
||||||
file.write(byteArray);
|
file.write(byteArray);
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
@ -993,7 +993,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::Por
|
|||||||
{
|
{
|
||||||
std::vector<double> fileValues;
|
std::vector<double> fileValues;
|
||||||
|
|
||||||
size_t numOccurrences = ecl_file_get_num_named_kw(m_ecl_init_file, result.toAscii().data());
|
size_t numOccurrences = ecl_file_get_num_named_kw(m_ecl_init_file, result.toLatin1().data());
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < numOccurrences; i++)
|
for (i = 0; i < numOccurrences; i++)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,12 @@
|
|||||||
|
|
||||||
#include "cafFactory.h"
|
#include "cafFactory.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QtWidgets/qerrormessage.h>
|
||||||
|
#include <QtWidgets/qmdisubwindow.h>
|
||||||
|
#else
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
#endif
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "RiuCursors.h"
|
#include "RiuCursors.h"
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtGui/QBitmap>
|
#include <QBitmap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGui/QCursor>
|
#include <QCursor>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,8 +57,12 @@ RiuEditPerforationCollectionWidget::RiuEditPerforationCollectionWidget(QWidget*
|
|||||||
m_pdmTableView->setChildArrayField(&(m_perforationCollection->m_perforations));
|
m_pdmTableView->setChildArrayField(&(m_perforationCollection->m_perforations));
|
||||||
|
|
||||||
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
||||||
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
verticalHeader->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
#else
|
||||||
|
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
||||||
|
#endif
|
||||||
m_pdmTableView->tableView()->resizeColumnsToContents();
|
m_pdmTableView->tableView()->resizeColumnsToContents();
|
||||||
|
|
||||||
// Set active child array to be able to use generic delete
|
// Set active child array to be able to use generic delete
|
||||||
|
@ -75,8 +75,11 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
|||||||
m_pdmTableView->setChildArrayField(&(project->multiSnapshotDefinitions()));
|
m_pdmTableView->setChildArrayField(&(project->multiSnapshotDefinitions()));
|
||||||
|
|
||||||
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
verticalHeader->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
#else
|
||||||
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
||||||
|
#endif
|
||||||
m_pdmTableView->tableView()->resizeColumnsToContents();
|
m_pdmTableView->tableView()->resizeColumnsToContents();
|
||||||
|
|
||||||
// Set active child array to be able to use generic delete
|
// Set active child array to be able to use generic delete
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGui/QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QDockWidget;
|
class QDockWidget;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGui/QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QDockWidget;
|
class QDockWidget;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
|
@ -63,7 +63,6 @@
|
|||||||
#include "cvfRendering.h"
|
#include "cvfRendering.h"
|
||||||
#include "cvfScene.h"
|
#include "cvfScene.h"
|
||||||
|
|
||||||
#include <QCDEStyle>
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
@ -156,8 +155,6 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
|
|||||||
m_animationProgress->setFormat("Time Step: %v/%m");
|
m_animationProgress->setFormat("Time Step: %v/%m");
|
||||||
m_animationProgress->setTextVisible(true);
|
m_animationProgress->setTextVisible(true);
|
||||||
|
|
||||||
m_progressBarStyle = new QCDEStyle();
|
|
||||||
m_animationProgress->setStyle(m_progressBarStyle);
|
|
||||||
m_showAnimProgress = false;
|
m_showAnimProgress = false;
|
||||||
|
|
||||||
// Histogram
|
// Histogram
|
||||||
@ -212,7 +209,6 @@ RiuViewer::~RiuViewer()
|
|||||||
delete m_infoLabel;
|
delete m_infoLabel;
|
||||||
delete m_animationProgress;
|
delete m_animationProgress;
|
||||||
delete m_histogramWidget;
|
delete m_histogramWidget;
|
||||||
delete m_progressBarStyle;
|
|
||||||
delete m_gridBoxGenerator;
|
delete m_gridBoxGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ class RiuViewerCommands;
|
|||||||
class RivGridBoxGenerator;
|
class RivGridBoxGenerator;
|
||||||
class RivWindowEdgeAxesOverlayItem;
|
class RivWindowEdgeAxesOverlayItem;
|
||||||
|
|
||||||
class QCDEStyle;
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
|
|
||||||
@ -157,8 +156,6 @@ private:
|
|||||||
RiuSimpleHistogramWidget* m_histogramWidget;
|
RiuSimpleHistogramWidget* m_histogramWidget;
|
||||||
bool m_showHistogram;
|
bool m_showHistogram;
|
||||||
|
|
||||||
QCDEStyle* m_progressBarStyle;
|
|
||||||
|
|
||||||
cvf::ref<cvf::OverlayAxisCross> m_axisCross;
|
cvf::ref<cvf::OverlayAxisCross> m_axisCross;
|
||||||
bool m_showAxisCross;
|
bool m_showAxisCross;
|
||||||
cvf::Collection<caf::TitledOverlayFrame> m_visibleLegends;
|
cvf::Collection<caf::TitledOverlayFrame> m_visibleLegends;
|
||||||
|
@ -36,7 +36,11 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSslConfiguration>
|
#include <QSslConfiguration>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QtWidgets>
|
||||||
|
#else
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
#endif
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -324,7 +328,11 @@ void RiuWellImportWizard::startRequest(QUrl url)
|
|||||||
if (supportsSsl)
|
if (supportsSsl)
|
||||||
{
|
{
|
||||||
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
|
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
config.setProtocol(QSsl::TlsV1_0);
|
||||||
|
#else
|
||||||
config.setProtocol(QSsl::TlsV1);
|
config.setProtocol(QSsl::TlsV1);
|
||||||
|
#endif
|
||||||
request.setSslConfiguration(config);
|
request.setSslConfiguration(config);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user