|
From: <cn...@us...> - 2023-05-25 23:42:01
|
Revision: 1385
http://sourceforge.net/p/seq/svn/1385
Author: cn187
Date: 2023-05-25 23:41:58 +0000 (Thu, 25 May 2023)
Log Message:
-----------
[Experimental] Initial work to support Qt6
Modified Paths:
--------------
showeq/branches/cn187_devel/acinclude.m4
showeq/branches/cn187_devel/configure.in
showeq/branches/cn187_devel/src/cgiconv.cpp
showeq/branches/cn187_devel/src/datalocationmgr.cpp
showeq/branches/cn187_devel/src/drawmap.cpp
showeq/branches/cn187_devel/src/editor.h
showeq/branches/cn187_devel/src/eqstr.cpp
showeq/branches/cn187_devel/src/experiencelog.cpp
showeq/branches/cn187_devel/src/filter.cpp
showeq/branches/cn187_devel/src/filter.h
showeq/branches/cn187_devel/src/filtermgr.cpp
showeq/branches/cn187_devel/src/filternotifications.cpp
showeq/branches/cn187_devel/src/guildlist.cpp
showeq/branches/cn187_devel/src/guildshell.cpp
showeq/branches/cn187_devel/src/interface.cpp
showeq/branches/cn187_devel/src/listspawn.cpp
showeq/branches/cn187_devel/src/map.cpp
showeq/branches/cn187_devel/src/map.h
showeq/branches/cn187_devel/src/mapcore.cpp
showeq/branches/cn187_devel/src/mapicondialog.ui
showeq/branches/cn187_devel/src/messagefilter.cpp
showeq/branches/cn187_devel/src/messagefilter.h
showeq/branches/cn187_devel/src/messagefilterdialog.cpp
showeq/branches/cn187_devel/src/messagewindow.cpp
showeq/branches/cn187_devel/src/messagewindow.h
showeq/branches/cn187_devel/src/netstream.cpp
showeq/branches/cn187_devel/src/packetinfo.cpp
showeq/branches/cn187_devel/src/showspawn.cpp
showeq/branches/cn187_devel/src/sortitem.cpp
showeq/branches/cn187_devel/src/spawn.cpp
showeq/branches/cn187_devel/src/spawnpointlist.cpp
showeq/branches/cn187_devel/src/spells.cpp
showeq/branches/cn187_devel/src/terminal.h
showeq/branches/cn187_devel/src/xmlpreferences.cpp
showeq/branches/cn187_devel/src/zonemgr.cpp
Modified: showeq/branches/cn187_devel/acinclude.m4
===================================================================
--- showeq/branches/cn187_devel/acinclude.m4 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/acinclude.m4 2023-05-25 23:41:58 UTC (rev 1385)
@@ -1,6 +1,6 @@
## -*- autoconf -*-
-# serial 4 improve qt5 autodetection on certain plaforms
+# serial 5 improve qt6 autodetection on certain plaforms
dnl This file is part of ShowEQ and is based on the file from KDE.
dnl Copyright (C) 1997 Janos Farkas (ch...@sh...)
@@ -127,20 +127,21 @@
AC_FIND_FILE(moc, [ $ac_qt_bindir \
$QTDIR/bin \
$QTDIR/src/moc \
- /usr/local/qt*/bin \
- /usr/lib/${host_cpu}-${host_vendor}-${host_os}/qt*/bin \
- /usr/lib/${host_cpu}-${host_os}/qt*/bin \
- /usr/lib/arm-linux-gnueabihf/qt*/bin \
- /usr/lib/*/qt*/bin \
- /usr/lib/qt*/bin \
- /usr/X11R6/bin/qt* \
- /usr/X11R6/bin/qt*/bin \
- /usr/X11R6/bin/X11/qt* \
- /usr/X11R6/bin/X11/qt*/bin \
- /usr/lib/qt*/bin \
+ /usr/local/qt${qt_major_version}/bin \
+ /usr/lib/${host_cpu}-${host_vendor}-${host_os}/qt${qt_major_version}/bin \
+ /usr/lib/${host_cpu}-${host_os}/qt${qt_major_version}/bin \
+ /usr/lib/arm-linux-gnueabihf/qt${qt_major_version}/bin \
+ /usr/lib/*/qt${qt_major_version}/bin \
+ /usr/lib/qt${qt_major_version}/bin \
+ /usr/lib/qt${qt_major_version}/libexec \
+ /usr/X11R6/bin/qt${qt_major_version} \
+ /usr/X11R6/bin/qt${qt_major_version}/bin \
+ /usr/X11R6/bin/X11/qt${qt_major_version} \
+ /usr/X11R6/bin/X11/qt${qt_major_version}/bin \
+ /usr/lib/qt${qt_major_version}/bin \
/usr/bin \
/usr/X11R6/bin \
- /usr/src/qt-*/bin ],
+ /usr/src/qt-${qt_major_version}/bin ],
MOC)
@@ -236,20 +237,21 @@
AC_FIND_FILE(uic, [ $ac_qt_bindir \
$QTDIR/bin \
$QTDIR/src/uic \
- /usr/local/qt*/bin \
- /usr/lib/${host_cpu}-${host_vendor}-${host_os}/qt*/bin \
- /usr/lib/${host_cpu}-${host_os}/qt*/bin \
- /usr/lib/arm-linux-gnueabihf/qt*/bin \
- /usr/lib/*/qt*/bin \
- /usr/lib64/*/qt*/bin \
+ /usr/local/qt${qt_major_version}/bin \
+ /usr/lib/${host_cpu}-${host_vendor}-${host_os}/qt${qt_major_version}/bin \
+ /usr/lib/${host_cpu}-${host_os}/qt${qt_major_version}/bin \
+ /usr/lib/arm-linux-gnueabihf/qt${qt_major_version}/bin \
+ /usr/lib/*/qt${qt_major_version}/bin \
+ /usr/lib64/*/qt${qt_major_version}/bin \
/usr/bin \
- /usr/X11R6/bin/qt* \
- /usr/X11R6/bin/qt*/bin \
- /usr/X11R6/bin/X11/qt* \
- /usr/X11R6/bin/X11/qt*/bin \
- /usr/lib/qt*/bin \
- /usr/lib64/qt*/bin \
- /usr/src/qt-*/bin ],
+ /usr/X11R6/bin/qt${qt_major_version} \
+ /usr/X11R6/bin/qt${qt_major_version}/bin \
+ /usr/X11R6/bin/X11/qt${qt_major_version} \
+ /usr/X11R6/bin/X11/qt${qt_major_version}/bin \
+ /usr/lib/qt${qt_major_version}/bin \
+ /usr/lib/qt${qt_major_version}/libexec \
+ /usr/lib64/qt${qt_major_version}/bin \
+ /usr/src/qt-${qt_major_version}/bin ],
UIC)
@@ -590,10 +592,10 @@
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSOCKET"
-ac_qt_libraries=""
+dnl ac_qt_libraries=""
ac_qt_bindir=""
-qt_libraries=""
+dnl qt_libraries=""
qt_docs=""
@@ -673,9 +675,13 @@
if [[ $qt_major_version -eq 4 ]]; then
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes -I$qt_incdir/Qt"
-else
- CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes -I$qt_incdir/QtCore -I$qt_incdir/QtWidgets -fPIC"
fi
+if [[ $qt_major_version -eq 5 ]]; then
+ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes -I$qt_incdir/QtCore -I$qt_incdir/QtWidgets -fPIC -std=c++11"
+fi
+if [[ $qt_major_version -eq 6 ]]; then
+ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes -I$qt_incdir/QtCore -I$qt_incdir/QtWidgets -fPIC -std=c++17"
+fi
LDFLAGS="-L$qt_libdir $all_libraries"
LIBS="$LIBS $LIBQT"
@@ -824,9 +830,9 @@
AC_DEFUN([AC_PATH_QT_HEADERS],
[
-ac_qt_includes=""
-qt_includes=""
-qt_incdir=""
+dnl ac_qt_includes=""
+dnl qt_includes=""
+dnl qt_incdir=""
AC_MSG_CHECKING([for Qt])
@@ -863,9 +869,9 @@
dnl qt5 (and later?) has QT_VERSION_STR in qconfig.h, while qt4 has it in qglobal.h
AC_FIND_FILE("Qt/qglobal.h", $qt_incdirs, qt4_incdir)
-AC_FIND_FILE("QtCore/qconfig.h", $qt_incdirs, qt5_incdir_base)
-AC_FIND_FILE("QtCore/qconfig-32.h", $qt_incdirs, qt5_incdir_32)
-AC_FIND_FILE("QtCore/qconfig-64.h", $qt_incdirs, qt5_incdir_64)
+AC_FIND_FILE("QtCore/qconfig.h", $qt_incdirs, qt56_incdir_base)
+AC_FIND_FILE("QtCore/qconfig-32.h", $qt_incdirs, qt56_incdir_32)
+AC_FIND_FILE("QtCore/qconfig-64.h", $qt_incdirs, qt56_incdir_64)
dnl *************************************************
dnl * At this point, we extract the Qt version from *
@@ -889,16 +895,16 @@
qt_incdir="$qt4_incdir"
else
- if [[ "$qt5_incdir_64" != "NO" ]]; then
- qt_version_source="$qt5_incdir_64/QtCore/qconfig-64.h"
- qt_incdir="$qt5_incdir_64"
+ if [[ "$qt56_incdir_64" != "NO" ]]; then
+ qt_version_source="$qt56_incdir_64/QtCore/qconfig-64.h"
+ qt_incdir="$qt56_incdir_64"
else
- if [[ "$qt5_incdir_32" != "NO" ]]; then
- qt_version_source="$qt5_incdir_32/QtCore/qconfig-32.h"
- qt_incdir="$qt5_incdir_32"
+ if [[ "$qt56_incdir_32" != "NO" ]]; then
+ qt_version_source="$qt56_incdir_32/QtCore/qconfig-32.h"
+ qt_incdir="$qt56_incdir_32"
else
- qt_version_source="$qt5_incdir_base/QtCore/qconfig.h"
- qt_incdir="$qt5_incdir_base"
+ qt_version_source="$qt56_incdir_base/QtCore/qconfig.h"
+ qt_incdir="$qt56_incdir_base"
fi
fi
@@ -932,8 +938,8 @@
if [[ -n "$qt_version_string" ]]; then
echo -e "yes\n>> Found version.:\t$qt_version_string"
- if [[ $qt_major_version -eq 5 ]]; then
- echo -e "NOTICE: Support for Qt5 is EXPERIMENTAL. If you experience issues, please report them on the forum."
+ if [[ $qt_major_version -eq 6 ]]; then
+ echo -e "NOTICE: Support for qt6 is EXPERIMENTAL. If you experience issues, please report them on the forum."
fi
echo -e ">>> Headers......:\t$qt_incdir"
ac_qt_includes="$qt_incdir"
@@ -944,6 +950,7 @@
qt4_target_version="4.4.0"
qt5_target_version="5.5.0"
+qt6_target_version="6.3.0"
case $qt_major_version in
4)
@@ -954,12 +961,15 @@
;;
5)
if [[ $qt_minor_version -lt 5 ]]; then
- AC_MSG_ERROR([ShowEQ requires qt $qt5_target_version or later. Please make sure qt $qt5_target_version or later is installed!!!]);
+ AC_MSG_ERROR([ShowEQ requires qt $qt5_target_version or later. Please make sure qt $qt5_target_version or later is installed!!!]);
fi
qt_lib=libQt5Core
;;
6)
- AC_MSG_ERROR([ShowEQ does not yet support qt6. Please install qt4 or qt5.]);
+ if [[ $qt_minor_version -lt 3 ]]; then
+ AC_MSG_ERROR([ShowEQ requires qt $qt6_target_version or later. Please make sure qt $qt6_target_version or later is installed!!!]);
+ fi
+ qt_lib=libQt6Core
;;
*)
AC_MSG_ERROR([ShowEQ requires qt $qt4_target_version or later. Please make sure qt $qt4_target_version or later is installed!!!]);
Modified: showeq/branches/cn187_devel/configure.in
===================================================================
--- showeq/branches/cn187_devel/configure.in 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/configure.in 2023-05-25 23:41:58 UTC (rev 1385)
@@ -175,6 +175,15 @@
LIB_QT+=" -lQt${qt_major_version}Gui -lQt${qt_major_version}Xml "
fi
+#if [[ $qt_major_version == 6 ]]; then
+# LIB_QT+=" -lQt6Core5Compat "
+#fi
+if [[ $qt_major_version == 6 ]]; then
+ CXXFLAGS="$CXXFLAGS -std=c++17"
+else
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+fi
+
dnl The below needs to be re-defined since the Qt defines from KDE destroy it
AC_LANG_CPLUSPLUS
@@ -471,7 +480,7 @@
AC_CHECK_RPATH
CFLAGS="$USE_THREADS $USE_OPT_C $USE_DEBUG_C $USE_INLINE_C $USE_PROFILE_C $CFLAGS"
-CXXFLAGS="$USE_THREADS $USE_OPT_CXX $USE_DEBUG_CXX $USE_INLINE_CXX $USE_PROFILE_CXX -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=${CGI_ICONS} -DICON_DIR=\\\"${CGI_ICON_DIR}\\\" $CXXFLAGS -std=c++11 -fPIC -DQT_NO_VERSION_TAGGING"
+CXXFLAGS="$USE_THREADS $USE_OPT_CXX $USE_DEBUG_CXX $USE_INLINE_CXX $USE_PROFILE_CXX -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=${CGI_ICONS} -DICON_DIR=\\\"${CGI_ICON_DIR}\\\" $CXXFLAGS -fPIC -DQT_NO_VERSION_TAGGING"
AC_DEFUN([SUCCESS],[
echo "Success!"
Modified: showeq/branches/cn187_devel/src/cgiconv.cpp
===================================================================
--- showeq/branches/cn187_devel/src/cgiconv.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/cgiconv.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -27,7 +27,11 @@
#include <cstdlib>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include <QFile>
#include <QTextStream>
@@ -78,8 +82,13 @@
int oldindex = 0;
// frequently used regular expressions
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression paramEndExp("[&;]");
+ QRegularExpression paramPlusExp("\\+");
+#else
QRegExp paramEndExp("[&;]");
QRegExp paramPlusExp("\\+");
+#endif
// iterate over the string finding name/value pairs
do
Modified: showeq/branches/cn187_devel/src/datalocationmgr.cpp
===================================================================
--- showeq/branches/cn187_devel/src/datalocationmgr.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/datalocationmgr.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -28,7 +28,11 @@
#include <QDir>
#include <QFileInfo>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
DataLocationMgr::DataLocationMgr(const QString& homeSubDir)
{
@@ -138,7 +142,11 @@
if (!caseSensitive)
{
// create a case insensitive regex
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression regex(filename, QRegularExpression::CaseInsensitiveOption);
+#else
QRegExp regex(filename, Qt::CaseInsensitive);
+#endif
// construct the filterspec to choose only the files with matching access
QDir::Filters filterSpec;
@@ -158,9 +166,13 @@
while (it.hasNext())
{
fi = it.next();
- // if found a match, then return it.
- if (regex.exactMatch(fi.fileName()))
- return fi;
+ // if found a match, then return it.
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ if (regex.match(QRegularExpression::anchoredPattern(fi.fileName())).hasMatch())
+#else
+ if (regex.exactMatch(fi.fileName()))
+#endif
+ return fi;
}
}
}
Modified: showeq/branches/cn187_devel/src/drawmap.cpp
===================================================================
--- showeq/branches/cn187_devel/src/drawmap.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/drawmap.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -31,7 +31,11 @@
#include <QString>
#include <QDir>
#include <QTextStream>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include "cgiconv.h"
#include "util.h"
@@ -579,7 +583,11 @@
// if in drawmap mode, then that's all that's done
if (drawMap)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression slashExp("/");
+#else
QRegExp slashExp("/");
+#endif
mapName.replace(slashExp, "_");
mapName.prepend(PKGDATADIR "maps/");
Modified: showeq/branches/cn187_devel/src/editor.h
===================================================================
--- showeq/branches/cn187_devel/src/editor.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/editor.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -35,7 +35,7 @@
{
Q_OBJECT
public:
- EditorWindow();
+ //EditorWindow();
EditorWindow( const char *fileName );
~EditorWindow();
Modified: showeq/branches/cn187_devel/src/eqstr.cpp
===================================================================
--- showeq/branches/cn187_devel/src/eqstr.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/eqstr.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -28,12 +28,17 @@
#include <cstdio>
-#include <QRegExp>
#include <QFile>
#include <QStringList>
#include <QVector>
#include <QString>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
+#include <QRegExp>
+#endif
+
EQStr::EQStr()
: m_messageStrings(),
m_loaded(false)
@@ -67,7 +72,11 @@
formatFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression lineTerm("[\r\n]{1,2}");
+#else
QRegExp lineTerm("[\r\n]{1,2}");
+#endif
// split the data into lines at the line termination
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
@@ -197,57 +206,100 @@
////////////////////////////
// replace template (%T) arguments in formatted string
QString formatString = formatStringRes;
- QRegExp rxt("%T(\\d{1,3})");
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression rxt("%T(\\d{1,3})");
+ // find first template substitution
+ auto match = rxt.match(formatString, 0);
+ curPos = match.capturedStart(1);
+#else
+ QRegExp rxt("%T(\\d{1,3})");
+ // find first template substitution
+ curPos = rxt.indexIn(formatString, 0);
+#endif
- // find first template substitution
- curPos = rxt.indexIn(formatString, 0);
+ while (curPos != -1)
+ {
+ substFormatStringRes = QString();
- while (curPos != -1)
- {
- substFormatStringRes = QString();
- substArg = rxt.cap(1).toInt(&ok);
- if (ok && (substArg <= argList.size()))
- {
- substArgValue = argList[substArg-1].toInt(&ok);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ substArg = match.captured(1).toInt(&ok);
+#else
+ substArg = rxt.cap(1).toInt(&ok);
+#endif
- if (ok)
- substFormatStringRes = m_messageStrings.value(substArgValue, QString());
- }
- // replace template argument with subst string
- if (!substFormatStringRes.isEmpty())
- formatString.replace(curPos, rxt.matchedLength(), substFormatStringRes);
- else
- curPos += rxt.matchedLength(); // if no replacement string, skip over
+ if (ok && (substArg <= argList.size()))
+ {
+ substArgValue = argList[substArg-1].toInt(&ok);
- // find next substitution
- curPos = rxt.indexIn(formatString, curPos);
- }
+ if (ok)
+ substFormatStringRes = m_messageStrings.value(substArgValue, QString());
+ }
+ // replace template argument with subst string
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ if (!substFormatStringRes.isEmpty())
+ formatString.replace(curPos, match.capturedLength(1), substFormatStringRes);
+ else
+ curPos = match.capturedEnd(1); // if no replacement string, skip over
+
+ // find next substitution
+ match = rxt.match(formatString, curPos);
+ curPos = match.capturedStart(1);
+#else
+ if (!substFormatStringRes.isEmpty())
+ formatString.replace(curPos, rxt.matchedLength(), substFormatStringRes);
+ else
+ curPos += rxt.matchedLength(); // if no replacement string, skip over
+
+ // find next substitution
+ curPos = rxt.indexIn(formatString, curPos);
+#endif
+ }
+
////////////////////////////
// now replace substitution arguments in formatted string
// NOTE: not using QString::arg() because not all arguments are always used
// and it will do screwy stuff in this situation
- QRegExp rx("%(\\d{1,3})");
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression rx("%(\\d{1,3})");
+ match = rx.match(formatString, 0);
+ curPos = match.capturedStart(1);
+#else
+ QRegExp rx("%(\\d{1,3})");
+ // find first template substitution
+ curPos = rx.indexIn(formatString, 0);
+#endif
- // find first template substitution
- curPos = rx.indexIn(formatString, 0);
+ while (curPos != -1)
+ {
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ substArg = match.captured(1).toInt(&ok);
- while (curPos != -1)
- {
- substArg = rx.cap(1).toInt(&ok);
+ // replace substitution argument with argument from list
+ if (ok && (substArg <= argList.size()))
+ formatString.replace(curPos, match.capturedLength(1), argList[substArg-1]);
+ else
+ curPos = match.capturedEnd(1); // if no such argument, skip over
- // replace substitution argument with argument from list
- if (ok && (substArg <= argList.size()))
- formatString.replace(curPos, rx.matchedLength(), argList[substArg-1]);
- else
- curPos += rx.matchedLength(); // if no such argument, skip over
+ // find next substitution
+ match = rx.match(formatString, curPos);
+ curPos = match.capturedStart(1);
+#else
+ substArg = rx.cap(1).toInt(&ok);
- // find next substitution
- curPos = rx.indexIn(formatString, curPos);
- }
+ // replace substitution argument with argument from list
+ if (ok && (substArg <= argList.size()))
+ formatString.replace(curPos, rx.matchedLength(), argList[substArg-1]);
+ else
+ curPos += rx.matchedLength(); // if no such argument, skip over
- return formatString;
+ // find next substitution
+ curPos = rx.indexIn(formatString, curPos);
+#endif
}
+ return formatString;
+ }
+
}
Modified: showeq/branches/cn187_devel/src/experiencelog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/experiencelog.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/experiencelog.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -34,6 +34,7 @@
#include <ctime>
#include <QTimer>
+#include <QActionGroup>
#include <QGroupBox>
#include <QMessageBox>
#include <QFileInfo>
Modified: showeq/branches/cn187_devel/src/filter.cpp
===================================================================
--- showeq/branches/cn187_devel/src/filter.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/filter.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -182,8 +182,13 @@
(const char*)regexString, minLevel, maxLevel);
#endif
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ if (!caseSensitive)
+ m_regexp.setPatternOptions(QRegularExpression::CaseInsensitiveOption);
+#else
m_regexp.setPatternSyntax(QRegExp::RegExp);
m_regexp.setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
+#endif
// For the pattern, save off the original. This is what will be saved
// during save operations. But the actual regexp we filter with will
@@ -244,7 +249,7 @@
bool FilterItem::isFiltered(const QString& filterString, uint8_t level) const
{
// check the main filter string
- if (m_regexp.indexIn(filterString) != -1)
+ if (filterString.indexOf(m_regexp) != -1)
{
// is there is a level range component to this filter
if ((m_minLevel > 0) || (m_maxLevel > 0))
@@ -603,8 +608,13 @@
QTextStream out(&file);
// set the output encoding to be UTF8
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ out.setEncoding(QStringConverter::Utf8);
+#else
out.setCodec("UTF-8");
+#endif
+
// set the number output to be left justified decimal
out.setIntegerBase(10);
out.setFieldAlignment(QTextStream::AlignLeft);
Modified: showeq/branches/cn187_devel/src/filter.h
===================================================================
--- showeq/branches/cn187_devel/src/filter.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/filter.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -33,10 +33,15 @@
#include <QString>
#include <QList>
-#include <QRegExp>
#include <QXmlAttributes>
#include <QTextStream>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
+#include <QRegExp>
+#endif
+
#include <map>
//--------------------------------------------------
@@ -76,7 +81,11 @@
void init(const QString& filterPattern, bool caseSensitive, uint8_t minLevel,
uint8_t maxLevel);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression m_regexp;
+#else
QRegExp m_regexp;
+#endif
QString m_regexpOriginalPattern;
uint8_t m_minLevel;
uint8_t m_maxLevel;
Modified: showeq/branches/cn187_devel/src/filtermgr.cpp
===================================================================
--- showeq/branches/cn187_devel/src/filtermgr.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/filtermgr.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -32,7 +32,6 @@
#include <cerrno>
-#include <QRegExp>
#include <QString>
#include <QFileInfo>
Modified: showeq/branches/cn187_devel/src/filternotifications.cpp
===================================================================
--- showeq/branches/cn187_devel/src/filternotifications.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/filternotifications.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -29,7 +29,11 @@
#include <cstdio>
#include <QString>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include <QApplication>
FilterNotifications::FilterNotifications(QObject* parent, const char* name)
@@ -130,8 +134,13 @@
// time to cook the command line
QString command = rawCommand;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression nameExp("%n");
+ QRegularExpression cueExp("%c");
+#else
QRegExp nameExp("%n");
QRegExp cueExp("%c");
+#endif
// get the name, and replace all occurrances of %n with the name
QString name = item->transformedName();
Modified: showeq/branches/cn187_devel/src/guildlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/guildlist.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/guildlist.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -112,7 +112,11 @@
setText(tGuildListColBank, m_member->bankRankString());
setText(tGuildListColAlt, m_member->altRankString());
QDateTime dt;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dt.setSecsSinceEpoch(m_member->lastOn());
+#else
dt.setTime_t(m_member->lastOn());
+#endif
setText(tGuildListColLastOn, dt.toString(dateFormat));
QString zoneString = guildShell->zoneString(m_member->zoneId());
if (m_member->zoneInstance())
Modified: showeq/branches/cn187_devel/src/guildshell.cpp
===================================================================
--- showeq/branches/cn187_devel/src/guildshell.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/guildshell.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -116,7 +116,11 @@
#ifdef GUILDSHELL_DIAG
QDateTime dt;
QString dateFormat("ddd MMM dd hh:mm:ss yyyy");
- dt.setTime_t(m_lastOn);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dt.setSecsSinceEpoch(m_lastOn());
+#else
+ dt.setTime_t(m_lastOn());
+#endif
QString zone;
zone = QString::number(m_zoneId);
@@ -238,7 +242,11 @@
it.next();
member = it.value();
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dt.setSecsSinceEpoch(member->lastOn());
+#else
dt.setTime_t(member->lastOn());
+#endif
zone = zoneString(member->zoneId());
if (member->zoneInstance())
zone += ":" + QString::number(member->zoneInstance());
@@ -307,7 +315,11 @@
emit added(member);
#ifdef GUILDSHELL_DIAG
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dt.setSecsSinceEpoch(member->lastOn());
+#else
dt.setTime_t(member->lastOn());
+#endif
seqDebug("%-64s\t%d\t%s\t%d\t%s\t'%s'\t%s:%d",
(const char*)member->name(),
member->level(),
Modified: showeq/branches/cn187_devel/src/interface.cpp
===================================================================
--- showeq/branches/cn187_devel/src/interface.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/interface.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -91,9 +91,12 @@
#include <QColorDialog>
#include <QMenu>
#include <QWidgetAction>
-#include <QDesktopWidget>
#include <QStyleFactory>
+#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
+#include <QDesktopWidget>
+#endif
+
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -536,7 +539,7 @@
QMenu* pFileMenu = new QMenu("&File");
menuBar()->addMenu(pFileMenu);
pFileMenu->addAction("&Save Preferences", this, SLOT(savePrefs()),
- Qt::CTRL+Qt::Key_S);
+ Qt::CTRL|Qt::Key_S);
pFileMenu->addAction("Open &Map", m_mapMgr, SLOT(loadMap()), Qt::Key_F1);
pFileMenu->addAction("&Import &Map", m_mapMgr, SLOT(importMap()));
pFileMenu->addAction("Sa&ve Map", m_mapMgr, SLOT(saveMap()), Qt::Key_F2);
@@ -544,15 +547,15 @@
pFileMenu->addAction("Reload Guilds File", m_guildmgr, SLOT(readGuildList()));
pFileMenu->addAction("Save Guilds File", m_guildmgr, SLOT(writeGuildList()));
pFileMenu->addAction("Add Spawn Category", this, SLOT(addCategory()),
- Qt::ALT+Qt::Key_C);
+ Qt::ALT|Qt::Key_C);
pFileMenu->addAction("Rebuild SpawnList", this, SLOT(rebuildSpawnList()),
- Qt::ALT+Qt::Key_R);
+ Qt::ALT|Qt::Key_R);
pFileMenu->addAction("Reload Categories", this, SLOT(reloadCategories()),
- Qt::CTRL+Qt::Key_R);
+ Qt::CTRL|Qt::Key_R);
pFileMenu->addAction("Select Next", this, SLOT(selectNext()),
- Qt::CTRL+Qt::Key_Right);
+ Qt::CTRL|Qt::Key_Right);
pFileMenu->addAction("Select Prev", this, SLOT(selectPrev()),
- Qt::CTRL+Qt::Key_Left);
+ Qt::CTRL|Qt::Key_Left);
pFileMenu->addAction("Save Selected Spawns Path", this,
SLOT(saveSelectedSpawnPath(void)));
pFileMenu->addAction("Save NPC Spawn Paths", this, SLOT(saveSpawnPaths(void)));
@@ -559,9 +562,9 @@
if (m_packet->playbackPackets() != PLAYBACK_OFF)
{
pFileMenu->addAction("Inc Playback Speed", m_packet, SLOT(incPlayback()),
- Qt::CTRL+Qt::Key_X);
+ Qt::CTRL|Qt::Key_X);
pFileMenu->addAction("Dec Playback Speed", m_packet, SLOT(decPlayback()),
- Qt::CTRL+Qt::Key_Z);
+ Qt::CTRL|Qt::Key_Z);
}
pFileMenu->addAction("&Quit", qApp, SLOT(quit()));
@@ -1231,12 +1234,12 @@
m_netMenu->addMenu(pOpCodeMenu);
m_action_opcode_monitor = pOpCodeMenu->addAction("&OpCode Monitoring", this,
- SLOT(toggle_opcode_monitoring()), Qt::CTRL+Qt::ALT+Qt::Key_O);
+ SLOT(toggle_opcode_monitoring()), Qt::CTRL|Qt::ALT|Qt::Key_O);
m_action_opcode_monitor->setCheckable(true);
m_action_opcode_monitor->setChecked(m_opcodeMonitorLog != 0);
pOpCodeMenu->addAction("&Reload Monitored OpCode List...", this,
- SLOT(set_opcode_monitored_list()), Qt::CTRL+Qt::ALT+Qt::Key_R);
+ SLOT(set_opcode_monitored_list()), Qt::CTRL|Qt::ALT|Qt::Key_R);
section = "OpCodeMonitoring";
@@ -1353,9 +1356,9 @@
filterMenu->addAction("Select Fil&ter File", this, SLOT(select_filter_file()));
filterMenu->addAction("Reload &Zone Filters", m_filterMgr,
- SLOT(loadZoneFilters()), Qt::SHIFT+Qt::Key_F3);
+ SLOT(loadZoneFilters()), Qt::SHIFT|Qt::Key_F3);
filterMenu->addAction("S&ave Zone Filters", m_filterMgr,
- SLOT(saveZoneFilters()), Qt::SHIFT+Qt::Key_F4);
+ SLOT(saveZoneFilters()), Qt::SHIFT|Qt::Key_F4);
filterMenu->addAction("Edit Zone Fi<ers", this,
SLOT(launch_editor_zoneFilters()));
@@ -1809,20 +1812,20 @@
QMenu* pDebugMenu = new QMenu("&Debug");
menuBar()->addMenu(pDebugMenu);
pDebugMenu->addAction("List I&nterface", this, SLOT(listInterfaceInfo()));
- pDebugMenu->addAction("List S&pawns", this, SLOT(listSpawns()), Qt::ALT+Qt::CTRL+Qt::Key_P);
- pDebugMenu->addAction("List &Drops", this, SLOT(listDrops()), Qt::ALT+Qt::CTRL+Qt::Key_D);
- pDebugMenu->addAction("List &Map Info", this, SLOT(listMapInfo()), Qt::ALT+Qt::CTRL+Qt::Key_M);
+ pDebugMenu->addAction("List S&pawns", this, SLOT(listSpawns()), Qt::ALT|Qt::CTRL|Qt::Key_P);
+ pDebugMenu->addAction("List &Drops", this, SLOT(listDrops()), Qt::ALT|Qt::CTRL|Qt::Key_D);
+ pDebugMenu->addAction("List &Map Info", this, SLOT(listMapInfo()), Qt::ALT|Qt::CTRL|Qt::Key_M);
pDebugMenu->addAction("List G&uild Info", m_guildmgr, SLOT(listGuildInfo()));
- pDebugMenu->addAction("List &Group", this, SLOT(listGroup()), Qt::ALT+Qt::CTRL+Qt::Key_G);
- pDebugMenu->addAction("List Guild M&embers", this, SLOT(listGuild()), Qt::ALT+Qt::CTRL+Qt::Key_E);
- pDebugMenu->addAction("Dump Spawns", this, SLOT(dumpSpawns()), Qt::ALT+Qt::SHIFT+Qt::CTRL+Qt::Key_P);
- pDebugMenu->addAction("Dump Drops", this, SLOT(dumpDrops()), Qt::ALT+Qt::SHIFT+Qt::CTRL+Qt::Key_D);
- pDebugMenu->addAction("Dump Map Info", this, SLOT(dumpMapInfo()), Qt::ALT+Qt::SHIFT+Qt::CTRL+Qt::Key_M);
+ pDebugMenu->addAction("List &Group", this, SLOT(listGroup()), Qt::ALT|Qt::CTRL|Qt::Key_G);
+ pDebugMenu->addAction("List Guild M&embers", this, SLOT(listGuild()), Qt::ALT|Qt::CTRL|Qt::Key_E);
+ pDebugMenu->addAction("Dump Spawns", this, SLOT(dumpSpawns()), Qt::ALT|Qt::SHIFT|Qt::CTRL|Qt::Key_P);
+ pDebugMenu->addAction("Dump Drops", this, SLOT(dumpDrops()), Qt::ALT|Qt::SHIFT|Qt::CTRL|Qt::Key_D);
+ pDebugMenu->addAction("Dump Map Info", this, SLOT(dumpMapInfo()), Qt::ALT|Qt::SHIFT|Qt::CTRL|Qt::Key_M);
pDebugMenu->addAction("Dump Guild Info", this , SLOT(dumpGuildInfo()));
pDebugMenu->addAction("Dump SpellBook Info", this , SLOT(dumpSpellBook()));
- pDebugMenu->addAction("Dump Group", this, SLOT(dumpGroup()), Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_G);
- pDebugMenu->addAction("Dump Guild Members", this, SLOT(dumpGuild()), Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_E);
- pDebugMenu->addAction("List &Filters", m_filterMgr, SLOT(listFilters()), Qt::ALT+Qt::CTRL+Qt::Key_F);
+ pDebugMenu->addAction("Dump Group", this, SLOT(dumpGroup()), Qt::ALT|Qt::CTRL|Qt::SHIFT|Qt::Key_G);
+ pDebugMenu->addAction("Dump Guild Members", this, SLOT(dumpGuild()), Qt::ALT|Qt::CTRL|Qt::SHIFT|Qt::Key_E);
+ pDebugMenu->addAction("List &Filters", m_filterMgr, SLOT(listFilters()), Qt::ALT|Qt::CTRL|Qt::Key_F);
pDebugMenu->addAction("List &Zone Filters", m_filterMgr, SLOT(listZoneFilters()));
////////////////////
@@ -2508,7 +2511,11 @@
else
// work around QTBUG-46620
if (isMaximized())
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ setGeometry(QApplication::primaryScreen()->availableGeometry());
+#else
setGeometry(QApplication::desktop()->availableGeometry(this));
+#endif
if (!restoreState(QByteArray::fromBase64(dockPrefsState.toLatin1())))
seqWarn("Could not restore dock/window state. Rearrange windows as"
@@ -2515,8 +2522,8 @@
" desired and then re-save prefrences");
}
- new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_S, this, SLOT(toggle_view_statusbar()));
- new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_T, this, SLOT(toggle_view_menubar()));
+ new QShortcut(Qt::CTRL|Qt::ALT|Qt::Key_S, this, SLOT(toggle_view_statusbar()));
+ new QShortcut(Qt::CTRL|Qt::ALT|Qt::Key_T, this, SLOT(toggle_view_menubar()));
// Set main window title
// TODO: Add % replacement values and a signal to update, for ip address currently
Modified: showeq/branches/cn187_devel/src/listspawn.cpp
===================================================================
--- showeq/branches/cn187_devel/src/listspawn.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/listspawn.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -27,7 +27,11 @@
#include <QString>
#include <QTextStream>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include "cgiconv.h"
#include "spawnshell.h"
@@ -214,7 +218,12 @@
"</TR>\n";
QString spawnName;
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression stripExp("[0-9]");
+#else
QRegExp stripExp("[0-9]");
+#endif
// iterate over the contents of the spawn database
while (fread (&dbSpawn, sizeof(dbSpawnStruct), 1, sdb))
Modified: showeq/branches/cn187_devel/src/map.cpp
===================================================================
--- showeq/branches/cn187_devel/src/map.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/map.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -50,6 +50,7 @@
#include <sys/types.h>
#include <QApplication>
+#include <QActionGroup>
#include <QPainter>
#include <QPixmap>
#include <QFont>
@@ -214,7 +215,7 @@
{
this->setObjectName("mapLabel");
m_Map = map;
- setMargin( 1 );
+ setContentsMargins(1, 1, 1, 1);
setIndent( 0 );
setFrameStyle( QFrame::Plain | QFrame::Box );
setLineWidth( 1 );
@@ -232,11 +233,20 @@
// borrowed from QPopupMenu::popup()
// get info about the widget and its environment
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ QRect availGeom = QApplication::primaryScreen()->availableGeometry();
+ int sw = availGeom.width();
+ int sh = availGeom.height();
+ int sx = availGeom.x();
+ int sy = availGeom.y();
+#else
QWidget *desktop = (QWidget*)QApplication::desktop();
int sw = desktop->width(); // screen width
int sh = desktop->height(); // screen height
int sx = desktop->x(); // screen pos
int sy = desktop->y();
+#endif
+
int x = pos.x();
int y = pos.y();
int w = width();
@@ -2014,7 +2024,7 @@
#ifdef DEBUGMAP
qDebug ("mouseDoubleClickEvent()");
#endif /* DEBUGMAP */
- if (me->button () == Qt::MidButton)
+ if (me->button () == Qt::MiddleButton)
viewTarget();
}
@@ -2023,7 +2033,7 @@
#ifdef DEBUGMAP
qDebug ("mouseReleaseEvent()");
#endif /* DEBUGMAP */
- if (me->button() == Qt::MidButton)
+ if (me->button() == Qt::MiddleButton)
m_mapPanning = false;
}
@@ -2042,17 +2052,27 @@
if(f)
{
fprintf (f,"%f, %f\n",
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ (m_param.screenCenterX() - me->position().x()) * m_param.ratioX(),
+ (m_param.screenCenterY() - me->position().y()) * m_param.ratioY());
+#else
(m_param.screenCenterX() - me->x()) * m_param.ratioX(),
(m_param.screenCenterY() - me->y()) * m_param.ratioY());
+#endif
fclose(f);
}
#endif /* DEBUGMAP */
}
- else if (me->button () == Qt::MidButton)
+ else if (me->button () == Qt::MiddleButton)
{
m_mapPanning = true;
- m_mapPanX = me->x ();
- m_mapPanY = me->y ();
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ m_mapPanX = me->position().x();
+ m_mapPanY = me->position().y();
+#else
+ m_mapPanX = me->x();
+ m_mapPanY = me->y();
+#endif
}
else
{
@@ -4356,8 +4376,13 @@
refreshMap();
}
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ emit mouseLocation(m_param.invertXOffset(event->position().x()),
+ m_param.invertYOffset(event->position().y()));
+#else
emit mouseLocation(m_param.invertXOffset(event->x()),
m_param.invertYOffset(event->y()));
+#endif
if ( !m_showTooltips)
{
@@ -4400,7 +4425,11 @@
// construct and set the spawned string
QString spawned;
QDateTime dateTime;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dateTime.setSecsSinceEpoch(sp->spawnTime());
+#else
dateTime.setTime_t(sp->spawnTime());
+#endif
QDate createDate = dateTime.date();
// spawn time
@@ -4876,7 +4905,7 @@
m_topControlBox = new QWidget(this);
QHBoxLayout* topControlBoxLayout = new QHBoxLayout(m_topControlBox);
topControlBoxLayout->setSpacing(1);
- topControlBoxLayout->setMargin(0);
+ topControlBoxLayout->setContentsMargins(0, 0, 0, 0);
m_topControlBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
tmpPrefString = "ShowTopControlBox";
if (!pSEQPrefs->getPrefBool(tmpPrefString, prefString, 1))
@@ -4898,7 +4927,7 @@
m_bottomControlBox = new QWidget(this);
QHBoxLayout* bottomControlBoxLayout = new QHBoxLayout(m_bottomControlBox);
bottomControlBoxLayout->setSpacing(1);
- bottomControlBoxLayout->setMargin(0);
+ bottomControlBoxLayout->setContentsMargins(0, 0, 0, 0);
m_bottomControlBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
tmpPrefString = "ShowBottomControlBox";
if (!pSEQPrefs->getPrefBool(tmpPrefString, prefString, 1))
@@ -4911,7 +4940,7 @@
m_zoomBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* zoomBoxLayout = new QHBoxLayout(m_zoomBox);
zoomBoxLayout->setSpacing(1);
- zoomBoxLayout->setMargin(0);
+ zoomBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_zoomBox);
tmpLabel->setText("Zoom:");
zoomBoxLayout->addWidget(tmpLabel);
@@ -4942,7 +4971,7 @@
m_playerLocationBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* playerLocationBoxLayout = new QHBoxLayout(m_playerLocationBox);
playerLocationBoxLayout->setSpacing(1);
- playerLocationBoxLayout->setMargin(0);
+ playerLocationBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_playerLocationBox);
tmpLabel->setText("You:");
playerLocationBoxLayout->addWidget(tmpLabel);
@@ -4970,7 +4999,7 @@
m_mouseLocationBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* mouseLocationBoxLayout = new QHBoxLayout(m_mouseLocationBox);
mouseLocationBoxLayout->setSpacing(1);
- mouseLocationBoxLayout->setMargin(0);
+ mouseLocationBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_mouseLocationBox);
tmpLabel->setText("Cursor:");
mouseLocationBoxLayout->addWidget(tmpLabel);
@@ -4997,7 +5026,7 @@
m_filterBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
QHBoxLayout* filterBoxLayout = new QHBoxLayout(m_filterBox);
filterBoxLayout->setSpacing(1);
- filterBoxLayout->setMargin(0);
+ filterBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_filterBox);
tmpLabel->setText("Find:");
filterBoxLayout->addWidget(tmpLabel);
@@ -5025,7 +5054,7 @@
m_layersBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* layersBoxLayout = new QHBoxLayout(m_layersBox);
layersBoxLayout->setSpacing(1);
- layersBoxLayout->setMargin(0);
+ layersBoxLayout->setContentsMargins(0, 0, 0, 0);
loadLayerButtons();
@@ -5042,7 +5071,7 @@
m_frameRateBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* frameRateBoxLayout = new QHBoxLayout(m_frameRateBox);
frameRateBoxLayout->setSpacing(1);
- frameRateBoxLayout->setMargin(0);
+ frameRateBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_frameRateBox);
tmpLabel->setText("Frame Rate:");
frameRateBoxLayout->addWidget(tmpLabel);
@@ -5074,7 +5103,7 @@
m_panBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* panBoxLayout = new QHBoxLayout(m_panBox);
panBoxLayout->setSpacing(1);
- panBoxLayout->setMargin(0);
+ panBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_panBox);
tmpLabel->setText("Pan X:");
QSize panXLabelMinSize = tmpLabel->minimumSizeHint();
@@ -5123,7 +5152,7 @@
m_depthControlBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout* depthControlBoxLayout = new QHBoxLayout(m_depthControlBox);
depthControlBoxLayout->setSpacing(1);
- depthControlBoxLayout->setMargin(0);
+ depthControlBoxLayout->setContentsMargins(0, 0, 0, 0);
tmpLabel = new QLabel(m_depthControlBox);
tmpLabel->setText("Head:");
QSize depthHeadLabelMinSize = tmpLabel->minimumSizeHint();
Modified: showeq/branches/cn187_devel/src/map.h
===================================================================
--- showeq/branches/cn187_devel/src/map.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/map.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -38,7 +38,6 @@
#include <QLineEdit>
#include <QLabel>
#include <QToolTip>
-#include <QRegExp>
#include <QHash>
#include <QTextStream>
#include <QDateTime>
Modified: showeq/branches/cn187_devel/src/mapcore.cpp
===================================================================
--- showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -43,7 +43,13 @@
#include <QStringList>
#include <QFileInfo>
#include <QFile>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
+
#include <QPolygon>
#include <QByteArray>
#include <QPixmap>
@@ -538,7 +544,11 @@
mapFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression lineTerm("[\r\n]{1,2}");
+#else
QRegExp lineTerm("[\r\n]{1,2}");
+#endif
// split the data into lines at the line termination
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
@@ -989,7 +999,11 @@
mapFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression lineTerm("[\r\n]{1,2}");
+#else
QRegExp lineTerm("[\r\n]{1,2}");
+#endif
// split the data into lines at the line termination
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
@@ -1004,7 +1018,11 @@
filelines = 1;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression fieldSep(",\\s*");
+#else
QRegExp fieldSep(",\\s*");
+#endif
// split the line into fields
QStringList fields;
@@ -1013,8 +1031,12 @@
// use the file base name as the zone long/short name, it isn't perfect,
// but neither is this file format
QFileInfo fileInfo(fileName);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression reStripTrailer("_[1-9]");
+#else
QRegExp reStripTrailer("_[1-9]");
-
+#endif
+
m_zoneLongName = fileInfo.baseName().remove(reStripTrailer);
m_zoneShortName = m_zoneLongName;
Modified: showeq/branches/cn187_devel/src/mapicondialog.ui
===================================================================
(Binary files differ)
Modified: showeq/branches/cn187_devel/src/messagefilter.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messagefilter.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/messagefilter.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -27,18 +27,33 @@
//----------------------------------------------------------------------
// MessageFilter
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
MessageFilter::MessageFilter(const QString& name,
+ uint64_t matchTypes, const QRegularExpression& regexp)
+ : m_name(name),
+ m_types(matchTypes),
+ m_regexp(regexp)
+#else
+MessageFilter::MessageFilter(const QString& name,
uint64_t matchTypes, const QRegExp& regexp)
: m_name(name),
m_types(matchTypes),
m_regexp(regexp)
+#endif
{
}
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+MessageFilter::MessageFilter(uint64_t matchTypes, const QRegularExpression& regexp)
+ : m_name(regexp.pattern()),
+ m_types(matchTypes),
+ m_regexp(regexp)
+#else
MessageFilter::MessageFilter(uint64_t matchTypes, const QRegExp& regexp)
: m_name(regexp.pattern()),
m_types(matchTypes),
m_regexp(regexp)
+#endif
{
}
@@ -67,7 +82,11 @@
QString number;
QString preferenceName;
QString filterName;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression regexp;
+#else
QRegExp regexp;
+#endif
uint64_t types;
for (int i = 0; i < maxMessageFilters; i++)
{
Modified: showeq/branches/cn187_devel/src/messagefilter.h
===================================================================
--- showeq/branches/cn187_devel/src/messagefilter.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/messagefilter.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -31,7 +31,11 @@
#include <QObject>
#include <QString>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
//----------------------------------------------------------------------
// constants
@@ -42,9 +46,15 @@
class MessageFilter
{
public:
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
MessageFilter(const QString& name,
+ uint64_t matchTypes, const QRegularExpression& regexp);
+ MessageFilter(uint64_t matchTypes, const QRegularExpression& regexp);
+#else
+ MessageFilter(const QString& name,
uint64_t matchTypes, const QRegExp& regexp);
MessageFilter(uint64_t matchTypes, const QRegExp& regexp);
+#endif
MessageFilter(const MessageFilter& mf);
~MessageFilter();
@@ -52,8 +62,13 @@
void setTypes(uint64_t types) { m_types = types; }
const QString& name() const { return m_name; }
void setName(const QString& name) { m_name = name; }
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ const QRegularExpression& regexp() const { return m_regexp; }
+ void setRegExp(const QRegularExpression& regexp) { m_regexp = regexp; }
+#else
const QRegExp& regexp() const { return m_regexp; }
void setRegExp(const QRegExp& regexp) { m_regexp = regexp; }
+#endif
bool valid() const { return m_regexp.isValid(); }
bool isFiltered(const MessageEntry& message) const;
@@ -64,7 +79,11 @@
protected:
QString m_name;
uint64_t m_types;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression m_regexp;
+#else
QRegExp m_regexp;
+#endif
};
inline bool MessageFilter::isFiltered(const MessageEntry& message) const
@@ -82,7 +101,7 @@
const QString& message) const
{
return (((m_types & messageTypeMask) != 0) &&
- (m_regexp.indexIn(message) != -1));
+ (message.indexOf(m_regexp) != -1));
}
inline bool MessageFilter::operator==(const MessageFilter& filter) const
Modified: showeq/branches/cn187_devel/src/messagefilterdialog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messagefilterdialog.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/messagefilterdialog.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -28,7 +28,11 @@
#include <cstdio>
#include <QString>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include <QLayout>
#include <QGroupBox>
#include <QLabel>
@@ -241,7 +245,11 @@
}
// create a message filter object
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ MessageFilter newFilter(m_name->text(), types, QRegularExpression(m_pattern->text()));
+#else
MessageFilter newFilter(m_name->text(), types, QRegExp(m_pattern->text()));
+#endif
// if this isn't a valid filter, don't create it
if (!newFilter.valid())
@@ -470,7 +478,11 @@
// buttons should only be enabled for valid message filter content
if (!m_name->text().isEmpty() &&
!m_pattern->text().isEmpty() &&
- QRegExp(m_pattern->text()).isValid())
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression(m_pattern->text()).isValid())
+#else
+ QRegExp(m_pattern->text()).isValid())
+#endif
{
// iterate over all the message types
int numRows = m_messageTypes->count();
Modified: showeq/branches/cn187_devel/src/messagewindow.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -30,7 +30,6 @@
#include <QInputDialog>
#include <QFontDialog>
#include <QColorDialog>
-#include <QRegExp>
#include <QLayout>
#include <QPushButton>
#include <QCheckBox>
@@ -131,7 +130,7 @@
QGridLayout* grid = new QGridLayout(this);
// sets margin around the grid
- grid->setMargin(5);
+ grid->setContentsMargins(5, 5, 5, 5);
m_findText = new QLineEdit(this);
m_findText->setReadOnly(false);
@@ -260,7 +259,7 @@
QFormLayout* grid = new QFormLayout(this);
// sets margin around the grid
- grid->setMargin(10);
+ grid->setContentsMargins(10, 10, 10, 10);
m_color = new QPushButton("...", this);
m_color->setObjectName("color");
Modified: showeq/branches/cn187_devel/src/messagewindow.h
===================================================================
--- showeq/branches/cn187_devel/src/messagewindow.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/messagewindow.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -28,7 +28,11 @@
#include <cstdint>
#include <QTextEdit>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include <QDialog>
#include <QLabel>
#include <QMouseEvent>
@@ -224,7 +228,11 @@
QString m_dateTimeFormat;
QString m_eqDateTimeFormat;
MessageTypeStyle* m_typeStyles;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression m_itemPattern;
+#else
QRegExp m_itemPattern;
+#endif
bool m_lockedText;
bool m_displayType;
bool m_displayDateTime;
Modified: showeq/branches/cn187_devel/src/netstream.cpp
===================================================================
--- showeq/branches/cn187_devel/src/netstream.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/netstream.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -178,7 +178,7 @@
QString r = "";
for (i = 0; i < len; i++) {
if (m_pos < m_lastPos) {
- r.append (*m_pos);
+ r.append (QChar(*m_pos));
m_pos++;
}
else
Modified: showeq/branches/cn187_devel/src/packetinfo.cpp
===================================================================
--- showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -366,7 +366,11 @@
QTextStream out(&file);
// set the output encoding to be UTF8
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ out.setEncoding(QStringConverter::Utf8);
+#else
out.setCodec("UTF-8");
+#endif
// set the number output to be left justified decimal
out.setIntegerBase(10);
@@ -511,13 +515,13 @@
QStringList comments = current->comments();
- fprintf(stderr, "\t\t%d comment(s)\n", comments.count());
+ fprintf(stderr, "\t\t%lld comment(s)\n", comments.count());
for (QStringList::Iterator cit = comments.begin();
cit != comments.end(); ++cit)
fprintf(stderr, "\t\t\t'%s'\n", (*cit).toLatin1().data());
- fprintf(stderr, "\t\t%d payload(s)\n", current->count());
+ fprintf(stderr, "\t\t%lld payload(s)\n", current->count());
QListIterator<EQPacketPayload*> pit(*current);
while (pit.hasNext())
Modified: showeq/branches/cn187_devel/src/showspawn.cpp
===================================================================
--- showeq/branches/cn187_devel/src/showspawn.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/showspawn.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -26,7 +26,11 @@
#include <cerrno>
#include <QString>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include <QTextStream>
#include "cgiconv.h"
@@ -202,7 +206,11 @@
}
QString spawnName;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression stripExp("[0-9]");
+#else
QRegExp stripExp("[0-9]");
+#endif
while (fread (&dbSpawn, sizeof(dbSpawnStruct), 1, sdb))
{
@@ -282,8 +290,13 @@
char tmp[32];
QString outstr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression escapeExp1("<");
+ QRegularExpression escapeExp2("&");
+#else
QRegExp escapeExp1("<");
QRegExp escapeExp2("&");
+#endif
hex[0]=0; asc[0]=0;
int c;
Modified: showeq/branches/cn187_devel/src/sortitem.cpp
===================================================================
--- showeq/branches/cn187_devel/src/sortitem.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/sortitem.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -24,6 +24,7 @@
#include <cstdio>
#include <QTextStream>
+#include <QIODevice>
#include "util.h"
Modified: showeq/branches/cn187_devel/src/spawn.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawn.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/spawn.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -37,7 +37,13 @@
#include <climits>
#include <cmath>
+#include <QtGlobal>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
#include "spawnshell.h"
#include "fixpt.h"
@@ -822,8 +828,13 @@
QString Spawn::cleanedName() const
{
QString newName = name();
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
+ newName.replace(QRegularExpression("[0-9]"), "");
+ newName.replace(QRegularExpression("_"), " ");
+#else
newName.replace(QRegExp("[0-9]"), "");
newName.replace(QRegExp("_"), " ");
+#endif
return newName;
}
Modified: showeq/branches/cn187_devel/src/spawnpointlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -93,7 +93,11 @@
// construct and set the spawned string
QDateTime dateTime;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,8,0))
+ dateTime.setSecsSinceEpoch( m_spawnPoint->spawnTime() );
+#else
dateTime.setTime_t( m_spawnPoint->spawnTime() );
+#endif
QDate createDate = dateTime.date();
tmpStr = "";
// spawn time
Modified: showeq/branches/cn187_devel/src/spells.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spells.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/spells.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -37,9 +37,14 @@
#include <QStringList>
#include <QFile>
#include <QQueue>
-#include <QRegExp>
#include <QByteArray>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
+#include <QRegExp>
+#endif
+
static inline int16_t min(const int16_t& __a, const int16_t& __b)
{
if (__b < __a)
@@ -270,7 +275,11 @@
spellsFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression lineTerm("[\r\n]{1,2}");
+#else
QRegExp lineTerm("[\r\n]{1,2}");
+#endif
uint16_t unicodeIndicator = *(uint16_t*)textData.data();
QString text;
Modified: showeq/branches/cn187_devel/src/terminal.h
===================================================================
--- showeq/branches/cn187_devel/src/terminal.h 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/terminal.h 2023-05-25 23:41:58 UTC (rev 1385)
@@ -30,7 +30,11 @@
#include <cstdint>
#include <QObject>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
#include <QRegExp>
+#endif
//----------------------------------------------------------------------
// forward declarations
@@ -76,7 +80,11 @@
uint64_t m_enabledTypes;
uint32_t m_enabledShowUserFilters;
uint32_t m_enabledHideUserFilters;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ QRegularExpression m_itemPattern;
+#else
QRegExp m_itemPattern;
+#endif
QString m_dateTimeFormat;
QString m_eqDateTimeFormat;
bool m_displayType;
Modified: showeq/branches/cn187_devel/src/xmlpreferences.cpp
===================================================================
--- showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-25 20:02:47 UTC (rev 1384)
+++ showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-25 23:41:58 UTC (rev 1385)
@@ -34,11 +34,16 @@
#include <QFile>
#include <QDir>
#include <QFileInfo>
-#include <QRegExp>
#include <QKeySequence>
#include <QTextStream>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+#include <QRegularExpression>
+#else
+#include <QRegExp>
+#endif
+
const float seqPrefVersion = 1.0;
const char* seqPrefName = "seqpreferences";
const char* seqPrefSysId = "seqpref.dtd";
@@ -474,7 +479,11 @@
QTextStream out(&f);
// make sure stream is UTF8 encoded
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ o...
[truncated message content] |