File indexing completed on 2024-04-28 05:38:43
0001 #include <QtCore/QString> 0002 #include <QtCore/QObject> 0003 0004 extern void takesString(QString); 0005 extern const char* returnsChar(); 0006 0007 void test() 0008 { 0009 QString s; 0010 QObject::tr("test"); // OK 0011 QObject::tr(""); // OK 0012 QObject::tr(s.toUtf8()); // Warn 0013 } 0014 0015 class MyObject : public QObject 0016 { 0017 public: 0018 void test() 0019 { 0020 takesString(tr("hello")); // OK 0021 takesString(tr(returnsChar())); // Warning 0022 } 0023 };