Added handler for QT library messages.

git-svn-id: http://voip.null.ro/svn/yate@2492 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-02-23 16:33:21 +00:00
parent c2e3b7e36d
commit a9383ea1e9
1 changed files with 23 additions and 0 deletions

View File

@ -351,6 +351,27 @@ String QtWidget::s_types[QtWidget::Unknown] = {
"QCalendarWidget"
};
// Handler for QT library messages
static void qtMsgHandler(QtMsgType type, const char* text)
{
int dbg = DebugAll;
switch (type) {
case QtDebugMsg:
dbg = DebugInfo;
break;
case QtWarningMsg:
dbg = DebugWarn;
break;
case QtCriticalMsg:
dbg = DebugGoOn;
break;
case QtFatalMsg:
dbg = DebugFail;
break;
}
Debug("QT",dbg,text);
}
// Utility: get a list row containing the given text
static int findListRow(QListWidget& list, const String& item)
{
@ -2545,10 +2566,12 @@ bool QtClient::connectObjects(QObject* sender, const char* signal,
QtDriver::QtDriver()
: m_init(false)
{
qInstallMsgHandler(qtMsgHandler);
}
QtDriver::~QtDriver()
{
qInstallMsgHandler(0);
}
void QtDriver::initialize()