Chinaunix首页 | 论坛 | 博客
  • 博客访问: 176872
  • 博文数量: 43
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 560
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-12 20:48
文章分类

全部博文(43)

文章存档

2013年(1)

2011年(1)

2010年(4)

2009年(25)

2008年(12)

我的朋友

分类: LINUX

2009-06-21 10:24:12

  • void setFilterRegExp ( const QRegExp & regExp )
  • void setFilterRegExp ( const QString & pattern )

以上是两个基于正规表达式的过滤,如果有特殊字符,可能会出问题。

如过滤的内容是tr("abc."),   . 在正则表过式里,代表通配符,这样,就会把所有前面三个字符是abc的项目都显示出来。

 

建议用下面的这个函数

void QSortFilterProxyModel::setFilterFixedString ( const QString & pattern )   [slot]

Sets the fixed string used to filter the contents of the source model to the given pattern.

 

 

阅读(1127) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~