VirtualBox

Changeset 58850 in vbox


Ignore:
Timestamp:
Nov 25, 2015 1:03:46 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Qt5 migration (part 3): Yet another QtMessageOutput stuff in DnD code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp

    r58329 r58850  
    283283QTextStream *g_pStrmLogQt = NULL; /* Output stream for Qt debug logging. */
    284284
     285# if QT_VERSION >= 0x050000
    285286/* static */
    286 void UIDnDHandler::debugOutputQt(QtMsgType type, const char *pszMsg)
    287 {
    288     AssertPtr(pszMsg);
    289 
     287void UIDnDHandler::debugOutputQt(QtMsgType type, const QMessageLogContext &context, const QString &strMessage)
     288{
    290289    QString strMsg;
    291290    switch (type)
     
    307306
    308307    if (g_pStrmLogQt)
     308        (*g_pStrmLogQt) << strMsg << " " << strMessage << endl;
     309}
     310# else /* QT_VERSION < 0x050000 */
     311/* static */
     312void UIDnDHandler::debugOutputQt(QtMsgType type, const char *pszMsg)
     313{
     314    AssertPtr(pszMsg);
     315
     316    QString strMsg;
     317    switch (type)
     318    {
     319    case QtWarningMsg:
     320        strMsg += "[W]";
     321        break;
     322    case QtCriticalMsg:
     323        strMsg += "[C]";
     324        break;
     325    case QtFatalMsg:
     326        strMsg += "[F]";
     327        break;
     328    case QtDebugMsg:
     329    default:
     330        strMsg += "[D]";
     331        break;
     332    }
     333
     334    if (g_pStrmLogQt)
    309335        (*g_pStrmLogQt) << strMsg << " " << pszMsg << endl;
    310336}
     337# endif /* QT_VERSION < 0x050000 */
    311338#endif /* DEBUG_DND_QT */
    312339
     
    335362        g_pStrmLogQt = new QTextStream(pFileDebugQt);
    336363
     364#if QT_VERSION >= 0x050000
     365        qInstallMessageHandler(UIDnDHandler::debugOutputQt);
     366#else /* QT_VERSION < 0x050000 */
    337367        qInstallMsgHandler(UIDnDHandler::debugOutputQt);
     368#endif /* QT_VERSION < 0x050000 */
    338369        qDebug("========================================================================");
    339370    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette