![](/img/trans.png)
[英]QApplication: No such file or directory with Qt5 and qtsingleapplication on windows
[英]Qt5 How to call QApplication from another class?
嗨,我正在Qt5中编写多语言应用程序。 我想访问
QApplication a(argc, argv);
从我的Settings类本地化在main.cpp中。 我需要这个来执行2个命令:
a.installTranslator();
a.removeTranslattor();
当我试图这样做时,我得到错误:
C2228: left of '.installTranslator' must have class/struct/union
C2228: left of '.removeTranslator' must have class/struct/union
我怎么称呼它?
根据您需要的功能,您有两种选择:
注意,这适用于Qt 4和Qt 5。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.