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  · 

Q3StrList Class Reference

The Q3StrList class provides a doubly-linked list of char*. More...

 #include <Q3StrList>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits: Q3PtrList<char>.

Inherited by: Q3StrIList.

Public Functions

Q3StrList ( bool deepCopies = true )
Q3StrList ( const Q3StrList & list )
Q3StrList ( const QList<QByteArray> & list )
~Q3StrList ()
operator QList<QByteArray> () const
Q3StrList & operator= ( const Q3StrList & list )
Q3StrList & operator= ( const QList<QByteArray> & list )

Additional Inherited Members

Detailed Description

The Q3StrList class provides a doubly-linked list of char*.

If you want a string list of QStrings use QStringList.

This class is a Q3PtrList<char> instance (a list of char*).

Q3StrList can make deep or shallow copies of the strings that are inserted.

A deep copy means that memory is allocated for the string and then the string data is copied into that memory. A shallow copy is just a copy of the pointer value and not of the string data itself.

The disadvantage of shallow copies is that because a pointer can be deleted only once, the program must put all strings in a central place and know when it is safe to delete them (i.e. when the strings are no longer referenced by other parts of the program). This can make the program more complex. The advantage of shallow copies is that they consume far less memory than deep copies. It is also much faster to copy a pointer (typically 4 or 8 bytes) than to copy string data.

A Q3StrList that operates on deep copies will, by default, turn on auto-deletion (see setAutoDelete()). Thus, by default Q3StrList will deallocate any string copies it allocates.

The virtual compareItems() function is reimplemented and does a case-sensitive string comparison. The inSort() function will insert strings in sorted order. In general it is fastest to insert the strings as they come and sort() at the end; inSort() is useful when you just have to add a few extra strings to an already sorted list.

The Q3StrListIterator class is an iterator for Q3StrList.

Member Function Documentation

Q3StrList::Q3StrList ( bool deepCopies = true )

Constructs an empty list of strings. Will make deep copies of all inserted strings if deepCopies is TRUE, or use shallow copies if deepCopies is FALSE.

Q3StrList::Q3StrList ( const Q3StrList & list )

Constructs a copy of list.

Q3StrList::Q3StrList ( const QList<QByteArray> & list )

Constructs a copy of list.

Q3StrList::~Q3StrList ()

Destroys the list. All strings are removed.

Q3StrList::operator QList<QByteArray> () const

Automatically converts a Q3StrList into a QList<QByteArray>.

Q3StrList & Q3StrList::operator= ( const Q3StrList & list )

Assigns list to this list and returns a reference to this list.

Q3StrList & Q3StrList::operator= ( const QList<QByteArray> & list )

Assigns list to this list and returns a reference to this list.

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