错误:"类 QComboBox"没有名为"setCurrentText"的成员;
error: ‘class QComboBox’ has no member named ‘setCurrentText’;
我遇到了这样的错误,
error: ‘class QComboBox’ has no member named ‘setCurrentText’; did you mean ‘currentText’?
x_cn_num->setCurrentText(QApplication::translate("MainWindow", "0", 0, QApplication::UnicodeUTF8));
^~~~~~~~~~~~~~
但是,我检查了官方文档,"setCurrentText"完全是QComboBox的兼容成员。
如果你知道真正的原因和解决方案,请给我一些线索。
您正在尝试使用 Qt 3.0 函数。您应该使用文档中链接的替代函数(在本例中setItemText
(,或者如果您确实想使用旧函数,则需要定义QT_DISABLE_DEPRECATED_BEFORE
以0
。
相关文章:
- 错误:"类 QComboBox"没有名为"setCurrentText"的成员;
- 'char (*RtlpNumberOf(T (&)[N]))[N]':无法从"char *"
- Arduino IDE 错误 - 无法找到数字文字运算符"运算符""f900ff"
- "inline"、"constexpr"或"noexcept"
- "非静态数据成员之前需要构造函数" - 我是否使用"boost::variant"
- 我必须安装"libbitcoin-server"才能包含"bitcoin.hpp"
- “并非所有控制路径都返回一个值./&quot“控制可能达到非空隙功能的末端”.验证时循环时
- 如何输出a'&quot在不使用线端的情况下进行文件
- 删除“按任何键” ..&quot.从VS C 控制台应用程序
- 如何检测我何时向可变参数函数传递"std::string"而不是"c_str()"
- '<'''<'''&quot的模板类错误''令牌”
- 错误消息:"jj"的名称查找已更改为ISO"for"范围,(如果您使用"