katie_generate_obsolete(QRegExpValidator QtGui qvalidator.h)
katie_generate_obsolete(QResizeEvent QtGui qevent.h)
katie_generate_obsolete(QReturnArgument QtCore qobjectdefs.h)
-katie_generate_obsolete(QScopedArrayPointer QtCore qscopedpointer.h)
-katie_generate_obsolete(QScopedPointerArrayDeleter QtCore qscopedpointer.h)
katie_generate_obsolete(QScopedPointerPodDeleter QtCore qscopedpointer.h)
katie_generate_obsolete(QSetIterator QtCore qset.h)
katie_generate_obsolete(QSharedDataPointer QtCore qshareddata.h)
# depend on KtNetwork depend on plugins that depend on it too
add_custom_target(plugins_dependant_tests)
function(KATIE_SETUP_PLUGIN FORPLUGIN)
- add_dependencies(plugins_dependant_tests ${FORPLUGIN})
+# add_dependencies(plugins_dependant_tests ${FORPLUGIN})
endfunction()
# a macro to ensure that object targets are build with PIC if the target they
include/katie/QtCore/QResource
include/katie/QtCore/QReturnArgument
include/katie/QtCore/QRunnable
-include/katie/QtCore/QScopedArrayPointer
include/katie/QtCore/QScopedPointer
-include/katie/QtCore/QScopedPointerArrayDeleter
include/katie/QtCore/QScopedPointerPodDeleter
include/katie/QtCore/QScopedValueRollback
include/katie/QtCore/QSemaphore
include/katie/QtCore/QResource
include/katie/QtCore/QReturnArgument
include/katie/QtCore/QRunnable
-include/katie/QtCore/QScopedArrayPointer
include/katie/QtCore/QScopedPointer
-include/katie/QtCore/QScopedPointerArrayDeleter
include/katie/QtCore/QScopedPointerPodDeleter
include/katie/QtCore/QScopedValueRollback
include/katie/QtCore/QSemaphore
include/katie/QtCore/QResource
include/katie/QtCore/QReturnArgument
include/katie/QtCore/QRunnable
-include/katie/QtCore/QScopedArrayPointer
include/katie/QtCore/QScopedPointer
-include/katie/QtCore/QScopedPointerArrayDeleter
include/katie/QtCore/QScopedPointerPodDeleter
include/katie/QtCore/QScopedValueRollback
include/katie/QtCore/QSemaphore
'QReadLocker': 'qreadwritelock.h',
'QRectF': 'qrect.h',
'QReturnArgument': 'qobjectdefs.h',
- 'QScopedArrayPointer': 'qscopedpointer.h',
- 'QScopedPointerArrayDeleter': 'qscopedpointer.h',
'QScopedPointerPodDeleter': 'qscopedpointer.h',
'QSetIterator': 'qset.h',
'QSharedDataPointer': 'qshareddata.h',
"QRgb",
"QRubberBand",
"QRunnable",
- "QScopedArrayPointer",
"QScopedPointer",
- "QScopedPointerArrayDeleter",
"QScopedPointerPodDeleter",
"QScopedValueRollback",
"QScriptable",
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
#include "qfilesystemengine_p.h"
+#include "qvarlengtharray.h"
#include "qscopedpointer.h"
#include "qcorecommon_p.h"
names->append(l.at(i).fileName());
}
} else {
- QScopedArrayPointer<QDirSortItem> si(new QDirSortItem[n]);
+ QVarLengthArray<QDirSortItem> si(n);
for (int i = 0; i < n; ++i)
si[i].item = l.at(i);
qSort(si.data(), si.data() + n, QDirSortItemComparator(sort));
\list
\i QScopedPointerDeleter - the default, deletes the pointer using \c delete
- \i QScopedPointerArrayDeleter - deletes the pointer using \c{delete []}. Use
- this handler for pointers that were allocated with \c{new []}.
\i QScopedPointerPodDeleter - deletes the pointer using \c{free()}. Use this
handler for pointers that were allocated with \c{malloc()}.
\endlist
Swap this pointer with \a other.
*/
-/*!
- \class QScopedArrayPointer
-
- \brief The QScopedArrayPointer class stores a pointer to a
- dynamically allocated array of objects, and deletes it upon
- destruction.
-
- \since 4.6
- \reentrant
- \ingroup misc
-
- A QScopedArrayPointer is a QScopedPointer that defaults to
- deleting the object it is pointing to with the delete[] operator. It
- also features operator[] for convenience, so we can write:
-
- \code
- void foo()
- {
- QScopedArrayPointer<int> i(new int[10]);
- i[2] = 42;
- ...
- return; // our integer array is now deleted using delete[]
- }
- \endcode
-*/
-
-/*!
- \fn QScopedArrayPointer::QScopedArrayPointer()
-
- Constructs a QScopedArrayPointer instance.
-*/
-
-/*!
- \fn T *QScopedArrayPointer::operator[](int i)
-
- Provides access to entry \a i of the scoped pointer's array of
- objects.
-
- If the contained pointer is \c null, behavior is undefined.
-
- \sa isNull()
-*/
-
-/*!
- \fn T *QScopedArrayPointer::operator[](int i) const
-
- Provides access to entry \a i of the scoped pointer's array of
- objects.
-
- If the contained pointer is \c null, behavior is undefined.
-
- \sa isNull()
-*/
-
QT_END_NAMESPACE
}
};
-template <typename T>
-class QScopedPointerArrayDeleter
-{
-public:
- static inline void cleanup(T *pointer)
- {
- // Enforce a complete type.
- // If you get a compile error here, read the section on forward declared
- // classes in the QScopedPointer documentation.
- typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
- (void) sizeof(IsIncompleteType);
-
- delete [] pointer;
- }
-};
-
struct QScopedPointerPodDeleter
{
static inline void cleanup(void *pointer) { if (pointer) free(pointer); }
}
QT_BEGIN_NAMESPACE
-
-namespace QtPrivate {
- template <typename X, typename Y> struct QScopedArrayEnsureSameType;
- template <typename X> struct QScopedArrayEnsureSameType<X,X> { typedef X* Type; };
- template <typename X> struct QScopedArrayEnsureSameType<const X, X> { typedef X* Type; };
-}
-
-template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
-class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
-{
-public:
- inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(0) {}
-
- template <typename D>
- explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
- : QScopedPointer<T, Cleanup>(p)
- {
- }
-
- inline T &operator[](int i)
- {
- return this->d[i];
- }
-
- inline const T &operator[](int i) const
- {
- return this->d[i];
- }
-
-private:
- explicit inline QScopedArrayPointer(void *) {
- // Enforce the same type.
-
- // If you get a compile error here, make sure you declare
- // QScopedArrayPointer with the same template type as you pass to the
- // constructor. See also the QScopedPointer documentation.
-
- // Storing a scalar array as a pointer to a different type is not
- // allowed and results in undefined behavior.
- }
-
- Q_DISABLE_COPY(QScopedArrayPointer)
-};
-
QT_END_NAMESPACE
#endif // QSCOPEDPOINTER_H