mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Several adjustments related to Qt6
* Avoid ambiguous definition during unity build on Windows * Add missing include * Add Qt6 to expressionparser * Add Qt6 to nightcharts * Replace forward define of QStringList with include <QStringList> * Use toMSecsSinceEpoch * Use setContentsMargins
This commit is contained in:
parent
39b9a25faa
commit
030688cff6
@ -72,7 +72,7 @@ auto RiaRftPltCurveDefinition::operator<=>( const RiaRftPltCurveDefinition& othe
|
||||
{
|
||||
if ( m_wellName == other.m_wellName )
|
||||
{
|
||||
return m_timeStep.toTime_t() <=> other.m_timeStep.toTime_t();
|
||||
return m_timeStep.toMSecsSinceEpoch() <=> other.m_timeStep.toMSecsSinceEpoch();
|
||||
}
|
||||
return m_wellName.toStdString() <=> other.m_wellName.toStdString();
|
||||
}
|
||||
|
@ -19,8 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
class QStringList;
|
||||
#include <QStringList>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -18,13 +18,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimRoffCase;
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
@ -26,7 +28,6 @@ class RifEclipseSummaryAddress;
|
||||
class RimSummaryCaseCollection;
|
||||
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RimObservedDataCollection.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -38,8 +39,6 @@ class RimObservedDataCollection;
|
||||
class RimSummaryCurve;
|
||||
class RimUserDefinedCalculation;
|
||||
|
||||
class QStringList;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmObject;
|
||||
|
@ -19,9 +19,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <map>
|
||||
#include <QStringList>
|
||||
|
||||
class QStringList;
|
||||
#include <map>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -19,12 +19,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimEclipseView;
|
||||
class RimWellPath;
|
||||
class QStringList;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
|
@ -79,7 +79,7 @@ RicGridStatisticsDialog::RicGridStatisticsDialog( QWidget* parent )
|
||||
dialogLayout->addWidget( m_mainViewWidget );
|
||||
|
||||
QVBoxLayout* mainViewLayout = new QVBoxLayout();
|
||||
mainViewLayout->setMargin( 0 );
|
||||
mainViewLayout->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_mainViewWidget->setLayout( mainViewLayout );
|
||||
mainViewLayout->addWidget( m_label );
|
||||
mainViewLayout->addWidget( m_textEdit );
|
||||
|
@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
@ -35,8 +36,6 @@ class RimSummaryCase;
|
||||
class RimSummaryCaseCollection;
|
||||
class RimEnsembleCurveSet;
|
||||
|
||||
class QStringList;
|
||||
|
||||
class RicSummaryPlotFeatureImpl
|
||||
{
|
||||
public:
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RigCaseRealizationParameters.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <map>
|
||||
@ -30,7 +31,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class QStringList;
|
||||
class QTextStream;
|
||||
class QXmlStreamReader;
|
||||
class QFile;
|
||||
|
@ -23,12 +23,12 @@
|
||||
#include "ert/ecl/ecl_sum.hpp"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class RifSummaryReaderInterface;
|
||||
class QStringList;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
|
@ -18,13 +18,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
class QString;
|
||||
class QDateTime;
|
||||
class QStringList;
|
||||
#include <QStringList>
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
class QString;
|
||||
class QDateTime;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
|
@ -20,6 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QIcon>
|
||||
#include <QStringList>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace caf
|
||||
@ -28,7 +30,6 @@ class CmdFeatureMenuBuilder;
|
||||
}
|
||||
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QMenu;
|
||||
class RimWellPath;
|
||||
class RimScriptCollection;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <array>
|
||||
#include <list>
|
||||
|
||||
//==================================================================================================
|
||||
/// Internal class for intersection point info
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
#include <deque>
|
||||
#include <map>
|
||||
@ -36,7 +38,6 @@ class RigActiveCellInfo;
|
||||
class RigMainGrid;
|
||||
class RigCell;
|
||||
class RigEclipseResultAddress;
|
||||
class QStringList;
|
||||
|
||||
class RigNNCData : public cvf::Object
|
||||
{
|
||||
|
@ -138,13 +138,13 @@ public:
|
||||
{
|
||||
int lineCount = 1 + posTickTypeText.second.label.count( "\n" );
|
||||
mediumTextLineCount = std::max( mediumTextLineCount, lineCount );
|
||||
medTickMaxTextSize = std::max( posTickTypeText.second.label.size(), medTickMaxTextSize );
|
||||
medTickMaxTextSize = std::max( (int)posTickTypeText.second.label.size(), medTickMaxTextSize );
|
||||
}
|
||||
else if ( posTickTypeText.second.tickType == QwtScaleDiv::MinorTick )
|
||||
{
|
||||
int lineCount = 1 + posTickTypeText.second.label.count( "\n" );
|
||||
minorTextLineCount = std::max( minorTextLineCount, lineCount );
|
||||
minTickMaxTextSize = std::max( posTickTypeText.second.label.size(), minTickMaxTextSize );
|
||||
minTickMaxTextSize = std::max( (int)posTickTypeText.second.label.size(), minTickMaxTextSize );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ RiuFlowCharacteristicsPlot::RiuFlowCharacteristicsPlot( RimFlowCharacteristicsPl
|
||||
|
||||
QGridLayout* mainLayout = new QGridLayout();
|
||||
setLayout( mainLayout );
|
||||
layout()->setMargin( 3 );
|
||||
layout()->setContentsMargins( 3, 3, 3, 3 );
|
||||
layout()->setSpacing( 3 );
|
||||
|
||||
// White background
|
||||
|
@ -20,11 +20,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
class QPaintEvent;
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
class RiuGridStatisticsHistogramWidget : public QWidget
|
||||
{
|
||||
|
@ -44,7 +44,10 @@ RiuMessagePanel::RiuMessagePanel( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout( this );
|
||||
layout->setMargin( caf::StyleSheetTools::smallContentMargin() );
|
||||
layout->setContentsMargins( caf::StyleSheetTools::smallContentMargin(),
|
||||
caf::StyleSheetTools::smallContentMargin(),
|
||||
caf::StyleSheetTools::smallContentMargin(),
|
||||
caf::StyleSheetTools::smallContentMargin() );
|
||||
|
||||
m_textEdit = new QPlainTextEdit;
|
||||
m_textEdit->setReadOnly( true );
|
||||
|
@ -91,7 +91,7 @@ RiuMultiPlotPage::RiuMultiPlotPage( RimPlotWindow* plotDefinition, QWidget* pare
|
||||
CAF_ASSERT( m_plotDefinition );
|
||||
|
||||
m_layout = new QVBoxLayout( this );
|
||||
m_layout->setMargin( 0 );
|
||||
m_layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_layout->setSpacing( 4 );
|
||||
|
||||
m_plotTitle = createTitleLabel();
|
||||
|
@ -74,7 +74,7 @@ RiuProjectAndPropertyView::RiuProjectAndPropertyView( QWidget* parent, Qt::Windo
|
||||
propertyHeader->setFixedHeight( 20 );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
layout->setMargin( 0 );
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
layout->addWidget( propertyHeader );
|
||||
layout->addWidget( m_propertyView );
|
||||
|
||||
@ -87,7 +87,7 @@ RiuProjectAndPropertyView::RiuProjectAndPropertyView( QWidget* parent, Qt::Windo
|
||||
splitter->addWidget( propertyEditorWithHeader );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
layout->setMargin( 0 );
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
layout->addWidget( splitter );
|
||||
|
||||
setLayout( layout );
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QStringList>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -29,7 +30,6 @@ class PdmUiPropertyView;
|
||||
class QDialogButtonBox;
|
||||
class QWidget;
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
class RiuPropertyViewTabWidget : public QDialog
|
||||
{
|
||||
|
@ -999,7 +999,7 @@ QString RiuResultTextBuilder::cellResultText( const std::vector<RimEclipseResult
|
||||
auto resultTextAndValues = cellResultTextAndValueText( resDef );
|
||||
for ( const auto& [key, value] : resultTextAndValues )
|
||||
{
|
||||
maxKeyLength = std::max( maxKeyLength, key.length() );
|
||||
maxKeyLength = std::max( maxKeyLength, (int)key.length() );
|
||||
keyValues[key] = value;
|
||||
}
|
||||
}
|
||||
|
@ -20,11 +20,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
class QPaintEvent;
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
class RiuSimpleHistogramWidget : public QWidget
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ RiuWellAllocationPlot::RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinit
|
||||
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout();
|
||||
setLayout( mainLayout );
|
||||
layout()->setMargin( 0 );
|
||||
layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||
layout()->setSpacing( 2 );
|
||||
|
||||
m_titleLabel = new QLabel( this );
|
||||
|
@ -11,13 +11,23 @@ set(MOC_HEADER_FILES cafFrameAnimationControl.h cafAnimationToolBar.h
|
||||
cafPopupMenuButton.h
|
||||
)
|
||||
|
||||
find_package(
|
||||
Qt5
|
||||
COMPONENTS
|
||||
REQUIRED Core Gui Widgets
|
||||
)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
if(CEE_USE_QT6)
|
||||
find_package(
|
||||
Qt6
|
||||
COMPONENTS
|
||||
REQUIRED Core Gui Widgets
|
||||
)
|
||||
set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets)
|
||||
qt_standard_project_setup()
|
||||
else()
|
||||
find_package(
|
||||
Qt5
|
||||
COMPONENTS
|
||||
REQUIRED Core Gui Widgets
|
||||
)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
endif()
|
||||
|
||||
# NOTE! Resources in this subfolder appends to the variable QRC_FILES in parent
|
||||
# scope CMakeList.txt in the application folder (parent scope) must use the
|
||||
|
@ -34,7 +34,13 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
// This include is required to avoid ambiguous definition during unity build
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafMemoryInspector.h"
|
||||
#include "cafProgressState.h"
|
||||
|
11
ThirdParty/expressionparser/CMakeLists.txt
vendored
11
ThirdParty/expressionparser/CMakeLists.txt
vendored
@ -7,9 +7,14 @@ if(MSVC)
|
||||
message(STATUS "MSVC: Enabled increased number of sections in object files")
|
||||
endif()
|
||||
|
||||
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core)
|
||||
set(QT_LIBRARIES Qt5::Core)
|
||||
if (CEE_USE_QT6)
|
||||
find_package(Qt6 COMPONENTS REQUIRED Core)
|
||||
set(QT_LIBRARIES Qt6::Core)
|
||||
qt_standard_project_setup()
|
||||
else()
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core)
|
||||
set(QT_LIBRARIES Qt5::Core)
|
||||
endif()
|
||||
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
ExpressionParser.h
|
||||
|
11
ThirdParty/nightcharts/CMakeLists.txt
vendored
11
ThirdParty/nightcharts/CMakeLists.txt
vendored
@ -2,9 +2,14 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project (nightcharts)
|
||||
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Widgets)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
if (CEE_USE_QT6)
|
||||
find_package(Qt6 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets)
|
||||
qt_standard_project_setup()
|
||||
else()
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
endif()
|
||||
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
nightcharts.h
|
||||
|
6
ThirdParty/nightcharts/nightcharts.cpp
vendored
6
ThirdParty/nightcharts/nightcharts.cpp
vendored
@ -330,7 +330,7 @@ int Nightcharts::draw(QPainter *painter)
|
||||
painter->drawRect(cX+pDist+i*(pW + pDist),cY+cH,pW,-cH/100*pieces[i].pPerc-5);
|
||||
QString label = QString::number(pieces[i].pPerc)+"%";
|
||||
painter->setPen(Qt::SolidLine);
|
||||
painter->drawText(cX+pDist+i*(pW + pDist)+pW/2-painter->fontMetrics().width(label)/2,cY+cH-cH/100*pieces[i].pPerc-painter->fontMetrics().height()/2,label);
|
||||
painter->drawText(cX+pDist+i*(pW + pDist)+pW/2-painter->fontMetrics().horizontalAdvance(label)/2,cY+cH-cH/100*pieces[i].pPerc-painter->fontMetrics().height()/2,label);
|
||||
}
|
||||
painter->setPen(Qt::SolidLine);
|
||||
for (int i=1;i<10;i++)
|
||||
@ -386,12 +386,12 @@ void Nightcharts::drawLegend(QPainter *painter)
|
||||
}
|
||||
painter->drawLine(p.x(),p.y(),p_.x(),p_.y());
|
||||
QString label = pieces[i].pname + " - " + QString::number(pieces[i].pPerc)+"%";
|
||||
float recW = painter->fontMetrics().width(label)+10;
|
||||
float recW = painter->fontMetrics().horizontalAdvance(label)+10;
|
||||
float recH = painter->fontMetrics().height()+10;
|
||||
p_.setX(p_.x()-recW/2 + recW/2*cos(angle*M_PI/180));
|
||||
p_.setY(p_.y()+recH/2 + recH/2*sin(angle*M_PI/180));
|
||||
painter->setBrush(textColor);
|
||||
painter->drawRoundRect(p_.x() ,p_.y(), recW, -recH);
|
||||
painter->drawRect(p_.x() ,p_.y(), recW, -recH);
|
||||
painter->drawText(p_.x()+5, p_.y()-recH/2+5, label);
|
||||
angle -= pdegree/2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user