tools/assistant/lib/qhelpsearchresultwidget.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
equal deleted inserted replaced
4:3b1da2848fc7 5:d3bac044e0f0
    71             this, SLOT(itemActivated(QTreeWidgetItem*,int)));
    71             this, SLOT(itemActivated(QTreeWidgetItem*,int)));
    72     }
    72     }
    73 
    73 
    74     void showResultPage(const QList<QHelpSearchEngine::SearchHit> hits)
    74     void showResultPage(const QList<QHelpSearchEngine::SearchHit> hits)
    75     {
    75     {
    76         foreach (const QHelpSearchEngine::SearchHit hit, hits)
    76         foreach (const QHelpSearchEngine::SearchHit &hit, hits)
    77             new QTreeWidgetItem(this, QStringList(hit.first) << hit.second);
    77             new QTreeWidgetItem(this, QStringList(hit.first) << hit.second);
    78     }
    78     }
    79 
    79 
    80 signals:
    80 signals:
    81     void requestShowLink(const QUrl &url);
    81     void requestShowLink(const QUrl &url);
   116                     "%1&nbsp;<span style=\"font-weight:normal; color:black\">"
   116                     "%1&nbsp;<span style=\"font-weight:normal; color:black\">"
   117                     "%2</span></div></div><br>")).arg(tr("Note:"))
   117                     "%2</span></div></div><br>")).arg(tr("Note:"))
   118                     .arg(tr("The search results may not be complete since the "
   118                     .arg(tr("The search results may not be complete since the "
   119                             "documentation is still being indexed!"));
   119                             "documentation is still being indexed!"));
   120 
   120 
   121             foreach (const QHelpSearchEngine::SearchHit hit, hits) {
   121             foreach (const QHelpSearchEngine::SearchHit &hit, hits) {
   122                 htmlFile += QString(QLatin1String("<div style=\"text-align:left; font-weight:bold\""
   122                 htmlFile += QString(QLatin1String("<div style=\"text-align:left; font-weight:bold\""
   123                 "><a href=\"%1\">%2</a><div style=\"color:green; font-weight:normal;"
   123                 "><a href=\"%1\">%2</a><div style=\"color:green; font-weight:normal;"
   124                 " margin:5px\">%1</div></div><p></p>"))
   124                 " margin:5px\">%1</div></div><p></p>"))
   125                 .arg(hit.first).arg(hit.second);
   125                 .arg(hit.first).arg(hit.second);
   126             }
   126             }
   406 #endif
   406 #endif
   407 
   407 
   408     connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int)));
   408     connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int)));
   409 }
   409 }
   410 
   410 
       
   411 /*! \reimp
       
   412 */
       
   413 void QHelpSearchResultWidget::changeEvent(QEvent *event)
       
   414 {
       
   415     if (event->type() == QEvent::LanguageChange)
       
   416         d->setResults(d->searchEngine->hitCount());
       
   417 }
       
   418 
   411 /*!
   419 /*!
   412     Destroys the search result widget.
   420     Destroys the search result widget.
   413 */
   421 */
   414 QHelpSearchResultWidget::~QHelpSearchResultWidget()
   422 QHelpSearchResultWidget::~QHelpSearchResultWidget()
   415 {
   423 {