umbrello 2.34.70-5524f40e1
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) const |
void | enable (const QString &name) |
void | disable (const QString &name) |
void | enableAll () |
void | disableAll () |
bool | logToConsole () |
Static Public Member Functions | |
static Tracer * | instance () |
static void | registerClass (const char *name, bool state=true, const char *filePath=0) |
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 * | s_instance = nullptr |
static MapType | s_classes |
static StateMap | s_states |
static bool | s_logToConsole |
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() << ...
other classes (Debug with given Name)
DEBUG_N("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 | ) | const |
Return debugging state for a given class
name | the class name to check |
bool Tracer::logToConsole | ( | ) |
|
static |
Register class for debug output
name | class name |
state | initial enabled state |
filePath | path qualified source filename of class |
|
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 |
|
staticprivate |