#include <stdio.h>
#include <QDebug>
#include <QByteArray>
#include <QDateTime>
#include <QApplication>
#include <QMessageBox>
#include <klfdefs.h>
#include <klfdebug.h>
Go to the source code of this file.
Functions | |
KLF_EXPORT FILE * | klf_qt_msg_get_tty_fp () |
get the TTY file pointer. | |
KLF_EXPORT bool | klf_qt_msg_tty_fp_failed () |
returns true if an attempt to open the tty fp failed. | |
KLF_EXPORT void | klf_qt_msg_set_fp (FILE *fp) |
redirect all debug/warning messages to a given file pointer | |
KLF_EXPORT QByteArray | klf_qt_msg_get_warnings_buffer () |
returns the contents of the warnings buffer. | |
KLF_EXPORT void | klf_qt_msg_clear_warnings_buffer () |
KLF_EXPORT void | klf_qt_msg_handle (QtMsgType type, const QMessageLogContext &, const QString &msgstr) |
a template handler function for Qt debugging/warning/critical messages etc. |
KLF_EXPORT void klf_qt_msg_clear_warnings_buffer | ( | ) |
Definition at line 123 of file klfdebug.cpp.
KLF_EXPORT FILE* klf_qt_msg_get_tty_fp | ( | ) |
get the TTY file pointer.
If the TTY is not yet open, this function tries to open the TTY as a file pointer and returns the corresponding pointer. Use klf_qt_msg_tty_fp_failed() to check for failure.
This function returns NULL on non-UNIX systems.
Definition at line 83 of file klfdebug.cpp.
KLF_EXPORT QByteArray klf_qt_msg_get_warnings_buffer | ( | ) |
returns the contents of the warnings buffer.
Definition at line 118 of file klfdebug.cpp.
KLF_EXPORT void klf_qt_msg_handle | ( | QtMsgType | type, |
const QMessageLogContext & | , | ||
const QString & | msgstr | ||
) |
a template handler function for Qt debugging/warning/critical messages etc.
This function is suitable for use with qInstallMsgHandler() .
Definition at line 132 of file klfdebug.cpp.
References QByteArray::constData(), QString::fromLocal8Bit(), QString::startsWith(), QString::toLatin1(), and QObject::tr().
KLF_EXPORT void klf_qt_msg_set_fp | ( | FILE * | fp | ) |
redirect all debug/warning messages to a given file pointer
Definition at line 101 of file klfdebug.cpp.
References QDateTime::currentDateTime().
KLF_EXPORT bool klf_qt_msg_tty_fp_failed | ( | ) |
returns true if an attempt to open the tty fp failed.
If a previous attempt to open the TTY was made, this function returns true if that attempt failed. If not, attempts to open the TTY and returns true if the attempt failed.
Definition at line 94 of file klfdebug.cpp.