⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qglist-h.html

📁 qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人员可以用来资料查询.
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Qt Toolkit - qglist.h include file</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }--></style></head><body bgcolor="#ffffff"><table width="100%"><tr><td><a href="index.html"><img width="100" height="100" src="qtlogo.png"alt="Home" border="0"><img width="100"height="100" src="face.png" alt="Home" border="0"></a><td valign="top"><div align="right"><img src="dochead.png" width="472" height="27"><br><a href="classes.html"><b>Classes</b></a>- <a href="annotated.html">Annotated</a>- <a href="hierarchy.html">Tree</a>- <a href="functions.html">Functions</a>- <a href="index.html">Home</a>- <a href="topicals.html"><b>Structure</b>  <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qte</font></a></div></table><h1 align=center>qglist.h</h1><br clear="all">This is the verbatim text of the qglist.h include file.  It isprovided only for illustration; the copyrightremains with Trolltech.<hr><pre>/****************************************************************************** &#36;Id&#58; qt/src/tools/qglist.h   2.3.8   edited 2004-05-12 $**** Definition of QGList and QGListIterator classes**** Created : 920624**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the tools module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#ifndef QGLIST_H#define QGLIST_H#ifndef QT_H#include "qcollection.h"#endif // QT_H/*****************************************************************************  QLNode class (internal doubly linked list node) *****************************************************************************/class Q_EXPORT <a href="qlnode.html">QLNode</a>{friend class QGList;friend class QGListIterator;public:    QCollection::Item getData() { return data; }private:    QCollection::Item data;    QLNode *prev;    QLNode *next;    QLNode( QCollection::Item d ) { data = d; }};/*****************************************************************************  QGList class *****************************************************************************/class Q_EXPORT <a href="qglist.html">QGList</a> : public <a href="qcollection.html">QCollection</a>      // doubly linked generic list{friend class QGListIterator;friend class QGVector;                          // needed by QGVector::toListpublic:    uint  count() const;                        // return number of nodes#ifndef QT_NO_DATASTREAM    QDataStream &amp;read( QDataStream &amp; );         // read list from stream    QDataStream &amp;write( QDataStream &amp; ) const;  // write list to stream#endifprotected:    QGList();                                   // create empty list    QGList( const QGList &amp; );                   // make copy of other list    virtual ~QGList();    QGList &amp;operator=( const QGList &amp; );        // assign from other list    bool operator==( const QGList&amp; ) const;    void inSort( QCollection::Item );           // add item sorted in list    void append( QCollection::Item );           // add item at end of list    bool insertAt( uint index, QCollection::Item ); // add item at i'th position    void relinkNode( QLNode * );                // relink as first item    bool removeNode( QLNode * );                // remove node    bool remove( QCollection::Item = 0 );       // remove item (0=current)    bool removeRef( QCollection::Item = 0 );    // remove item (0=current)    bool removeFirst();                         // remove first item    bool removeLast();                          // remove last item    bool removeAt( uint index );                // remove item at i'th position    QCollection::Item takeNode( QLNode * );     // take out node    QCollection::Item take();                   // take out current item    QCollection::Item takeAt( uint index );     // take out item at i'th pos    QCollection::Item takeFirst();              // take out first item    QCollection::Item takeLast();               // take out last item    void sort();                        // sort all items;    void clear();                       // remove all items    int  findRef( QCollection::Item, bool = TRUE ); // find exact item in list    int  find( QCollection::Item, bool = TRUE ); // find equal item in list    uint containsRef( QCollection::Item ) const; // get number of exact matches    uint contains( QCollection::Item )  const;  // get number of equal matches    QCollection::Item at( uint index );         // access item at i'th pos    int   at() const;                           // get current index    QLNode *currentNode() const;                // get current node    QCollection::Item get() const;              // get current item    QCollection::Item cfirst() const;   // get ptr to first list item    QCollection::Item clast()  const;   // get ptr to last list item    QCollection::Item first();          // set first item in list curr    QCollection::Item last();           // set last item in list curr    QCollection::Item next();           // set next item in list curr    QCollection::Item prev();           // set prev item in list curr    void  toVector( QGVector * ) const;         // put items in vector    virtual int compareItems( QCollection::Item, QCollection::Item );#ifndef QT_NO_DATASTREAM    virtual QDataStream &amp;read( QDataStream &amp;, QCollection::Item &amp; );    virtual QDataStream &amp;write( QDataStream &amp;, QCollection::Item ) const;#endifprivate:    void  prepend( QCollection::Item ); // add item at start of list    void heapSortPushDown( QCollection::Item* heap, int first, int last );    QLNode *firstNode;                          // first node    QLNode *lastNode;                           // last node    QLNode *curNode;                            // current node    int     curIndex;                           // current index    uint    numNodes;                           // number of nodes    QGList *iterators;                          // list of iterators    QLNode *locate( uint );                     // get node at i'th pos    QLNode *unlink();                           // unlink node};inline uint QGList::count() const{    return numNodes;}inline bool QGList::removeFirst(){    first();    return remove();}inline bool QGList::removeLast(){    last();    return remove();}inline int QGList::at() const{    return curIndex;}inline QCollection::Item QGList::at( uint index ){    QLNode *n = locate( index );    return n ? n-&gt;data : 0;}inline QLNode *QGList::currentNode() const{    return curNode;}inline QCollection::Item QGList::get() const{    return curNode ? curNode-&gt;data : 0;}inline QCollection::Item QGList::cfirst() const{    return firstNode ? firstNode-&gt;data : 0;}inline QCollection::Item QGList::clast() const{    return lastNode ? lastNode-&gt;data : 0;}/*****************************************************************************  QGList stream functions *****************************************************************************/#ifndef QT_NO_DATASTREAMQ_EXPORT QDataStream &amp;operator&gt;&gt;( QDataStream &amp;, QGList &amp; );Q_EXPORT QDataStream &amp;operator&lt;&lt;( QDataStream &amp;, const QGList &amp; );#endif/*****************************************************************************  QGListIterator class *****************************************************************************/class Q_EXPORT <a href="qglistiterator.html">QGListIterator</a>                   // QGList iterator{friend class QGList;protected:    QGListIterator( const QGList &amp; );    QGListIterator( const QGListIterator &amp; );    QGListIterator &amp;operator=( const QGListIterator &amp; );   ~QGListIterator();    bool  atFirst() const;                      // test if at first item    bool  atLast()  const;                      // test if at last item    QCollection::Item     toFirst();                            // move to first item    QCollection::Item     toLast();                             // move to last item    QCollection::Item     get() const;                          // get current item    QCollection::Item     operator()();                         // get current and move to next    QCollection::Item     operator++();                         // move to next item (prefix)    QCollection::Item     operator+=(uint);                     // move n positions forward    QCollection::Item     operator--();                         // move to prev item (prefix)    QCollection::Item     operator-=(uint);                     // move n positions backwardprotected:    QGList *list;                               // reference to listprivate:    QLNode  *curNode;                           // current node in list};inline bool QGListIterator::atFirst() const{    return curNode == list-&gt;firstNode;}inline bool QGListIterator::atLast() const{    return curNode == list-&gt;lastNode;}inline QCollection::Item QGListIterator::get() const{    return curNode ? curNode-&gt;data : 0;}#endif  // QGLIST_H</pre><p><address><hr><div align="center"><table width="100%" cellspacing="0" border="0"><tr><td>Copyright 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -