diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/application/berryQtWorkbenchAdvisor.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/application/berryQtWorkbenchAdvisor.cpp index cbc0062635..4916ca0cb7 100755 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/application/berryQtWorkbenchAdvisor.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/application/berryQtWorkbenchAdvisor.cpp @@ -1,59 +1,61 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryQtWorkbenchAdvisor.h" #include "internal/berryQtGlobalEventFilter.h" #include "berryQtPreferences.h" #include #include #include #include #include #include #include #include #include namespace berry { void QtWorkbenchAdvisor::Initialize(IWorkbenchConfigurer::Pointer configurer) { WorkbenchAdvisor::Initialize(configurer); IPreferencesService::Pointer prefService = Platform::GetServiceRegistry().GetServiceById( IPreferencesService::ID); IPreferences::Pointer prefs = prefService->GetSystemPreferences()->Node(QtPreferences::QT_STYLES_NODE); QString styleName = QString::fromStdString(prefs->Get(QtPreferences::QT_STYLE_NAME, "")); IQtStyleManager::Pointer styleManager = Platform::GetServiceRegistry().GetServiceById(IQtStyleManager::ID); styleManager->SetStyle(styleName); QObject* eventFilter = new QtGlobalEventFilter(qApp); qApp->installEventFilter(eventFilter); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // character strings should be interpreted as UTF-8 encoded strings // e.g. plugin.xml files are UTF-8 encoded QTextCodec* utf8Codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForCStrings(utf8Codec); QTextCodec::setCodecForTr(utf8Codec); +#endif } }