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  ·  Classes  ·  Annotées  ·  Hiérarchie  ·  Fonctions  ·  Structure  · 

QStrList Class Reference


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

#include <qstrlist.h>

Inherits QList.

Inherited by QStrIList.

List of all member functions.

Public Members

  • QStrList ( bool deepCopies=TRUE ) 
  • QStrList ( const QStrList & ) 
  • ~QStrList () 
  • QStrList& operator= ( const QStrList & ) 

Detailed Description

The QStrList class provides a doubly linked list of char*.

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

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

A deep copy means to allocate space for the string and then copy the string data into it. A shallow copy is just a copy of the pointer value and not the string data.

The disadvantage with shallow copies is that since a pointer can only be deleted 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 shallow copies 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 QStrList that operates on deep copies will by default turn on auto-deletion (see setAutoDelete()). Thus, by default, QStrList 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 a sorted order.

The QStrListIterator class is an iterator for QStrList.


Member Function Documentation

QStrList::QStrList ( bool deepCopies=TRUE )

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

QStrList::QStrList ( const QStrList & list )

Constructs a copy of list.

If list has deep copies, this list will also get deep copies. Only the pointers are copied (shallow copy) if the other list does not use deep copies.

QStrList::~QStrList ()

Destroys the list. All strings are removed.

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

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

If list has deep copies, this list will also get deep copies. Only the pointers are copied (shallow copy) if the other list does not use deep copies.


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.

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