遇到个QT的QListView的问题..

isfrog 2008-07-31 03:22:16
1. 'setCurrentItem' : is not a member of 'QListView'
//我查手册了,本来就是有这个函数的。
2.QListWidgetItem的构造函数在我这就两个,没有QListWidgetItem ( const QString & text, QListWidget * parent = 0, int type = Type )
这个都是怎么回事啊?是不是我环境搞的不对呀?
...全文
202 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
imho888 2009-02-03
  • 打赏
  • 举报
回复
你用QT什么版本
ForestDB 2009-02-02
  • 打赏
  • 举报
回复
The simplest pattern of use is to create a QListView, add some column headers using addColumn() and create one or more QListViewItem or QCheckListItem objects with the QListView as parent:

QListView * table;

table->addColumn( "Qualified name" );
table->addColumn( "Namespace" );

element = new QListViewItem( table, qName, namespaceURI );

Further nodes can be added to the list view object (the root of the tree) or as child nodes to QListViewItems:

for ( int i = 0 ; i < attributes.length(); i++ ) {
new QListViewItem( element, attributes.qName(i), attributes.uri(i) );
}


http://doc.trolltech.com/3.3/qlistview.html
AmourAngle 2009-02-02
  • 打赏
  • 举报
回复
我遇到的都不能使用QListvewItem 555
ericksky 2008-07-31
  • 打赏
  • 举报
回复
没碰到过这个问题,先MARK一下~

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧