error: ‘qVariantValue’ was not declared in this scope
来源:互联网 发布:淘宝代销分账要钱吗 编辑:程序博客网 时间:2024/06/01 15:54
qVariantValue is deprecated
Your compiler will say
- error: ‘qVariantValue’ was not declared in this scope
This function is equivalent to QVariant::value<T>(value). Therefore if given a QVariant val rewrite the line
- QTime t = qVariantValue<QTime>(val);
to
- QTime t = val.value<QTime>();
This QTime enclosed in the angled brackets lets the compiler know what QVariant will return. However, if the variable is not a QVariable the type enclosed in the angled brackets should not be used(doing so will result in a vague compile time error). So given that m_color is of type QColor you will rewrite
- s.setValue(“color/favorite”, qVariantValue<QColor>(m_color));
to
- s.setValue(“color/favorite”, m_color.value());
转载于:http://ixiaomo.net/2015/03/19/qt5-4-1-%E7%BC%96%E8%AF%91upplay/
http://blog.sina.com.cn/s/blog_a6fb6cc90101endy.html
0 0
- error: ‘qVariantValue’ was not declared in this scope
- error: '_localtime_not_threadsafe_' was not declared in this scope
- error: ‘exit’ was not declared in this scope
- error: `cout' was not declared in this scope
- error: 'UINT64_C' was not declared in this scope
- error: 'memcpy' was not declared in this scope
- error: 'memcpy' was not declared in this scope的解决
- error: ‘BYTE’ was not declared in this scope
- error: ‘closesocket’ was not declared in this scope
- error:inet_addr() was not declared in this scope
- error: ‘exit’ was not declared in this scope 的解决方法
- 关于error: ‘htons’ was not declared in this scope
- error: ‘memcpy’ was not declared in this scope 解决
- error: ‘alarm’ was not declared in this scope 解决
- error: ‘ostream_iterator’ was not declared in this scope
- error: 'glGenFramebuffersOES' was not declared in this scope
- error: 'LOGE' was not declared in this scope
- error: 'ff_get_buffer' was not declared in this scope
- 常见C++面试题及基本知识点总结(一)
- 打铁还需自身硬
- POSIX下的信号量(生产者&消费者模型)
- Unity制作UI界面时,在Sprite和UITexture之间如何选择?
- Jenkins+ant_实现Jmeter脚本持续集成测试实例
- error: ‘qVariantValue’ was not declared in this scope
- 网口扫盲一:网卡初步认识
- Arduino与ESP8266进行串口通信
- 写给初学者27_android_本地广播和系统常用广播
- shiro与spring整合的配置(第一种)
- SQL SERVER中利用IDENTITY属性创建自动ID列
- git使用 与github搭配
- C++常见面试题
- 网口扫盲二:Mac与Phy组成原理的简单分析