mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -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)
|
||||
RiaApplication::instance()->showFormattedTextInMessageBox(helpText);
|
||||
#else
|
||||
fprintf(stdout, "%s\n", helpText.toAscii().data());
|
||||
fprintf(stdout, "%s\n", helpText.toLatin1().data());
|
||||
fflush(stdout);
|
||||
#endif
|
||||
return false;
|
||||
|
@ -123,7 +123,11 @@ QWidget* RicSummaryCurveCalculatorEditor::createWidget(QWidget* parent)
|
||||
m_pdmTableView->enableHeaderText(false);
|
||||
|
||||
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
||||
#if QT_VERSION >= 0x050000
|
||||
verticalHeader->setSectionResizeMode(QHeaderView::Interactive);
|
||||
#else
|
||||
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
||||
#endif
|
||||
|
||||
m_pdmTableView->tableView()->resizeColumnsToContents();
|
||||
|
||||
|
@ -159,7 +159,7 @@ void RifCaseRealizationParametersReader::parse()
|
||||
}
|
||||
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));
|
||||
}
|
||||
@ -264,7 +264,7 @@ void RifCaseRealizationRunspecificationReader::parse()
|
||||
}
|
||||
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()));
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ bool RifCsvUserDataParser::parseColumnBasedData(const AsciiDataParseOptions& par
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ void RifEclipseInputFileTools::findKeywordsOnFile(const QString &fileName, std::
|
||||
lineLength = data.readLine(buf, sizeof(buf));
|
||||
if (lineLength > 0)
|
||||
{
|
||||
line = QString::fromAscii(buf);
|
||||
line = QString::fromLatin1(buf);
|
||||
if (line.size() && line[0].isLetter())
|
||||
{
|
||||
RifKeywordAndFilePos keyPos;
|
||||
@ -400,7 +400,7 @@ void RifEclipseInputFileTools::parseAndReadPathAliasKeyword(const QString &fileN
|
||||
qint64 lineLength = data.readLine(buf, sizeof(buf));
|
||||
if (lineLength > 0)
|
||||
{
|
||||
line = QString::fromAscii(buf);
|
||||
line = QString::fromLatin1(buf);
|
||||
if (line.size() && (line[0].isLetter() || foundPathsKeyword))
|
||||
{
|
||||
line = line.trimmed();
|
||||
|
@ -189,7 +189,7 @@ bool RifEclipseRestartFilesetAccess::results(const QString& resultName, size_t t
|
||||
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
|
||||
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));
|
||||
|
||||
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++)
|
||||
{
|
||||
std::vector<double> partValues;
|
||||
|
@ -52,7 +52,7 @@ void JsonReader::dumpToFile(std::vector<cvf::Vec3d>& points, QString filePath)
|
||||
cvf::Vec3d point = points[idx];
|
||||
QString string;
|
||||
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.close();
|
||||
|
@ -993,7 +993,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::Por
|
||||
{
|
||||
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;
|
||||
for (i = 0; i < numOccurrences; i++)
|
||||
{
|
||||
|
@ -33,7 +33,12 @@
|
||||
|
||||
#include "cafFactory.h"
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets/qerrormessage.h>
|
||||
#include <QtWidgets/qmdisubwindow.h>
|
||||
#else
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include <QtNetwork>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "RiuCursors.h"
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QBitmap>
|
||||
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QCursor>
|
||||
|
||||
|
||||
|
||||
|
@ -57,8 +57,12 @@ RiuEditPerforationCollectionWidget::RiuEditPerforationCollectionWidget(QWidget*
|
||||
m_pdmTableView->setChildArrayField(&(m_perforationCollection->m_perforations));
|
||||
|
||||
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();
|
||||
|
||||
// Set active child array to be able to use generic delete
|
||||
|
@ -75,8 +75,11 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
||||
m_pdmTableView->setChildArrayField(&(project->multiSnapshotDefinitions()));
|
||||
|
||||
QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader();
|
||||
#if QT_VERSION >= 0x050000
|
||||
verticalHeader->setSectionResizeMode(QHeaderView::Interactive);
|
||||
#else
|
||||
verticalHeader->setResizeMode(QHeaderView::Interactive);
|
||||
|
||||
#endif
|
||||
m_pdmTableView->tableView()->resizeColumnsToContents();
|
||||
|
||||
// Set active child array to be able to use generic delete
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class QDockWidget;
|
||||
class QLabel;
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class QDockWidget;
|
||||
class QTextEdit;
|
||||
|
@ -63,7 +63,6 @@
|
||||
#include "cvfRendering.h"
|
||||
#include "cvfScene.h"
|
||||
|
||||
#include <QCDEStyle>
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressBar>
|
||||
@ -156,8 +155,6 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
|
||||
m_animationProgress->setFormat("Time Step: %v/%m");
|
||||
m_animationProgress->setTextVisible(true);
|
||||
|
||||
m_progressBarStyle = new QCDEStyle();
|
||||
m_animationProgress->setStyle(m_progressBarStyle);
|
||||
m_showAnimProgress = false;
|
||||
|
||||
// Histogram
|
||||
@ -212,7 +209,6 @@ RiuViewer::~RiuViewer()
|
||||
delete m_infoLabel;
|
||||
delete m_animationProgress;
|
||||
delete m_histogramWidget;
|
||||
delete m_progressBarStyle;
|
||||
delete m_gridBoxGenerator;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ class RiuViewerCommands;
|
||||
class RivGridBoxGenerator;
|
||||
class RivWindowEdgeAxesOverlayItem;
|
||||
|
||||
class QCDEStyle;
|
||||
class QLabel;
|
||||
class QProgressBar;
|
||||
|
||||
@ -157,8 +156,6 @@ private:
|
||||
RiuSimpleHistogramWidget* m_histogramWidget;
|
||||
bool m_showHistogram;
|
||||
|
||||
QCDEStyle* m_progressBarStyle;
|
||||
|
||||
cvf::ref<cvf::OverlayAxisCross> m_axisCross;
|
||||
bool m_showAxisCross;
|
||||
cvf::Collection<caf::TitledOverlayFrame> m_visibleLegends;
|
||||
|
@ -36,7 +36,11 @@
|
||||
#include <QObject>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslSocket>
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets>
|
||||
#else
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include <QtNetwork>
|
||||
|
||||
#include <algorithm>
|
||||
@ -324,7 +328,11 @@ void RiuWellImportWizard::startRequest(QUrl url)
|
||||
if (supportsSsl)
|
||||
{
|
||||
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
|
||||
#if QT_VERSION >= 0x050000
|
||||
config.setProtocol(QSsl::TlsV1_0);
|
||||
#else
|
||||
config.setProtocol(QSsl::TlsV1);
|
||||
#endif
|
||||
request.setSslConfiguration(config);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user