Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
424:374b72f5b4bb | 425:4a5fe5471282 |
---|---|
88 raise(); | 88 raise(); |
89 | 89 |
90 m_upToDateCount = 0; | 90 m_upToDateCount = 0; |
91 m_timer = new QTimer(this); | 91 m_timer = new QTimer(this); |
92 connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); | 92 connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); |
93 m_timer->start(0); | 93 m_timer->start(30); |
94 } | 94 } |
95 | 95 |
96 TransformFinder::~TransformFinder() | 96 TransformFinder::~TransformFinder() |
97 { | 97 { |
98 } | 98 } |
145 } | 145 } |
146 | 146 |
147 return; | 147 return; |
148 } | 148 } |
149 | 149 |
150 if (m_upToDateCount < m_sortedResults.size()) { | 150 if (m_upToDateCount >= m_sortedResults.size()) return; |
151 | |
152 while (m_upToDateCount < m_sortedResults.size()) { | |
151 | 153 |
152 int i = m_upToDateCount; | 154 int i = m_upToDateCount; |
153 | 155 |
154 std::cerr << "sorted size = " << m_sortedResults.size() << std::endl; | 156 std::cerr << "sorted size = " << m_sortedResults.size() << std::endl; |
155 | 157 |
156 TransformDescription desc = | 158 TransformDescription desc = |
157 TransformFactory::getInstance()->getTransformDescription | 159 TransformFactory::getInstance()->getTransformDescription |
158 (m_sortedResults[i].transform); | 160 (m_sortedResults[i].transform); |
159 | 161 |
160 QString labelText; | 162 QString labelText; |
161 labelText += tr("%1: %2<br><small>") | 163 labelText += tr("%1<br><small>") |
162 .arg(m_sortedResults[i].score) | |
163 .arg(XmlExportable::encodeEntities(desc.name)); | 164 .arg(XmlExportable::encodeEntities(desc.name)); |
164 | 165 |
165 labelText += "..."; | 166 labelText += "..."; |
166 for (TransformFactory::Match::FragmentMap::const_iterator k = | 167 for (TransformFactory::Match::FragmentMap::const_iterator k = |
167 m_sortedResults[i].fragments.begin(); | 168 m_sortedResults[i].fragments.begin(); |
199 } | 200 } |
200 | 201 |
201 m_labels[i]->setObjectName(desc.identifier); | 202 m_labels[i]->setObjectName(desc.identifier); |
202 m_labels[i]->setFixedWidth(this->width() - 40); | 203 m_labels[i]->setFixedWidth(this->width() - 40); |
203 m_labels[i]->setUnselectedText(labelText); | 204 m_labels[i]->setUnselectedText(labelText); |
205 | |
206 // std::cerr << "selected text: " << selectedText.toStdString() << std::endl; | |
204 m_labels[i]->setSelectedText(selectedText); | 207 m_labels[i]->setSelectedText(selectedText); |
205 | 208 |
206 m_labels[i]->setSelected(m_selectedTransform == desc.identifier); | 209 m_labels[i]->setSelected(m_selectedTransform == desc.identifier); |
207 m_labels[i]->show(); | 210 |
211 if (!m_labels[i]->isVisible()) m_labels[i]->show(); | |
208 | 212 |
209 ++m_upToDateCount; | 213 ++m_upToDateCount; |
210 | 214 |
211 // if (m_upToDateCount == m_sortedResults.size()) { | 215 if (i == 0) break; |
212 m_resultsFrame->resize(m_resultsFrame->sizeHint()); | 216 } |
213 // } | 217 |
214 } | 218 m_resultsFrame->resize(m_resultsFrame->sizeHint()); |
215 } | 219 } |
216 | 220 |
217 void | 221 void |
218 TransformFinder::selectedLabelChanged() | 222 TransformFinder::selectedLabelChanged() |
219 { | 223 { |