Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127544

qtwebengine/examples/webenginewidgets/permissionbrowser fail to compile with -Werror=format-security

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 Beta3, 6.9.0 FF
    • 6.8.0 Beta2
    • WebEngine
    • None
    • Linux/X11
    • c8b34851f (dev), 2692773d3 (6.8)

    Description

      The actual failure is:

      2024-07-25T04:16:05.0996675Z /github/home/rpmbuild/BUILD/qtwebengine-everywhere-src-6.8.0-beta2/examples/webenginewidgets/permissionbrowser/main.cpp:13:37: error: conversion from ‘const char16_t [18]’ to ‘QChar’ is ambiguous
      2024-07-25T04:16:05.0997916Z    13 |     app.setWindowIcon(QIcon(QString(u":AppLogoColor.png")));
      2024-07-25T04:16:05.0998390Z       |                                     ^~~~~~~~~~~~~~~~~~~~
      2024-07-25T04:16:05.0998840Z In file included from /usr/include/qt6/QtCore/qstring.h:14,

       

      I have worked out that simply removing the 'u' prefix to the string works. Thus:

       

      — dev/examples/webenginewidgets/permissionbrowser/main.cpp.orig    2024-07-25 17:02:57.095976292 +0100
      +++ dev/examples/webenginewidgets/permissionbrowser/main.cpp    2024-07-25 17:03:35.347433241 +0100
      @@ -10,7 +10,7 @@
       {
           QCoreApplication::setOrganizationName("QtExamples");
           QApplication app(argc, argv);

      •    app.setWindowIcon(QIcon(QString(u":AppLogoColor.png")));
        +    app.setWindowIcon(QIcon(QString(":AppLogoColor.png")));
             MainWindow window(QUrl("qrc:/landing.html"));
             window.resize(1024, 768);
             window.show();

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kchehlarski Kaloyan Chehlarski
            hintak Hin-Tak Leung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes