mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
#3752 CAF code changes to build on both Qt4 and Qt5
This commit is contained in:
parent
398a59d0a6
commit
cc7269c717
@ -95,10 +95,10 @@ void Log::infoMultiLine(const QString& line1, const QString& line2Etc)
|
||||
|
||||
if (generateTrace)
|
||||
{
|
||||
cvf::Trace::show("INF: %s", (const char*)line1.toAscii());
|
||||
cvf::Trace::show("INF: %s", (const char*)line1.toLatin1());
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toAscii());
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -127,10 +127,10 @@ void Log::warningMultiLine(const QString& line1, const QString& line2Etc)
|
||||
|
||||
if (generateTrace)
|
||||
{
|
||||
cvf::Trace::show("WRN: %s", (const char*)line1.toAscii());
|
||||
cvf::Trace::show("WRN: %s", (const char*)line1.toLatin1());
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toAscii());
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,10 +186,10 @@ bool Log::errorMultiLine(const QString& line1, const QString& line2Etc)
|
||||
|
||||
if (generateTrace)
|
||||
{
|
||||
cvf::Trace::show("\nERR: %s", (const char*)line1.toAscii());
|
||||
cvf::Trace::show("\nERR: %s", (const char*)line1.toLatin1());
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toAscii());
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,10 +37,10 @@
|
||||
|
||||
#include "cafMessagePanel.h"
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QDockWidget>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QBoxLayout>
|
||||
#include <QWidget>
|
||||
#include <QDockWidget>
|
||||
#include <QTextEdit>
|
||||
#include <QBoxLayout>
|
||||
|
||||
namespace caf {
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class QDockWidget;
|
||||
class QTextEdit;
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include <QtOpenGL/QGLContext>
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
class QTextStream;
|
||||
|
||||
|
@ -129,7 +129,7 @@ TEST(PdmReferenceHelperTest, ReferenceFrommRootToField)
|
||||
|
||||
QString refString = caf::PdmReferenceHelper::referenceFromRootToField(ihd1, &s3->m_dir);
|
||||
QString expectedString = "m_dir m_simpleObjPtrField 2";
|
||||
EXPECT_STREQ(expectedString.toAscii(), refString.toAscii());
|
||||
EXPECT_STREQ(expectedString.toLatin1(), refString.toLatin1());
|
||||
|
||||
delete ihd1;
|
||||
}
|
||||
@ -160,7 +160,7 @@ TEST(PdmReferenceHelperTest, ReferenceFrommRootToObject)
|
||||
|
||||
QString refString = caf::PdmReferenceHelper::referenceFromRootToObject(ihd1, s3);
|
||||
QString expectedString = "m_simpleObjPtrField 2";
|
||||
EXPECT_STREQ(expectedString.toAscii(), refString.toAscii());
|
||||
EXPECT_STREQ(expectedString.toLatin1(), refString.toLatin1());
|
||||
|
||||
ReferenceSimpleObj* ihd2 = new ReferenceSimpleObj;
|
||||
SimpleObj* s4 = new SimpleObj;
|
||||
|
@ -266,7 +266,7 @@ TEST(BaseTest, PdmReferenceHelper)
|
||||
{
|
||||
QString refString = caf::PdmReferenceHelper::referenceFromRootToObject(ihd1, s3);
|
||||
QString expectedString = ihd1->m_childArrayField.keyword() + " 3";
|
||||
EXPECT_STREQ(refString.toAscii(), expectedString.toAscii());
|
||||
EXPECT_STREQ(refString.toLatin1(), expectedString.toLatin1());
|
||||
|
||||
caf::PdmObjectHandle* fromRef = caf::PdmReferenceHelper::objectFromReference(ihd1, refString);
|
||||
EXPECT_TRUE(fromRef == s3);
|
||||
|
@ -968,7 +968,7 @@ TEST(BaseTest, PdmReferenceHelper)
|
||||
|
||||
refString = caf::PdmReferenceHelper::referenceFromRootToObject(ihd1, s3);
|
||||
QString expectedString = ihd1->m_simpleObjectsField.keyword() + " 3";
|
||||
EXPECT_STREQ(refString.toAscii(), expectedString.toAscii());
|
||||
EXPECT_STREQ(refString.toLatin1(), expectedString.toLatin1());
|
||||
|
||||
caf::PdmObjectHandle* fromRef = caf::PdmReferenceHelper::objectFromReference(ihd1, refString);
|
||||
EXPECT_TRUE(fromRef == s3);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QMainWindow>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QItemSelection>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class QGridLayout;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class QGridLayout;
|
||||
|
@ -38,10 +38,10 @@
|
||||
#include "cafAboutDialog.h"
|
||||
#include "cafAssert.h"
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QVariant>
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QtOpenGL/QGLFormat>
|
||||
|
||||
namespace caf {
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QDialog>
|
||||
|
||||
class QGridLayout;
|
||||
|
||||
|
@ -200,8 +200,8 @@ void caf::UiListViewModelPdm::setPdmData(PdmObjectCollection* objectGroup, const
|
||||
}
|
||||
|
||||
computeColumnCount();
|
||||
|
||||
reset();
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,7 +231,11 @@ void PdmUiTableViewEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
else if (editorAttrib.resizePolicy == PdmUiTableViewEditorAttribute::RESIZE_TO_FILL_CONTAINER)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
#else
|
||||
m_tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ QVariant PdmUiTableViewQModel::data(const QModelIndex &index, int role /*= Qt::D
|
||||
}
|
||||
else
|
||||
{
|
||||
return Qt::lightGray;
|
||||
return QColor(Qt::lightGray);
|
||||
}
|
||||
}
|
||||
else if (textColor.isValid())
|
||||
|
@ -85,13 +85,13 @@ TEST(PdmUiTreeSelectionQModelTest, ParentBehaviour)
|
||||
|
||||
{
|
||||
QModelIndex firstChildIndex = myModel.index(0, 0, parentIndex);
|
||||
EXPECT_STREQ("Second_a", myModel.data(firstChildIndex).toString().toAscii());
|
||||
EXPECT_STREQ("Second_a", myModel.data(firstChildIndex).toString().toLatin1());
|
||||
EXPECT_TRUE(parentIndex == myModel.parent(firstChildIndex));
|
||||
}
|
||||
|
||||
{
|
||||
QModelIndex secondChildIndex = myModel.index(1, 0, parentIndex);
|
||||
EXPECT_STREQ("Second_b", myModel.data(secondChildIndex).toString().toAscii());
|
||||
EXPECT_STREQ("Second_b", myModel.data(secondChildIndex).toString().toLatin1());
|
||||
EXPECT_TRUE(parentIndex == myModel.parent(secondChildIndex));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user