Drop Qt5: Utils: Remove code below Qt 6.0.0

Change-Id: I6557238ceccc11c2d1fd8168f1e578fd27a1ee95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-07-22 18:01:00 +02:00
parent 041ff11aae
commit 165fefffe8
4 changed files with 4 additions and 36 deletions

View File

@@ -1296,14 +1296,6 @@ QSet<T> toSet(const QList<T> &list)
return QSet<T>(list.begin(), list.end());
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template<class T>
QSet<T> toSet(const QVector<T> &vec)
{
return QSet<T>(vec.begin(), vec.end());
}
#endif
template<class T>
QList<T> toList(const QSet<T> &set)
{

View File

@@ -48,24 +48,11 @@ class LauncherProcess : public QProcess
public:
LauncherProcess(QObject *parent) : QProcess(parent)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined(Q_OS_UNIX)
setChildProcessModifier([this] { setupChildProcess_impl(); });
#endif
}
private:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void setupChildProcess() override
{
setupChildProcess_impl();
}
#endif
void setupChildProcess_impl()
{
#ifdef Q_OS_UNIX
setChildProcessModifier([this] {
const auto pid = static_cast<pid_t>(processId());
setpgid(pid, pid);
});
#endif
}
};

View File

@@ -68,12 +68,8 @@ void NavigationTreeView::scrollTo(const QModelIndex &index, QAbstractItemView::S
QAbstractItemDelegate *delegate = itemDelegate(index);
if (delegate) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QStyleOptionViewItem option = viewOptions();
#else
QStyleOptionViewItem option;
initViewItemOption(&option);
#endif
itemRect.setWidth(delegate->sizeHint(option, index).width());
}

View File

@@ -34,9 +34,7 @@
#include <QByteArray>
#include <QString>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QStringEncoder>
#endif
#include <algorithm>
#include <charconv>
@@ -488,7 +486,6 @@ public:
void append(QStringView string)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QStringEncoder encoder{QStringEncoder::Utf8};
constexpr size_type temporaryArraySize = Size * 6;
@@ -518,10 +515,6 @@ public:
}
*newEnd = 0;
setSize(newEnd - data());
#else
QByteArray array = string.toUtf8();
append(SmallStringView{array.data(), static_cast<size_type>(array.size())});
#endif
}
BasicSmallString &operator+=(SmallStringView string)