MCPcopy Create free account
hub / github.com/KDE/labplot / searchExampleProjects

Method searchExampleProjects

src/frontend/welcomescreen/WelcomeScreenHelper.cpp:319–339  ·  view source on GitHub ↗

* @brief Searches among the example projects based on the text introduce in the search bar of the welcome screen. * @param searchtext - the text based on which we'll have to search * @return Returns the results */

Source from the content-addressed store, hash-verified

317 * @return Returns the results
318 */
319QVariant WelcomeScreenHelper::searchExampleProjects(const QString& searchtext) {
320 QStringList results;
321
322 // search based on tags
323 for (auto tag = m_tagMap.begin(); tag != m_tagMap.end(); ++tag) {
324 if (tag.key().contains(searchtext)) {
325 for (QString example : tag.value()) {
326 if (!results.contains(example))
327 results.append(example);
328 }
329 }
330 }
331
332 // search based on name
333 for (QString example : m_projectNameList) {
334 if (example.contains(searchtext) && !results.contains(example))
335 results.append(example);
336 }
337
338 return QVariant(results);
339}
340
341/**
342 * @brief Sets the width scale for the given section, which will be saved.

Callers

nothing calls this directly

Calls 5

appendMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected