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

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 2.3.3
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Platform/s:
      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

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes