[Qt-interest] QLineEdit press enter key

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Mon Apr 18 12:33:20 CEST 2011


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/20110418/21c4a1d9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 42799 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110418/21c4a1d9/attachment.jpe 


More information about the Qt-interest-old mailing list