소스 검색

Fix build of ctkTestApplication.cpp with Qt4. Fixes #482

This commit fixes windows build error originally introduced by
commit 77a4db54 adding support for Qt5.

Example of errors:

31>6>4>..\..\..\..\CTK\Libs\Widgets\ctkTestApplication.cpp(129) : error C2228: left of '.toLocal8Bit' must have class/struct/union
31>6>4>        type is 'const char *'
Jean-Christophe Fillion-Robin 11 년 전
부모
커밋
37373075eb
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      Libs/Widgets/ctkTestApplication.cpp

+ 4 - 2
Libs/Widgets/ctkTestApplication.cpp

@@ -119,10 +119,12 @@ int ctkTestApplication::exec(bool reportErrorsOnExit)
 //-----------------------------------------------------------------------------
 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
 void ctkTestApplication::messageHandler(QtMsgType type, const QMessageLogContext& /*context*/, const QString& msg)
+{
 #else
-void ctkTestApplication::messageHandler(QtMsgType type, const char *msg)
-#endif
+void ctkTestApplication::messageHandler(QtMsgType type, const char *msgAsStr)
 {
+  QString msg(msgAsStr);
+#endif
   switch(type)
   {
   case QtDebugMsg: