ISLEman
Public Member Functions | List of all members
QSortedList< type > Class Template Reference
Inheritance diagram for QSortedList< type >:
QList< type > QGList

Public Member Functions

 QSortedList (const QSortedList< type > &l)
 
QSortedList< type > & operator= (const QSortedList< type > &l)
 
virtual int compareItems (QCollection::Item s1, QCollection::Item s2)
 
- Public Member Functions inherited from QList< type >
 QList (const QList< type > &l)
 
QList< type > & operator= (const QList< type > &l)
 
bool operator== (const QList< type > &list) const
 
uint count () const
 
bool isEmpty () const
 
bool insert (uint i, const type *d)
 
void inSort (const type *d)
 
void prepend (const type *d)
 
void append (const type *d)
 
bool remove (uint i)
 
bool remove (const type *d)
 
bool removeRef (const type *d)
 
bool removeFirst ()
 
bool removeLast ()
 
type * take (uint i)
 
void clear ()
 
void sort ()
 
int find (const type *d) const
 
int findRef (const type *d) const
 
uint contains (const type *d) const
 
uint containsRef (const type *d) const
 
type * at (uint i) const
 
type * getFirst () const
 
type * getLast () const
 
void setAutoDelete (bool enable)
 

Member Function Documentation

§ compareItems()

template<class type>
virtual int QSortedList< type >::compareItems ( QCollection::Item  item1,
QCollection::Item  item2 
)
inlinevirtual

This virtual function compares two list items.

Returns:

  • 0 if item1 == item2
  • non-zero if item1 != item2

This function returns int rather than bool so that reimplementations can return three values and use it to sort by:

  • 0 if item1 == item2
  • > 0 (positive integer) if item1 > item2
  • < 0 (negative integer) if item1 < item2

The QList::inSort() function requires that compareItems() is implemented as described here.

This function should not modify the list because some const functions call compareItems().

The default implementation compares the pointers:

Reimplemented from QList< type >.


The documentation for this class was generated from the following file: