-rw-r--r-- | qmake/include/qptrlist.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qmake/include/qptrlist.h b/qmake/include/qptrlist.h index 53fb605..17b5ee9 100644 --- a/qmake/include/qptrlist.h +++ b/qmake/include/qptrlist.h | |||
@@ -1,55 +1,53 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Definition of QPtrList template/macro class | 4 | ** Definition of QPtrList template/macro class |
5 | ** | 5 | ** |
6 | ** Created : | ||
7 | ** | ||
8 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | 6 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. |
9 | ** | 7 | ** |
10 | ** This file is part of the tools module of the Qt GUI Toolkit. | 8 | ** This file is part of the tools module of the Qt GUI Toolkit. |
11 | ** | 9 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 10 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 11 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 12 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 13 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 14 | ** This file may be distributed and/or modified under the terms of the |
17 | ** GNU General Public License version 2 as published by the Free Software | 15 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 16 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 17 | ** packaging of this file. |
20 | ** | 18 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 19 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition |
22 | ** licenses may use this file in accordance with the Qt Commercial License | 20 | ** licenses may use this file in accordance with the Qt Commercial License |
23 | ** Agreement provided with the Software. | 21 | ** Agreement provided with the Software. |
24 | ** | 22 | ** |
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 23 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 24 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
27 | ** | 25 | ** |
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 26 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
29 | ** information about Qt Commercial License Agreements. | 27 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 28 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 29 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 30 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 31 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 32 | ** not clear to you. |
35 | ** | 33 | ** |
36 | **********************************************************************/ | 34 | **********************************************************************/ |
37 | 35 | ||
38 | #ifndef QPTRLIST_H | 36 | #ifndef QPTRLIST_H |
39 | #define QPTRLIST_H | 37 | #define QPTRLIST_H |
40 | 38 | ||
41 | #ifndef QT_H | 39 | #ifndef QT_H |
42 | #include "qglist.h" | 40 | #include "qglist.h" |
43 | #endif // QT_H | 41 | #endif // QT_H |
44 | 42 | ||
45 | 43 | ||
46 | template<class type> | 44 | template<class type> |
47 | class QPtrList | 45 | class QPtrList |
48 | #ifdef Q_QDOC | 46 | #ifdef Q_QDOC |
49 | : public QPtrCollection | 47 | : public QPtrCollection |
50 | #else | 48 | #else |
51 | : public QGList | 49 | : public QGList |
52 | #endif | 50 | #endif |
53 | { | 51 | { |
54 | public: | 52 | public: |
55 | QPtrList() {} | 53 | QPtrList() {} |
@@ -112,49 +110,53 @@ private: | |||
112 | 110 | ||
113 | #if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) | 111 | #if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) |
114 | template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item ) | 112 | template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item ) |
115 | { | 113 | { |
116 | } | 114 | } |
117 | #endif | 115 | #endif |
118 | 116 | ||
119 | template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d ) | 117 | template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d ) |
120 | { | 118 | { |
121 | if ( del_item ) delete (type *)d; | 119 | if ( del_item ) delete (type *)d; |
122 | } | 120 | } |
123 | 121 | ||
124 | template<class type> | 122 | template<class type> |
125 | class QPtrListIterator : public QGListIterator | 123 | class QPtrListIterator : public QGListIterator |
126 | { | 124 | { |
127 | public: | 125 | public: |
128 | QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {} | 126 | QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {} |
129 | ~QPtrListIterator() {} | 127 | ~QPtrListIterator() {} |
130 | uint count() const { return list->count(); } | 128 | uint count() const { return list->count(); } |
131 | bool isEmpty() const { return list->count() == 0; } | 129 | bool isEmpty() const { return list->count() == 0; } |
132 | bool atFirst() const { return QGListIterator::atFirst(); } | 130 | bool atFirst() const { return QGListIterator::atFirst(); } |
133 | bool atLast() const { return QGListIterator::atLast(); } | 131 | bool atLast() const { return QGListIterator::atLast(); } |
134 | type *toFirst() { return (type *)QGListIterator::toFirst(); } | 132 | type *toFirst() { return (type *)QGListIterator::toFirst(); } |
135 | type *toLast() { return (type *)QGListIterator::toLast(); } | 133 | type *toLast() { return (type *)QGListIterator::toLast(); } |
136 | operator type *() const { return (type *)QGListIterator::get(); } | 134 | operator type *() const { return (type *)QGListIterator::get(); } |
137 | type *operator*() { return (type *)QGListIterator::get(); } | 135 | type *operator*() { return (type *)QGListIterator::get(); } |
138 | 136 | ||
139 | // No good, since QPtrList<char> (ie. QStrList fails... | 137 | // No good, since QPtrList<char> (ie. QStrList fails... |
140 | // | 138 | // |
141 | // MSVC++ gives warning | 139 | // MSVC++ gives warning |
142 | // Sunpro C++ 4.1 gives error | 140 | // Sunpro C++ 4.1 gives error |
143 | // type *operator->() { return (type *)QGListIterator::get(); } | 141 | // type *operator->() { return (type *)QGListIterator::get(); } |
144 | 142 | ||
145 | type *current() const { return (type *)QGListIterator::get(); } | 143 | type *current() const { return (type *)QGListIterator::get(); } |
146 | type *operator()() { return (type *)QGListIterator::operator()();} | 144 | type *operator()() { return (type *)QGListIterator::operator()();} |
147 | type *operator++() { return (type *)QGListIterator::operator++(); } | 145 | type *operator++() { return (type *)QGListIterator::operator++(); } |
148 | type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);} | 146 | type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);} |
149 | type *operator--() { return (type *)QGListIterator::operator--(); } | 147 | type *operator--() { return (type *)QGListIterator::operator--(); } |
150 | type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);} | 148 | type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);} |
151 | QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it) | 149 | QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it) |
152 | { QGListIterator::operator=(it); return *this; } | 150 | { QGListIterator::operator=(it); return *this; } |
153 | }; | 151 | }; |
154 | 152 | ||
155 | #ifndef QT_NO_COMPAT | 153 | #ifndef QT_NO_COMPAT |
156 | #define QList QPtrList | 154 | #define QList QPtrList |
157 | #define QListIterator QPtrListIterator | 155 | #define QListIterator QPtrListIterator |
158 | #endif | 156 | #endif |
159 | 157 | ||
158 | #ifdef QT_QWINEXPORT | ||
159 | #define Q_DEFINED_QPTRLIST | ||
160 | #include "qwinexport.h" | ||
161 | #endif /* QT_QWINEXPORT */ | ||
160 | #endif // QPTRLIST_H | 162 | #endif // QPTRLIST_H |