• 3102阅读
  • 3回复

参数未使用 错误 [复制链接]

上一主题 下一主题
离线donixli1314
 

只看楼主 倒序阅读 楼主  发表于: 2010-02-03
环境:
ubuntu9.04
qt 4.5.0
eclipse + qt插件1.6

请问如何屏蔽掉 参数未使用  的错误提示?
比如 QTreeView 有个signal : expanded ( const QModelIndex& )
对应的slot 也得有个const QModelIndex& 参数 (如slot: TreeViewExpanded ( const QModelIndex& ) )
在TreeViewExpanded ( const QModelIndex& index )方法中并没用到index这个参数
但编译的时候提示 “参数未使用 index”错误


离线午小夜

只看该作者 1楼 发表于: 2010-02-03
那是警告。如果不想看到那個警告,可以加這句話:
Q_UNUSED(index);
[操作系统版本]  Windows XP;Linux Ubuntu;Linux Fedora;
[Qt SDK版本]    4.7.0
[SDK 发布日期]  2010.05
[IDE(集成开发环境)] QtCreator
个人网页:http://hi.baidu.com/午小夜
學歷:Royal Jalidon
离线donixli1314

只看该作者 2楼 发表于: 2010-02-03
很好很强大
谢谢
离线steinlee

只看该作者 3楼 发表于: 2010-02-04
TreeViewExpanded ( const QModelIndex& index )

if index is not used  in this function, simply write the function as TreeViewExpanded ( const QModelIndex& )
Looking for remote C/C++ and Qt 兼职
快速回复
限100 字节
 
上一个 下一个