20#ifndef LIBREPCB_CORE_QTCOMPAT_H
21#define LIBREPCB_CORE_QTCOMPAT_H
55#if QT_VERSION_MAJOR >= 6
56 using Hash = std::size_t;
68#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
70 return Qt::KeepEmptyParts;
73 return Qt::SkipEmptyParts;
76 static inline constexpr QString::SplitBehavior
keepEmptyParts() noexcept {
77 return QString::KeepEmptyParts;
79 static inline constexpr QString::SplitBehavior
skipEmptyParts() noexcept {
80 return QString::SkipEmptyParts;
89#if QT_VERSION_MAJOR >= 6
90 static inline QStringView
midRef(
const QString& s,
int pos,
91 int n = -1) noexcept {
94 return QStringView(s).mid(pos, n);
97 static inline QStringRef
midRef(
const QString& s,
int pos,
98 int n = -1) noexcept {
99 return s.midRef(pos, n);
Qt compatibility helper class.
Definition: qtcompat.h:43
static QStringRef midRef(const QString &s, int pos, int n=-1) noexcept
Wrapper for QString::midRef()
Definition: qtcompat.h:97
uint Hash
Return type of Qt's qHash() function.
Definition: qtcompat.h:58
static constexpr Qt::SplitBehavior keepEmptyParts() noexcept
String split behavior.
Definition: qtcompat.h:69
static constexpr Qt::SplitBehavior skipEmptyParts() noexcept
Definition: qtcompat.h:72
QtCompat & operator=(const QtCompat &rhs)=delete
QtCompat(const QtCompat &other)=delete
Definition: occmodel.cpp:77