diff --git a/src/common.cpp b/src/common.cpp index 1d780afd6..58654aa2d 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -24,7 +24,8 @@ #include #include #include -#include +#include + #ifdef Q_OS_WIN #include #endif @@ -90,9 +91,9 @@ QStringList parseArgumentsString(QString tempString) { bool inside = (!tempString.isEmpty() && tempString.at(0) == QChar('"')); #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - QStringList tempList = tempString.split(QRegExp("\""), Qt::SkipEmptyParts); + QStringList tempList = tempString.split(QRegularExpression("\""), Qt::SkipEmptyParts); #else - QStringList tempList = tempString.split(QRegExp("\""), QString::SkipEmptyParts); + QStringList tempList = tempString.split(QRegularExpression("\""), QString::SkipEmptyParts); #endif QStringList finalList = QStringList(); QStringListIterator iter(tempList); @@ -105,9 +106,9 @@ QStringList parseArgumentsString(QString tempString) finalList.append(temp); else #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - finalList.append(temp.split(QRegExp("\\s+"), Qt::SkipEmptyParts)); + finalList.append(temp.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts)); #else - finalList.append(temp.split(QRegExp("\\s+"), QString::SkipEmptyParts)); + finalList.append(temp.split(QRegularExpression("\\s+"), QString::SkipEmptyParts)); #endif inside = !inside; } @@ -179,7 +180,7 @@ QIcon loadIcon(QString name) QDirIterator it(":images/", QDirIterator::Subdirectories); QString fallback_location = ""; // search also for variants with underscore like document_save.png for document-save - QRegExp regex = QRegExp(".*" + name.replace(QChar('-'), "[_-]") + "\\.(svg|png)"); + QRegularExpression regex = QRegularExpression(".*" + name.replace(QChar('-'), "[_-]") + "\\.(svg|png)"); while (it.hasNext()) { QString value = it.next(); diff --git a/src/gamecontroller/gamecontroller.cpp b/src/gamecontroller/gamecontroller.cpp index 3cc7877e9..27cebf8de 100644 --- a/src/gamecontroller/gamecontroller.cpp +++ b/src/gamecontroller/gamecontroller.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -91,7 +91,7 @@ QString GameController::getSerialString() const if (controller != nullptr) { const char *serial = SDL_GameControllerGetSerial(controller); - temp = QString(serial).remove(QRegExp("[^A-Za-z0-9]")); + temp = QString(serial).remove(QRegularExpression("[^A-Za-z0-9]")); } #endif return temp; diff --git a/src/globalvariables.cpp b/src/globalvariables.cpp index 76b7cd9df..fc71f60e3 100644 --- a/src/globalvariables.cpp +++ b/src/globalvariables.cpp @@ -101,8 +101,8 @@ const int GlobalVariables::InputDevice::RAISEDDEADZONE = 20000; const int GlobalVariables::InputDevice::DEFAULTKEYREPEATDELAY = 660; // 660 ms const int GlobalVariables::InputDevice::DEFAULTKEYREPEATRATE = 40; // 40 ms. 25 times per second -// QRegExp GlobalVariables::InputDevice::emptyGUID("^[0]+$"); -QRegExp GlobalVariables::InputDevice::emptyUniqueID("^[0]+$"); +// QRegularExpression GlobalVariables::InputDevice::emptyGUID("^[0]+$"); +QRegularExpression GlobalVariables::InputDevice::emptyUniqueID("^[0]+$"); // ---- JOYAXIS ---- // diff --git a/src/globalvariables.h b/src/globalvariables.h index 23cd1779a..722c4dc66 100644 --- a/src/globalvariables.h +++ b/src/globalvariables.h @@ -21,7 +21,7 @@ #include #include -#include +#include namespace GlobalVariables { class JoyButton @@ -107,8 +107,8 @@ class InputDevice static const int DEFAULTKEYREPEATDELAY; static const int DEFAULTKEYREPEATRATE; - // static QRegExp emptyGUID; - static QRegExp emptyUniqueID; + // static QRegularExpression emptyGUID; + static QRegularExpression emptyUniqueID; }; class JoyAxis diff --git a/src/joystick.cpp b/src/joystick.cpp index d111b3176..32a69d685 100644 --- a/src/joystick.cpp +++ b/src/joystick.cpp @@ -112,7 +112,7 @@ QString Joystick::getSerialString() const if (m_joyhandle != nullptr) { const char *serial = SDL_JoystickGetSerial(m_joyhandle); - temp = QString(serial).remove(QRegExp("[^A-Za-z0-9]")); + temp = QString(serial).remove(QRegularExpression("[^A-Za-z0-9]")); } #endif