Skip to content

Commit 8ec9136

Browse files
authored
COMP: Fix Qt4 build adding fallback implementation for qUtf8Printable() (#909)
1 parent 33286e5 commit 8ec9136

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

Libs/Core/Testing/Cpp/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ set(KITTests_SRCS
3535
ctkLoggerTest1.cpp
3636
ctkModelTesterTest1.cpp
3737
ctkModelTesterTest2.cpp
38-
ctkUtf8Test1.cpp
3938
ctkUtilsCopyDirRecursivelyTest1.cpp
4039
ctkUtilsQtHandleToStringTest1.cpp
4140
ctkUtilsTest.cpp
@@ -52,7 +51,11 @@ set(KITTests_SRCS
5251
ctkWorkflowTest2.cpp
5352
ctkWorkflowTest3.cpp
5453
)
55-
54+
if(CTK_QT_VERSION VERSION_GREATER "4")
55+
list(APPEND KITTests_SRCS
56+
ctkUtf8Test1.cpp
57+
)
58+
endif()
5659
if(HAVE_BFD)
5760
list(APPEND KITTests_SRCS
5861
ctkBinaryFileDescriptorTest1.cpp

Libs/Core/ctkCompatibility_p.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*=========================================================================
2+
3+
Library: CTK
4+
5+
Copyright (c) Kitware Inc.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0.txt
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
=========================================================================*/
20+
21+
#ifndef __ctkCompatibility_p_h
22+
#define __ctkCompatibility_p_h
23+
24+
//
25+
// This file is not part of the CTK API. It exists purely as an
26+
// implementation detail. This header file may change from version to
27+
// version without notice, or even be removed.
28+
//
29+
// We mean it.
30+
//
31+
32+
#include <QtGlobal>
33+
34+
#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
35+
#define qUtf8Printable(string) QString(string).toUtf8().constData()
36+
#endif
37+
38+
#endif

Libs/ctkExport.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifndef __@MY_EXPORT_HEADER_PREFIX@Export_h
99
#define __@MY_EXPORT_HEADER_PREFIX@Export_h
1010

11+
#include "ctkCompatibility_p.h"
1112
#include "ctkCompilerDetections_p.h"
1213

1314
#include <QtGlobal>

0 commit comments

Comments
 (0)