diff widgets/TransformFinder.cpp @ 425:4a5fe5471282

* More transform finder stuff
author Chris Cannam
date Mon, 29 Sep 2008 16:31:49 +0000
parents 374b72f5b4bb
children 6bf3c906b7a5
line wrap: on
line diff
--- a/widgets/TransformFinder.cpp	Mon Sep 29 15:06:43 2008 +0000
+++ b/widgets/TransformFinder.cpp	Mon Sep 29 16:31:49 2008 +0000
@@ -90,7 +90,7 @@
     m_upToDateCount = 0;
     m_timer = new QTimer(this);
     connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
-    m_timer->start(0);
+    m_timer->start(30);
 }
 
 TransformFinder::~TransformFinder()
@@ -147,7 +147,9 @@
         return;
     }
 
-    if (m_upToDateCount < m_sortedResults.size()) {
+    if (m_upToDateCount >= m_sortedResults.size()) return;
+
+    while (m_upToDateCount < m_sortedResults.size()) {
 
         int i = m_upToDateCount;
 
@@ -158,8 +160,7 @@
             (m_sortedResults[i].transform);
 
         QString labelText;
-        labelText += tr("%1: %2<br><small>")
-            .arg(m_sortedResults[i].score)
+        labelText += tr("%1<br><small>")
             .arg(XmlExportable::encodeEntities(desc.name));
 
         labelText += "...";
@@ -201,17 +202,20 @@
         m_labels[i]->setObjectName(desc.identifier);
         m_labels[i]->setFixedWidth(this->width() - 40);
         m_labels[i]->setUnselectedText(labelText);
+
+//        std::cerr << "selected text: " << selectedText.toStdString() << std::endl;
         m_labels[i]->setSelectedText(selectedText);
 
         m_labels[i]->setSelected(m_selectedTransform == desc.identifier);
-        m_labels[i]->show();
+
+        if (!m_labels[i]->isVisible()) m_labels[i]->show();
 
         ++m_upToDateCount;
 
-//        if (m_upToDateCount == m_sortedResults.size()) {
-            m_resultsFrame->resize(m_resultsFrame->sizeHint());
-//        }
+        if (i == 0) break;
     }
+
+    m_resultsFrame->resize(m_resultsFrame->sizeHint());
 }
 
 void