Results 1 to 2 of 2

Thread: help on QObject::tr()

  1. #1
    Join Date
    Apr 2007
    Posts
    117
    Thanks
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default help on QObject::tr()

    return tr("");

    is my code.. and here's the error

    'tr' was not declared in this scope

    i've imported

    #include <QString>
    #include <QObject>

    Isn't this enough?
    Image Analysis Development Framework Using Qt (IADFUQ)

  2. #2
    Join Date
    Sep 2007
    Posts
    19
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: help on QObject::tr()

    in non QObject-child classes you should use QObject::tr() instead of tr().

    try
    Qt Code:
    1. return QObject::tr("Hello");
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to nile.one for this useful post:

    sincnarf (16th October 2007)

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.