Skip to content

Commit

Permalink
Qt: Drop int for QT_SCALE_FACTOR_ROUNDING_POLICY
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Mar 29, 2021
1 parent d62983e commit a982280
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions rpcs3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit a982280

Please sign in to comment.