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  ·  Tous les espaces de nom  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Qt 3 Support Members for QLinkedList

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

Public Functions

  • iterator find ( iterator from, const T & t )
  • iterator find ( const T & t )
  • const_iterator find ( const_iterator from, const T & t ) const
  • const_iterator find ( const T & t ) const
  • int findIndex ( const T & t ) const
  • iterator remove ( iterator pos )

Member Function Documentation

iterator QLinkedList::find ( iterator from, const T & t )

If you need random access to a data structure then QList, QVector, QMap, or QHash, are all better choices than QLinkedList.

For example, if you have code like

 QLinkedList::iterator i = list->find(from, value);

you can rewrite it as

 QLinkedList::iterator i = from;
 while (i != list->end() && *i != value)
     ++i;

iterator QLinkedList::find ( const T & t )

This is an overloaded member function, provided for convenience.

If you need random access to a data structure then QList, QVector, QMap, or QHash, are all better choices than QLinkedList.

For example, if you have code like

 QLinkedList::iterator i = list->find(value);

you can rewrite it as

 QLinkedList::iterator i = list->begin();
 while (i != list->end() && *i != value)
     ++i;

const_iterator QLinkedList::find ( const_iterator from, const T & t ) const

This is an overloaded member function, provided for convenience.

If you need random access to a data structure then QList, QVector, QMap, or QHash, are all better choices than QLinkedList.

For example, if you have code like

 QLinkedList::const_iterator i = list->find(from, value);

you can rewrite it as

 QLinkedList::const_iterator i = from;
 while (i != list->end() && *i != value)
     ++i;

const_iterator QLinkedList::find ( const T & t ) const

This is an overloaded member function, provided for convenience.

If you need random access to a data structure then QList, QVector, QMap, or QHash, are all better choices than QLinkedList.

For example, if you have code like

 QLinkedList::const_iterator i = list->find(value);

you can rewrite it as

 QLinkedList::const_iterator i = list->begin();
 while (i != list->end() && *i != value)
     ++i;

int QLinkedList::findIndex ( const T & t ) const

If you need indexes then QList or QVector are better choices than QLinkedList.

For example, if you have code like

 int index = list->findIndex(value);

you can rewrite it as

 int index = 0;
 bool found = false;
 for (const_iterator i = list->begin(); i != list->end(); ++i; ++index)
     if (*i == value) {
         found = true;
         break;
     }
 if (!found)
     index = -1;

iterator QLinkedList::remove ( iterator pos )

Use erase() instead.

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.3
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