Fix Qt6 build for windows

This commit is contained in:
Waqar Ahmed
2023-03-11 13:48:49 +05:00
parent 5dfa3d0546
commit 4361a1ccc1
2 changed files with 18 additions and 13 deletions

View File

@@ -917,22 +917,24 @@ inline bool Profile::canInheritProperty(Property p)
template<class T>
inline T Profile::property(Property p) const
{
return property<QVariant>(p).value<T>();
}
auto getVariant = [this, p]() {
auto it = _propertyValues.find(p);
if (it != _propertyValues.end()) {
return it->second;
} else if (_parent && canInheritProperty(p)) {
return _parent->property<QVariant>(p);
} else {
return QVariant();
}
};
template<>
inline QVariant Profile::property(Property p) const
{
auto it = _propertyValues.find(p);
if (it != _propertyValues.end()) {
return it->second;
} else if (_parent && canInheritProperty(p)) {
return _parent->property<QVariant>(p);
} else {
return QVariant();
if constexpr (std::is_same_v<T, QVariant>) {
return getVariant();
}
}
const QVariant variant = getVariant();
return variant.value<T>();
}
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)

View File

@@ -6,8 +6,11 @@
#define IPTYPROCESS_H
#include <QDebug>
#include <QIODevice>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QTimer>
#define CONPTY_MINIMAL_WINDOWS_VERSION 18309