gSAFE  1.3.8
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
HDebugConsole Class Reference

#include <dconsole.h>

Inherits QWidget.

Public Member Functions

 HDebugConsole (QWidget *parent)
 ~HDebugConsole (void)
void add_text (QString s, int type)
HConsolePanelconsoleObject (void)
void setCommandExecution (bool enabled=true)

Static Public Member Functions

static void debug_sql (QString s)
static void debug_txt (QString s)
static void popup (QString title, QString str)

Static Public Attributes

static HDebugConsolemyself = NULL

Protected Member Functions

void closeEvent (QCloseEvent *e)

Detailed Description

HDebugConsole is a debug/info console with a limited sql console and internal command line functionality.


An example to start console, and send some debug message:

//somewhere in the code:
dconsole(); //start the debug console.
sdebug("First phase passed.");
sdebug("N-th phase passed.");

The HDebugConsole grabs the Qt's qDebug messages so you can see the Qt system messages/warnngs/errors
The following messages are goes to the HDebugConsole (when opened):

//somewhere in the code:
qDebug() << "Start processing";
qWarning() << "The string is:" << obj.toString();

You can easely use this console in your project by adding dconsole.h and dconsole.cpp to your project file.
If you don't need the Sql functionality, so you would like to drop the QtSql dependency define the DCONSOLE_NO_SQL macro in your project file:

SOURCES += dconsole.cpp
HEADERS += dconsole.h
#define this below to stay Sql independent.
#define this below if you use 4.X version of Qt (Not Qt 5.X)

Current available commands (Console "help" command output):

HDebugConsole, commands:
alldb - Show all available database connections
clear - Clears the debug window's text
close - Close the debug window (only)
dbinfo - Show the current connected database information
disable <filter> - Disable the "filter" kind of output
enable <filter> - Enable the "filter" kind of output
exit - Exit main program (The debugged program too)
filters - Show available debug filters
help - List the available commands
run <custom> - Run the "custom" program command
save - Save the content of debug window to debug.txt
setdb - Sets the current database to default (not the program but console)
setdb <dbname> - Sets the current database to "dbname"
show - Show all table in the current database
show <tablename> - Show the fields of table named "tablename"
state <filter> - Show the state of the "filter" kind of output filter
synw - Query the state or clear the content of syndebug.txt
synw off - Disable the writing of syndebug.txt
synw on - Enable the writing of syndebug.txt
synw clear - Clear the content of syndebug.txt
write <text> - Write "text" to the console
"SQL" - Execute the SQL command

Definition at line 175 of file dconsole.h.

Constructor & Destructor Documentation

HDebugConsole::HDebugConsole ( QWidget *  parent)

Creates a HDebugConsole. Don't create directly. Use the dconsole() global function instead

Definition at line 173 of file dconsole.cpp.

HDebugConsole::~HDebugConsole ( void  )


Definition at line 296 of file dconsole.cpp.

Member Function Documentation

void HDebugConsole::add_text ( QString  s,
int  type 

Write a text to the console. Don't use it directly. Use the sdebug() and sqldebug() instead

Definition at line 341 of file dconsole.cpp.

HConsolePanel * HDebugConsole::consoleObject ( void  )

Returns the console panel object

Definition at line 330 of file dconsole.cpp.

void HDebugConsole::debug_sql ( QString  s)

Write an sql text to the console

Definition at line 375 of file dconsole.cpp.

void HDebugConsole::debug_txt ( QString  s)

Write a normal text to the console

Definition at line 382 of file dconsole.cpp.

void HDebugConsole::popup ( QString  title,
QString  str 

Popups a warning text

Definition at line 335 of file dconsole.cpp.

void HDebugConsole::setCommandExecution ( bool  enabled = true)

You can disable the command excution if this function called with FALSE.

enabledFALSE:The user can't execute any command. TRUE(Default state):The console execute the user's commands.

Definition at line 309 of file dconsole.cpp.

Member Data Documentation

HDebugConsole * HDebugConsole::myself = NULL

The one pointer of the only one HDebugConsole

Definition at line 181 of file dconsole.h.

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