mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8614 from OPM/minor-adjustments
This commit is contained in:
parent
abff06d2d5
commit
1563ae7b58
@ -50,9 +50,8 @@ void RicNewPlotAxisPropertiesFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
RimSummaryPlot* summaryPlot = summaryPlots[0];
|
||||
|
||||
bool connectSignals = true;
|
||||
RimPlotAxisProperties* newPlotAxisProperties =
|
||||
summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis", connectSignals );
|
||||
summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis" );
|
||||
|
||||
summaryPlot->updateConnectedEditors();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlotAxisProperties );
|
||||
|
@ -54,6 +54,7 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
, axisPositionChanged( this )
|
||||
, m_enableTitleTextSettings( true )
|
||||
, m_isRangeSettingsEnabled( true )
|
||||
, m_isAlwaysRequired( false )
|
||||
{
|
||||
CAF_PDM_InitObject( "Axis Properties", ":/LeftAxis16x16.png" );
|
||||
|
||||
@ -97,13 +98,20 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::setAlwaysRequired( bool enable )
|
||||
{
|
||||
m_isAlwaysRequired = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotAxisProperties::isDeletable() const
|
||||
{
|
||||
// The default axes (which have index 0) are not deletable
|
||||
return m_plotAxisIndex != 0;
|
||||
return !m_isAlwaysRequired;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -210,6 +218,7 @@ void RimPlotAxisProperties::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
scaleGroup.add( &m_valuesFontSize );
|
||||
|
||||
scaleGroup.add( &m_plotAxis );
|
||||
m_plotAxis.uiCapability()->setUiReadOnly( m_isAlwaysRequired );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
public:
|
||||
RimPlotAxisProperties();
|
||||
|
||||
void setAlwaysRequired( bool enable );
|
||||
|
||||
void setEnableTitleTextSettings( bool enable );
|
||||
void enableRangeSettings( bool enable );
|
||||
void setNameAndAxis( const QString& name, RiaDefines::PlotAxis axis, int axisIndex = 0 );
|
||||
@ -79,7 +81,6 @@ public:
|
||||
|
||||
bool isDeletable() const override;
|
||||
|
||||
|
||||
std::vector<RimPlotAxisAnnotation*> annotations() const override;
|
||||
void appendAnnotation( RimPlotAxisAnnotation* annotation ) override;
|
||||
void removeAllAnnotations() override;
|
||||
@ -136,6 +137,7 @@ private:
|
||||
|
||||
bool m_enableTitleTextSettings;
|
||||
bool m_isRangeSettingsEnabled;
|
||||
bool m_isAlwaysRequired;
|
||||
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_titleFontSize;
|
||||
caf::PdmField<caf::AppEnum<AxisTitlePositionType>> m_titlePositionEnum;
|
||||
|
@ -122,13 +122,15 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisProperties, "AxisProperties", "Axes", ":/Axes16x16.png" );
|
||||
|
||||
bool connectSignals = false;
|
||||
addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left", connectSignals );
|
||||
addNewAxisProperties( RiuPlotAxis::defaultRight(), "Right", connectSignals );
|
||||
auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" );
|
||||
leftAxis->setAlwaysRequired( true );
|
||||
|
||||
auto rightAxis = addNewAxisProperties( RiuPlotAxis::defaultRight(), "Right" );
|
||||
rightAxis->setAlwaysRequired( true );
|
||||
|
||||
if ( m_isCrossPlot )
|
||||
{
|
||||
addNewAxisProperties( RiuPlotAxis::defaultBottom(), "Bottom", connectSignals );
|
||||
addNewAxisProperties( RiuPlotAxis::defaultBottom(), "Bottom" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1727,26 +1729,21 @@ void RimSummaryPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisProperties*
|
||||
RimSummaryPlot::addNewAxisProperties( RiaDefines::PlotAxis plotAxis, const QString& name, bool connectSignals )
|
||||
RimPlotAxisProperties* RimSummaryPlot::addNewAxisProperties( RiaDefines::PlotAxis plotAxis, const QString& name )
|
||||
{
|
||||
RiuPlotAxis newPlotAxis = plotWidget()->createNextPlotAxis( plotAxis );
|
||||
return addNewAxisProperties( newPlotAxis, name, connectSignals );
|
||||
return addNewAxisProperties( newPlotAxis, name );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisProperties* RimSummaryPlot::addNewAxisProperties( RiuPlotAxis plotAxis, const QString& name, bool connectSignals )
|
||||
RimPlotAxisProperties* RimSummaryPlot::addNewAxisProperties( RiuPlotAxis plotAxis, const QString& name )
|
||||
{
|
||||
RimPlotAxisProperties* axisProperties = new RimPlotAxisProperties;
|
||||
axisProperties->setNameAndAxis( name, plotAxis.axis(), plotAxis.index() );
|
||||
m_axisProperties.push_back( axisProperties );
|
||||
|
||||
if ( connectSignals )
|
||||
{
|
||||
connectAxisSignals( axisProperties );
|
||||
}
|
||||
connectAxisSignals( axisProperties );
|
||||
|
||||
return axisProperties;
|
||||
}
|
||||
@ -2488,9 +2485,8 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve )
|
||||
if ( !destinationCurve->summaryAddressY().uiText().empty() )
|
||||
axisObjectName = QString::fromStdString( destinationCurve->summaryAddressY().uiText() );
|
||||
|
||||
newPlotAxis = plotWidget()->createNextPlotAxis( plotAxis );
|
||||
bool connectSignals = true;
|
||||
addNewAxisProperties( newPlotAxis, axisObjectName, connectSignals );
|
||||
newPlotAxis = plotWidget()->createNextPlotAxis( plotAxis );
|
||||
addNewAxisProperties( newPlotAxis, axisObjectName );
|
||||
}
|
||||
|
||||
destinationCurve->setLeftOrRightAxisY( newPlotAxis );
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
|
||||
RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const;
|
||||
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name, bool connectSignals );
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name );
|
||||
|
||||
public:
|
||||
// RimViewWindow overrides
|
||||
@ -212,7 +212,7 @@ private:
|
||||
|
||||
void connectCurveToPlot( RimSummaryCurve* curve, bool update, bool autoAssignPlotAxis );
|
||||
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiuPlotAxis plotAxis, const QString& name, bool connectSignals );
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiuPlotAxis plotAxis, const QString& name );
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
|
@ -215,6 +215,8 @@ int caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInG
|
||||
labelAndFieldVerticalLayout->addWidget( fieldLabelWidget, 0, Qt::AlignTop );
|
||||
labelAndFieldVerticalLayout->addWidget( fieldEditorWidget, 1, Qt::AlignTop );
|
||||
|
||||
m_layouts.push_back( labelAndFieldVerticalLayout );
|
||||
|
||||
// Apply margins determined by the editor type
|
||||
// fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
|
||||
currentColumn += itemColumnSpan;
|
||||
@ -489,6 +491,13 @@ void caf::PdmUiFormLayoutObjectEditor::cleanupBeforeSettingPdmObject()
|
||||
}
|
||||
|
||||
m_groupBoxes.clear();
|
||||
|
||||
for ( auto l : m_layouts )
|
||||
{
|
||||
delete l;
|
||||
l = nullptr;
|
||||
}
|
||||
m_layouts.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,7 @@
|
||||
class QMinimizePanel;
|
||||
class QGridLayout;
|
||||
class QWidget;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -110,6 +111,7 @@ private:
|
||||
std::map<QString, QPointer<QMinimizePanel>> m_newGroupBoxes; ///< used temporarily to store the new(complete) set of
|
||||
///< group boxes
|
||||
std::map<QString, std::map<QString, bool>> m_objectKeywordGroupUiNameExpandedState;
|
||||
std::vector<QPointer<QVBoxLayout>> m_layouts;
|
||||
};
|
||||
|
||||
} // end namespace caf
|
||||
|
@ -161,11 +161,23 @@ PdmUiTreeViewEditor::~PdmUiTreeViewEditor()
|
||||
m_treeView->removeEventFilter( this );
|
||||
m_treeViewModel->setPdmItemRoot( nullptr );
|
||||
|
||||
if ( m_mainWidget ) delete m_mainWidget;
|
||||
if ( m_delegate ) delete m_delegate;
|
||||
if ( m_treeViewModel ) delete m_treeViewModel;
|
||||
if ( m_filterModel ) delete m_filterModel;
|
||||
if ( m_treeView ) delete m_treeView;
|
||||
delete m_mainWidget;
|
||||
m_mainWidget = nullptr;
|
||||
|
||||
delete m_delegate;
|
||||
m_delegate = nullptr;
|
||||
|
||||
delete m_treeViewModel;
|
||||
m_treeViewModel = nullptr;
|
||||
|
||||
delete m_filterModel;
|
||||
m_filterModel = nullptr;
|
||||
|
||||
delete m_treeView;
|
||||
m_treeView = nullptr;
|
||||
|
||||
delete m_layout;
|
||||
m_layout = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -157,8 +157,8 @@ private:
|
||||
bool eventFilter( QObject* obj, QEvent* event ) override;
|
||||
|
||||
private:
|
||||
QPointer<QWidget> m_mainWidget;
|
||||
QVBoxLayout* m_layout;
|
||||
QPointer<QWidget> m_mainWidget;
|
||||
QPointer<QVBoxLayout> m_layout;
|
||||
|
||||
QPointer<PdmUiTreeViewWidget> m_treeView;
|
||||
QPointer<PdmUiTreeViewQModel> m_treeViewModel;
|
||||
|
Loading…
Reference in New Issue
Block a user