[Qt-interest] 答复: QLineEdit press enter key

pengliang(彭亮) pengliang at founder.com
Tue Apr 19 02:21:48 CEST 2011


Hi Tony

         I added the sentences: 

if (ui.treewidget->viewport() != NULL)
      ui.treewidget->viewport()->update();

 

But problem still exist.

 

 

 

Thanks

Ken

 

 

 

 

 

 

 

________________________________

发件人: qt-interest-bounces+pengliang=founder.com at qt.nokia.com [mailto:qt-interest-bounces+pengliang=founder.com at qt.nokia.com] 代表 Tony Rietwyk
发送时间: 2011年4月18日 18:33
收件人: qt-interest at trolltech.com
主题: Re: [Qt-interest] QLineEdit press enter key

 

Hi Ken, 

 

Your subject has nothing to do with your question!  Try 'QTreeWidget does not update after being cleared'.  

 

We have this problem with all of the item view widgets on Mac OSX 10.5 with Qt 4.6.0.  I think the problem is the underlying QScrollArea.  

 

Our current workaround is to add: 

 

if (ui.treewidget->viewport() != NULL)
      ui.treewidget->viewport()->update();

after the list/table/tree is updated. 

 

Hope that helps,

 

Tony

 

	-----Original Message-----
	From: qt-interest-bounces+tony.rietwyk=rightsoft.com.au at qt.nokia.com [mailto:qt-interest-bounces+tony.rietwyk=rightsoft.com.au at qt.nokia.com] On Behalf Of pengliang(ÅíÁÁ)
	Sent: Monday, 18 April 2011 12:39 PM
	To: qt-interest at trolltech.com
	Subject: [Qt-interest] QLineEdit press enter key

	Hello all

	         Please see the picture and snippets below.

	Anybody could help me?

	Thanks

	Ken

	 

	 

	- 

	 

	 

	 

	=======================    snippet ===============================

	 

	void selJobWindow::filterJob()
	{
	    QString jobFilterStr = ui->selJobJobName->text();
	    QString dbFilterStr = ui->selJobDB->text();
	    QRegExp jobRegExp(jobFilterStr);
	    jobRegExp.setPatternSyntax(QRegExp::Wildcard);
	    QRegExp dbRegExp(dbFilterStr);
	    dbRegExp.setPatternSyntax(QRegExp::Wildcard);
	    QTreeWidgetItem *item;
	    ui->selJobTreeWidget->clear();
	    int filterCount=0;
	    for(int i=0;i<jobNameList.count();i++)
	    {
	        if (jobRegExp.exactMatch(jobNameList[i]) && dbRegExp.exactMatch(dbList[i]))
	        {
	            item = new QTreeWidgetItem(ui->selJobTreeWidget);
	            item->setText(0,jobNameList[i]);
	            item->setText(1,dbList[i]);
	            filterCount++;
	        }
	    }
	    QString jobHeader = QString("Job Name(%1)").arg(filterCount);
	    ui->selJobTreeWidget->setHeaderLabels(QStringList() << jobHeader << "Database");
	}
	 
	void selJobWindow::on_selJobJobName_returnPressed()
	{
	    filterJob();

	}

	 

	 

	 

		 

	 

	-----

	No virus found in this message.

	Checked by AVG - www.avg.com

	Version: 10.0.1209 / Virus Database: 1500/3580 - Release Date: 04/17/11

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110419/c2500aee/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 42799 bytes
Desc: image001.jpg
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110419/c2500aee/attachment.jpe 


More information about the Qt-interest-old mailing list