forked from qt-creator/qt-creator
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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user