umbrello  2.32.1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Slots | Private Member Functions | Static Private Attributes | List of all members
Tracer Class Reference

The singleton class for switching on or off debug messages. More...

#include <debug_utils.h>

Inheritance diagram for Tracer:

Classes

class  MapEntry
 

Public Member Functions

 ~Tracer ()
 
bool isEnabled (const QString &name)
 
void enable (const QString &name)
 
void disable (const QString &name)
 
void enableAll ()
 
void disableAll ()
 

Static Public Member Functions

static Tracerinstance ()
 
static void registerClass (const QString &name, bool state=true, const QString &filePath=QString())
 

Protected Member Functions

void update (const QString &name)
 
void updateParentItemCheckBox (QTreeWidgetItem *parent)
 
virtual void showEvent (QShowEvent *)
 

Private Types

typedef QMap< QString, MapEntryMapType
 
typedef QMap< QString, Qt::CheckState > StateMap
 

Private Slots

void slotParentItemClicked (QTreeWidgetItem *parent)
 
void slotItemClicked (QTreeWidgetItem *item, int column)
 

Private Member Functions

 Tracer (QWidget *parent=0)
 

Static Private Attributes

static Tracerm_instance = nullptr
 
static MapTypem_classes = nullptr
 
static StateMapm_states = nullptr
 

Detailed Description

The singleton class for switching on or off debug messages.

This class provides a user controllable way to enable class related debug output.

Classes could be registered with the static method registerClass().

With show() a dialog will be shown, in which the user is able to enable/disable debug output for each registered class.

Class related debug output implementation

To register classes independent from related object instantiation time one of the macros

DEBUG_REGISTER(className) DEBUG_REGISTER_DISABLED(className)

should be placed in the implementation part of a class before the first class methods. The first macro enables debug output for the related class, while the latter macro disables it by default.

Debug output in class methods should use

Member Typedef Documentation

◆ MapType

typedef QMap<QString, MapEntry> Tracer::MapType
private

◆ StateMap

typedef QMap<QString,Qt::CheckState> Tracer::StateMap
private

Constructor & Destructor Documentation

◆ ~Tracer()

Tracer::~Tracer ( )

Destructor.

◆ Tracer()

Tracer::Tracer ( QWidget *  parent = 0)
explicitprivate

Constructor.

Parameters
parentthe parent widget

Member Function Documentation

◆ disable()

void Tracer::disable ( const QString &  name)

Disable debug output for the given class.

Parameters
nameclass name

◆ disableAll()

void Tracer::disableAll ( )

◆ enable()

void Tracer::enable ( const QString &  name)

Enable debug output for the given class.

Parameters
nameclass name

◆ enableAll()

void Tracer::enableAll ( )

◆ instance()

Tracer * Tracer::instance ( )
static

◆ isEnabled()

bool Tracer::isEnabled ( const QString &  name)

Return debugging state for a given class

Parameters
namethe class name to check

◆ registerClass()

void Tracer::registerClass ( const QString &  name,
bool  state = true,
const QString &  filePath = QString() 
)
static

Register class for debug output

Parameters
nameclass name
stateinitial enabled state

◆ showEvent()

void Tracer::showEvent ( QShowEvent *  e)
protectedvirtual

Fill tree widget with collected classes.

◆ slotItemClicked

void Tracer::slotItemClicked ( QTreeWidgetItem *  item,
int  column 
)
privateslot

handle tree widget item selection signal

Parameters
itemtree widget item
columnselected column

◆ slotParentItemClicked

void Tracer::slotParentItemClicked ( QTreeWidgetItem *  parent)
privateslot

◆ update()

void Tracer::update ( const QString &  name)
protected

Transfer class state into tree widget.

Parameters
nameclass name

◆ updateParentItemCheckBox()

void Tracer::updateParentItemCheckBox ( QTreeWidgetItem *  parent)
protected

Update check box of parent items.

Parameters
parentparent widget item

Member Data Documentation

◆ m_classes

Tracer::MapType * Tracer::m_classes = nullptr
staticprivate

◆ m_instance

Tracer * Tracer::m_instance = nullptr
staticprivate

◆ m_states

Tracer::StateMap * Tracer::m_states = nullptr
staticprivate

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