diff --git a/.cirrus.yml b/.cirrus.yml index 7d957444b..d4ac409cd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,9 +1,9 @@ freebsd_instance: - image: freebsd-13-1-release-amd64 + image_family: freebsd-14-0 task: install_script: - - pkg install -y boost-libs git qt5-buildtools qt5-concurrent qt5-core qt5-multimedia qt5-svg qtkeychain-qt5 qt5-qmake cmake qt5-linguist + - pkg install -y boost-libs git qt6-base qt6-svg qt6-5compat qt6-imageformats qtkeychain-qt6 cmake script: | git submodule init git submodule update @@ -20,6 +20,7 @@ task: -DUSE_SYSTEM_QTKEYCHAIN="ON" \ -DCMAKE_BUILD_TYPE="release" \ -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ + -DBUILD_WITH_QT6="ON" \ .. cat compile_commands.json make -j $(getconf _NPROCESSORS_ONLN) diff --git a/BUILDING_ON_FREEBSD.md b/BUILDING_ON_FREEBSD.md index 26e751c93..38b603a2c 100644 --- a/BUILDING_ON_FREEBSD.md +++ b/BUILDING_ON_FREEBSD.md @@ -1,15 +1,15 @@ # FreeBSD -Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**. +For all dependencies below we use Qt 6. Our minimum supported version is Qt 5.15.2, but you are on your own. -## FreeBSD 12.1-RELEASE +## FreeBSD 14.0-RELEASE -Note: This is known to work on FreeBSD 12.1-RELEASE amd64. Chances are +Note: This is known to work on FreeBSD 14.0-RELEASE amd64. Chances are high that this also works on older FreeBSD releases, architectures and -FreeBSD 13.0-CURRENT. +FreeBSD 15.0-SNAP. 1. Install build dependencies from package sources (or build from the - ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg qt5-buildtools gstreamer-plugins-good boost-libs rapidjson cmake` + ports tree): `# pkg install boost-libs git qt6-base qt6-svg qt6-5compat qt6-imageformats qtkeychain-qt6 cmake` 1. In the project directory, create a build directory and enter it ```sh mkdir build @@ -17,7 +17,7 @@ FreeBSD 13.0-CURRENT. ``` 1. Generate build files. To enable Lua plugins in your build add `-DCHATTERINO_PLUGINS=ON` to this command. ```sh - cmake .. + cmake -DBUILD_WITH_QT6=ON .. ``` 1. Build the project ```sh diff --git a/BUILDING_ON_LINUX.md b/BUILDING_ON_LINUX.md index 3aa2df4a8..51317ecd1 100644 --- a/BUILDING_ON_LINUX.md +++ b/BUILDING_ON_LINUX.md @@ -1,6 +1,6 @@ # Linux -For all dependencies below we use Qt6. Our minimum supported version is Qt5.15, but you are on your own. +For all dependencies below we use Qt 6. Our minimum supported version is Qt 5.15.2, but you are on your own. ## Install dependencies @@ -8,11 +8,11 @@ For all dependencies below we use Qt6. Our minimum supported version is Qt5.15, Building on Ubuntu requires Docker. -Use https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-20.04 as your base if you're on Ubuntu 20.04. +Use as your base if you're on Ubuntu 20.04. -Use https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-22.04 if you're on Ubuntu 22.04. +Use if you're on Ubuntu 22.04. -The built binary should be exportable from the final image & able to run on your system assuming you perform a static build. See our [build.yml github workflow file](.github/workflows/build.yml) for the cmake line used for Ubuntu builds. +The built binary should be exportable from the final image & able to run on your system assuming you perform a static build. See our [build.yml GitHub workflow file](.github/workflows/build.yml) for the CMake line used for Ubuntu builds. ### Debian 12 (bookworm) or later diff --git a/BUILDING_ON_MAC.md b/BUILDING_ON_MAC.md index 1c8fc38a1..d1fc018b9 100644 --- a/BUILDING_ON_MAC.md +++ b/BUILDING_ON_MAC.md @@ -1,6 +1,6 @@ # Building on macOS -Chatterino2 is built in CI on Intel on macOS 12. +Chatterino2 is built in CI on Intel on macOS 13. Local dev machines for testing are available on Apple Silicon on macOS 13. ## Installing dependencies diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md index 42d71cc51..2449a329d 100644 --- a/BUILDING_ON_WINDOWS.md +++ b/BUILDING_ON_WINDOWS.md @@ -24,7 +24,7 @@ Notes: Notes: -- Installing the latest **stable** Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.12 or later**. +- Installing the latest **stable** Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.15.2 or later**. #### Components @@ -33,7 +33,7 @@ When prompted which components to install, do the following: 1. Unfold the tree element that says "Qt" 2. Unfold the top most tree element (latest stable Qt version, e.g. `Qt 6.5.3`) 3. Under this version, select the following entries: - - `MSVC 2019 64-bit` (or alternative version if you are using that) + - `MSVC 2019 64-bit` (or `MSVC 2022 64-bit` from Qt 6.8 onwards) - `Qt 5 Compatibility Module` - `Additional Libraries` > `Qt Image Formats` 4. Under the "Tools" tree element (at the bottom), ensure that `Qt Creator X.X.X` and `Debugging Tools for Windows` are selected. (they should be checked by default) @@ -66,9 +66,9 @@ These dependencies are only required if you are not using a package manager - Visit the downloads list on [SourceForge](https://sourceforge.net/projects/boost/files/boost-binaries/). - Select the latest version from the list. - Download the `.exe` file appropriate to your Visual Studio installation version and system bitness (choose `-64` for 64-bit systems). - Visual Studio versions map as follows: `14.3` in the filename corresponds to MSVC 2022,`14.2` to 2019, `14.1` to 2017, `14.0` to 2015. _Anything prior to Visual Studio 2015 is unsupported. Please upgrade should you have an older installation._ + Visual Studio versions map as follows: `14.3` in the filename corresponds to MSVC 2022. _Anything prior to Visual Studio 2022 is unsupported. Please upgrade should you have an older installation._ - **Convenience link for Visual Studio 2022: [boost_1_79_0-msvc-14.3-64.exe](https://sourceforge.net/projects/boost/files/boost-binaries/1.79.0/boost_1_79_0-msvc-14.3-64.exe/download)** + **Convenience link for Visual Studio 2022: [boost_1_84_0-msvc-14.3-64.exe](https://sourceforge.net/projects/boost/files/boost-binaries/1.84.0/boost_1_84_0-msvc-14.3-64.exe/download)** 2. When prompted where to install Boost, set the location to `C:\local\boost`. 3. After the installation finishes, rename the `C:\local\boost\lib64-msvc-14.3` (or similar) directory to simply `lib` (`C:\local\boost\lib`). @@ -237,7 +237,7 @@ Select the `CMake Applications > chatterino` configuration and add a new _Run Ex Now you can run the `chatterino | Debug` configuration. -If you want to run the portable version of Chatterino, create a file called `modes` inside of `build/bin` and +If you want to run the portable version of Chatterino, create a file called `modes` inside `build/bin` and write `portable` into it. #### Debugging diff --git a/BUILDING_ON_WINDOWS_WITH_VCPKG.md b/BUILDING_ON_WINDOWS_WITH_VCPKG.md index ec9615724..18748acb7 100644 --- a/BUILDING_ON_WINDOWS_WITH_VCPKG.md +++ b/BUILDING_ON_WINDOWS_WITH_VCPKG.md @@ -1,6 +1,6 @@ # Building on Windows with vcpkg -This will require more than 30GB of free space on your hard drive. +This will require more than 30 GB of free space on your hard drive. ## Prerequisites @@ -29,7 +29,7 @@ This will require more than 30GB of free space on your hard drive. See [VCPKG_ROOT documentation](https://learn.microsoft.com/en-gb/vcpkg/users/config-environment#vcpkg_root) - Append the vcpkg path to your path e.g. `setx PATH "%PATH%;"` - - For more configurations, see https://learn.microsoft.com/en-gb/vcpkg/users/config-environment + - For more configurations, see 1. You may need to restart your computer to ensure all your environment variables and what-not are loaded everywhere. ## Building diff --git a/CHANGELOG.md b/CHANGELOG.md index 35717f6af..fa05a4478 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Dev: The MSVC CRT is now bundled with Chatterino as it depends on having a recent version installed. (#5447) - Dev: Refactor/unsingletonize `UserDataController`. (#5459) - Dev: Cleanup `BrowserExtension`. (#5465) +- Dev: Deprecate Qt 5.12. (#5396) ## 2.5.1 diff --git a/src/common/LinkParser.cpp b/src/common/LinkParser.cpp index 8ef1dc232..d64abed31 100644 --- a/src/common/LinkParser.cpp +++ b/src/common/LinkParser.cpp @@ -124,15 +124,6 @@ LinkParser::LinkParser(const QString &unparsedString) QStringView remaining(unparsedString); QStringView protocol(remaining); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - QStringView wholeString(unparsedString); - const auto refFromView = [&](QStringView view) { - return QStringRef(&unparsedString, - static_cast(view.begin() - wholeString.begin()), - static_cast(view.size())); - }; -#endif - // Check protocol for https?:// if (remaining.startsWith(QStringLiteral("http"), Qt::CaseInsensitive) && remaining.length() >= 4 + 3 + 1) // 'http' + '://' + [any] @@ -149,12 +140,7 @@ LinkParser::LinkParser(const QString &unparsedString) { // there's really a protocol => consume it remaining = withProto.mid(3); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) result.protocol = {protocol.begin(), remaining.begin()}; -#else - result.protocol = - refFromView({protocol.begin(), remaining.begin()}); -#endif } } @@ -219,13 +205,8 @@ LinkParser::LinkParser(const QString &unparsedString) if ((nDots == 3 && isValidIpv4(host)) || isValidTld(host.mid(lastDotPos + 1))) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) result.host = host; result.rest = rest; -#else - result.host = refFromView(host); - result.rest = refFromView(rest); -#endif result.source = unparsedString; this->result_ = std::move(result); } diff --git a/src/common/LinkParser.hpp b/src/common/LinkParser.hpp index 9d5e10cfb..2ef118318 100644 --- a/src/common/LinkParser.hpp +++ b/src/common/LinkParser.hpp @@ -7,28 +7,23 @@ namespace chatterino { struct ParsedLink { -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - using StringView = QStringView; -#else - using StringView = QStringRef; -#endif /// The parsed protocol of the link. Can be empty. /// /// https://www.forsen.tv/commands /// ^------^ - StringView protocol; + QStringView protocol; /// The parsed host of the link. Can not be empty. /// /// https://www.forsen.tv/commands /// ^-----------^ - StringView host; + QStringView host; /// The remainder of the link. Can be empty. /// /// https://www.forsen.tv/commands /// ^-------^ - StringView rest; + QStringView rest; /// The original unparsed link. /// diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index af96ee9ee..ac4dca9e8 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -40,7 +40,6 @@ #include "singletons/Paths.hpp" #include "util/CombinePath.hpp" #include "util/QStringHash.hpp" -#include "util/Qt.hpp" #include diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index ef0cb8c1c..64af873b9 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -15,7 +15,6 @@ #include "singletons/Resources.hpp" #include "singletons/Theme.hpp" #include "util/FormatTime.hpp" -#include "util/Qt.hpp" #include diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index 98ec30473..52349107f 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -14,7 +14,6 @@ #include "singletons/StreamerMode.hpp" #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" -#include "util/Qt.hpp" #include diff --git a/src/messages/search/AuthorPredicate.cpp b/src/messages/search/AuthorPredicate.cpp index adc365577..ae951b8cd 100644 --- a/src/messages/search/AuthorPredicate.cpp +++ b/src/messages/search/AuthorPredicate.cpp @@ -1,7 +1,6 @@ #include "messages/search/AuthorPredicate.hpp" #include "messages/Message.hpp" -#include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/BadgePredicate.cpp b/src/messages/search/BadgePredicate.cpp index dc3fbafa8..218ede8e1 100644 --- a/src/messages/search/BadgePredicate.cpp +++ b/src/messages/search/BadgePredicate.cpp @@ -2,7 +2,6 @@ #include "messages/Message.hpp" #include "providers/twitch/TwitchBadge.hpp" -#include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/ChannelPredicate.cpp b/src/messages/search/ChannelPredicate.cpp index 665f96a97..47df247fa 100644 --- a/src/messages/search/ChannelPredicate.cpp +++ b/src/messages/search/ChannelPredicate.cpp @@ -1,7 +1,6 @@ #include "messages/search/ChannelPredicate.hpp" #include "messages/Message.hpp" -#include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/LinkPredicate.cpp b/src/messages/search/LinkPredicate.cpp index 69442069c..8430f84ba 100644 --- a/src/messages/search/LinkPredicate.cpp +++ b/src/messages/search/LinkPredicate.cpp @@ -2,7 +2,6 @@ #include "common/LinkParser.hpp" #include "messages/Message.hpp" -#include "util/Qt.hpp" namespace chatterino { diff --git a/src/messages/search/MessageFlagsPredicate.cpp b/src/messages/search/MessageFlagsPredicate.cpp index 76e32de72..d36fc72bb 100644 --- a/src/messages/search/MessageFlagsPredicate.cpp +++ b/src/messages/search/MessageFlagsPredicate.cpp @@ -1,7 +1,5 @@ #include "messages/search/MessageFlagsPredicate.hpp" -#include "util/Qt.hpp" - namespace chatterino { MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags, bool negate) diff --git a/src/messages/search/SubtierPredicate.cpp b/src/messages/search/SubtierPredicate.cpp index 2dc79fc35..70d5b7148 100644 --- a/src/messages/search/SubtierPredicate.cpp +++ b/src/messages/search/SubtierPredicate.cpp @@ -2,7 +2,6 @@ #include "messages/Message.hpp" #include "providers/twitch/TwitchBadge.hpp" -#include "util/Qt.hpp" namespace chatterino { diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 7fa77e494..fe7e44990 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -37,7 +37,6 @@ #include "util/Helpers.hpp" #include "util/IrcHelpers.hpp" #include "util/QStringHash.hpp" -#include "util/Qt.hpp" #include "widgets/Window.hpp" #include @@ -382,13 +381,7 @@ namespace { dst.reserve(newLength); for (const QStringView &chunk : std::as_const(chunks)) { -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) - static_assert(sizeof(QChar) == sizeof(decltype(*chunk.utf16()))); - dst.append(reinterpret_cast(chunk.utf16()), - chunk.length()); -#else dst += chunk; -#endif } return dst; } @@ -1178,13 +1171,8 @@ void TwitchMessageBuilder::processIgnorePhrases( shiftIndicesAfter(static_cast(from + length), static_cast(replacement.length() - length)); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) auto midExtendedRef = QStringView{originalMessage}.mid(wordStart, wordEnd - wordStart); -#else - auto midExtendedRef = - originalMessage.midRef(wordStart, wordEnd - wordStart); -#endif for (auto &emote : removedEmotes) { diff --git a/src/util/DebugCount.cpp b/src/util/DebugCount.cpp index 1fe915cf2..1c3906782 100644 --- a/src/util/DebugCount.cpp +++ b/src/util/DebugCount.cpp @@ -85,11 +85,7 @@ void DebugCount::decrease(const QString &name, const int64_t &amount) QString DebugCount::getDebugText() { -#if QT_VERSION > QT_VERSION_CHECK(5, 13, 0) static const QLocale locale(QLocale::English); -#else - static QLocale locale(QLocale::English); -#endif auto counts = COUNTS.access(); diff --git a/src/util/Helpers.cpp b/src/util/Helpers.cpp index f81ac9b79..7d66184d1 100644 --- a/src/util/Helpers.cpp +++ b/src/util/Helpers.cpp @@ -11,7 +11,7 @@ namespace chatterino { namespace _helpers_internal { - SizeType skipSpace(StringView view, SizeType startPos) + SizeType skipSpace(QStringView view, SizeType startPos) { while (startPos < view.length() && view.at(startPos).isSpace()) { @@ -20,7 +20,7 @@ namespace _helpers_internal { return startPos - 1; } - bool matchesIgnorePlural(StringView word, const QString &expected) + bool matchesIgnorePlural(QStringView word, const QString &expected) { if (!word.startsWith(expected)) { @@ -34,7 +34,7 @@ namespace _helpers_internal { word.at(word.length() - 1).toLatin1() == 's'; } - std::pair findUnitMultiplierToSec(StringView view, + std::pair findUnitMultiplierToSec(QStringView view, SizeType &pos) { // Step 1. find end of unit @@ -207,11 +207,7 @@ int64_t parseDurationToSeconds(const QString &inputString, return -1; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) - StringView input(inputString); -#else - StringView input(&inputString); -#endif + QStringView input(inputString); input = input.trimmed(); uint64_t currentValue = 0; diff --git a/src/util/Helpers.hpp b/src/util/Helpers.hpp index 56e25082a..6f0552487 100644 --- a/src/util/Helpers.hpp +++ b/src/util/Helpers.hpp @@ -4,10 +4,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) -# include -#endif - #include #include #include @@ -17,12 +13,7 @@ namespace chatterino { // only qualified for tests namespace _helpers_internal { -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) - using StringView = QStringView; -#else - using StringView = QStringRef; -#endif - using SizeType = StringView::size_type; + using SizeType = QStringView::size_type; /** * Skips all spaces. @@ -32,7 +23,7 @@ namespace _helpers_internal { * @param startPos The starting position (there must be a space in the view). * @return The position of the last space. */ - SizeType skipSpace(StringView view, SizeType startPos); + SizeType skipSpace(QStringView view, SizeType startPos); /** * Checks if `word` equals `expected` (singular) or `expected` + 's' (plural). @@ -41,7 +32,7 @@ namespace _helpers_internal { * @param expected Singular of the expected word. * @return true if `word` is singular or plural of `expected`. */ - bool matchesIgnorePlural(StringView word, const QString &expected); + bool matchesIgnorePlural(QStringView word, const QString &expected); /** * Tries to find the unit starting at `pos` and returns its multiplier so @@ -58,7 +49,7 @@ namespace _helpers_internal { * if it's a valid unit, undefined otherwise. * @return (multiplier, ok) */ - std::pair findUnitMultiplierToSec(StringView view, + std::pair findUnitMultiplierToSec(QStringView view, SizeType &pos); } // namespace _helpers_internal diff --git a/src/util/QStringHash.hpp b/src/util/QStringHash.hpp index eb4efe2f0..ac4bef57a 100644 --- a/src/util/QStringHash.hpp +++ b/src/util/QStringHash.hpp @@ -4,8 +4,6 @@ #include #include -#include - namespace boost { template <> @@ -17,17 +15,3 @@ struct hash { }; } // namespace boost - -namespace std { - -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) -template <> -struct hash { - std::size_t operator()(const QString &s) const - { - return qHash(s); - } -}; -#endif - -} // namespace std diff --git a/src/util/Qt.hpp b/src/util/Qt.hpp deleted file mode 100644 index 1187953d8..000000000 --- a/src/util/Qt.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) -namespace Qt { -const QString::SplitBehavior SkipEmptyParts = QString::SkipEmptyParts; -} -#endif diff --git a/src/util/XDGDirectory.cpp b/src/util/XDGDirectory.cpp index 979e58170..ab401e50f 100644 --- a/src/util/XDGDirectory.cpp +++ b/src/util/XDGDirectory.cpp @@ -1,7 +1,6 @@ #include "util/XDGDirectory.hpp" #include "util/CombinePath.hpp" -#include "util/Qt.hpp" #include diff --git a/src/util/XDGHelper.cpp b/src/util/XDGHelper.cpp index 588c46166..e6e2df63f 100644 --- a/src/util/XDGHelper.cpp +++ b/src/util/XDGHelper.cpp @@ -3,7 +3,6 @@ #include "common/Literals.hpp" #include "common/QLogging.hpp" #include "util/CombinePath.hpp" -#include "util/Qt.hpp" #include "util/XDGDesktopFile.hpp" #include "util/XDGDirectory.hpp" diff --git a/src/widgets/helper/ResizingTextEdit.cpp b/src/widgets/helper/ResizingTextEdit.cpp index 3a44aa3e4..0ac7e0e89 100644 --- a/src/widgets/helper/ResizingTextEdit.cpp +++ b/src/widgets/helper/ResizingTextEdit.cpp @@ -77,11 +77,7 @@ QString ResizingTextEdit::textUnderCursor(bool *hadSpace) const auto textUpToCursor = currentText.left(tc.selectionStart()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) auto words = QStringView{textUpToCursor}.split(' '); -#else - auto words = textUpToCursor.splitRef(' '); -#endif if (words.size() == 0) { return QString(); diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index 9dc53b9bf..de94d11d2 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -7,7 +7,6 @@ #include "singletons/Settings.hpp" #include "util/CombinePath.hpp" #include "util/LayoutCreator.hpp" -#include "util/Qt.hpp" #include "util/StandardItemHelper.hpp" #include "widgets/helper/EditableModelView.hpp" diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index 141eeed5e..865392163 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -226,20 +226,16 @@ void SplitInput::themeChangedEvent() QPalette placeholderPalette; palette.setColor(QPalette::WindowText, this->theme->splits.input.text); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) placeholderPalette.setColor( QPalette::PlaceholderText, this->theme->messages.textColors.chatPlaceholder); -#endif this->updateEmoteButton(); this->updateCancelReplyButton(); this->ui_.textEditLength->setPalette(palette); this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) this->ui_.textEdit->setPalette(placeholderPalette); -#endif auto marginPx = static_cast(2.F * this->scale()); this->ui_.vbox->setContentsMargins(marginPx, marginPx, marginPx, marginPx); diff --git a/tests/src/Helpers.cpp b/tests/src/Helpers.cpp index c615167cf..a98868bfa 100644 --- a/tests/src/Helpers.cpp +++ b/tests/src/Helpers.cpp @@ -252,12 +252,6 @@ TEST(Helpers, BatchDifferentInputType) EXPECT_EQ(result, expectation); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) -# define makeView(x) x -#else -# define makeView(str) (&(str)) -#endif - TEST(Helpers, skipSpace) { struct TestCase { @@ -272,7 +266,7 @@ TEST(Helpers, skipSpace) for (const auto &c : tests) { - const auto actual = skipSpace(makeView(c.input), c.startIdx); + const auto actual = skipSpace(c.input, c.startIdx); EXPECT_EQ(actual, c.expected) << actual << " (" << c.input << ") did not match expected value " @@ -414,7 +408,7 @@ TEST(Helpers, findUnitMultiplierToSec) for (const auto &c : tests) { SizeType pos = c.startPos; - const auto actual = findUnitMultiplierToSec(makeView(c.input), pos); + const auto actual = findUnitMultiplierToSec(c.input, pos); if (c.expectedMultiplier == bad) {