mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Qt: Drop int for QT_SCALE_FACTOR_ROUNDING_POLICY
This commit is contained in:
parent
d62983e1a2
commit
a982280400
@ -265,27 +265,13 @@ QCoreApplication* createApplication(int& argc, char* argv[])
|
||||
|
||||
const auto check_dpi_rounding_arg = [&rounding_str_cli, &rounding_val, &meta_enum](const char* val) -> bool
|
||||
{
|
||||
bool ok{false};
|
||||
|
||||
// Try to find out if the argument is a valid string representation of Qt::HighDpiScaleFactorRoundingPolicy
|
||||
bool ok{false};
|
||||
if (const int enum_index = meta_enum.keyToValue(val, &ok); ok)
|
||||
{
|
||||
rounding_str_cli = meta_enum.valueToKey(enum_index);
|
||||
rounding_val = static_cast<Qt::HighDpiScaleFactorRoundingPolicy>(enum_index);
|
||||
}
|
||||
// Try to find out if the argument is a valid integer representation of Qt::HighDpiScaleFactorRoundingPolicy
|
||||
else if (const int enum_index = QString(val).toInt(&ok); ok)
|
||||
{
|
||||
if (const char* key = meta_enum.valueToKey(enum_index))
|
||||
{
|
||||
rounding_str_cli = key;
|
||||
rounding_val = static_cast<Qt::HighDpiScaleFactorRoundingPolicy>(enum_index);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user