Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-839

CLONE - lupdate cannot resolve context when member function implementaton is in a namespace scope

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 2.3.3
    • General
    • None
    • Windows

    Description

      This is a clone of https://bugreports.qt.io/browse/QTVSADDINBUG-281 since the original issue still persists with Qt VS Add-In 2.3.3 and Visual Studio 2019.

      The bug happens when using tr() inside a namespace and the source and header files are located in different directories.

      I attached a Visual Studio project showing the problem.

      In the attached project lupdate reports

      C:/Temporary/LUpdateTest/src/LUpdateTest/LUpdateTest.cpp:11: Qualifying with unknown namespace/class ::LUpdateTest

      for the following source (LUpdateTest.cpp):

       
      #include "LUpdateTest.h"
      
      namespace Namespace
      {
      
      LUpdateTest::LUpdateTest(QWidget *parent)
      	: QDialog(parent)
      {
      	ui.setupUi(this);
      	ui.label->setText(tr("Translation here"));
      }
      
      }
      
      

       

      lupdate_de.ts contains

      <context>
        <name>LUpdateTest</name>
        <message>
          <location filename="../../src/LUpdateTest/LUpdateTest.cpp" line="11"/>
          <source>Translation here</source>
          <translation>Übersetzung hier</translation>
        </message>
      </context>
      

      The name tag contains "LUpdateTest" but it should be "Namespace::LUpdateTest".

       

      Attachments

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

        Activity

          People

            mecfc Miguel Costa
            michael.schwarz Michael Schwarz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes