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

double ampersand in QToolTip displayed text when translate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.6
    • None
    • All

    Description

      There is issue with QToolTip and displayed text using translate. Double ampersand will not transformed to single ampersand.

      I do not know about versions and platforms involved, I tested it on macOS, Qt 6.6.2

      An example to reproduce, with QToolBar:

      #include <QApplication>
      #include <QWidget>
      #include <QGridLayout>
      #include <QToolBar>
      #include <QAction>
      
      int main(int argc, char *argv[])
      {
          QApplication *app = new QApplication(argc, argv);
      
          QWidget *widget = new QWidget;
          widget->setWindowTitle("QToolTip translate ampersand test");
          widget->setMinimumSize(640, 480);
      
          QGridLayout *frm = new QGridLayout(widget);
          QToolBar *tbar = new QToolBar();
      
          QAction *action = tbar->addAction("");
      
          // ok  double ampersand transformed
          action->setText(QCoreApplication::translate("main", "Double&&ampersand"));
      
          // the issue  double ampersand in tooltip displayed text
          action->setToolTip(QCoreApplication::translate("main", "Double&&ampersand"));
      
          frm->addWidget(tbar);
      
          widget->setLayout(frm);
          widget->show();
      
          return app->exec();
      }
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ctlcltd Leonardo Laureti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes