[libcalamares] Add an "integer-like" predicate for variants

This commit is contained in:
Adriaan de Groot 2024-10-22 14:23:20 +02:00
parent 69e3e493de
commit 7842d03ef6

View File

@ -45,6 +45,13 @@ const auto ULongLongVariantType = QMetaType::Type::ULongLong;
const auto DoubleVariantType = QMetaType::Type::Double; const auto DoubleVariantType = QMetaType::Type::Double;
#endif #endif
inline bool
isIntegerVariantType( const QVariant& v )
{
const auto t = typeOf( v );
return t == IntVariantType || t == UIntVariantType || t == LongLongVariantType || t == ULongLongVariantType;
}
} // namespace Calamares } // namespace Calamares
#endif #endif