mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Refactor and rename QIconProvider -> IconProvider (#5893)
* Refactor and rename QIconProvider -> IconProvider * Generate icons on demand as unique_ptrs
This commit is contained in:
@@ -616,7 +616,7 @@ void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector Y" );
|
||||
curveDataGroup->add( &m_yValuesSummaryCaseCollection );
|
||||
curveDataGroup->add( &m_yValuesSummaryAddressUiField );
|
||||
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, {false, 1, 0} );
|
||||
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
curveDataGroup->add( &m_plotAxis );
|
||||
}
|
||||
|
||||
@@ -680,19 +680,14 @@ void RimEnsembleCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOr
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
|
||||
caf::QIconProvider iconProvider = this->uiIconProvider();
|
||||
if ( iconProvider.isNull() ) return;
|
||||
caf::IconProvider iconProvider = this->uiIconProvider();
|
||||
if ( !iconProvider.valid() ) return;
|
||||
|
||||
RimEnsembleCurveSetCollection* coll = nullptr;
|
||||
this->firstAncestorOrThisOfType( coll );
|
||||
if ( coll && coll->curveSetForSourceStepping() == this )
|
||||
{
|
||||
QPixmap updownpixmap( ":/StepUpDownCorner16x16.png" );
|
||||
iconProvider.setOverlayPixmap( updownpixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
iconProvider.setOverlayPixmap( QPixmap() );
|
||||
iconProvider.setOverlayResourceString( ":/StepUpDownCorner16x16.png" );
|
||||
}
|
||||
|
||||
this->setUiIcon( iconProvider );
|
||||
|
||||
@@ -77,8 +77,8 @@ void RimSummaryCrossPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionIt
|
||||
{
|
||||
for ( RimSummaryPlot* plot : m_summaryCrossPlots() )
|
||||
{
|
||||
caf::QIconProvider icon = plot->uiCapability()->uiIconProvider();
|
||||
QString displayName = plot->description();
|
||||
caf::IconProvider icon = plot->uiCapability()->uiIconProvider();
|
||||
QString displayName = plot->description();
|
||||
|
||||
optionInfos->push_back( caf::PdmOptionItemInfo( displayName, plot, false, icon ) );
|
||||
}
|
||||
|
||||
@@ -596,22 +596,18 @@ void RimSummaryCurve::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderi
|
||||
{
|
||||
RimPlotCurve::defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
||||
|
||||
caf::QIconProvider iconProvider = this->uiIconProvider();
|
||||
if ( iconProvider.isNull() ) return;
|
||||
|
||||
QIcon icon = iconProvider.icon();
|
||||
caf::IconProvider iconProvider = this->uiIconProvider();
|
||||
if ( !iconProvider.valid() ) return;
|
||||
|
||||
RimSummaryCurveCollection* coll = nullptr;
|
||||
this->firstAncestorOrThisOfType( coll );
|
||||
if ( coll && coll->curveForSourceStepping() == this )
|
||||
{
|
||||
QPixmap updownpixmap( ":/StepUpDownCorner16x16.png" );
|
||||
|
||||
iconProvider.setOverlayPixmap( updownpixmap );
|
||||
iconProvider.setOverlayResourceString( ":/StepUpDownCorner16x16.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
iconProvider.setOverlayPixmap( QPixmap() );
|
||||
iconProvider.setOverlayResourceString( "" );
|
||||
}
|
||||
|
||||
setUiIcon( iconProvider );
|
||||
@@ -645,10 +641,10 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
||||
QString curveDataGroupName = "Summary Vector";
|
||||
if ( isCrossPlotCurve() ) curveDataGroupName += " Y";
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "Summary Vector Y" );
|
||||
curveDataGroup->add( &m_yValuesSummaryCase, {true, 3, 1} );
|
||||
curveDataGroup->add( &m_yValuesSummaryAddressUiField, {true, 2, 1} );
|
||||
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, {false, 1, 0} );
|
||||
curveDataGroup->add( &m_plotAxis, {true, 3, 1} );
|
||||
curveDataGroup->add( &m_yValuesSummaryCase, { true, 3, 1 } );
|
||||
curveDataGroup->add( &m_yValuesSummaryAddressUiField, { true, 2, 1 } );
|
||||
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
curveDataGroup->add( &m_plotAxis, { true, 3, 1 } );
|
||||
|
||||
if ( isCrossPlotCurve() )
|
||||
m_showErrorBars = false;
|
||||
@@ -659,9 +655,9 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
||||
if ( isCrossPlotCurve() )
|
||||
{
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X" );
|
||||
curveDataGroup->add( &m_xValuesSummaryCase, {true, 3, 1} );
|
||||
curveDataGroup->add( &m_xValuesSummaryAddressUiField, {true, 2, 1} );
|
||||
curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, {false, 1, 0} );
|
||||
curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } );
|
||||
curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } );
|
||||
curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||
|
||||
Reference in New Issue
Block a user