Skip to content

Fix compile erorr in platformquirks_linux.cpp#1537

Merged
tdewey-rpi merged 1 commit into
raspberrypi:mainfrom
lurch:fix_linux_build_error
Mar 5, 2026
Merged

Fix compile erorr in platformquirks_linux.cpp#1537
tdewey-rpi merged 1 commit into
raspberrypi:mainfrom
lurch:fix_linux_build_error

Conversation

@lurch

@lurch lurch commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

I was getting a compile error when running the create_appimage.sh script on Ubuntu Linux:

/home/andrew/github/raspberrypi/rpi-imager2a/src/linux/platformquirks_linux.cpp: In function ‘QString PlatformQuirks::xmlEscape(const QString&)’:
/home/andrew/github/raspberrypi/rpi-imager2a/src/linux/platformquirks_linux.cpp:744:52: error: no matching function for call to ‘QString::arg(char16_t, int, int)’
  744 |                     result += QString("&#x%1;").arg(c.unicode(), 0, 16);
      |                               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /opt/Qt/6.9.3/gcc_64/include/QtCore/QString:1,
                 from /home/andrew/github/raspberrypi/rpi-imager2a/src/linux/../platformquirks.h:9,
                 from /home/andrew/github/raspberrypi/rpi-imager2a/src/linux/platformquirks_linux.cpp:14:
/opt/Qt/6.9.3/gcc_64/include/QtCore/qstring.h:317:27: note: candidate: ‘template<class T, typename std::enable_if<conjunction_v<std::disjunction<std::is_convertible<T, long long unsigned int>, std::is_convertible<T, long long int> >, std::negation<std::disjunction<std::is_same<typename std::remove_cvref<_Tp>::type, qfloat16>, std::is_floating_point<_Tp> > >, std::negation<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> > > >, bool>::type <anonymous> > QString QString::arg(T, int, int, QChar) const’
  317 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, int base = 10,
      |                           ^~~
/opt/Qt/6.9.3/gcc_64/include/QtCore/qstring.h:317:27: note:   template argument deduction/substitution failed:
[snip]

This PR fixes that error.

Note that https://doc.qt.io/qt-6/qstring.html#arg-2 says "Note: In Qt versions prior to 6.9, this function was overloaded on various integral types and sometimes incorrectly accepted char and char16_t arguments." which implies that Qt 6.9 doesn't accept char16_t here.

@tdewey-rpi tdewey-rpi merged commit 31936e6 into raspberrypi:main Mar 5, 2026
@lurch lurch deleted the fix_linux_build_error branch March 5, 2026 11:17
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.

2 participants