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

lupdate broken with forward declared template class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.9.2
    • Tools: Linguist
    • None

    Description

      When using this kind of header lupdate complain that it can not guess correctly the fully qualified class namespace for the translations:

      // Header
      namespace MyApp {
      template <typename Model>
      class ModelHelper;
      typedef ModelHelper<class BaseProxyModel> ProxyModel;
      
      class XYZ : public QObject 
      {
          Q_OBJECT
      
      public:
        explicit XYZ(QObject *parent = nullptr);
      };
      } // My App
      
      // Source
      using namespace MyApp;
      
      XYZ::XYZ(QObject *parent)
        : QObject(parent)
      {
        tr("Hello");
      }
      

      changing to this one fix the issue:

      // Header
      namespace MyApp {
      template <typename Model>
      class ModelHelper;
      class BaseProxyModel;
      typedef ModelHelper<BaseProxyModel> ProxyModel;
      
      class XYZ : public QObject 
      {
          Q_OBJECT
      
      public:
        explicit XYZ(QObject *parent = nullptr);
      };
      } // My App
      
      // Source
      using namespace MyApp;
      
      XYZ::XYZ(QObject *parent)
        : QObject(parent)
      {
        tr("Hello");
      }
      

      So the guilty line is typedef ModelHelper<class BaseProxyModel> ProxyModel;

      Attachments

        Issue Links

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

          Activity

            People

              buddenha Oswald Buddenhagen
              filipe.azevedo Filipe Azevedo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes