Results 1 to 1 of 1

Thread: lupdate having problem to identify correct tr() caller

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default lupdate having problem to identify correct tr() caller

    Hello!

    I'm having a problem regarding a calling of lupdate: it is reporting "Cannot invoke tr() like this" for a situation that it seems fine:

    I have a global pointer (called in other files by a 'externed' pointer) to a subclass of QSplashScreen (SplashScreen) that has the Q_OBJECT macro. The global pointer is in the main.cpp file and what happens is that, when I call

    g_mainSplashScreen->showMessage(g_mainSplashScreen->tr("Booting the system..."));
    in the main() method or in a non-Q_OBJECT-derived class' method, I get the error mentioned above (g_mainSplashScreen is the global pointer to my SplashScreen class).

    My question is: was that supposed to happen? since I'm calling SplashScreen' tr() method, isn't it providing the required context for tr() to work (since it is both a QObject derived class and has the Q_OBJECT macro)?


    It's also interesting that, in the first call to g_mainSplashScreen->tr() not in the main() method, but inside a method from a class which is not QObject-derived (Interface::StructureDirector), a message is also sad in the terminal: "Class 'Interface::StructureDirector' lacks Q_OBJECT macro". Now that is true, but the problem is that I'm not calling a tr() from Interface::StructureDirector, but from my SplashScreen class which is the correct context for the tr() call \o/


    So where could the problem be?

    I hope I was clear enough; if code is required, just ask, although it would be quite a lot of code :x


    Thanks,

    Momergil
    Last edited by Momergil; 4th August 2014 at 13:06.
    May the Lord be with you. Always.

Similar Threads

  1. lupdate problem
    By cejot in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2013, 10:14
  2. Replies: 13
    Last Post: 8th September 2011, 13:23
  3. [SOLVED] share data between caller and slot
    By whites11 in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2010, 13:34
  4. lupdate.exe problem on Windows 7 (Qt 4.6.2)
    By glimberg in forum Installation and Deployment
    Replies: 0
    Last Post: 2nd April 2010, 21:29
  5. Problem with lupdate
    By loris128 in forum Qt Tools
    Replies: 3
    Last Post: 8th April 2009, 20:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.