如何解决“Qt:检测到未经测试的 Windows 10.0 版!" [英] How solve "Qt: Untested Windows version 10.0 detected!"
问题描述
我正在尝试将 cmake 用于有很多依赖项的项目.一周前,我从 Windows 7 开始更新到 Windows 10,现在出现此错误.
I'm trying to use cmake for a project that has a lot of dependencies. I updated to Windows 10 some week ago, starting from Windows 7, and now I get this error.
考虑到我不会降级到 Windows 7,我该如何解决这个问题?
How can I solve this problem considering I won't downgrade to Windows 7?
谢谢大家
推荐答案
我认为您使用的是在 Windows 8 发布之前发布的 Qt 版本.它可能是 Qt 4.8.x.要暂停警告,您需要更新 Qt 版本或直接忽略该警告.
I think you use Qt version that was released before Windows 8 release. It might be Qt 4.8.x. To suspend the warning you need to update your Qt version or simply ignore that warning.
更新
如果警告信息真的很麻烦,您可以尝试通过以下方式将其过滤掉:
If the warning message makes real trouble, you can try to filter it out in the following way:
#include <qapplication.h>
#include <stdio.h>
#include <stdlib.h>
void myMessageOutput(QtMsgType type, const char *msg)
{
switch (type) {
case QtDebugMsg:
fprintf(stderr, "Debug: %s\n", msg);
break;
case QtWarningMsg:
if (strstr(msg, "Qt: Untested Windows version") == 0) {
// Print warning if it is not "Qt: Untested Windows..."
fprintf(stderr, "Warning: %s\n", msg);
}
break;
case QtCriticalMsg:
fprintf(stderr, "Critical: %s\n", msg);
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s\n", msg);
abort();
}
}
int main(int argc, char **argv)
{
qInstallMsgHandler(myMessageOutput);
QApplication app(argc, argv);
...
return app.exec();
}
这篇关于如何解决“Qt:检测到未经测试的 Windows 10.0 版!"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!