Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Qt6.9 QString stricter .arg matching #14080

Merged

Conversation

Swiftb0y
Copy link
Member

(Hopefully) fixes #14071

@Swiftb0y
Copy link
Member Author

waiting for @jospezial to confirm whether this fixes their issue.

@Swiftb0y Swiftb0y force-pushed the fix/gh14071-wrong-qstring-arg-call branch 2 times, most recently from 5b69db4 to 9834273 Compare December 30, 2024 13:59
@jospezial
Copy link

It fixes the compile of that part of the code. Thank you. But there is another one:

FAILED: CMakeFiles/mixxx-lib.dir/src/recording/recordingmanager.cpp.o 
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DMIXXX_BUILD_RELEASE -DMIXXX_USE_QOPENGL -DPA_USE_ALSA -DPROTOBUF_USE_DLLS -DQT_CONCURRENT_LIB -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_SHADERTOOLS_LIB -DQT_SQL_LIB -DQT_SVGWIDGETS_LIB -DQT_SVG_LIB -DQT_TABLET_SUPPORT -DQT_TESTCASE_BUILDDIR=\"/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999_build\" -DQT_TESTCASE_SOURCEDIR=\"/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999\" -DQT_TESTLIB_LIB -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_XML_LIB -DSFC_SUPPORTS_SET_COMPRESSION_LEVEL -D__BATTERY__ -D__BULK__ -D__FAAD__ -D__FFMPEG__ -D__HID__ -D__KEYFINDER__ -D__LILV__ -D__LINUX__ -D__MAD__ -D__MODPLUG__ -D__MP4V2__ -D__OPUS__ -D__PORTMIDI__ -D__QTKEYCHAIN__ -D__RUBBERBAND__ -D__SNDFILE__ -D__SQLITE3__ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STEM__ -D__UNIX__ -D__VINYLCONTROL__ -D__WV__ -Dx86_64 -I/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999_build/mixxx-lib_autogen/include -I/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src -I/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999_build/src -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/fidlib -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/portaudio -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/rigtorp/SPSCQueue/include -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/replaygain -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/reverb -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/rekordbox-metadata -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/kaitai -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/mp3guessenc-0.27.4 -isystem /usr/include/qt6/QtConcurrent -isystem /usr/include/qt6 -isystem /usr/include/qt6/QtCore -isystem /usr/lib64/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtGui -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/qt6/QtOpenGL -isystem /usr/include/qt6/QtPrintSupport -isystem /usr/include/qt6/QtWidgets -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtSql -isystem /usr/include/qt6/QtSvg -isystem /usr/include/qt6/QtTest -isystem /usr/include/qt6/QtXml -isystem /usr/include/qt6/QtShaderTools -isystem /usr/include/qt6/QtSvgWidgets -isystem /usr/include/qt6/QtCore5Compat -isystem /usr/include/qt6/QtDBus -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/qm-dsp -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/qm-dsp/include -isystem /usr/include/taglib -isystem /usr/include/libupower-glib -isystem /usr/include/lilv-0 -isystem /usr/include/opus -isystem /usr/include/hidapi -isystem /usr/include/libusb-1.0 -isystem /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/lib/xwax -isystem /usr/include/wavpack  -march=native -O2 -pipe -std=gnu++20 -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Wall -Wextra -Woverloaded-virtual -Wfloat-conversion -Werror=return-type -Wformat=2 -Wformat-security -Wvla -Wundef -fmacro-prefix-map=/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999=. -pthread -fPIC -MD -MT CMakeFiles/mixxx-lib.dir/src/recording/recordingmanager.cpp.o -MF CMakeFiles/mixxx-lib.dir/src/recording/recordingmanager.cpp.o.d -o CMakeFiles/mixxx-lib.dir/src/recording/recordingmanager.cpp.o -c /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.cpp
/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.cpp: In member function ‘QString RecordingManager::getRecordedDurationStr(unsigned int)’:
/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.cpp:213:22: error: no matching function for call to ‘QString::arg(unsigned int, int, char, int, char)’
  212 |     return QString("%1:%2")
      |            ~~~~~~~~~~~~~~~~
  213 |                  .arg(duration / 60, 2, 'f', 0, '0')   // minutes
      |                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qobject.h:11,
                 from /usr/include/qt6/QtCore/QObject:1,
                 from /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.h:3,
                 from /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.cpp:1:
/usr/include/qt6/QtCore/qstring.h:316: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, _Float16>, 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’
  316 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, int base = 10,
      |                           ^~~
/usr/include/qt6/QtCore/qstring.h:316:27: note:   candidate expects 4 arguments, 5 provided
/usr/include/qt6/QtCore/qstring.h:331:27: note: candidate: ‘template<class T, typename std::enable_if<std::disjunction<std::is_same<typename std::remove_cvref<_Tp>::type, _Float16>, std::is_same<typename std::remove_cvref<_Tp>::type, qfloat16>, std::is_floating_point<_Tp> >::value, bool>::type <anonymous> > QString QString::arg(T, int, char, int, QChar) const’
  331 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, char format = 'g', int precision = -1,
      |                           ^~~
/usr/include/qt6/QtCore/qstring.h:331:27: note:   template argument deduction/substitution failed:
/usr/include/qt6/QtCore/qstring.h:330:50: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
  330 |     template <typename T, if_floating_point<T> = true>
      |                                                  ^~~~
/usr/include/qt6/QtCore/qstring.h:336:27: note: candidate: ‘template<class T, typename std::enable_if<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> >::value, bool>::type <anonymous> > QString QString::arg(const T&, int, QChar) const’
  336 |     [[nodiscard]] QString arg(const T &a, int fieldWidth = 0, QChar fillChar = u' ') const
      |                           ^~~
/usr/include/qt6/QtCore/qstring.h:336:27: note:   candidate expects 3 arguments, 5 provided
/usr/include/qt6/QtCore/qstring.h:356:5: note: candidate: ‘template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const’
  356 |     arg(Args &&...args) const
      |     ^~~
/usr/include/qt6/QtCore/qstring.h:356:5: note:   template argument deduction/substitution failed:
/usr/include/qt6/QtCore/qstring.h: In substitution of ‘template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const [with Args = {unsigned int, int, char, int, char}]’:
/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/recording/recordingmanager.cpp:213:22:   required from here
  212 |     return QString("%1:%2")
      |            ~~~~~~~~~~~~~~~~
  213 |                  .arg(duration / 60, 2, 'f', 0, '0')   // minutes
      |                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qstring.h:356:5: error: no type named ‘type’ in ‘struct std::enable_if<false, QString>’
  356 |     arg(Args &&...args) const
      |     ^~~

@jospezial
Copy link

14080_mein_qt6_9_recordingmanager.patch.txt
I fixed it the same way. Take my changes if that is good.
Successfully compiled mixxx git main .
Is a "const qulonglong" line there also needed?

@daschuer
Copy link
Member

daschuer commented Jan 6, 2025

Does this PR compile without the const qulonglong ?

You may consider to do your own Pull Request and become a Mixxx Contributor. You are very welcome.

@daschuer daschuer closed this Jan 6, 2025
@daschuer daschuer reopened this Jan 6, 2025
@daschuer
Copy link
Member

daschuer commented Jan 6, 2025

Sorry for hitting unintentionally the famous "close with comment" button.

@Swiftb0y
Copy link
Member Author

Swiftb0y commented Jan 6, 2025

@jospezial I applied your changes. Could you try compiling again? Thank you.

@jospezial
Copy link

Fixes these 2 compile errors. Also no problems for time display seen in mixxx. I tested recording.
Do you want to move it all into one commit? That would look better without the temporary added code..

@ronso0
Copy link
Member

ronso0 commented Jan 6, 2025

Sorry for hitting unintentionally the famous "close with comment" button.

hehe..
FWIW I minimized that button in Firefox with this snippet in .mozilla/firefox/[profile]/chrome/github_tweaks.css


  /* minimize "Close and comment" button */
  .js-comment-and-button {
    max-width: 40px;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

@Swiftb0y
Copy link
Member Author

Swiftb0y commented Jan 7, 2025

Fixes these 2 compile errors. Also no problems for time display seen in mixxx. I tested recording. Do you want to move it all into one commit? That would look better without the temporary added code..

Thank you for testing. Yes I will git rebase --autosquash after this gets a LGTM from someone.

@Swiftb0y Swiftb0y requested a review from daschuer January 7, 2025 11:46
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@Swiftb0y Swiftb0y force-pushed the fix/gh14071-wrong-qstring-arg-call branch from 152848f to 355eb9c Compare January 7, 2025 14:17
@Swiftb0y
Copy link
Member Author

Swiftb0y commented Jan 7, 2025

squashed the fixups.

@acolombier acolombier merged commit 3971356 into mixxxdj:2.5 Jan 8, 2025
13 checks passed
@Swiftb0y Swiftb0y deleted the fix/gh14071-wrong-qstring-arg-call branch January 9, 2025 10:33
@Swiftb0y
Copy link
Member Author

Swiftb0y commented Jan 9, 2025

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants