FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

configure: Check for Qt6, fall back to Qt5 · gnuplot/gnuplot@e458b88 · GitHub

Repository navigation

Commit e458b88

Browse files
Ethan A Merritt
committed
configure: Check for Qt6, fall back to Qt5
Note: requires C++ -std=c++17 Note: requires Qt6 compatibility module Core5Compat for class QTextCodec codecForLocale() codecForMib() fromUnicode() toUnicode() in order to support non-utf8 encodings (gnuplot's "set encoding"). This is not entirely satisfactory, since there is apparently not a guarantee from Qt that the compatibility modules will continue to be available in the future. ./configure --with-qt=qt4 is still accepted but I no longer have the Qt4 libraries installed to confirm that it works.
1 parent e460850 commit e458b88

2 files changed

Lines changed: 45 additions & 17 deletions

File tree

‎configure.ac‎

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,29 +1065,48 @@ if test "${enable_qt}" = yes ; then
10651065
enable_qt_ok=no
10661066
fi
10671067

1068-
dnl First check for Qt5
1069-
if test "x${with_qt}" = "xqt5"; then
1070-
try_qt4=no
1071-
else
1068+
dnl Qt4 only by special request
1069+
if test "x${with_qt}" = "xqt4"; then
10721070
try_qt4=yes
1071+
else
1072+
try_qt4=no
10731073
fi
1074+
10741075
if test "x${with_qt}" != "xqt4"; then
1075-
PKG_CHECK_MODULES_NOFAIL(QT, [Qt5Core Qt5Gui Qt5Network Qt5Svg Qt5PrintSupport])
1076+
AC_MSG_CHECKING([Checking for Qt6 support libraries])
1077+
PKG_CHECK_MODULES_NOFAIL(QT, [Qt6Core Qt6Gui Qt6Network Qt6Svg Qt6PrintSupport Qt6Core5Compat])
10761078
if test $pkg_failed = no; then
1077-
try_qt4=no
1078-
QT5LOC=`$PKG_CONFIG --variable=host_bins Qt5Core`
1079-
if test "x${QT5LOC}" != "x"; then
1080-
UIC=${QT5LOC}/uic
1081-
MOC=${QT5LOC}/moc
1082-
RCC=${QT5LOC}/rcc
1083-
LRELEASE=${QT5LOC}/lrelease
1079+
QT6LOC=`$PKG_CONFIG --variable=host_bins Qt6Core`
1080+
if test "x${QT6LOC}" != "x"; then
1081+
UIC=${QT6LOC}/uic
1082+
MOC=${QT6LOC}/moc
1083+
RCC=${QT6LOC}/rcc
1084+
LRELEASE=${QT6LOC}/lrelease
10841085
fi
10851086
CXXFLAGS="$CXXFLAGS -fPIC"
1087+
AC_MSG_RESULT([The Qt terminal will use Qt6.])
1088+
QTVER="6"
1089+
else
1090+
AC_MSG_CHECKING([Checking for Qt5 support libraries])
1091+
PKG_CHECK_MODULES_NOFAIL(QT, [Qt5Core Qt5Gui Qt5Network Qt5Svg Qt5PrintSupport])
1092+
if test $pkg_failed = no; then
1093+
QT5LOC=`$PKG_CONFIG --variable=host_bins Qt5Core`
1094+
if test "x${QT5LOC}" != "x"; then
1095+
UIC=${QT5LOC}/uic
1096+
MOC=${QT5LOC}/moc
1097+
RCC=${QT5LOC}/rcc
1098+
LRELEASE=${QT5LOC}/lrelease
1099+
fi
1100+
CXXFLAGS="$CXXFLAGS -fPIC"
1101+
AC_MSG_RESULT([The Qt terminal will use Qt5.])
1102+
QTVER="5"
1103+
fi
10861104
fi
10871105
fi
10881106

1089-
dnl No Qt5, check for Qt4.5 or greater
1090-
if test ${try_qt4} != no; then
1107+
dnl Explicit request for qt4
1108+
if test ${try_qt4} = yes; then
1109+
AC_MSG_CHECKING([Checking for Qt4 support])
10911110
PKG_CHECK_MODULES_NOFAIL(QT, [QtCore >= 4.5 QtGui >= 4.5 QtNetwork >= 4.5 QtSvg >= 4.5])
10921111
if test $pkg_failed != no; then
10931112
enable_qt_ok=no
@@ -1101,9 +1120,6 @@ if test "${enable_qt}" = yes ; then
11011120
AC_MSG_RESULT([The Qt terminal will use Qt4.])
11021121
QTVER="4"
11031122
fi
1104-
else
1105-
AC_MSG_RESULT([The Qt terminal will use Qt5.])
1106-
QTVER="5"
11071123
fi
11081124
fi
11091125

@@ -1366,6 +1382,9 @@ if test "$enable_qt_ok" = yes; then
13661382
if test "$QTVER" = 5; then
13671383
AC_MSG_RESULT([ Qt : yes (qt5)])
13681384
fi
1385+
if test "$QTVER" = 6; then
1386+
AC_MSG_RESULT([ Qt : yes (qt6)])
1387+
fi
13691388
else
13701389
AC_MSG_RESULT([ Qt : no (use --with-qt or --with-qt=qt4 to enable])
13711390
fi

‎src/qtterminal/qt_conversion.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
* under either the GPL or the gnuplot license.
4242
]*/
4343

44+
/*
45+
* Qt6 no longer supports other 8-bit encodings natively, relegating the
46+
* QTextCodec functions to a compatibility module Core5Compat.
47+
* FIXME: roll our own?
48+
*/
49+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
50+
#include <QTextCodec>
51+
#endif
52+
4453
static QColor qt_colorList[12] =
4554
{
4655
Qt::white,

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL