mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Clean up RiuWidgetStyleSheet and add more comments
This commit is contained in:
@@ -93,7 +93,7 @@ RiuWidgetStyleSheet::RiuWidgetStyleSheet()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Set keys and values directly to the default state
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWidgetStyleSheet::set( const QString& key, const QString& value )
|
||||
{
|
||||
@@ -101,7 +101,7 @@ void RiuWidgetStyleSheet::set( const QString& key, const QString& value )
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Get values directly from the default state
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuWidgetStyleSheet::get( const QString& key ) const
|
||||
{
|
||||
@@ -110,7 +110,7 @@ QString RiuWidgetStyleSheet::get( const QString& key ) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Access a particular state in the stylesheet
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWidgetStyleSheet::State& RiuWidgetStyleSheet::state( StateTag stateTag )
|
||||
{
|
||||
@@ -121,19 +121,7 @@ RiuWidgetStyleSheet::State& RiuWidgetStyleSheet::state( StateTag stateTag )
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuWidgetStyleSheet::propertyName( StateTag state )
|
||||
{
|
||||
if ( state < PSEUDO_STATE_LIMIT )
|
||||
{
|
||||
return StateTagEnum::text( state );
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Apply the current stylesheet to the provided widget instance
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWidgetStyleSheet::applyToWidget( QWidget* widget ) const
|
||||
{
|
||||
@@ -144,16 +132,7 @@ void RiuWidgetStyleSheet::applyToWidget( QWidget* widget ) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWidgetStyleSheet::refreshWidget( QWidget* widget ) const
|
||||
{
|
||||
widget->style()->unpolish( widget );
|
||||
widget->style()->polish( widget );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Put the provided widget into the provided state
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWidgetStyleSheet::setWidgetState( QWidget* widget, StateTag widgetState ) const
|
||||
{
|
||||
@@ -187,6 +166,15 @@ QString RiuWidgetStyleSheet::fullText( const QString& className, const QString&
|
||||
return textForAllStates.join( "\n" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWidgetStyleSheet::refreshWidget( QWidget* widget ) const
|
||||
{
|
||||
widget->style()->unpolish( widget );
|
||||
widget->style()->polish( widget );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -203,3 +191,15 @@ QString RiuWidgetStyleSheet::buildStateString( StateTag state )
|
||||
}
|
||||
return stateString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuWidgetStyleSheet::propertyName( StateTag state )
|
||||
{
|
||||
if ( state < PSEUDO_STATE_LIMIT )
|
||||
{
|
||||
return StateTagEnum::text( state );
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user