Cppcheck
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ShowTypes Class Reference

A class for different show types we have. More...

#include <showtypes.h>

Public Types

enum  ShowType {
  ShowStyle = 0 , ShowWarnings , ShowPerformance , ShowPortability ,
  ShowInformation , ShowErrors , ShowNone
}
 Show types we have (i.e. More...
 

Public Member Functions

 ShowTypes ()
 Constructor. More...
 
 ~ShowTypes ()
 Destructor. More...
 
void load ()
 Load visibility settings from the platform's settings storage. More...
 
void save () const
 Save visibility settings to the platform's settings storage. More...
 
bool isShown (ShowTypes::ShowType category) const
 Is the showtype visible in the GUI? More...
 
bool isShown (Severity severity) const
 Is the severity visible in the GUI? More...
 
void show (ShowTypes::ShowType category, bool showing)
 Show/hide the showtype. More...
 

Static Public Member Functions

static ShowTypes::ShowType SeverityToShowType (Severity severity)
 Convert severity string to ShowTypes value. More...
 
static Severity ShowTypeToSeverity (ShowTypes::ShowType type)
 Convert ShowType to severity string. More...
 
static ShowTypes::ShowType VariantToShowType (const QVariant &data)
 Convert QVariant (that contains an int) to Showtypes value. More...
 

Public Attributes

bool mVisible [ShowNone]
 

Detailed Description

A class for different show types we have.

This class contains enum type for the different show types we have. Each show type presents one severity selectable in the GUI. In addition there are several supporting functions.

Notice that the "visibility" settings are automatically loaded when the class is constructed and saved when the class is destroyed.

Definition at line 38 of file showtypes.h.

Member Enumeration Documentation

◆ ShowType

Show types we have (i.e.

severities in the GUI).

Enumerator
ShowStyle 
ShowWarnings 
ShowPerformance 
ShowPortability 
ShowInformation 
ShowErrors 
ShowNone 

Definition at line 44 of file showtypes.h.

Constructor & Destructor Documentation

◆ ShowTypes()

ShowTypes::ShowTypes ( )

Constructor.

Note
Loads visibility settings.

Definition at line 26 of file showtypes.cpp.

References load().

◆ ~ShowTypes()

ShowTypes::~ShowTypes ( )

Destructor.

Note
Saves visibility settings.

Definition at line 31 of file showtypes.cpp.

References save().

Member Function Documentation

◆ isShown() [1/2]

bool ShowTypes::isShown ( Severity  severity) const

Is the severity visible in the GUI?

Parameters
severityseverity to check.
Returns
true if the severity is visible.

Definition at line 122 of file showtypes.cpp.

References isShown(), and SeverityToShowType().

◆ isShown() [2/2]

bool ShowTypes::isShown ( ShowTypes::ShowType  category) const

Is the showtype visible in the GUI?

Parameters
categoryShowtype to check.
Returns
true if the showtype is visible.

Definition at line 117 of file showtypes.cpp.

References mVisible.

Referenced by ResultsTree::addErrorItem(), isShown(), MainWindow::loadSettings(), ResultsTree::refreshTree(), and ResultsTree::showResults().

◆ load()

void ShowTypes::load ( )

◆ save()

void ShowTypes::save ( ) const

◆ SeverityToShowType()

ShowTypes::ShowType ShowTypes::SeverityToShowType ( Severity  severity)
static

Convert severity string to ShowTypes value.

Parameters
severityError severity
Returns
Severity converted to ShowTypes value

Definition at line 36 of file showtypes.cpp.

References error, information, internal, none, performance, portability, ShowErrors, ShowInformation, ShowNone, ShowPerformance, ShowPortability, ShowStyle, ShowWarnings, style, and warning.

Referenced by ResultsTree::addErrorItem(), ResultsView::error(), and isShown().

◆ show()

void ShowTypes::show ( ShowTypes::ShowType  category,
bool  showing 
)

Show/hide the showtype.

Parameters
categoryShowtype whose visibility to set.
showingtrue if the severity is set visible.

Definition at line 127 of file showtypes.cpp.

References mVisible.

Referenced by ResultsTree::showResults().

◆ ShowTypeToSeverity()

Severity ShowTypes::ShowTypeToSeverity ( ShowTypes::ShowType  type)
static

Convert ShowType to severity string.

Parameters
typeShowType to convert
Returns
ShowType converted to severity

Definition at line 59 of file showtypes.cpp.

References error, information, none, performance, portability, ShowErrors, ShowInformation, ShowNone, ShowPerformance, ShowPortability, ShowStyle, ShowWarnings, style, and warning.

Referenced by ResultsTree::copy(), and ResultsTree::readErrorItem().

◆ VariantToShowType()

ShowTypes::ShowType ShowTypes::VariantToShowType ( const QVariant &  data)
static

Convert QVariant (that contains an int) to Showtypes value.

Parameters
dataQVariant (that contains an int) to be converted
Returns
data converted to ShowTypes

Definition at line 86 of file showtypes.cpp.

References ShowErrors, and ShowNone.

Referenced by ResultsTree::readErrorItem(), and ResultsTree::refreshTree().

Member Data Documentation

◆ mVisible

bool ShowTypes::mVisible[ShowNone]

Definition at line 119 of file showtypes.h.

Referenced by isShown(), load(), save(), and show().


The documentation for this class was generated from the following files: