Skip to content

Commit

Permalink
Qt6: eliminate dependency on Qt5Compat module
Browse files Browse the repository at this point in the history
  • Loading branch information
pbartfai committed Sep 4, 2024
1 parent 4ee7e7a commit 7a2d3b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion QT/LDView.pro
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEMPLATE = app
CONFIG += qt opengl thread warn_on release
QT += opengl network
contains(QT_VERSION, ^6\\..*) {
QT += core5compat widgets gui core openglwidgets printsupport
QT += widgets gui core openglwidgets printsupport
DEFINES += QOPENGLWIDGET
}
message(Qt: $$QT_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion QT/QTMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "QtWebClientPlugin.h"
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#include <QWidget>
#include <QTextCodec>
//#include <QTextCodec>
#include <QtOpenGL>
#else
#include <QApplication>
Expand Down
4 changes: 4 additions & 0 deletions TCFoundation/TCLocalStrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,8 +1267,10 @@ void TCLocalStrings::instSetCodePage(int codePage)
QString name;

name = QString("CP%1").arg(codePage);
#if QT_VERSION < QT_VERSION_CHECK(6,0,0) || defined(QT_BUILD_CORE5COMPAT_LIB)
m_textCodec =
QTextCodec::codecForName((const char *)name.toLatin1().constData());
#endif
#endif // WIN32
}

Expand Down Expand Up @@ -1500,6 +1502,7 @@ void TCLocalStrings::mbstowstring(std::wstring &dst, const char *src,
#if !defined(WIN32) && !defined(__APPLE__) && !defined(_OSMESA)
else if (m_textCodec)
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0) || defined(QT_BUILD_CORE5COMPAT_LIB)
QString unicodeString = m_textCodec->toUnicode(src);
dst.clear();
dst.resize(unicodeString.length());
Expand All @@ -1509,6 +1512,7 @@ void TCLocalStrings::mbstowstring(std::wstring &dst, const char *src,

dst[i] = (wchar_t)qchar.unicode();
}
#endif
}
#endif // WIN32
else
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ environment:
QT: 5.15
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204
QT: 6.5
# - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204
# QT: 6.7
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204
QT: 6.7
- APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma

install:
Expand Down

0 comments on commit 7a2d3b0

Please sign in to comment.