umbrello
2.31.0
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
The singleton class for switching on or off debug messages. More...
#include <debug_utils.h>
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 Tracer * | instance () |
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, MapEntry > | MapType |
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 Tracer * | m_instance = nullptr |
static MapType * | m_classes = nullptr |
static StateMap * | m_states = nullptr |
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
QObject based classes
DEBUG(DBG_SRC) << ...
other classes
DEBUG("class name") << ...
|
private |
|
private |
Tracer::~Tracer | ( | ) |
Destructor.
|
explicitprivate |
Constructor.
parent | the parent widget |
void Tracer::disable | ( | const QString & | name | ) |
Disable debug output for the given class.
name | class name |
void Tracer::disableAll | ( | ) |
void Tracer::enable | ( | const QString & | name | ) |
Enable debug output for the given class.
name | class name |
void Tracer::enableAll | ( | ) |
|
static |
bool Tracer::isEnabled | ( | const QString & | name | ) |
Return debugging state for a given class
name | the class name to check |
|
static |
Register class for debug output
name | class name |
state | initial enabled state |
|
protectedvirtual |
Fill tree widget with collected classes.
|
privateslot |
handle tree widget item selection signal
item | tree widget item |
column | selected column |
|
privateslot |
|
protected |
Transfer class state into tree widget.
name | class name |
|
protected |
Update check box of parent items.
parent | parent widget item |
|
staticprivate |
|
staticprivate |
|
staticprivate |