Skip to content

Fix QString::arg() with scoped enum#2401

Open
wishstudio wants to merge 1 commit into
olive-editor:masterfrom
wishstudio:master
Open

Fix QString::arg() with scoped enum#2401
wishstudio wants to merge 1 commit into
olive-editor:masterfrom
wishstudio:master

Conversation

@wishstudio

Copy link
Copy Markdown

Using QString::arg() with scoped enum do not implicitly convert the enums to int starting in Qt 6.10.1. This causes compilation error:

app/render/videoparams.cpp: In static member function 'static QString olive::VideoParams::GetFormatName(olive::core::PixelFormat)':
app/render/videoparams.cpp:229:74: error: no matching function for call to 'QString::arg(olive::core::PixelFormat&, int, int)'
  229 |   return QCoreApplication::translate("VideoParams", "Unknown (0x%1)").arg(format, 0, 16);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

app/ui/humanstrings.cpp: In static member function 'static QString olive::HumanStrings::FormatToString(const olive::core::SampleFormat&)':
app/ui/humanstrings.cpp:63:74: error: no matching function for call to 'QString::arg(const olive::core::SampleFormat&, int, int)'
   63 |   return QCoreApplication::translate("AudioParams", "Unknown (0x%1)").arg(f, 1, 16);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This patch add static casts to int to fix these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant