Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QHelpSearchEngine Class Reference
[QtHelp module]

The QHelpSearchEngine class provides access to widgets reusable to integrate fulltext search as well as to index and search documentation. More...

 #include <QHelpSearchEngine>

This class is not part of the Qt GUI Framework Edition.

Inherits QObject.

This class was introduced in Qt 4.4.


Public Types

typedef SearchHit

Public Functions

QHelpSearchEngine ( QHelpEngineCore * helpEngine, QObject * parent = 0 )
~QHelpSearchEngine ()
int hitCount () const
QList<SearchHit> hits ( int start, int end ) const
QList<QHelpSearchQuery> query () const
QHelpSearchQueryWidget * queryWidget ()
QHelpSearchResultWidget * resultWidget ()
  • 29 public functions inherited from QObject

Public Slots

void cancelIndexing ()
void cancelSearching ()
void reindexDocumentation ()
void search ( const QList<QHelpSearchQuery> & queryList )
  • 1 public slot inherited from QObject

Signals

void indexingFinished ()
void indexingStarted ()
void searchingFinished ( int hits )
void searchingStarted ()

Additional Inherited Members

  • 1 property inherited from QObject
  • 5 static public members inherited from QObject
  • 7 protected functions inherited from QObject

Detailed Description

The QHelpSearchEngine class provides access to widgets reusable to integrate fulltext search as well as to index and search documentation.

Before the search engine can be used, one has to instantiate at least a QHelpEngineCore object that needs to be passed to the search engines constructor. This is required as the search engine needs to be connected to the help engines setupFinished() signal to know when it can start to index documentation.

After starting the indexing process the signal indexingStarted() is emitted and on the end of the indexing process the indexingFinished() is emited. To stop the indexing one can call cancelIndexing().

While the indexing process has finished, the search engine can now be used to search thru its index for a given term. To do this one may use the possibility of creating the QHelpSearchQuery list by self or reuse the QHelpSearchQueryWidget which has the inbuild functionality to set up a proper search querys list that get's passed to the search engines search() function.

After the list of querys has been passed to the search engine, the signal searchingStarted() is emited and after the search has finished the searchingFinished() signal is emited. The search process can be stopped by calling cancelSearching().

If the search succeeds, the searchingFinished() will be called with the search hits count, which can be reused to fetch the search hits from the search engine. Calling the hits() function with the range of hits you would like to get will return a list of the requested SearchHits. They basically constist at the moment of a pair of strings where the values of that pair are the documentation file path and the page title.

To display the given hits use the QHelpSearchResultWidget or build up your own one if you need more advanced functionality. Note that the QHelpSearchResultWidget can not be instantiated directly, you must retrieve the widget from the search engine in use as all connections will be established for you by the widget itself.


Member Type Documentation

typedef QHelpSearchEngine::SearchHit

Typedef for QPair<QString, QString>. The values of that pair are the documentation file path and the page title.

See also hits().


Member Function Documentation

QHelpSearchEngine::QHelpSearchEngine ( QHelpEngineCore * helpEngine, QObject * parent = 0 )

Constructs a new search engine with the given parent. The search engine uses the given helpEngine to access the documentation that needs to be indexed. The QHelpEngine's setupFinished() signal is automatically connected to the QHelpSearchEngine's indexing function, so that new documentation will be indexed after the signal is emited.

QHelpSearchEngine::~QHelpSearchEngine ()

Destructs the search engine.

void QHelpSearchEngine::cancelIndexing ()   [slot]

Stops the indexing process.

void QHelpSearchEngine::cancelSearching ()   [slot]

Stops the search process.

int QHelpSearchEngine::hitCount () const

Returns the amount of hits the search engine found.

This function was introduced in Qt 4.6.

QList<SearchHit> QHelpSearchEngine::hits ( int start, int end ) const

Returns a list of search hits within the range of start end.

void QHelpSearchEngine::indexingFinished ()   [signal]

This signal is emitted when the indexing process is complete.

void QHelpSearchEngine::indexingStarted ()   [signal]

This signal is emitted when indexing process is started.

QList<QHelpSearchQuery> QHelpSearchEngine::query () const

Returns the list of queries last searched for.

This function was introduced in Qt 4.5.

QHelpSearchQueryWidget * QHelpSearchEngine::queryWidget ()

Returns a widget to use as input widget. Depending on your search engine configuration you will get a different widget with more or less subwidgets.

void QHelpSearchEngine::reindexDocumentation ()   [slot]

Forces the search engine to reindex all documentation files.

QHelpSearchResultWidget * QHelpSearchEngine::resultWidget ()

Returns a widget that can hold and display the search results.

void QHelpSearchEngine::search ( const QList<QHelpSearchQuery> & queryList )   [slot]

Starts the search process using the given list of querys queryList build by the search field name and the values to search for.

void QHelpSearchEngine::searchingFinished ( int hits )   [signal]

This signal is emitted when the search process is complete. The hit count is stored in hits.

void QHelpSearchEngine::searchingStarted ()   [signal]

This signal is emitted when the search process is started.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.6
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web