小编Boo*_*oon的帖子

QMetaType :: Float不在QVariant :: Type中

我有一个运行良好的应用程序,但未打开警告进行编译。我正在尝试重新打开它并对其进行分类,但是关于如何解决此问题的想法已用尽。我有 :

QVariant someVar     
QVariant::Type variantType = someVar.type();
switch (variantType) {
    case QMetaType::QString:
        doSomething1();
        break;
    case QMetaType::Float:
        doSomething2();
        break;
}
Run Code Online (Sandbox Code Playgroud)

并得到以下警告/错误:

error: case value ‘135’ not in enumerated type ‘QVariant::Type’ [-Werror=switch]
Run Code Online (Sandbox Code Playgroud)

在QMetaType :: Float行中。我检查了QT文档,并将QMetaType :: Float列为值38。这可能是什么引起的?

我可以找到的最接近的东西是https://github.com/qbittorrent/qBittorrent/issues/2510,它具有相同的错误。有人遇到过吗?

c++ qt

5
推荐指数
1
解决办法
3241
查看次数

标签 统计

c++ ×1

qt ×1