summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-07-06 13:55:40 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-07-06 14:08:02 +0200
commit314fdbce8ce473eb3610be3658c61fab2fac0efb (patch)
tree98a24a6f53ea8d6a7f3fc6ad60ab84dd66ae2863 /src/corelib
parent8d7647e286e07690de15a6ff9189307ee1a3517c (diff)
parent83736a8d06a6ca2a1f165d6119ddaca90646e1f8 (diff)
Merge remote branch 'gerrit/master' into refactor
Conflicts: config.tests/unix/opengldesktop/opengldesktop.cpp examples/itemviews/interview/interview.pro examples/mainwindows/mainwindow/mainwindow.pro examples/openvg/README examples/richtext/textedit/textedit.pro examples/tools/undo/undo.pro src/corelib/global/qglobal.h src/corelib/kernel/qcoreapplication.h src/corelib/kernel/qcoreevent.h src/corelib/kernel/qmetatype.h src/gui/kernel/qevent.cpp src/gui/kernel/qevent.h src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qpaintengine_raster_p.h src/gui/text/qfontdatabase.cpp src/opengl/qgl.h src/openvg/qpaintengine_vg.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp tests/auto/qmainwindow/qmainwindow.pro Change-Id: I6bfb586740a68379bb99f4612ec993393a5f3234
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qtextcodec.cpp58
-rw-r--r--src/corelib/codecs/qtextcodec.h14
-rw-r--r--src/corelib/global/qglobal.cpp53
-rw-r--r--src/corelib/global/qglobal.h122
-rw-r--r--src/corelib/global/qnamespace.h258
-rw-r--r--src/corelib/global/qnamespace.qdoc46
-rw-r--r--src/corelib/io/qdatastream.cpp41
-rw-r--r--src/corelib/io/qdatastream.h15
-rw-r--r--src/corelib/io/qdir.cpp155
-rw-r--r--src/corelib/io/qdir.h45
-rw-r--r--src/corelib/io/qdir_p.h5
-rw-r--r--src/corelib/io/qfile.cpp16
-rw-r--r--src/corelib/io/qfile.h11
-rw-r--r--src/corelib/io/qfileinfo.cpp13
-rw-r--r--src/corelib/io/qfileinfo.h41
-rw-r--r--src/corelib/io/qiodevice.cpp25
-rw-r--r--src/corelib/io/qiodevice.h71
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp8
-rw-r--r--src/corelib/io/qprocess_win.cpp18
-rw-r--r--src/corelib/io/qsettings.cpp272
-rw-r--r--src/corelib/io/qsettings.h110
-rw-r--r--src/corelib/io/qtextstream.cpp298
-rw-r--r--src/corelib/io/qtextstream.h88
-rw-r--r--src/corelib/io/qurl.cpp33
-rw-r--r--src/corelib/io/qurl.h50
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp149
-rw-r--r--src/corelib/kernel/qcoreapplication.h20
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h3
-rw-r--r--src/corelib/kernel/qcoreevent.cpp59
-rw-r--r--src/corelib/kernel/qcoreevent.h33
-rw-r--r--src/corelib/kernel/qeventloop.h4
-rw-r--r--src/corelib/kernel/qmetaobject.cpp6
-rw-r--r--src/corelib/kernel/qmetatype.cpp6
-rw-r--r--src/corelib/kernel/qmetatype.h7
-rw-r--r--src/corelib/kernel/qobject.cpp210
-rw-r--r--src/corelib/kernel/qobject.h67
-rw-r--r--src/corelib/kernel/qobject_p.h12
-rw-r--r--src/corelib/kernel/qobjectdefs.h21
-rw-r--r--src/corelib/kernel/qsignalmapper.cpp12
-rw-r--r--src/corelib/kernel/qsignalmapper.h5
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp34
-rw-r--r--src/corelib/kernel/qsocketnotifier.h3
-rw-r--r--src/corelib/kernel/qtimer.cpp30
-rw-r--r--src/corelib/kernel/qtimer.h8
-rw-r--r--src/corelib/kernel/qtranslator.cpp12
-rw-r--r--src/corelib/kernel/qtranslator.h8
-rw-r--r--src/corelib/kernel/qvariant.cpp15
-rw-r--r--src/corelib/kernel/qvariant.h80
-rw-r--r--src/corelib/plugin/qlibrary.h4
-rw-r--r--src/corelib/thread/qmutex.h18
-rw-r--r--src/corelib/thread/qthread.h6
-rw-r--r--src/corelib/thread/qthread_p.h21
-rw-r--r--src/corelib/tools/qbytearray.h47
-rw-r--r--src/corelib/tools/qcache.h9
-rw-r--r--src/corelib/tools/qchar.h27
-rw-r--r--src/corelib/tools/qdatetime.h48
-rw-r--r--src/corelib/tools/qlinkedlist.h15
-rw-r--r--src/corelib/tools/qlist.h14
-rw-r--r--src/corelib/tools/qmap.h36
-rw-r--r--src/corelib/tools/qrect.h30
-rw-r--r--src/corelib/tools/qregexp.h33
-rw-r--r--src/corelib/tools/qscopedpointer.h4
-rw-r--r--src/corelib/tools/qstring.cpp94
-rw-r--r--src/corelib/tools/qstring.h131
-rw-r--r--src/corelib/tools/qstringbuilder.cpp2
-rw-r--r--src/corelib/tools/qstringbuilder.h2
-rw-r--r--src/corelib/tools/qstringlist.cpp36
-rw-r--r--src/corelib/tools/qstringlist.h51
68 files changed, 79 insertions, 3219 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 985f5153ea..0f919fb401 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1427,48 +1427,6 @@ bool QTextCodec::canEncode(const QString& s) const
return (state.invalidChars == 0);
}
-#ifdef QT3_SUPPORT
-/*!
- Returns a string representing the current language and
- sublanguage, e.g. "pt" for Portuguese, or "pt_br" for Portuguese/Brazil.
-
- \sa QLocale
-*/
-const char *QTextCodec::locale()
-{
- static char locale[6];
- QByteArray l = QLocale::system().name().toLatin1();
- int len = qMin(l.length(), 5);
- memcpy(locale, l.constData(), len);
- locale[len] = '\0';
-
- return locale;
-}
-
-/*!
- \overload
-*/
-
-QByteArray QTextCodec::fromUnicode(const QString& uc, int& lenInOut) const
-{
- QByteArray result = convertFromUnicode(uc.constData(), lenInOut, 0);
- lenInOut = result.length();
- return result;
-}
-
-/*!
- \overload
-
- \a a contains the source characters; \a len contains the number of
- characters in \a a to use.
-*/
-QString QTextCodec::toUnicode(const QByteArray& a, int len) const
-{
- len = qMin(a.size(), len);
- return convertToUnicode(a.constData(), len, 0);
-}
-#endif
-
/*!
\overload
@@ -1552,22 +1510,6 @@ QByteArray QTextEncoder::fromUnicode(const QChar *uc, int len)
return result;
}
-#ifdef QT3_SUPPORT
-/*!
- \overload
-
- Converts \a lenInOut characters (not bytes) from \a uc, and returns the
- result in a QByteArray. The number of characters read is returned in
- the \a lenInOut parameter.
-*/
-QByteArray QTextEncoder::fromUnicode(const QString& uc, int& lenInOut)
-{
- QByteArray result = c->fromUnicode(uc.constData(), lenInOut, &state);
- lenInOut = result.length();
- return result;
-}
-#endif
-
/*!
\class QTextDecoder
\brief The QTextDecoder class provides a state-based decoder.
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 270e96aaf7..015c0941f2 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -134,17 +134,6 @@ protected:
QTextCodec();
virtual ~QTextCodec();
-public:
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QTextCodec* codecForContent(const char*, int) { return 0; }
- static QT3_SUPPORT const char* locale();
- static QT3_SUPPORT QTextCodec* codecForName(const char* hint, int) { return codecForName(QByteArray(hint)); }
- QT3_SUPPORT QByteArray fromUnicode(const QString& uc, int& lenInOut) const;
- QT3_SUPPORT QString toUnicode(const QByteArray&, int len) const;
- QT3_SUPPORT QByteArray mimeName() const { return name(); }
- static QT3_SUPPORT QTextCodec *codecForIndex(int i) { return codecForName(availableCodecs().value(i)); }
-#endif
-
private:
friend class QTextCodecCleanup;
static QTextCodec *cftr;
@@ -165,9 +154,6 @@ public:
~QTextEncoder();
QByteArray fromUnicode(const QString& str);
QByteArray fromUnicode(const QChar *uc, int len);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT QByteArray fromUnicode(const QString& uc, int& lenInOut);
-#endif
bool hasFailure() const;
private:
const QTextCodec *c;
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e5626b4632..ca8b30fc00 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2471,11 +2471,6 @@ void qCritical(const char *msg, ...)
va_end(ap);
}
-#ifdef QT3_SUPPORT
-void qSystemWarning(const char *msg, int code)
- { qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); }
-#endif // QT3_SUPPORT
-
void qErrnoWarning(const char *msg, ...)
{
// qt_error_string() will allocate anyway, so we don't have
@@ -3031,54 +3026,6 @@ int qrand()
with meaningful parameter names in their signatures.
*/
-#if defined(QT3_SUPPORT) && !defined(QT_NO_SETTINGS)
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <qlibraryinfo.h>
-QT_END_INCLUDE_NAMESPACE
-
-static const char *qInstallLocation(QLibraryInfo::LibraryLocation loc)
-{
- static QByteArray ret;
- ret = QLibraryInfo::location(loc).toLatin1();
- return ret.constData();
-}
-const char *qInstallPath()
-{
- return qInstallLocation(QLibraryInfo::PrefixPath);
-}
-const char *qInstallPathDocs()
-{
- return qInstallLocation(QLibraryInfo::DocumentationPath);
-}
-const char *qInstallPathHeaders()
-{
- return qInstallLocation(QLibraryInfo::HeadersPath);
-}
-const char *qInstallPathLibs()
-{
- return qInstallLocation(QLibraryInfo::LibrariesPath);
-}
-const char *qInstallPathBins()
-{
- return qInstallLocation(QLibraryInfo::BinariesPath);
-}
-const char *qInstallPathPlugins()
-{
- return qInstallLocation(QLibraryInfo::PluginsPath);
-}
-const char *qInstallPathData()
-{
- return qInstallLocation(QLibraryInfo::DataPath);
-}
-const char *qInstallPathTranslations()
-{
- return qInstallLocation(QLibraryInfo::TranslationsPath);
-}
-const char *qInstallPathSysconf()
-{
- return qInstallLocation(QLibraryInfo::SettingsPath);
-}
-#endif
struct QInternal_CallBackTable {
QVector<QList<qInternalCallback> > callbacks;
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 4fa6a9954b..af9d86c2ca 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1031,18 +1031,10 @@ redefine to built-in booleans to make autotests work properly */
#endif
#if defined(QT_NO_DEPRECATED)
-/* disable Qt3 support as well */
-# undef QT3_SUPPORT_WARNINGS
-# undef QT3_SUPPORT
# undef QT_DEPRECATED
# undef QT_DEPRECATED_VARIABLE
# undef QT_DEPRECATED_CONSTRUCTOR
#elif defined(QT_DEPRECATED_WARNINGS)
-# ifdef QT3_SUPPORT
-/* enable Qt3 support warnings as well */
-# undef QT3_SUPPORT_WARNINGS
-# define QT3_SUPPORT_WARNINGS
-# endif
# undef QT_DEPRECATED
# define QT_DEPRECATED Q_DECL_DEPRECATED
# undef QT_DEPRECATED_VARIABLE
@@ -1058,28 +1050,6 @@ redefine to built-in booleans to make autotests work properly */
# define QT_DEPRECATED_CONSTRUCTOR
#endif
-#if defined(QT3_SUPPORT_WARNINGS)
-# if !defined(QT_COMPAT_WARNINGS) /* also enable compat */
-# define QT_COMPAT_WARNINGS
-# endif
-# undef QT3_SUPPORT
-# define QT3_SUPPORT Q_DECL_DEPRECATED
-# undef QT3_SUPPORT_VARIABLE
-# define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED
-# undef QT3_SUPPORT_CONSTRUCTOR
-# define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
-#elif defined(QT3_SUPPORT) /* define back to nothing */
-# if !defined(QT_COMPAT) /* also enable qt3 support */
-# define QT_COMPAT
-# endif
-# undef QT3_SUPPORT
-# define QT3_SUPPORT
-# undef QT3_SUPPORT_VARIABLE
-# define QT3_SUPPORT_VARIABLE
-# undef QT3_SUPPORT_CONSTRUCTOR
-# define QT3_SUPPORT_CONSTRUCTOR explicit
-#endif
-
/* moc compats (signals/slots) */
#ifndef QT_MOC_COMPAT
# if defined(QT3_SUPPORT)
@@ -1173,31 +1143,6 @@ template <typename T>
inline const T &qBound(const T &min, const T &val, const T &max)
{ return qMax(min, qMin(max, val)); }
-#ifdef QT3_SUPPORT
-typedef qint8 Q_INT8;
-typedef quint8 Q_UINT8;
-typedef qint16 Q_INT16;
-typedef quint16 Q_UINT16;
-typedef qint32 Q_INT32;
-typedef quint32 Q_UINT32;
-typedef qint64 Q_INT64;
-typedef quint64 Q_UINT64;
-
-typedef qint64 Q_LLONG;
-typedef quint64 Q_ULLONG;
-#if defined(Q_OS_WIN64)
-typedef __int64 Q_LONG; /* word up to 64 bit signed */
-typedef unsigned __int64 Q_ULONG; /* word up to 64 bit unsigned */
-#else
-typedef long Q_LONG; /* word up to 64 bit signed */
-typedef unsigned long Q_ULONG; /* word up to 64 bit unsigned */
-#endif
-
-# define QABS(a) qAbs(a)
-# define QMAX(a, b) qMax((a), (b))
-# define QMIN(a, b) qMin((a), (b))
-#endif
-
/*
Data stream functions are provided by many classes (defined in qdatastream.h)
*/
@@ -1659,27 +1604,6 @@ Q_CORE_EXPORT bool qSharedBuild();
inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
#endif
-#ifdef QT3_SUPPORT
-inline QT3_SUPPORT bool qSysInfo(int *wordSize, bool *bigEndian)
-{
- *wordSize = QSysInfo::WordSize;
- *bigEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian);
- return true;
-}
-#endif
-
-#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
-#if defined(QT3_SUPPORT)
-inline QT3_SUPPORT bool qt_winUnicode() { return true; }
-inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
-#endif
-
-// ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE.
-#define QT_WA(unicode, ansi) unicode
-#define QT_WA_INLINE(unicode, ansi) (unicode)
-
-#endif /* Q_OS_WIN */
-
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
#endif
@@ -1749,9 +1673,6 @@ Q_CORE_EXPORT void qFatal(const char *, ...) /* print fatal message and exit */
#endif
;
-#ifdef QT3_SUPPORT
-Q_CORE_EXPORT QT3_SUPPORT void qSystemWarning(const char *msg, int code = -1);
-#endif /* QT3_SUPPORT */
Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...);
Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
@@ -1853,11 +1774,6 @@ Q_CORE_EXPORT void qt_message_output(QtMsgType, const char *buf);
typedef void (*QtMsgHandler)(QtMsgType, const char *);
Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);
-#ifdef QT3_SUPPORT
-inline QT3_SUPPORT void qSuppressObsoleteWarnings(bool = true) {}
-inline QT3_SUPPORT void qObsolete(const char *, const char * = 0, const char * = 0) {}
-#endif
-
#if !defined(Q_UNIMPLEMENTED)
# define Q_UNIMPLEMENTED() qWarning("%s:%d: %s: Unimplemented code.", __FILE__, __LINE__, Q_FUNC_INFO)
#endif
@@ -2491,9 +2407,15 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
classes contains a private copy constructor and assignment
operator to disable copying (the compiler gives an error message).
*/
+#ifdef Q_COMPILER_DEFAULT_DELETE_MEMBERS
+#define Q_DISABLE_COPY(Class) \
+ Class(const Class &) = delete;\
+ Class &operator=(const Class &) = delete;
+#else
#define Q_DISABLE_COPY(Class) \
Class(const Class &); \
Class &operator=(const Class &);
+#endif
class QByteArray;
Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
@@ -2508,27 +2430,6 @@ inline int qIntCast(float f) { return int(f); }
Q_CORE_EXPORT void qsrand(uint seed);
Q_CORE_EXPORT int qrand();
-/*
- Compat functions that were generated by configure
-*/
-#ifdef QT3_SUPPORT
-#ifndef QT_PRODUCT_LICENSEE
-# define QT_PRODUCT_LICENSEE QLibraryInfo::licensee()
-#endif
-#ifndef QT_PRODUCT_LICENSE
-# define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts()
-#endif
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPath();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathDocs();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathHeaders();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathLibs();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathBins();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathPlugins();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathData();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations();
-QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
-#endif
-
#if defined(Q_OS_SYMBIAN)
#ifdef SYMBIAN_BUILD_GCE
@@ -2612,8 +2513,6 @@ Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex);
#define QT_MODULE_OPENGL 0x000008
#define QT_MODULE_SQL 0x000010
#define QT_MODULE_XML 0x000020
-#define QT_MODULE_QT3SUPPORTLIGHT 0x000040
-#define QT_MODULE_QT3SUPPORT 0x000080
#define QT_MODULE_SVG 0x000100
#define QT_MODULE_ACTIVEQT 0x000200
#define QT_MODULE_GRAPHICSVIEW 0x000400
@@ -2641,7 +2540,6 @@ Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex);
| QT_MODULE_DBUS)
#define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \
| QT_MODULE_GUI \
- | QT_MODULE_QT3SUPPORTLIGHT \
| QT_MODULE_TEST \
| QT_MODULE_DBUS)
#define QT_EDITION_OPENSOURCE (QT_MODULE_CORE \
@@ -2655,8 +2553,6 @@ Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex);
| QT_MODULE_XMLPATTERNS \
| QT_MODULE_SCRIPT \
| QT_MODULE_SCRIPTTOOLS \
- | QT_MODULE_QT3SUPPORTLIGHT \
- | QT_MODULE_QT3SUPPORT \
| QT_MODULE_SVG \
| QT_MODULE_DECLARATIVE \
| QT_MODULE_GRAPHICSVIEW \
@@ -2723,12 +2619,6 @@ QT_LICENSED_MODULE(Script)
#if (QT_EDITION & QT_MODULE_SCRIPTTOOLS)
QT_LICENSED_MODULE(ScriptTools)
#endif
-#if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT)
-QT_LICENSED_MODULE(Qt3SupportLight)
-#endif
-#if (QT_EDITION & QT_MODULE_QT3SUPPORT)
-QT_LICENSED_MODULE(Qt3Support)
-#endif
#if (QT_EDITION & QT_MODULE_SVG)
QT_LICENSED_MODULE(Svg)
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 38d4a85b89..44e59e6cf8 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -66,7 +66,6 @@ Qt {
Q_ENUMS(ScrollBarPolicy FocusPolicy ContextMenuPolicy)
Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle)
Q_ENUMS(FillRule MaskMode BGMode ClipOperation SizeMode)
- Q_ENUMS(BackgroundMode) // Qt3
Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation DropAction)
Q_FLAGS(Alignment Orientations DropActions)
Q_FLAGS(DockWidgetAreas ToolBarAreas)
@@ -159,18 +158,6 @@ public:
};
Q_DECLARE_FLAGS(MouseButtons, MouseButton)
-#ifdef QT3_SUPPORT
- enum ButtonState_enum {
- ShiftButton = Qt::ShiftModifier,
- ControlButton = Qt::ControlModifier,
- AltButton = Qt::AltModifier,
- MetaButton = Qt::MetaModifier,
- Keypad = Qt::KeypadModifier,
- KeyButtonMask = Qt::KeyboardModifierMask
- };
- typedef int ButtonState;
-#endif
-
enum Orientation {
Horizontal = 0x1,
Vertical = 0x2
@@ -189,10 +176,6 @@ public:
enum SortOrder {
AscendingOrder,
DescendingOrder
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- ,Ascending = AscendingOrder,
- Descending = DescendingOrder
-#endif
};
enum TileRule {
@@ -221,9 +204,6 @@ public:
AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
AlignCenter = AlignVCenter | AlignHCenter
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- , AlignAuto = AlignLeft
-#endif
};
Q_DECLARE_FLAGS(Alignment, AlignmentFlag)
@@ -243,22 +223,7 @@ public:
TextForceRightToLeft = 0x40000,
TextLongestVariant = 0x80000,
TextBypassShaping = 0x100000
-
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- ,SingleLine = TextSingleLine,
- DontClip = TextDontClip,
- ExpandTabs = TextExpandTabs,
- ShowPrefix = TextShowMnemonic,
- WordBreak = TextWordWrap,
- BreakAnywhere = TextWrapAnywhere,
- DontPrint = TextDontPrint,
- IncludeTrailingSpaces = TextIncludeTrailingSpaces,
- NoAccel = TextHideMnemonic
-#endif
};
-#ifdef QT3_SUPPORT
- typedef TextFlag TextFlags;
-#endif
enum TextElideMode {
ElideLeft,
@@ -533,36 +498,11 @@ public:
OpaqueMode
};
-#ifdef QT3_SUPPORT
- enum PaintUnit { // paint unit
- PixelUnit,
- LoMetricUnit, // obsolete
- HiMetricUnit, // obsolete
- LoEnglishUnit, // obsolete
- HiEnglishUnit, // obsolete
- TwipsUnit // obsolete
- };
-
- enum GUIStyle {
- MacStyle,
- WindowsStyle,
- Win3Style,
- PMStyle,
- MotifStyle
- };
-#endif
-
enum Key {
Key_Escape = 0x01000000, // misc keys
Key_Tab = 0x01000001,
Key_Backtab = 0x01000002,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_BackTab = Key_Backtab,
-#endif
Key_Backspace = 0x01000003,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_BackSpace = Key_Backspace,
-#endif
Key_Return = 0x01000004,
Key_Enter = 0x01000005,
Key_Insert = 0x01000006,
@@ -578,13 +518,7 @@ public:
Key_Right = 0x01000014,
Key_Down = 0x01000015,
Key_PageUp = 0x01000016,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_Prior = Key_PageUp,
-#endif
Key_PageDown = 0x01000017,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_Next = Key_PageDown,
-#endif
Key_Shift = 0x01000020, // modifiers
Key_Control = 0x01000021,
Key_Meta = 0x01000022,
@@ -770,41 +704,7 @@ public:
Key_Yacute = 0x0dd,
Key_THORN = 0x0de,
Key_ssharp = 0x0df,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_agrave = Key_Agrave,
- Key_aacute = Key_Aacute,
- Key_acircumflex = Key_Acircumflex,
- Key_atilde = Key_Atilde,
- Key_adiaeresis = Key_Adiaeresis,
- Key_aring = Key_Aring,
- Key_ae = Key_AE,
- Key_ccedilla = Key_Ccedilla,
- Key_egrave = Key_Egrave,
- Key_eacute = Key_Eacute,
- Key_ecircumflex = Key_Ecircumflex,
- Key_ediaeresis = Key_Ediaeresis,
- Key_igrave = Key_Igrave,
- Key_iacute = Key_Iacute,
- Key_icircumflex = Key_Icircumflex,
- Key_idiaeresis = Key_Idiaeresis,
- Key_eth = Key_ETH,
- Key_ntilde = Key_Ntilde,
- Key_ograve = Key_Ograve,
- Key_oacute = Key_Oacute,
- Key_ocircumflex = Key_Ocircumflex,
- Key_otilde = Key_Otilde,
- Key_odiaeresis = Key_Odiaeresis,
-#endif
Key_division = 0x0f7,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_oslash = Key_Ooblique,
- Key_ugrave = Key_Ugrave,
- Key_uacute = Key_Uacute,
- Key_ucircumflex = Key_Ucircumflex,
- Key_udiaeresis = Key_Udiaeresis,
- Key_yacute = Key_Yacute,
- Key_thorn = Key_THORN,
-#endif
Key_ydiaeresis = 0x0ff,
// International input method support (X keycode - 0xEE00, the
@@ -904,9 +804,6 @@ public:
Key_MediaPlay = 0x01000080,
Key_MediaStop = 0x01000081,
Key_MediaPrevious = 0x01000082,
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- Key_MediaPrev = Key_MediaPrevious,
-#endif
Key_MediaNext = 0x01000083,
Key_MediaRecord = 0x01000084,
Key_MediaPause = 0x1000085,
@@ -1122,9 +1019,6 @@ public:
RadialGradientPattern,
ConicalGradientPattern,
TexturePattern = 24
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- , CustomPattern = TexturePattern
-#endif
};
enum SizeMode {
@@ -1132,66 +1026,6 @@ public:
RelativeSize
};
-#if defined(QT3_SUPPORT)
-#if defined(Q_OS_MAC)
-#ifndef qdoc
- typedef int MacintoshVersion;
-
- enum
-#else
- enum MacintoshVersion
-#endif
- {
- //Unknown
- MV_Unknown = 0x0000,
-
- //Version numbers
- MV_9 = QSysInfo::MV_9,
- MV_10_DOT_0 = QSysInfo::MV_10_0,
- MV_10_DOT_1 = QSysInfo::MV_10_1,
- MV_10_DOT_2 = QSysInfo::MV_10_2,
- MV_10_DOT_3 = QSysInfo::MV_10_3,
- MV_10_DOT_4 = QSysInfo::MV_10_4,
-
- //Code names
- MV_CHEETAH = QSysInfo::MV_CHEETAH,
- MV_PUMA = QSysInfo::MV_PUMA,
- MV_JAGUAR = QSysInfo::MV_JAGUAR,
- MV_PANTHER = QSysInfo::MV_PANTHER,
- MV_TIGER = QSysInfo::MV_TIGER
- };
-#endif // Q_OS_MAC
-
-#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
-#ifndef qdoc
- typedef int WindowsVersion;
-
- enum
-#else
- enum WindowsVersion
-#endif
- {
- WV_32s = QSysInfo::WV_32s,
- WV_95 = QSysInfo::WV_95,
- WV_98 = QSysInfo::WV_98,
- WV_Me = QSysInfo::WV_Me,
- WV_DOS_based= QSysInfo::WV_DOS_based,
-
- WV_NT = QSysInfo::WV_NT,
- WV_2000 = QSysInfo::WV_2000,
- WV_XP = QSysInfo::WV_XP,
- WV_2003 = QSysInfo::WV_2003,
- WV_NT_based = QSysInfo::WV_NT_based,
-
- WV_CE = QSysInfo::WV_CE,
- WV_CENET = QSysInfo::WV_CENET,
- WV_CE_5 = QSysInfo::WV_CE_5,
- WV_CE_6 = QSysInfo::WV_CE_6,
- WV_CE_based = QSysInfo::WV_CE_based
- };
-#endif // Q_OS_WIN
-#endif // QT3_SUPPORT
-
enum UIEffect {
UI_General,
UI_AnimateMenu,
@@ -1228,26 +1062,6 @@ public:
LastCursor = DragLinkCursor,
BitmapCursor = 24,
CustomCursor = 25
-
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- ,
- arrowCursor = ArrowCursor,
- upArrowCursor = UpArrowCursor,
- crossCursor = CrossCursor,
- waitCursor = WaitCursor,
- ibeamCursor = IBeamCursor,
- sizeVerCursor = SizeVerCursor,
- sizeHorCursor = SizeHorCursor,
- sizeBDiagCursor = SizeBDiagCursor,
- sizeFDiagCursor = SizeFDiagCursor,
- sizeAllCursor = SizeAllCursor,
- blankCursor = BlankCursor,
- splitVCursor = SplitVCursor,
- splitHCursor = SplitHCursor,
- pointingHandCursor = PointingHandCursor,
- forbiddenCursor = ForbiddenCursor,
- whatsThisCursor = WhatsThisCursor
-#endif
};
enum TextFormat {
@@ -1261,15 +1075,7 @@ public:
IgnoreAspectRatio,
KeepAspectRatio,
KeepAspectRatioByExpanding
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- , ScaleFree = IgnoreAspectRatio,
- ScaleMin = KeepAspectRatio,
- ScaleMax = KeepAspectRatioByExpanding
-#endif
};
-#ifdef QT3_SUPPORT
- typedef AspectRatioMode ScaleMode;
-#endif
// This is for Q3TextEdit only, actually.
enum AnchorAttribute {
@@ -1310,28 +1116,6 @@ public:
Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea)
-#ifdef QT3_SUPPORT
- enum Dock {
- DockUnmanaged,
- DockTornOff,
- DockTop,
- DockBottom,
- DockRight,
- DockLeft,
- DockMinimized
- ,
- Unmanaged = DockUnmanaged,
- TornOff = DockTornOff,
- Top = DockTop,
- Bottom = DockBottom,
- Right = DockRight,
- Left = DockLeft,
- Minimized = DockMinimized
- };
- // compatibility
- typedef Dock ToolBarDock;
-#endif
-
enum DateFormat {
TextDate, // default Qt
ISODate, // ISO 8601
@@ -1366,31 +1150,6 @@ public:
ScrollBarAlwaysOn
};
-#ifdef QT3_SUPPORT
- enum BackgroundMode {
- FixedColor,
- FixedPixmap,
- NoBackground,
- PaletteForeground,
- PaletteButton,
- PaletteLight,
- PaletteMidlight,
- PaletteDark,
- PaletteMid,
- PaletteText,
- PaletteBrightText,
- PaletteBase,
- PaletteBackground,
- PaletteShadow,
- PaletteHighlight,
- PaletteHighlightedText,
- PaletteButtonText,
- PaletteLink,
- PaletteLinkVisited,
- X11ParentRelative
- };
-#endif
-
enum CaseSensitivity {
CaseInsensitive,
CaseSensitive
@@ -1401,12 +1160,6 @@ public:
TopRightCorner = 0x00001,
BottomLeftCorner = 0x00002,
BottomRightCorner = 0x00003
-#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- ,TopLeft = TopLeftCorner,
- TopRight = TopRightCorner,
- BottomLeft = BottomLeftCorner,
- BottomRight = BottomRightCorner
-#endif
};
enum ConnectionType {
@@ -1438,8 +1191,7 @@ public:
enum ClipOperation {
NoClip,
ReplaceClip,
- IntersectClip,
- UniteClip
+ IntersectClip
};
// Shape = 0x1, BoundingRect = 0x2
@@ -1818,14 +1570,6 @@ public:
static bool callFunction(InternalFunction func, void **);
};
-#ifdef QT3_SUPPORT
-typedef qint32 QCOORD; // coordinate type
-enum {
- QCOORD_MAX = 2147483647,
- QCOORD_MIN = -QCOORD_MAX - 1
-};
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 09611e67f4..2d102e7ba1 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2201,52 +2201,6 @@
TargetMoveAction is not used on the Mac.
*/
-#if defined(Q_OS_WIN) && defined(QT3_SUPPORT)
-/*!
- \enum Qt::WindowsVersion
- \compat
-
- \value WV_32s
- \value WV_95
- \value WV_98
- \value WV_Me
- \value WV_DOS_based
- \value WV_NT
- \value WV_2000
- \value WV_XP
- \value WV_2003
- \value WV_NT_based
- \value WV_CE
- \value WV_CENET
- \value WV_CE_based
- \value WV_CE_5
- \value WV_CE_6
-*/
-#endif
-
-#if defined(Q_OS_MAC) && defined(QT3_SUPPORT)
-/*!
- \enum Qt::MacintoshVersion
- \compat
-
- \value MV_Unknown Use QSysInfo::MV_Unknown instead.
- \value MV_9 Use QSysInfo::MV_9 instead.
- \value MV_10_DOT_0 Use QSysInfo::MV_10_0 instead.
- \value MV_10_DOT_1 Use QSysInfo::MV_10_1 instead.
- \value MV_10_DOT_2 Use QSysInfo::MV_10_2 instead.
- \value MV_10_DOT_3 Use QSysInfo::MV_10_3 instead.
- \value MV_10_DOT_4 Use QSysInfo::MV_10_4 instead.
-
- \value MV_CHEETAH Use QSysInfo::MV_10_0 instead.
- \value MV_PUMA Use QSysInfo::MV_10_1 instead.
- \value MV_JAGUAR Use QSysInfo::MV_10_2 instead.
- \value MV_PANTHER Use QSysInfo::MV_10_3 instead.
- \value MV_TIGER Use QSysInfo::MV_10_4 instead.
-
- \sa QSysInfo::MacVersion
-*/
-#endif
-
/*! \typedef Qt::ToolBarDock
\compat
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index b397c1a29c..af4ec3bc60 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -294,31 +294,6 @@ QDataStream::QDataStream(QIODevice *d)
q_status = Ok;
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QDataStream::QDataStream(QByteArray *array, int mode)
- \compat
-
- Constructs a data stream that operates on the given \a array. The
- \a mode specifies how the byte array is to be used, and is
- usually either QIODevice::ReadOnly or QIODevice::WriteOnly.
-*/
-QDataStream::QDataStream(QByteArray *a, int mode)
-{
- QBuffer *buf = new QBuffer(a);
-#ifndef QT_NO_QOBJECT
- buf->blockSignals(true);
-#endif
- buf->open(QIODevice::OpenMode(mode));
- dev = buf;
- owndev = true;
- byteorder = BigEndian;
- ver = DefaultStreamVersion;
- noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian;
- q_status = Ok;
-}
-#endif
-
/*!
\fn QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode mode)
@@ -587,6 +562,8 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_4_6 Version 12 (Qt 4.6, Qt 4.7, Qt 4.8)
\value Qt_4_7 Same as Qt_4_6.
\value Qt_4_8 Same as Qt_4_6.
+ \value Qt_4_9 Same as Qt_4_6.
+ \value Qt_5_0 Same as Qt_4_6.
\sa setVersion(), version()
*/
@@ -1307,20 +1284,6 @@ int QDataStream::skipRawData(int len)
}
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QDataStream &QDataStream::readRawBytes(char *str, uint len)
-
- Use readRawData() instead.
-*/
-
-/*!
- \fn QDataStream &QDataStream::writeRawBytes(const char *str, uint len)
-
- Use writeRawData() instead.
-*/
-#endif
-
QT_END_NAMESPACE
#endif // QT_NO_DATASTREAM
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 57d68e2f39..1ae0573f6c 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -113,9 +113,6 @@ public:
QDataStream();
explicit QDataStream(QIODevice *);
-#ifdef QT3_SUPPORT
- QDataStream(QByteArray *, int mode);
-#endif
QDataStream(QByteArray *, QIODevice::OpenMode flags);
QDataStream(const QByteArray &);
virtual ~QDataStream();
@@ -125,9 +122,6 @@ public:
void unsetDevice();
bool atEnd() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool eof() const { return atEnd(); }
-#endif
Status status() const;
void setStatus(Status status);
@@ -177,15 +171,6 @@ public:
int skipRawData(int len);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QDataStream &readRawBytes(char *str, uint len)
- { readRawData(str, static_cast<int>(len)); return *this; }
- inline QT3_SUPPORT QDataStream &writeRawBytes(const char *str, uint len)
- { writeRawData(str, static_cast<int>(len)); return *this; }
- inline QT3_SUPPORT bool isPrintableData() const { return false; }
- inline QT3_SUPPORT void setPrintableData(bool) {}
-#endif
-
private:
Q_DISABLE_COPY(QDataStream)
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 9426618875..3621deea28 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -91,10 +91,6 @@ QDirPrivate::QDirPrivate(const QString &path, const QStringList &nameFilters_, Q
, nameFilters(nameFilters_)
, sort(sort_)
, filters(filters_)
-#ifdef QT3_SUPPORT
- , filterSepChar(0)
- , matchAllDirs(false)
-#endif
, fileListsInitialized(false)
{
setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
@@ -118,10 +114,6 @@ QDirPrivate::QDirPrivate(const QDirPrivate &copy)
, nameFilters(copy.nameFilters)
, sort(copy.sort)
, filters(copy.filters)
-#ifdef QT3_SUPPORT
- , filterSepChar(copy.filterSepChar)
- , matchAllDirs(copy.matchAllDirs)
-#endif
, fileListsInitialized(false)
, dirEntry(copy.dirEntry)
, metaData(copy.metaData)
@@ -1288,10 +1280,6 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
if (filters == NoFilter)
filters = d->filters;
-#ifdef QT3_SUPPORT
- if (d->matchAllDirs)
- filters |= AllDirs;
-#endif
if (sort == NoSort)
sort = d->sort;
@@ -1334,10 +1322,6 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
if (filters == NoFilter)
filters = d->filters;
-#ifdef QT3_SUPPORT
- if (d->matchAllDirs)
- filters |= AllDirs;
-#endif
if (sort == NoSort)
sort = d->sort;
@@ -2177,145 +2161,6 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter)
\sa Q_INIT_RESOURCE(), {The Qt Resource System}
*/
-#ifdef QT3_SUPPORT
-
-/*!
- \fn bool QDir::matchAllDirs() const
-
- Use filter() & AllDirs instead.
-*/
-bool QDir::matchAllDirs() const
-{
- const QDirPrivate* d = d_ptr.constData();
- return d->matchAllDirs;
-}
-
-
-/*!
- \fn void QDir::setMatchAllDirs(bool on)
-
- Use setFilter() instead.
-*/
-void QDir::setMatchAllDirs(bool on)
-{
- QDirPrivate* d = d_ptr.data();
- d->initFileEngine();
- d->clearFileLists();
-
- d->matchAllDirs = on;
-}
-
-/*!
- Use nameFilters() instead.
-*/
-QString QDir::nameFilter() const
-{
- const QDirPrivate* d = d_ptr.constData();
- return nameFilters().join(QString(d->filterSepChar));
-}
-
-/*!
- Use setNameFilters() instead.
-
- The \a nameFilter is a wildcard (globbing) filter that understands
- "*" and "?" wildcards. (See \l{QRegExp wildcard matching}.) You may
- specify several filter entries, each separated by spaces or by
- semicolons.
-
- For example, if you want entryList() and entryInfoList() to list
- all files ending with either ".cpp" or ".h", you would use either
- dir.setNameFilters("*.cpp *.h") or dir.setNameFilters("*.cpp;*.h").
-
- \oldcode
- QString filter = "*.cpp *.cxx *.cc";
- dir.setNameFilter(filter);
- \newcode
- QString filter = "*.cpp *.cxx *.cc";
- dir.setNameFilters(filter.split(' '));
- \endcode
-*/
-void QDir::setNameFilter(const QString &nameFilter)
-{
- QDirPrivate* d = d_ptr.data();
- d->initFileEngine();
- d->clearFileLists();
-
- d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter);
- d->nameFilters = QDirPrivate::splitFilters(nameFilter, d->filterSepChar);
-}
-
-/*!
- \fn QString QDir::absPath() const
-
- Use absolutePath() instead.
-*/
-
-/*!
- \fn QString QDir::absFilePath(const QString &fileName, bool acceptAbsPath) const
-
- Use absoluteFilePath(\a fileName) instead.
-
- The \a acceptAbsPath parameter is ignored.
-*/
-
-/*!
- \fn bool QDir::mkdir(const QString &dirName, bool acceptAbsPath) const
-
- Use mkdir(\a dirName) instead.
-
- The \a acceptAbsPath parameter is ignored.
-*/
-
-/*!
- \fn bool QDir::rmdir(const QString &dirName, bool acceptAbsPath) const
-
- Use rmdir(\a dirName) instead.
-
- The \a acceptAbsPath parameter is ignored.
-*/
-
-/*!
- \fn QStringList QDir::entryList(const QString &nameFilter, Filters filters,
- SortFlags sort) const
- \overload
-
- Use the overload that takes a name filter string list as first
- argument instead of a combination of attribute filter flags.
-*/
-
-/*!
- \fn QFileInfoList QDir::entryInfoList(const QString &nameFilter, Filters filters,
- SortFlags sort) const
- \overload
-
- Use the overload that takes a name filter string list as first
- argument instead of a combination of attribute filter flags.
-*/
-
-/*!
- \fn void QDir::convertToAbs()
-
- Use makeAbsolute() instead.
-*/
-
-/*!
- \fn QString QDir::cleanDirPath(const QString &name)
-
- Use cleanPath() instead.
-*/
-
-/*!
- \typedef QDir::FilterSpec
-
- Use QDir::Filters instead.
-*/
-
-/*!
- \typedef QDir::SortSpec
-
- Use QDir::SortFlags instead.
-*/
-#endif // QT3_SUPPORT
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, QDir::Filters filters)
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index e2f43f06b6..de5fb1bf00 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -67,17 +67,11 @@ public:
NoSymLinks = 0x008,
AllEntries = Dirs | Files | Drives,
TypeMask = 0x00f,
-#ifdef QT3_SUPPORT
- All = AllEntries,
-#endif
Readable = 0x010,
Writable = 0x020,
Executable = 0x040,
PermissionMask = 0x070,
-#ifdef QT3_SUPPORT
- RWEMask = 0x070,
-#endif
Modified = 0x080,
Hidden = 0x100,
@@ -92,14 +86,8 @@ public:
NoDotDot = 0x4000,
NoFilter = -1
-#ifdef QT3_SUPPORT
- ,DefaultFilter = NoFilter
-#endif
};
Q_DECLARE_FLAGS(Filters, Filter)
-#ifdef QT3_SUPPORT
- typedef Filters FilterSpec;
-#endif
enum SortFlag { Name = 0x00,
Time = 0x01,
@@ -114,9 +102,6 @@ public:
LocaleAware = 0x40,
Type = 0x80,
NoSort = -1
-#ifdef QT3_SUPPORT
- ,DefaultSort = NoSort
-#endif
};
Q_DECLARE_FLAGS(SortFlags, SortFlag)
@@ -223,36 +208,6 @@ public:
static QString cleanPath(const QString &path);
void refresh() const;
-
-#ifdef QT3_SUPPORT
- typedef SortFlags SortSpec;
- inline QT3_SUPPORT QString absPath() const { return absolutePath(); }
- inline QT3_SUPPORT QString absFilePath(const QString &fileName, bool acceptAbsPath = true) const
- { Q_UNUSED(acceptAbsPath); return absoluteFilePath(fileName); }
- QT3_SUPPORT bool matchAllDirs() const;
- QT3_SUPPORT void setMatchAllDirs(bool on);
- inline QT3_SUPPORT QStringList entryList(const QString &nameFilter, Filters filters = NoFilter,
- SortFlags sort = NoSort) const
- { return entryList(nameFiltersFromString(nameFilter), filters, sort); }
- inline QT3_SUPPORT QFileInfoList entryInfoList(const QString &nameFilter,
- Filters filters = NoFilter,
- SortFlags sort = NoSort) const
- { return entryInfoList(nameFiltersFromString(nameFilter), filters, sort); }
-
- QT3_SUPPORT QString nameFilter() const;
- QT3_SUPPORT void setNameFilter(const QString &nameFilter);
-
- inline QT3_SUPPORT bool mkdir(const QString &dirName, bool acceptAbsPath) const
- { Q_UNUSED(acceptAbsPath); return mkdir(dirName); }
- inline QT3_SUPPORT bool rmdir(const QString &dirName, bool acceptAbsPath) const
- { Q_UNUSED(acceptAbsPath); return rmdir(dirName); }
-
- inline QT3_SUPPORT void convertToAbs() { makeAbsolute(); }
- inline QT3_SUPPORT static QString currentDirPath() { return currentPath(); }
- inline QT3_SUPPORT static QString homeDirPath() { return homePath(); }
- inline QT3_SUPPORT static QString rootDirPath() { return rootPath(); }
- inline QT3_SUPPORT static QString cleanDirPath(const QString &name) { return cleanPath(name); }
-#endif // QT3_SUPPORT
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters)
diff --git a/src/corelib/io/qdir_p.h b/src/corelib/io/qdir_p.h
index 3e00529070..7644a0391e 100644
--- a/src/corelib/io/qdir_p.h
+++ b/src/corelib/io/qdir_p.h
@@ -77,11 +77,6 @@ public:
QDir::SortFlags sort;
QDir::Filters filters;
-#ifdef QT3_SUPPORT
- QChar filterSepChar;
- bool matchAllDirs;
-#endif
-
QScopedPointer<QAbstractFileEngine> fileEngine;
mutable bool fileListsInitialized;
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 66edf58214..47f57f7fdb 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -364,20 +364,14 @@ QFilePrivate::setError(QFile::FileError err, int errNum)
QIODevice.
\value AutoCloseHandle The file handle passed into open() should be
- closed by close(), the default behaviour is that close just flushes
- the file and the app is responsible for closing the file handle. When
- opening a file by name, this flag is ignored as Qt always "owns" the
+ closed by close(), the default behavior is that close just flushes
+ the file and the application is responsible for closing the file handle.
+ When opening a file by name, this flag is ignored as Qt always owns the
file handle and must close it.
+ \value DontCloseHandle If not explicitly closed, the underlying file
+ handle is left open when the QFile object is destroyed.
*/
-#ifdef QT3_SUPPORT
-/*!
- \typedef QFile::PermissionSpec
-
- Use QFile::Permission instead.
-*/
-#endif
-
#ifdef QT_NO_QOBJECT
QFile::QFile()
: QIODevice(*new QFilePrivate)
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index e4a74859db..554b2954e1 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -87,9 +87,6 @@ public:
ResizeError = 12,
PermissionsError = 13,
CopyError = 14
-#ifdef QT3_SUPPORT
- , ConnectError = 30
-#endif
};
enum Permission {
@@ -186,14 +183,6 @@ public:
virtual QAbstractFileEngine *fileEngine() const;
-#ifdef QT3_SUPPORT
- typedef Permission PermissionSpec;
- inline QT3_SUPPORT QString name() const { return fileName(); }
- inline QT3_SUPPORT void setName(const QString &aName) { setFileName(aName); }
- inline QT3_SUPPORT bool open(OpenMode aFlags, FILE *f) { return open(f, aFlags); }
- inline QT3_SUPPORT bool open(OpenMode aFlags, int fd) { return open(fd, aFlags); }
-#endif
-
protected:
#ifdef QT_NO_QOBJECT
QFile(QFilePrivate &dd);
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index ca42c87454..ee40c589a2 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -851,19 +851,6 @@ QDir QFileInfo::absoluteDir() const
return QDir(absolutePath());
}
-#ifdef QT3_SUPPORT
-/*!
- Use absoluteDir() or the dir() overload that takes no parameters
- instead.
-*/
-QDir QFileInfo::dir(bool absPath) const
-{
- if (absPath)
- return absoluteDir();
- return dir();
-}
-#endif //QT3_SUPPORT
-
/*!
Returns true if the user can read the file; otherwise returns false.
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 5b1b48b7d5..6ca0ae79e0 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -139,40 +139,6 @@ public:
bool caching() const;
void setCaching(bool on);
-#ifdef QT3_SUPPORT
- enum Permission {
- ReadOwner = QFile::ReadOwner, WriteOwner = QFile::WriteOwner, ExeOwner = QFile::ExeOwner,
- ReadUser = QFile::ReadUser, WriteUser = QFile::WriteUser, ExeUser = QFile::ExeUser,
- ReadGroup = QFile::ReadGroup, WriteGroup = QFile::WriteGroup, ExeGroup = QFile::ExeGroup,
- ReadOther = QFile::ReadOther, WriteOther = QFile::WriteOther, ExeOther = QFile::ExeOther
- };
- Q_DECLARE_FLAGS(PermissionSpec, Permission)
-
- inline QT3_SUPPORT QString baseName(bool complete) {
- if(complete)
- return completeBaseName();
- return baseName();
- }
- inline QT3_SUPPORT QString extension(bool complete = true) const {
- if(complete)
- return completeSuffix();
- return suffix();
- }
- inline QT3_SUPPORT QString absFilePath() const { return absoluteFilePath(); }
-
- inline QT3_SUPPORT QString dirPath(bool absPath = false) const {
- if(absPath)
- return absolutePath();
- return path();
- }
- QT3_SUPPORT QDir dir(bool absPath) const;
- inline QT3_SUPPORT bool convertToAbs() { return makeAbsolute(); }
-#if !defined(Q_NO_TYPESAFE_FLAGS)
- inline QT3_SUPPORT bool permission(PermissionSpec permissions) const
- { return permission(QFile::Permissions(static_cast<int>(permissions))); }
-#endif
-#endif
-
protected:
QSharedDataPointer<QFileInfoPrivate> d_ptr;
private:
@@ -190,14 +156,7 @@ private:
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
-#ifdef QT3_SUPPORT
-Q_DECLARE_OPERATORS_FOR_FLAGS(QFileInfo::PermissionSpec)
-#endif
-
typedef QList<QFileInfo> QFileInfoList;
-#ifdef QT3_SUPPORT
-typedef QList<QFileInfo>::Iterator QFileInfoListIterator;
-#endif
QT_END_NAMESPACE
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index ea00cb4a1f..4371d9cbef 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1790,31 +1790,6 @@ QString QIODevice::errorString() const
Use write(\a data) instead.
*/
-#if defined QT3_SUPPORT
-QIODevice::Status QIODevice::status() const
-{
-#if !defined(QT_NO_QOBJECT)
- const QFile *f = qobject_cast<const QFile *>(this);
- if (f) return (int) f->error();
-#endif
- return isOpen() ? 0 /* IO_Ok */ : 8 /* IO_UnspecifiedError */;
-}
-
-/*!
- For device specific error handling, please refer to the
- individual device documentation.
-
- \sa qobject_cast()
-*/
-void QIODevice::resetStatus()
-{
-#if !defined(QT_NO_QOBJECT)
- QFile *f = qobject_cast<QFile *>(this);
- if (f) f->unsetError();
-#endif
-}
-#endif
-
#if !defined(QT_NO_DEBUG_STREAM)
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
{
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 328e329401..7d4afca850 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -167,81 +167,10 @@ protected:
private:
Q_DECLARE_PRIVATE(QIODevice)
Q_DISABLE_COPY(QIODevice)
-
-#ifdef QT3_SUPPORT
-public:
- typedef qint64 Offset;
-
- inline QT3_SUPPORT int flags() const { return static_cast<int>(openMode()); }
- inline QT3_SUPPORT int mode() const { return static_cast<int>(openMode()); }
- inline QT3_SUPPORT int state() const;
-
- inline QT3_SUPPORT bool isDirectAccess() const { return !isSequential(); }
- inline QT3_SUPPORT bool isSequentialAccess() const { return isSequential(); }
- inline QT3_SUPPORT bool isCombinedAccess() const { return false; }
- inline QT3_SUPPORT bool isBuffered() const { return true; }
- inline QT3_SUPPORT bool isRaw() const { return false; }
- inline QT3_SUPPORT bool isSynchronous() const { return true; }
- inline QT3_SUPPORT bool isAsynchronous() const { return false; }
- inline QT3_SUPPORT bool isTranslated() const { return (openMode() & Text) != 0; }
- inline QT3_SUPPORT bool isInactive() const { return !isOpen(); }
-
- typedef int Status;
- QT3_SUPPORT Status status() const;
- QT3_SUPPORT void resetStatus();
-
- inline QT3_SUPPORT Offset at() const { return pos(); }
- inline QT3_SUPPORT bool at(Offset offset) { return seek(offset); }
-
- inline QT3_SUPPORT qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
- inline QT3_SUPPORT qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
- inline QT3_SUPPORT qint64 writeBlock(const QByteArray &data) { return write(data); }
-
- inline QT3_SUPPORT int getch() { char c; return getChar(&c) ? int(uchar(c)) : -1; }
- inline QT3_SUPPORT int putch(int c) { return putChar(char(c)) ? int(uchar(c)) : -1; }
- inline QT3_SUPPORT int ungetch(int c) { ungetChar(uchar(c)); return c; }
-#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QIODevice::OpenMode)
-#ifdef QT3_SUPPORT
-static QT3_SUPPORT_VARIABLE const uint IO_Direct = 0x0100;
-static QT3_SUPPORT_VARIABLE const uint IO_Sequential = 0x0200;
-static QT3_SUPPORT_VARIABLE const uint IO_Combined = 0x0300;
-static QT3_SUPPORT_VARIABLE const uint IO_TypeMask = 0x0300;
-
-static QT3_SUPPORT_VARIABLE const uint IO_Raw = 0x0000;
-static QT3_SUPPORT_VARIABLE const uint IO_Async = 0x0000;
-
-#define IO_ReadOnly QIODevice::ReadOnly
-#define IO_WriteOnly QIODevice::WriteOnly
-#define IO_ReadWrite QIODevice::ReadWrite
-#define IO_Append QIODevice::Append
-#define IO_Truncate QIODevice::Truncate
-#define IO_Translate QIODevice::Text
-#define IO_ModeMask 0x00ff
-
-static QT3_SUPPORT_VARIABLE const uint IO_Open = 0x1000;
-static QT3_SUPPORT_VARIABLE const uint IO_StateMask = 0xf000;
-
-static QT3_SUPPORT_VARIABLE const uint IO_Ok = 0;
-static QT3_SUPPORT_VARIABLE const uint IO_ReadError = 1;
-static QT3_SUPPORT_VARIABLE const uint IO_WriteError = 2;
-static QT3_SUPPORT_VARIABLE const uint IO_FatalError = 3;
-static QT3_SUPPORT_VARIABLE const uint IO_ResourceError = 4;
-static QT3_SUPPORT_VARIABLE const uint IO_OpenError = 5;
-static QT3_SUPPORT_VARIABLE const uint IO_ConnectError = 5;
-static QT3_SUPPORT_VARIABLE const uint IO_AbortError = 6;
-static QT3_SUPPORT_VARIABLE const uint IO_TimeOutError = 7;
-static QT3_SUPPORT_VARIABLE const uint IO_UnspecifiedError = 8;
-
-inline QT3_SUPPORT int QIODevice::state() const
-{
- return isOpen() ? 0x1000 : 0;
-}
-#endif
-
#if !defined(QT_NO_DEBUG_STREAM)
class QDebug;
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 5568920061..113ba4b4bb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -479,7 +479,7 @@ qint64 QByteDeviceWrappingIoDevice::writeData( const char* data, qint64 maxSize)
*/
/*!
- \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *device);
+ \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *device)
Create a QNonContiguousByteDevice out of a QIODevice.
For QFile, QBuffer and all other QIoDevice, sequential or not.
@@ -501,7 +501,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *dev
}
/*!
- \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QRingBuffer *ringBuffer);
+ \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer<QRingBuffer> ringBuffer)
Create a QNonContiguousByteDevice out of a QRingBuffer.
@@ -513,7 +513,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer
}
/*!
- \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QByteArray *byteArray);
+ \fn static QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QByteArray *byteArray)
Create a QNonContiguousByteDevice out of a QByteArray.
@@ -525,7 +525,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QByteArray *by
}
/*!
- \fn static QIODevice* QNonContiguousByteDeviceFactory::wrap(QNonContiguousByteDevice* byteDevice);
+ \fn static QIODevice* QNonContiguousByteDeviceFactory::wrap(QNonContiguousByteDevice* byteDevice)
Wrap the \a byteDevice (possibly again) into a QIODevice.
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 1761c0edee..510f72312e 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -46,6 +46,7 @@
#include <qdatetime.h>
#include <qdir.h>
#include <qfileinfo.h>
+#include <qregexp.h>
#include <qtimer.h>
#include <qthread.h>
#include <qmutex.h>
@@ -256,24 +257,19 @@ static QString qt_create_commandline(const QString &program, const QStringList &
for (int i=0; i<arguments.size(); ++i) {
QString tmp = arguments.at(i);
- // in the case of \" already being in the string the \ must also be escaped
- tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") );
- // escape a single " because the arguments will be parsed
- tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") );
+ // Quotes are escaped and their preceding backslashes are doubled.
+ tmp.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\""));
if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
- QString endQuote(QLatin1Char('\"'));
int i = tmp.length();
- while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) {
+ while (i > 0 && tmp.at(i - 1) == QLatin1Char('\\'))
--i;
- endQuote += QLatin1Char('\\');
- }
- args += QLatin1String(" \"") + tmp.left(i) + endQuote;
- } else {
- args += QLatin1Char(' ') + tmp;
+ tmp.insert(i, QLatin1Char('"'));
+ tmp.prepend(QLatin1Char('"'));
}
+ args += QLatin1Char(' ') + tmp;
}
return args;
}
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 79b2728f58..7e40e5f73b 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3547,278 +3547,6 @@ QSettings::Format QSettings::registerFormat(const QString &extension, ReadFunc r
return QSettings::Format((int)QSettings::CustomFormat1 + index);
}
-#ifdef QT3_SUPPORT
-void QSettings::setPath_helper(Scope scope, const QString &organization, const QString &application)
-{
- Q_D(QSettings);
- if (d->pendingChanges)
- d->flush();
- QSettingsPrivate *oldPriv = d;
- QSettingsPrivate *newPriv = QSettingsPrivate::create(oldPriv->format, scope, organization, application);
- static_cast<QObjectPrivate &>(*newPriv) = static_cast<QObjectPrivate &>(*oldPriv); // copy the QObject stuff over (hack)
- d_ptr.reset(newPriv);
-}
-
-/*! \fn bool QSettings::writeEntry(const QString &key, bool value)
-
- Sets the value of setting \a key to \a value.
-
- Use setValue() instead.
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, double value)
-
- \overload
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, int value)
-
- \overload
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, const char *value)
-
- \overload
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, const QString &value)
-
- \overload
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, const QStringList &value)
-
- \overload
-*/
-
-/*! \fn bool QSettings::writeEntry(const QString &key, const QStringList &value, QChar separator)
-
- \overload
-
- Use setValue(\a key, \a value) instead. You don't need \a separator.
-*/
-
-/*! \fn QStringList QSettings::readListEntry(const QString &key, bool *ok = 0)
-
- Returns the value of setting \a key converted to a QStringList.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- QStringList list = settings.readListEntry("recentFiles", &ok);
- \newcode
- bool ok = settings.contains("recentFiles");
- QStringList list = settings.value("recentFiles").toStringList();
- \endcode
-*/
-
-/*! \fn QStringList QSettings::readListEntry(const QString &key, QChar separator, bool *ok)
-
- Returns the value of setting \a key converted to a QStringList.
- \a separator is ignored.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- QStringList list = settings.readListEntry("recentFiles", ":", &ok);
- \newcode
- bool ok = settings.contains("recentFiles");
- QStringList list = settings.value("recentFiles").toStringList();
- \endcode
-*/
-
-/*! \fn QString QSettings::readEntry(const QString &key, const QString &defaultValue, bool *ok)
-
- Returns the value for setting \a key converted to a QString. If
- the setting doesn't exist, returns \a defaultValue.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- QString str = settings.readEntry("userName", "administrator", &ok);
- \newcode
- bool ok = settings.contains("userName");
- QString str = settings.value("userName", "administrator").toString();
- \endcode
-*/
-
-/*! \fn int QSettings::readNumEntry(const QString &key, int defaultValue, bool *ok)
-
- Returns the value for setting \a key converted to an \c int. If
- the setting doesn't exist, returns \a defaultValue.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- int max = settings.readNumEntry("maxConnections", 30, &ok);
- \newcode
- bool ok = settings.contains("maxConnections");
- int max = settings.value("maxConnections", 30).toInt();
- \endcode
-*/
-
-/*! \fn double QSettings::readDoubleEntry(const QString &key, double defaultValue, bool *ok)
-
- Returns the value for setting \a key converted to a \c double. If
- the setting doesn't exist, returns \a defaultValue.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- double pi = settings.readDoubleEntry("pi", 3.141592, &ok);
- \newcode
- bool ok = settings.contains("pi");
- double pi = settings.value("pi", 3.141592).toDouble();
- \endcode
-*/
-
-/*! \fn bool QSettings::readBoolEntry(const QString &key, bool defaultValue, bool *ok)
-
- Returns the value for setting \a key converted to a \c bool. If
- the setting doesn't exist, returns \a defaultValue.
-
- If \a ok is not 0, *\a{ok} is set to true if the key exists,
- otherwise *\a{ok} is set to false.
-
- Use value() instead.
-
- \oldcode
- bool ok;
- bool grid = settings.readBoolEntry("showGrid", true, &ok);
- \newcode
- bool ok = settings.contains("showGrid");
- bool grid = settings.value("showGrid", true).toBool();
- \endcode
-*/
-
-/*! \fn bool QSettings::removeEntry(const QString &key)
-
- Use remove() instead.
-*/
-
-/*! \enum QSettings::System
- \compat
-
- \value Unix Unix systems (X11 and Embedded Linux)
- \value Windows Microsoft Windows systems
- \value Mac Mac OS X systems
-
- \sa insertSearchPath(), removeSearchPath()
-*/
-
-/*! \fn void QSettings::insertSearchPath(System system, const QString &path)
-
- This function is implemented as a no-op. It is provided for
- source compatibility with Qt 3. The new QSettings class has no
- concept of "search path".
-*/
-
-/*! \fn void QSettings::removeSearchPath(System system, const QString &path)
-
- This function is implemented as a no-op. It is provided for
- source compatibility with Qt 3. The new QSettings class has no
- concept of "search path".
-*/
-
-/*! \fn void QSettings::setPath(const QString &organization, const QString &application, \
- Scope scope)
-
- Specifies the \a organization, \a application, and \a scope to
- use by the QSettings object.
-
- Use the appropriate constructor instead, with QSettings::UserScope
- instead of QSettings::User and QSettings::SystemScope instead of
- QSettings::Global.
-
- \oldcode
- QSettings settings;
- settings.setPath("twikimaster.com", "Kanooth", QSettings::Global);
- \newcode
- QSettings settings(QSettings::SystemScope, "twikimaster.com", "Kanooth");
- \endcode
-*/
-
-/*! \fn void QSettings::resetGroup()
-
- Sets the current group to be the empty string.
-
- Use endGroup() instead (possibly multiple times).
-
- \oldcode
- QSettings settings;
- settings.beginGroup("mainWindow");
- settings.beginGroup("leftPanel");
- ...
- settings.resetGroup();
- \newcode
- QSettings settings;
- settings.beginGroup("mainWindow");
- settings.beginGroup("leftPanel");
- ...
- settings.endGroup();
- settings.endGroup();
- \endcode
-*/
-
-/*! \fn QStringList QSettings::entryList(const QString &key) const
-
- Returns a list of all sub-keys of \a key.
-
- Use childKeys() instead.
-
- \oldcode
- QSettings settings;
- QStringList keys = settings.entryList("cities");
- ...
- \newcode
- QSettings settings;
- settings.beginGroup("cities");
- QStringList keys = settings.childKeys();
- ...
- settings.endGroup();
- \endcode
-*/
-
-/*! \fn QStringList QSettings::subkeyList(const QString &key) const
-
- Returns a list of all sub-keys of \a key.
-
- Use childGroups() instead.
-
- \oldcode
- QSettings settings;
- QStringList groups = settings.entryList("cities");
- ...
- \newcode
- QSettings settings;
- settings.beginGroup("cities");
- QStringList groups = settings.childKeys();
- ...
- settings.endGroup();
- \endcode
-*/
-#endif
-
QT_END_NAMESPACE
#endif // QT_NO_SETTINGS
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index 155e5c14a6..b144a9af4c 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -54,10 +54,6 @@ QT_END_NAMESPACE
#ifndef QT_NO_SETTINGS
-#ifdef QT3_SUPPORT
-#include <QtCore/qstringlist.h>
-#endif
-
#include <ctype.h>
QT_BEGIN_NAMESPACE
@@ -115,11 +111,6 @@ public:
enum Scope {
UserScope,
SystemScope
-#ifdef QT3_SUPPORT
- ,
- User = UserScope,
- Global = SystemScope
-#endif
};
#ifndef QT_NO_QOBJECT
@@ -194,113 +185,12 @@ public:
static Format registerFormat(const QString &extension, ReadFunc readFunc, WriteFunc writeFunc,
Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool writeEntry(const QString &key, bool value)
- { setValue(key, value); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, double value)
- { setValue(key, value); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, int value)
- { setValue(key, value); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, const char *value)
- { setValue(key, QString::fromAscii(value)); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, const QString &value)
- { setValue(key, value); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, const QStringList &value)
- { setValue(key, value); return isWritable(); }
- inline QT3_SUPPORT bool writeEntry(const QString &key, const QStringList &value, QChar separator)
- { setValue(key, value.join(QString(separator))); return isWritable(); }
- inline QT3_SUPPORT QStringList readListEntry(const QString &key, bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- return value(key).toStringList();
- }
- inline QT3_SUPPORT QStringList readListEntry(const QString &key, QChar separator, bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- QString str = value(key).toString();
- if (str.isEmpty())
- return QStringList();
- return str.split(separator);
- }
- inline QT3_SUPPORT QString readEntry(const QString &key, const QString &defaultValue = QString(),
- bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- return value(key, defaultValue).toString();
- }
- inline QT3_SUPPORT int readNumEntry(const QString &key, int defaultValue = 0, bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- return value(key, defaultValue).toInt();
- }
- inline QT3_SUPPORT double readDoubleEntry(const QString &key, double defaultValue = 0,
- bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- return value(key, defaultValue).toDouble();
- }
- inline QT3_SUPPORT bool readBoolEntry(const QString &key, bool defaultValue = false,
- bool *ok = 0)
- {
- if (ok)
- *ok = contains(key);
- return value(key, defaultValue).toBool();
- }
- inline QT3_SUPPORT bool removeEntry(const QString &key)
- { remove(key); return true; }
-
- enum System { Unix, Windows, Mac };
- inline QT3_SUPPORT void insertSearchPath(System, const QString &) {}
- inline QT3_SUPPORT void removeSearchPath(System, const QString &) {}
-
- inline QT3_SUPPORT void setPath(const QString &organization, const QString &application,
- Scope scope = Global)
- {
- setPath_helper(scope == Global ? QSettings::SystemScope : QSettings::UserScope,
- organization, application);
- }
- inline QT3_SUPPORT void resetGroup()
- {
- while (!group().isEmpty())
- endGroup();
- }
- inline QT3_SUPPORT QStringList entryList(const QString &key) const
- {
- QSettings *that = const_cast<QSettings *>(this);
- QStringList result;
-
- that->beginGroup(key);
- result = that->childKeys();
- that->endGroup();
- return result;
- }
- inline QT3_SUPPORT QStringList subkeyList(const QString &key) const
- {
- QSettings *that = const_cast<QSettings *>(this);
- QStringList result;
-
- that->beginGroup(key);
- result = that->childGroups();
- that->endGroup();
- return result;
- }
-#endif
-
protected:
#ifndef QT_NO_QOBJECT
bool event(QEvent *event);
#endif
private:
-#ifdef QT3_SUPPORT
- void setPath_helper(Scope scope, const QString &organization, const QString &application);
-#endif
-
Q_DISABLE_COPY(QSettings)
};
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 7289bb6c03..177f73def3 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -3107,304 +3107,6 @@ QLocale QTextStream::locale() const
return d->locale;
}
-#ifdef QT3_SUPPORT
-/*!
- \class QTextIStream
- \brief The QTextIStream class is a convenience class for input streams.
-
- \compat
- \reentrant
-
- Use QTextStream instead.
-*/
-
-/*!
- \fn QTextIStream::QTextIStream(const QString *string)
-
- Use QTextStream(&\a{string}, QIODevice::ReadOnly) instead.
-*/
-/*!
- \fn QTextIStream::QTextIStream(QByteArray *byteArray)
-
- Use QTextStream(&\a{byteArray}, QIODevice::ReadOnly) instead.
-*/
-/*!
- \fn QTextIStream::QTextIStream(FILE *file)
-
- Use QTextStream(\a{file}, QIODevice::ReadOnly) instead.
-*/
-
-/*!
- \class QTextOStream
- \brief The QTextOStream class is a convenience class for output streams.
-
- \compat
- \reentrant
-
- Use QTextStream instead.
-*/
-
-/*!
- \fn QTextOStream::QTextOStream(QString *string)
-
- Use QTextStream(&\a{string}, QIODevice::WriteOnly) instead.
-*/
-/*!
- \fn QTextOStream::QTextOStream(QByteArray *byteArray)
-
- Use QTextStream(&\a{byteArray}, QIODevice::WriteOnly) instead.
-*/
-/*!
- \fn QTextOStream::QTextOStream(FILE *file)
-
- Use QTextStream(\a{file}, QIODevice::WriteOnly) instead.
-*/
-
-/*! \internal
-*/
-int QTextStream::flagsInternal() const
-{
- Q_D(const QTextStream);
-
- int f = 0;
- switch (d->fieldAlignment) {
- case AlignLeft: f |= left; break;
- case AlignRight: f |= right; break;
- case AlignCenter: f |= internal; break;
- default:
- break;
- }
- switch (d->integerBase) {
- case 2: f |= bin; break;
- case 8: f |= oct; break;
- case 10: f |= dec; break;
- case 16: f |= hex; break;
- default:
- break;
- }
- switch (d->realNumberNotation) {
- case FixedNotation: f |= fixed; break;
- case ScientificNotation: f |= scientific; break;
- default:
- break;
- }
- if (d->numberFlags & ShowBase)
- f |= showbase;
- if (d->numberFlags & ForcePoint)
- f |= showpoint;
- if (d->numberFlags & ForceSign)
- f |= showpos;
- if (d->numberFlags & UppercaseBase)
- f |= uppercase;
- return f;
-}
-
-/*! \internal
-*/
-int QTextStream::flagsInternal(int newFlags)
-{
- int oldFlags = flagsInternal();
-
- if (newFlags & left)
- setFieldAlignment(AlignLeft);
- else if (newFlags & right)
- setFieldAlignment(AlignRight);
- else if (newFlags & internal)
- setFieldAlignment(AlignCenter);
-
- if (newFlags & bin)
- setIntegerBase(2);
- else if (newFlags & oct)
- setIntegerBase(8);
- else if (newFlags & dec)
- setIntegerBase(10);
- else if (newFlags & hex)
- setIntegerBase(16);
-
- if (newFlags & showbase)
- setNumberFlags(numberFlags() | ShowBase);
- if (newFlags & showpos)
- setNumberFlags(numberFlags() | ForceSign);
- if (newFlags & showpoint)
- setNumberFlags(numberFlags() | ForcePoint);
- if (newFlags & uppercase)
- setNumberFlags(numberFlags() | UppercaseBase);
-
- if (newFlags & fixed)
- setRealNumberNotation(FixedNotation);
- else if (newFlags & scientific)
- setRealNumberNotation(ScientificNotation);
-
- return oldFlags;
-}
-
-#ifndef QT_NO_TEXTCODEC
-/*!
- Use setCodec() and setAutoDetectUnicode() instead.
-*/
-void QTextStream::setEncoding(Encoding encoding)
-{
- Q_D(QTextStream);
- resetCodecConverterStateHelper(&d->readConverterState);
- resetCodecConverterStateHelper(&d->writeConverterState);
-
- switch (encoding) {
- case Locale:
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForLocale());
- d->autoDetectUnicode = true;
- break;
- case Latin1:
- d->readConverterState.flags |= QTextCodec::IgnoreHeader;
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForName("ISO-8859-1"));
- d->autoDetectUnicode = false;
- break;
- case Unicode:
- setCodec(QTextCodec::codecForName("UTF-16"));
- d->autoDetectUnicode = false;
- break;
- case RawUnicode:
- d->readConverterState.flags |= QTextCodec::IgnoreHeader;
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForName("UTF-16"));
- d->autoDetectUnicode = false;
- break;
- case UnicodeNetworkOrder:
- d->readConverterState.flags |= QTextCodec::IgnoreHeader;
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForName("UTF-16BE"));
- d->autoDetectUnicode = false;
- break;
- case UnicodeReverse:
- d->readConverterState.flags |= QTextCodec::IgnoreHeader;
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForName("UTF-16LE"));
- d->autoDetectUnicode = false;
- break;
- case UnicodeUTF8:
- d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
- setCodec(QTextCodec::codecForName("UTF-8"));
- d->autoDetectUnicode = true;
- break;
- }
-}
-#endif
-
-/*!
- \enum QTextStream::Encoding
- \compat
-
- \value Latin1 Use setCodec(QTextCodec::codecForName("ISO-8859-1")) instead.
- \value Locale Use setCodec(QTextCodec::codecForLocale()) instead.
- \value RawUnicode Use setCodec(QTextCodec::codecForName("UTF-16")) instead.
- \value Unicode Use setCodec(QTextCodec::codecForName("UTF-16")) instead.
- \value UnicodeNetworkOrder Use setCodec(QTextCodec::codecForName("UTF-16BE")) instead.
- \value UnicodeReverse Use setCodec(QTextCodec::codecForName("UTF-16LE")) instead.
- \value UnicodeUTF8 Use setCodec(QTextCodec::codecForName("UTF-8")) instead.
-
- Also, for all encodings except QTextStream::Latin1 and
- QTextStream::UTF8, you need to call setAutoDetectUnicode(false)
- to obtain the Qt 3 behavior in addition to the setCodec() call.
-
- \sa setCodec(), setAutoDetectUnicode()
-*/
-
-/*!
- \fn int QTextStream::flags() const
-
- Use fieldAlignment(), padChar(), fieldWidth(), numberFlags(),
- integerBase(), realNumberNotation(), and realNumberNotation
- instead.
-*/
-
-/*!
- \fn int QTextStream::flags(int)
-
- Use setFieldAlignment(), setPadChar(), setFieldWidth(),
- setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
- setRealNumberNotation instead.
-*/
-
-/*!
- \fn int QTextStream::setf(int)
-
- Use setFieldAlignment(), setPadChar(), setFieldWidth(),
- setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
- setRealNumberNotation instead.
-*/
-
-/*!
- \fn int QTextStream::setf(int, int)
-
- Use setFieldAlignment(), setPadChar(), setFieldWidth(),
- setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
- setRealNumberNotation instead.
-*/
-
-/*!
- \fn int QTextStream::unsetf(int)
-
- Use setFieldAlignment(), setPadChar(), setFieldWidth(),
- setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
- setRealNumberNotation instead.
-*/
-
-/*!
- \fn int QTextStream::width(int)
-
- Use setFieldWidth() instead.
-*/
-
-/*!
- \fn int QTextStream::fill(int)
-
- Use setPadChar() instead.
-*/
-
-/*!
- \fn int QTextStream::precision(int)
-
- Use setRealNumberPrecision() instead.
-*/
-
-/*!
- \fn int QTextStream::read()
-
- Use readAll() or readLine() instead.
-*/
-
-/*!
- \fn int QTextStream::unsetDevice()
-
- Use setDevice(0) instead.
-*/
-
-/*!
- \variable QTextStream::skipws
- \variable QTextStream::left
- \variable QTextStream::right
- \variable QTextStream::internal
- \variable QTextStream::bin
- \variable QTextStream::oct
- \variable QTextStream::dec
- \variable QTextStream::hex
- \variable QTextStream::showbase
- \variable QTextStream::showpoint
- \variable QTextStream::uppercase
- \variable QTextStream::showpos
- \variable QTextStream::scientific
- \variable QTextStream::fixed
- \variable QTextStream::basefield
- \variable QTextStream::adjustfield
- \variable QTextStream::floatfield
- \compat
-
- Use the new \l{QTextStream manipulators} instead.
-*/
-
-#endif
-
QT_END_NAMESPACE
#ifndef QT_NO_QOBJECT
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index 3747fab6f6..db038855a8 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -48,12 +48,6 @@
#include <QtCore/qlocale.h>
#include <QtCore/qscopedpointer.h>
-#ifndef QT_NO_TEXTCODEC
-# ifdef QT3_SUPPORT
-# include <QtCore/qtextcodec.h>
-# endif
-#endif
-
#include <stdio.h>
#ifdef Status
@@ -199,63 +193,7 @@ public:
QTextStream &operator<<(const char *c);
QTextStream &operator<<(const void *ptr);
-#ifdef QT3_SUPPORT
- // not marked as QT3_SUPPORT to avoid double compiler warnings, as
- // they are used in the QT3_SUPPORT functions below.
- inline QT3_SUPPORT int flags() const { return flagsInternal(); }
- inline QT3_SUPPORT int flags(int f) { return flagsInternal(f); }
-
- inline QT3_SUPPORT int setf(int bits)
- { int old = flagsInternal(); flagsInternal(flagsInternal() | bits); return old; }
- inline QT3_SUPPORT int setf(int bits, int mask)
- { int old = flagsInternal(); flagsInternal(flagsInternal() | (bits & mask)); return old; }
- inline QT3_SUPPORT int unsetf(int bits)
- { int old = flagsInternal(); flagsInternal(flagsInternal() & ~bits); return old; }
-
- inline QT3_SUPPORT int width(int w)
- { int old = fieldWidth(); setFieldWidth(w); return old; }
- inline QT3_SUPPORT int fill(int f)
- { QChar ch = padChar(); setPadChar(QChar(f)); return ch.unicode(); }
- inline QT3_SUPPORT int precision(int p)
- { int old = realNumberPrecision(); setRealNumberPrecision(p); return old; }
-
- enum {
- skipws = 0x0001, // skip whitespace on input
- left = 0x0002, // left-adjust output
- right = 0x0004, // right-adjust output
- internal = 0x0008, // pad after sign
- bin = 0x0010, // binary format integer
- oct = 0x0020, // octal format integer
- dec = 0x0040, // decimal format integer
- hex = 0x0080, // hex format integer
- showbase = 0x0100, // show base indicator
- showpoint = 0x0200, // force decimal point (float)
- uppercase = 0x0400, // upper-case hex output
- showpos = 0x0800, // add '+' to positive integers
- scientific = 0x1000, // scientific float output
- fixed = 0x2000 // fixed float output
- };
- enum {
- basefield = bin | oct | dec | hex,
- adjustfield = left | right | internal,
- floatfield = scientific | fixed
- };
-
-#ifndef QT_NO_TEXTCODEC
- enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
- UnicodeReverse, RawUnicode, UnicodeUTF8 };
- QT3_SUPPORT void setEncoding(Encoding encoding);
-#endif
- inline QT3_SUPPORT QString read() { return readAll(); }
- inline QT3_SUPPORT void unsetDevice() { setDevice(0); }
-#endif
-
private:
-#ifdef QT3_SUPPORT
- int flagsInternal() const;
- int flagsInternal(int flags);
-#endif
-
Q_DISABLE_COPY(QTextStream)
QScopedPointer<QTextStreamPrivate> d_ptr;
@@ -344,32 +282,6 @@ inline QTextStreamManipulator qSetRealNumberPrecision(int precision)
return QTextStreamManipulator(func, precision);
}
-#ifdef QT3_SUPPORT
-typedef QTextStream QTS;
-
-class Q_CORE_EXPORT QTextIStream : public QTextStream
-{
-public:
- inline explicit QTextIStream(const QString *s) : QTextStream(const_cast<QString *>(s), QIODevice::ReadOnly) {}
- inline explicit QTextIStream(QByteArray *a) : QTextStream(a, QIODevice::ReadOnly) {}
- inline QTextIStream(FILE *f) : QTextStream(f, QIODevice::ReadOnly) {}
-
-private:
- Q_DISABLE_COPY(QTextIStream)
-};
-
-class Q_CORE_EXPORT QTextOStream : public QTextStream
-{
-public:
- inline explicit QTextOStream(QString *s) : QTextStream(s, QIODevice::WriteOnly) {}
- inline explicit QTextOStream(QByteArray *a) : QTextStream(a, QIODevice::WriteOnly) {}
- inline QTextOStream(FILE *f) : QTextStream(f, QIODevice::WriteOnly) {}
-
-private:
- Q_DISABLE_COPY(QTextOStream)
-};
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 881365678f..b948a43080 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -189,9 +189,6 @@
#include "qstack.h"
#include "qvarlengtharray.h"
#include "qdebug.h"
-#if defined QT3_SUPPORT
-#include "qfileinfo.h"
-#endif
#ifndef QT_BOOTSTRAPPED
#include "qtldurl_p.h"
#endif
@@ -5466,6 +5463,7 @@ void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
if (end < d->query.size())
++end; // remove additional '%'
d->query.remove(pos, end - pos);
+ query = d->query.constData(); //required if remove detach;
} else {
pos = end + 1;
}
@@ -6362,35 +6360,6 @@ bool QUrl::isParentOf(const QUrl &childUrl) const
Use QFileInfo(path()).absolutePath() or QFileInfo(path()) instead.
*/
-#ifdef QT3_SUPPORT
-void QUrl::setFileName(const QString &txt)
-{
- QFileInfo fileInfo(path());
- fileInfo.setFile(txt);
- setPath(fileInfo.filePath());
-}
-
-QString QUrl::fileName() const
-{
- QFileInfo fileInfo(path());
- return fileInfo.fileName();
-}
-
-QString QUrl::dirPath() const
-{
- QFileInfo fileInfo(path());
- if (fileInfo.isAbsolute()) {
- QString absPath = fileInfo.absolutePath();
-#ifdef Q_OS_WIN
- if (absPath.size() > 1 && absPath.at(1) == QLatin1Char(':'))
- absPath = absPath.mid(2);
-#endif
- return absPath;
- }
- return fileInfo.path();
-}
-#endif
-
#ifndef QT_NO_DATASTREAM
/*! \relates QUrl
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index d57a0c77df..e62cd0a85b 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -221,58 +221,8 @@ public:
static QStringList idnWhitelist();
static void setIdnWhitelist(const QStringList &);
-#if defined QT3_SUPPORT
- inline QT3_SUPPORT QString protocol() const { return scheme(); }
- inline QT3_SUPPORT void setProtocol(const QString &s) { setScheme(s); }
- inline QT3_SUPPORT void setUser(const QString &s) { setUserName(s); }
- inline QT3_SUPPORT QString user() const { return userName(); }
- inline QT3_SUPPORT bool hasUser() const { return !userName().isEmpty(); }
- inline QT3_SUPPORT bool hasPassword() const { return !password().isEmpty(); }
- inline QT3_SUPPORT bool hasHost() const { return !host().isEmpty(); }
- inline QT3_SUPPORT bool hasPort() const { return port() != -1; }
- inline QT3_SUPPORT bool hasPath() const { return !path().isEmpty(); }
- inline QT3_SUPPORT void setQuery(const QString &txt)
- {
- setEncodedQuery(txt.toLatin1());
- }
- inline QT3_SUPPORT QString query() const
- {
- return QString::fromLatin1(encodedQuery().constData());
- }
- inline QT3_SUPPORT QString ref() const { return fragment(); }
- inline QT3_SUPPORT void setRef(const QString &txt) { setFragment(txt); }
- inline QT3_SUPPORT bool hasRef() const { return !fragment().isEmpty(); }
- inline QT3_SUPPORT void addPath(const QString &p) { setPath(path() + QLatin1Char('/') + p); }
- QT3_SUPPORT void setFileName(const QString &txt);
- QT3_SUPPORT QString fileName() const;
- QT3_SUPPORT QString dirPath() const;
- static inline QT3_SUPPORT void decode(QString &url)
- {
- url = QUrl::fromPercentEncoding(url.toLatin1());
- }
- static inline QT3_SUPPORT void encode(QString &url)
- {
- url = QString::fromLatin1(QUrl::toPercentEncoding(url).constData());
- }
- inline QT3_SUPPORT operator QString() const { return toString(); }
- inline QT3_SUPPORT bool cdUp()
- {
- *this = resolved(QUrl(QLatin1String("..")));
- return true;
- }
- static inline QT3_SUPPORT bool isRelativeUrl(const QString &url)
- {
- return QUrl(url).isRelative();
- }
-#endif
-
QString errorString() const;
-protected:
-#if defined (QT3_SUPPORT)
- inline QT3_SUPPORT void reset() { clear(); }
-#endif
-
private:
QUrlPrivate *d;
public:
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index e00db5e01a..c134881f31 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -176,9 +176,6 @@ extern QString qAppFileName();
#endif
int QCoreApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0
-#if defined(QT3_SUPPORT)
-bool QCoreApplicationPrivate::useQt3Support = true;
-#endif
#if !defined(Q_OS_WIN)
#ifdef Q_OS_MAC
@@ -337,9 +334,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
in_exec(false), aboutToQuitEmitted(false), threadData_clean(false)
{
app_compile_version = flags & 0xffffff;
-#if defined(QT3_SUPPORT)
- useQt3Support = !(flags & 0x01000000);
-#endif
static const char *const empty = "";
if (argc == 0 || argv == 0) {
argc = 0;
@@ -1261,20 +1255,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
// delete the event on exceptions to protect against memory leaks till the event is
// properly owned in the postEventList
QScopedPointer<QEvent> eventDeleter(event);
- if (data->postEventList.isEmpty() || data->postEventList.last().priority >= priority) {
- // optimization: we can simply append if the last event in
- // the queue has higher or equal priority
- data->postEventList.append(QPostEvent(receiver, event, priority));
- } else {
- // insert event in descending priority order, using upper
- // bound for a given priority (to ensure proper ordering
- // of events with the same priority)
- QPostEventList::iterator begin = data->postEventList.begin()
- + data->postEventList.insertionOffset,
- end = data->postEventList.end();
- QPostEventList::iterator at = qUpperBound(begin, end, priority);
- data->postEventList.insert(at, QPostEvent(receiver, event, priority));
- }
+ data->postEventList.addEvent(QPostEvent(receiver, event, priority));
eventDeleter.take();
event->posted = true;
++receiver->d_func()->postedEvents;
@@ -1372,20 +1353,6 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
++data->postEventList.recursion;
-#ifdef QT3_SUPPORT
- if (event_type == QEvent::ChildInserted) {
- if (receiver) {
- // optimize sendPostedEvents(w, QEvent::ChildInserted) calls away
- receiver->d_func()->sendPendingChildInsertedEvents();
- --data->postEventList.recursion;
- return;
- }
-
- // ChildInserted events are sent in response to *Request
- event_type = QEvent::ChildInsertedRequest;
- }
-#endif
-
QMutexLocker locker(&data->postEventList.mutex);
// by default, we assume that the event dispatcher can go to sleep after
@@ -1434,7 +1401,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
// cannot send deferred delete
if (!event_type && !receiver) {
// don't lose the event
- data->postEventList.append(pe);
+ data->postEventList.addEvent(pe);
const_cast<QPostEvent &>(pe).event = 0;
}
continue;
@@ -1536,11 +1503,6 @@ void QCoreApplication::removePostedEvents(QObject *receiver)
void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
{
-#ifdef QT3_SUPPORT
- if (eventType == QEvent::ChildInserted)
- eventType = QEvent::ChildInsertedRequest;
-#endif
-
QThreadData *data = receiver ? receiver->d_func()->threadData : QThreadData::current();
QMutexLocker locker(&data->postEventList.mutex);
@@ -1563,10 +1525,6 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
if ((!receiver || pe.receiver == receiver)
&& (pe.event && (eventType == 0 || pe.event->type() == eventType))) {
--pe.receiver->d_func()->postedEvents;
-#ifdef QT3_SUPPORT
- if (pe.event->type() == QEvent::ChildInsertedRequest)
- pe.receiver->d_func()->pendingChildInsertedEvents.clear();
-#endif
pe.event->posted = false;
events.append(pe.event);
const_cast<QPostEvent &>(pe).event = 0;
@@ -2558,109 +2516,6 @@ bool QCoreApplication::hasPendingEvents()
return false;
}
-#ifdef QT3_SUPPORT
-/*! \fn void QCoreApplication::lock()
-
- In Qt 3, this function locked the Qt library mutex, allowing
- non-GUI threads to perform basic printing operations using
- QPainter.
-
- In Qt 4, this is no longer supported, since painting is only
- supported from within a paint event handler. This function does
- nothing.
-
- \sa QWidget::paintEvent()
-*/
-
-/*! \fn void QCoreApplication::unlock(bool wakeUpGui)
-
- In Qt 3, this function unlocked the Qt library mutex. The mutex
- allowed non-GUI threads to perform basic printing operations
- using QPainter.
-
- In Qt 4, this is no longer supported, since painting is only
- supported from within a paint event handler. This function does
- nothing.
-*/
-
-/*! \fn bool QCoreApplication::locked()
-
- This function does nothing. It is there to keep old code working.
- It always returns false.
-
- See lock() for details.
-*/
-
-/*! \fn bool QCoreApplication::tryLock()
-
- This function does nothing. It is there to keep old code working.
- It always returns false.
-
- See lock() for details.
-*/
-
-/*! \fn void QCoreApplication::processOneEvent()
- \obsolete
-
- Waits for an event to occur, processes it, then returns.
-
- This function is useful for adapting Qt to situations where the
- event processing must be grafted onto existing program loops.
-
- Using this function in new applications may be an indication of design
- problems.
-
- \sa processEvents(), exec(), QTimer
-*/
-
-/*! \obsolete
-
- This function enters the main event loop (recursively). Do not call
- it unless you really know what you are doing.
-*/
-int QCoreApplication::enter_loop()
-{
- if (!QCoreApplicationPrivate::checkInstance("enter_loop"))
- return -1;
- if (QThreadData::current() != self->d_func()->threadData) {
- qWarning("QCoreApplication::enter_loop: Must be called from the main thread");
- return -1;
- }
- QEventLoop eventLoop;
- int returnCode = eventLoop.exec();
- return returnCode;
-}
-
-/*! \obsolete
-
- This function exits from a recursive call to the main event loop.
- Do not call it unless you are an expert.
-*/
-void QCoreApplication::exit_loop()
-{
- if (!QCoreApplicationPrivate::checkInstance("exit_loop"))
- return;
- QThreadData *data = QThreadData::current();
- if (data != self->d_func()->threadData) {
- qWarning("QCoreApplication::exit_loop: Must be called from the main thread");
- return;
- }
- if (!data->eventLoops.isEmpty())
- data->eventLoops.top()->exit();
-}
-
-/*! \obsolete
-
- Returns the current loop level.
-*/
-int QCoreApplication::loopLevel()
-{
- if (!QCoreApplicationPrivate::checkInstance("loopLevel"))
- return -1;
- return self->d_func()->threadData->eventLoops.size();
-}
-#endif
-
/*
\fn void QCoreApplication::watchUnixSignal(int signal, bool watch)
\internal
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index c3d174d878..04d538d1b3 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -46,10 +46,6 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qeventloop.h>
-#ifdef QT_INCLUDE_COMPAT
-#include <QtCore/qstringlist.h>
-#endif
-
#if defined(Q_OS_WIN) && !defined(tagMSG)
typedef struct tagMSG MSG;
#endif
@@ -79,9 +75,6 @@ class Q_CORE_EXPORT QCoreApplication : public QObject
Q_DECLARE_PRIVATE(QCoreApplication)
public:
enum { ApplicationFlags = QT_VERSION
-#if !defined(QT3_SUPPORT)
- | 0x01000000
-#endif
};
QCoreApplication(int &argc, char **argv, int = ApplicationFlags);
@@ -155,19 +148,6 @@ public:
static void flush();
-#if defined(QT3_SUPPORT)
- inline QT3_SUPPORT void lock() {}
- inline QT3_SUPPORT void unlock(bool = true) {}
- inline QT3_SUPPORT bool locked() { return false; }
- inline QT3_SUPPORT bool tryLock() { return false; }
-
- static inline QT3_SUPPORT void processOneEvent()
- { processEvents(QEventLoop::WaitForMoreEvents); }
- static QT3_SUPPORT int enter_loop();
- static QT3_SUPPORT void exit_loop();
- static QT3_SUPPORT int loopLevel();
-#endif
-
#if defined(Q_OS_WIN)
virtual bool winEventFilter(MSG *message, long *result);
#endif
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 22585a1ce9..62026141a1 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -141,9 +141,6 @@ public:
static uint attribs;
static inline bool testAttribute(uint flag) { return attribs & (1 << flag); }
static int app_compile_version;
-#if defined(QT3_SUPPORT)
- static bool useQt3Support;
-#endif
static QSettings *trolltechConf();
};
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 49c6da42c6..0c3a3b8777 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -505,65 +505,6 @@ QChildEvent::~QChildEvent()
false.
*/
-/*!
- \class QCustomEvent
- \brief The QCustomEvent class provides support for custom events.
-
- \compat
-
- QCustomEvent has a \c{void *} that can be used to store custom
- data.
-
- In Qt 3, QObject::customEvent() took a QCustomEvent pointer. We
- found out that this approach was unsatisfactory, because
- there was often no safe way of deleting the data held in the
- \c{void *}.
-
- In Qt 4, QObject::customEvent() takes a plain QEvent pointer.
- You can add custom data by subclassing.
-
- \sa QObject::customEvent(), QCoreApplication::notify()
-*/
-
-/*!
- \fn QCustomEvent::QCustomEvent(int type, void *data)
-
- Constructs a custom event object with the event \a type and a
- pointer to \a data. The value of \a type must be at least as
- large as QEvent::User. By default, the data pointer is set to 0.
-*/
-#ifdef QT3_SUPPORT
-QCustomEvent::QCustomEvent(int type, void *data)
- : QEvent(static_cast<Type>(type))
-{
- d = reinterpret_cast<QEventPrivate *>(data);
-}
-
-/*! \internal
-*/
-QCustomEvent::~QCustomEvent()
-{
-}
-#endif
-/*!
- \fn void QCustomEvent::setData(void *data)
-
- \compat
-
- Sets the generic data pointer to \a data.
-
- \sa data()
-*/
-
-/*!
- \fn void *QCustomEvent::data() const
-
- \compat
-
- Returns a pointer to the generic event data.
-
- \sa setData()
-*/
/*!
\fn bool QChildEvent::inserted() const
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 791b207dea..831a403975 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -89,9 +89,6 @@ public:
Quit = 20, // request to quit application
ParentChange = 21, // widget has been reparented
ParentAboutToChange = 131, // sent just before the parent change is done
-#ifdef QT3_SUPPORT
- Reparent = ParentChange,
-#endif
ThreadChange = 22, // object has changed threads
WindowActivate = 24, // window was activated
WindowDeactivate = 25, // window was deactivated
@@ -118,11 +115,6 @@ public:
DragResponse = 64, // drag accepted/rejected
ChildAdded = 68, // new child widget
ChildPolished = 69, // polished child widget
-#ifdef QT3_SUPPORT
- ChildInsertedRequest = 67, // send ChildInserted compatibility events to receiver
- ChildInserted = 70, // compatibility child inserted
- LayoutHint = 72, // compatibility relayout request
-#endif
ChildRemoved = 71, // deleted child widget
ShowWindowRequest = 73, // widget's window should be mapped
PolishRequest = 74, // widget should be polished
@@ -174,18 +166,8 @@ public:
Shortcut = 117, // shortcut triggered
ShortcutOverride = 51, // shortcut override request
-#ifdef QT3_SUPPORT
- Accel = 30, // accelerator event
- AccelAvailable = 32, // accelerator available event
- AccelOverride = ShortcutOverride, // accelerator override event
-#endif
-
WhatsThisClicked = 118,
-#ifdef QT3_SUPPORT
- CaptionChange = WindowTitleChange,
- IconChange = WindowIconChange,
-#endif
ToolBarChange = 120, // toolbar visibility toggled
ApplicationActivate = 121, // application has been changed to active
@@ -297,6 +279,7 @@ public:
Expose = 208,
InputMethodQuery = 209,
+ OrientationChange = 210, // Screen orientation has changed
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
@@ -364,26 +347,12 @@ public:
~QChildEvent();
QObject *child() const { return c; }
bool added() const { return type() == ChildAdded; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT bool inserted() const { return type() == ChildInserted; }
-#endif
bool polished() const { return type() == ChildPolished; }
bool removed() const { return type() == ChildRemoved; }
protected:
QObject *c;
};
-#ifdef QT3_SUPPORT
-class Q_CORE_EXPORT QCustomEvent : public QEvent
-{
-public:
- QT3_SUPPORT_CONSTRUCTOR QCustomEvent(int type, void *data = 0);
- ~QCustomEvent();
- QT3_SUPPORT void *data() const { return d; }
- QT3_SUPPORT void setData(void* aData) { d = reinterpret_cast<QEventPrivate *>(aData); }
-};
-#endif
-
class Q_CORE_EXPORT QDynamicPropertyChangeEvent : public QEvent
{
public:
diff --git a/src/corelib/kernel/qeventloop.h b/src/corelib/kernel/qeventloop.h
index 46ee118ce5..5bd4146352 100644
--- a/src/corelib/kernel/qeventloop.h
+++ b/src/corelib/kernel/qeventloop.h
@@ -66,10 +66,6 @@ public:
ExcludeUserInputEvents = 0x01,
ExcludeSocketNotifiers = 0x02,
WaitForMoreEvents = 0x04,
-#ifdef QT3_SUPPORT
- ExcludeUserInput = ExcludeUserInputEvents,
- WaitForMore = WaitForMoreEvents,
-#endif
X11ExcludeTimers = 0x08
#ifdef QT_DEPRECATED
, DeferredDeletion = 0x10
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index b4c37f4778..c8ac15c1fa 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2283,11 +2283,7 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const
QVariant v = value;
uint t = QVariant::Invalid;
if (isEnumType()) {
- if (v.type() == QVariant::String
-#ifdef QT3_SUPPORT
- || v.type() == QVariant::CString
-#endif
- ) {
+ if (v.type() == QVariant::String) {
if (isFlagType())
v = QVariant(menum.keysToValue(value.toByteArray()));
else
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index e5ef021ed1..c97f9d260e 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -765,9 +765,6 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
stream << *static_cast<const NS(QEasingCurve)*>(data);
break;
#endif
-#ifdef QT3_SUPPORT
- case QMetaType::QColorGroup:
-#endif
case QMetaType::QFont:
case QMetaType::QPixmap:
case QMetaType::QBrush:
@@ -974,9 +971,6 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
stream >> *static_cast< NS(QEasingCurve)*>(data);
break;
#endif
-#ifdef QT3_SUPPORT
- case QMetaType::QColorGroup:
-#endif
case QMetaType::QFont:
case QMetaType::QPixmap:
case QMetaType::QBrush:
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index da59a8fa2b..5df7658a13 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -72,6 +72,7 @@ public:
QVariantHash = 28, QEasingCurve = 29, LastCoreType = QEasingCurve,
FirstGuiType = 64 /* QFont */,
+
QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68,
QImage = 69, QPolygon = 70, QRegion = 71, QBitmap = 72,
QCursor = 73, QKeySequence = 74, QPen = 75,
@@ -314,9 +315,6 @@ class QEasingCurve;
class QWidget;
class QObject;
-#ifdef QT3_SUPPORT
-class QColorGroup;
-#endif
class QFont;
class QPixmap;
class QBrush;
@@ -384,9 +382,6 @@ Q_DECLARE_BUILTIN_METATYPE(QRegExp, QRegExp)
#endif
Q_DECLARE_BUILTIN_METATYPE(QEasingCurve, QEasingCurve)
-#ifdef QT3_SUPPORT
-Q_DECLARE_BUILTIN_METATYPE(QColorGroup, QColorGroup)
-#endif
Q_DECLARE_BUILTIN_METATYPE(QFont, QFont)
Q_DECLARE_BUILTIN_METATYPE(QPixmap, QPixmap)
Q_DECLARE_BUILTIN_METATYPE(QBrush, QBrush)
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index a958efd64f..d573741654 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -203,22 +203,6 @@ void QObjectPrivate::resetDeleteWatch(QObjectPrivate *d, int *oldWatch, int dele
}
#endif
-#ifdef QT3_SUPPORT
-void QObjectPrivate::sendPendingChildInsertedEvents()
-{
- Q_Q(QObject);
- for (int i = 0; i < pendingChildInsertedEvents.size(); ++i) {
- QObject *c = pendingChildInsertedEvents.at(i).data();
- if (!c || c->parent() != q)
- continue;
- QChildEvent childEvent(QEvent::ChildInserted, c);
- QCoreApplication::sendEvent(q, &childEvent);
- }
- pendingChildInsertedEvents.clear();
-}
-
-#endif
-
/*!\internal
For a given metaobject, compute the signal offset, and the method offset (including signals)
@@ -737,29 +721,6 @@ QObject::QObject(QObject *parent)
qt_addObject(this);
}
-#ifdef QT3_SUPPORT
-/*!
- \overload QObject()
- \obsolete
-
- Creates a new QObject with the given \a parent and object \a name.
- */
-QObject::QObject(QObject *parent, const char *name)
- : d_ptr(new QObjectPrivate)
-{
- Q_D(QObject);
- qt_addObject(d_ptr->q_ptr = this);
- d->threadData = (parent && !parent->thread()) ? parent->d_func()->threadData : QThreadData::current();
- d->threadData->ref();
- if (parent) {
- if (!check_parent_thread(parent, parent ? parent->d_func()->threadData : 0, d->threadData))
- parent = 0;
- setParent(parent);
- }
- setObjectName(QString::fromAscii(name));
-}
-#endif
-
/*! \internal
*/
QObject::QObject(QObjectPrivate &dd, QObject *parent)
@@ -1079,56 +1040,6 @@ void QObject::setObjectName(const QString &name)
d->declarativeData->objectNameChanged(d->declarativeData, this);
}
-
-#ifdef QT3_SUPPORT
-/*! \internal
- QObject::child is compat but needs to call itself recursively,
- that's why we need this helper.
-*/
-static QObject *qChildHelper(const char *objName, const char *inheritsClass,
- bool recursiveSearch, const QObjectList &children)
-{
- if (children.isEmpty())
- return 0;
-
- bool onlyWidgets = (inheritsClass && qstrcmp(inheritsClass, "QWidget") == 0);
- const QLatin1String oName(objName);
- for (int i = 0; i < children.size(); ++i) {
- QObject *obj = children.at(i);
- if (onlyWidgets) {
- if (obj->isWidgetType() && (!objName || obj->objectName() == oName))
- return obj;
- } else if ((!inheritsClass || obj->inherits(inheritsClass))
- && (!objName || obj->objectName() == oName))
- return obj;
- if (recursiveSearch && (obj = qChildHelper(objName, inheritsClass,
- recursiveSearch, obj->children())))
- return obj;
- }
- return 0;
-}
-
-
-/*!
- Searches the children and optionally grandchildren of this object,
- and returns a child that is called \a objName that inherits \a
- inheritsClass. If \a inheritsClass is 0 (the default), any class
- matches.
-
- If \a recursiveSearch is true (the default), child() performs a
- depth-first search of the object's children.
-
- If there is no such object, this function returns 0. If there are
- more than one, the first one found is returned.
-*/
-QObject* QObject::child(const char *objName, const char *inheritsClass,
- bool recursiveSearch) const
-{
- Q_D(const QObject);
- return qChildHelper(objName, inheritsClass, recursiveSearch, d->children);
-}
-#endif
-
/*!
\fn bool QObject::isWidgetType() const
@@ -1157,17 +1068,8 @@ bool QObject::event(QEvent *e)
timerEvent((QTimerEvent*)e);
break;
-#ifdef QT3_SUPPORT
- case QEvent::ChildInsertedRequest:
- d_func()->sendPendingChildInsertedEvents();
- break;
-#endif
-
case QEvent::ChildAdded:
case QEvent::ChildPolished:
-#ifdef QT3_SUPPORT
- case QEvent::ChildInserted:
-#endif
case QEvent::ChildRemoved:
childEvent((QChildEvent*)e);
break;
@@ -1483,7 +1385,7 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
continue;
if (pe.receiver == q) {
// move this post event to the targetList
- targetData->postEventList.append(pe);
+ targetData->postEventList.addEvent(pe);
const_cast<QPostEvent &>(pe).event = 0;
++eventsMoved;
}
@@ -1636,102 +1538,6 @@ void QObject::killTimer(int id)
\sa findChild(), findChildren(), parent(), setParent()
*/
-#ifdef QT3_SUPPORT
-static void objSearch(QObjectList &result,
- const QObjectList &list,
- const char *inheritsClass,
- bool onlyWidgets,
- const char *objName,
- QRegExp *rx,
- bool recurse)
-{
- for (int i = 0; i < list.size(); ++i) {
- QObject *obj = list.at(i);
- if (!obj)
- continue;
- bool ok = true;
- if (onlyWidgets)
- ok = obj->isWidgetType();
- else if (inheritsClass && !obj->inherits(inheritsClass))
- ok = false;
- if (ok) {
- if (objName)
- ok = (obj->objectName() == QLatin1String(objName));
-#ifndef QT_NO_REGEXP
- else if (rx)
- ok = (rx->indexIn(obj->objectName()) != -1);
-#endif
- }
- if (ok) // match!
- result.append(obj);
- if (recurse) {
- QObjectList clist = obj->children();
- if (!clist.isEmpty())
- objSearch(result, clist, inheritsClass,
- onlyWidgets, objName, rx, recurse);
- }
- }
-}
-
-/*!
- \internal
-
- Searches the children and optionally grandchildren of this object,
- and returns a list of those objects that are named or that match
- \a objName and inherit \a inheritsClass. If \a inheritsClass is 0
- (the default), all classes match. If \a objName is 0 (the
- default), all object names match.
-
- If \a regexpMatch is true (the default), \a objName is a regular
- expression that the objects's names must match. The syntax is that
- of a QRegExp. If \a regexpMatch is false, \a objName is a string
- and object names must match it exactly.
-
- Note that \a inheritsClass uses single inheritance from QObject,
- the way inherits() does. According to inherits(), QWidget
- inherits QObject but not QPaintDevice. This does not quite match
- reality, but is the best that can be done on the wide variety of
- compilers Qt supports.
-
- Finally, if \a recursiveSearch is true (the default), queryList()
- searches \e{n}th-generation as well as first-generation children.
-
- If all this seems a bit complex for your needs, the simpler
- child() function may be what you want.
-
- This somewhat contrived example disables all the buttons in this
- window:
-
- \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 9
-
- \warning Delete the list as soon you have finished using it. The
- list contains pointers that may become invalid at almost any time
- without notice (as soon as the user closes a window you may have
- dangling pointers, for example).
-
- \sa child() children(), parent(), inherits(), objectName(), QRegExp
-*/
-
-QObjectList QObject::queryList(const char *inheritsClass,
- const char *objName,
- bool regexpMatch,
- bool recursiveSearch) const
-{
- Q_D(const QObject);
- QObjectList list;
- bool onlyWidgets = (inheritsClass && qstrcmp(inheritsClass, "QWidget") == 0);
-#ifndef QT_NO_REGEXP
- if (regexpMatch && objName) { // regexp matching
- QRegExp rx(QString::fromLatin1(objName));
- objSearch(list, d->children, inheritsClass, onlyWidgets, 0, &rx, recursiveSearch);
- } else
-#endif
- {
- objSearch(list, d->children, inheritsClass, onlyWidgets, objName, 0, recursiveSearch);
- }
- return list;
-}
-#endif
/*!
\fn T *QObject::findChild(const QString &name) const
@@ -1949,16 +1755,6 @@ void QObjectPrivate::setParent_helper(QObject *o)
if (!isWidget) {
QChildEvent e(QEvent::ChildAdded, q);
QCoreApplication::sendEvent(parent, &e);
-#ifdef QT3_SUPPORT
- if (QCoreApplicationPrivate::useQt3Support) {
- if (parent->d_func()->pendingChildInsertedEvents.isEmpty()) {
- QCoreApplication::postEvent(parent,
- new QEvent(QEvent::ChildInsertedRequest),
- Qt::HighEventPriority);
- }
- parent->d_func()->pendingChildInsertedEvents.append(q);
- }
-#endif
}
}
}
@@ -2940,7 +2736,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
\a receiver. Returns true if the connection is successfully broken;
otherwise returns false.
- This function provides the same posibilities like
+ This function provides the same possibilities like
disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
but uses QMetaMethod to represent the signal and the method to be disconnected.
@@ -2958,7 +2754,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
QMetaMethod() may be used as wildcard in the meaning "any signal" or "any slot in receiving object".
In the same way 0 can be used for \a receiver in the meaning "any receiving object". In this case
- method shoud also be QMetaMethod(). \a sender parameter should be never 0.
+ method should also be QMetaMethod(). \a sender parameter should be never 0.
\sa disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
*/
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 0fa28c0e63..1c367eb8d1 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -188,14 +188,6 @@ public:
}
#endif
-#ifdef QT3_SUPPORT
- QT3_SUPPORT QObject *child(const char *objName, const char *inheritsClass = 0,
- bool recursiveSearch = true) const;
- QT3_SUPPORT QObjectList queryList(const char *inheritsClass = 0,
- const char *objName = 0,
- bool regexpMatch = true,
- bool recursiveSearch = true) const;
-#endif
inline const QObjectList &children() const { return d_ptr->children; }
void setParent(QObject *);
@@ -204,44 +196,14 @@ public:
static bool connect(const QObject *sender, const char *signal,
- const QObject *receiver, const char *member, Qt::ConnectionType =
-#ifdef qdoc
- Qt::AutoConnection
-#else
-#ifdef QT3_SUPPORT
- Qt::AutoCompatConnection
-#else
- Qt::AutoConnection
-#endif
-#endif
- );
+ const QObject *receiver, const char *member, Qt::ConnectionType = Qt::AutoConnection);
static bool connect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &method,
- Qt::ConnectionType type =
-#ifdef qdoc
- Qt::AutoConnection
-#else
-#ifdef QT3_SUPPORT
- Qt::AutoCompatConnection
-#else
- Qt::AutoConnection
-#endif
-#endif
- );
+ Qt::ConnectionType type = Qt::AutoConnection);
inline bool connect(const QObject *sender, const char *signal,
- const char *member, Qt::ConnectionType type =
-#ifdef qdoc
- Qt::AutoConnection
-#else
-#ifdef QT3_SUPPORT
- Qt::AutoCompatConnection
-#else
- Qt::AutoConnection
-#endif
-#endif
- ) const;
+ const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
static bool disconnect(const QObject *sender, const char *signal,
const QObject *receiver, const char *member);
@@ -292,29 +254,6 @@ protected:
virtual void connectNotify(const char *signal);
virtual void disconnectNotify(const char *signal);
-#ifdef QT3_SUPPORT
-public:
- QT3_SUPPORT_CONSTRUCTOR QObject(QObject *parent, const char *name);
- inline QT3_SUPPORT void insertChild(QObject *o)
- { if (o) o->setParent(this); }
- inline QT3_SUPPORT void removeChild(QObject *o)
- { if (o) o->setParent(0); }
- inline QT3_SUPPORT bool isA(const char *classname) const
- { return qstrcmp(classname, metaObject()->className()) == 0; }
- inline QT3_SUPPORT const char *className() const { return metaObject()->className(); }
- inline QT3_SUPPORT const char *name() const { return objectName().latin1_helper(); }
- inline QT3_SUPPORT const char *name(const char *defaultName) const
- { QString s = objectName(); return s.isEmpty()?defaultName:s.latin1_helper(); }
- inline QT3_SUPPORT void setName(const char *aName) { setObjectName(QLatin1String(aName)); }
-protected:
- inline QT3_SUPPORT bool checkConnectArgs(const char *signal,
- const QObject *,
- const char *member)
- { return QMetaObject::checkConnectArgs(signal, member); }
- static inline QT3_SUPPORT QByteArray normalizeSignalSlot(const char *signalSlot)
- { return QMetaObject::normalizedSignature(signalSlot); }
-#endif
-
protected:
QObject(QObjectPrivate &dd, QObject *parent = 0);
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 3968a31bb8..9151e8eb7b 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -157,10 +157,6 @@ public:
void addConnection(int signal, Connection *c);
void cleanConnectionLists();
-#ifdef QT3_SUPPORT
- void sendPendingChildInsertedEvents();
-#endif
-
static inline Sender *setCurrentSender(QObject *receiver,
Sender *sender);
static inline void resetCurrentSender(QObject *receiver,
@@ -190,14 +186,6 @@ public:
Sender *currentSender; // object currently activating the object
mutable quint32 connectedSignals[2];
-#ifdef QT3_SUPPORT
- QVector< QWeakPointer<QObject> > pendingChildInsertedEvents;
-#else
- // preserve binary compatibility with code compiled without Qt 3 support
- // keeping the binary layout stable helps the Qt Creator debugger
- void *unused;
-#endif
-
QList<QPointer<QObject> > eventFilters;
union {
QObject *currentChildBeingDeleted;
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index efce4d5456..705956869d 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -83,9 +83,6 @@ class QString;
#define Q_OVERRIDE(text)
#define Q_ENUMS(x)
#define Q_FLAGS(x)
-#ifdef QT3_SUPPORT
-# define Q_SETS(x)
-#endif
#define Q_SCRIPTABLE
#define Q_INVOKABLE
#define Q_SIGNAL
@@ -188,9 +185,6 @@ private:
#define Q_OVERRIDE(text) Q_OVERRIDE(text)
#define Q_ENUMS(x) Q_ENUMS(x)
#define Q_FLAGS(x) Q_FLAGS(x)
-#ifdef QT3_SUPPORT
-# define Q_SETS(x) Q_SETS(x)
-#endif
/* tmake ignore Q_OBJECT */
#define Q_OBJECT Q_OBJECT
/* tmake ignore Q_OBJECT */
@@ -233,12 +227,6 @@ Q_CORE_EXPORT const char *qFlagLocation(const char *method);
# define SIGNAL(a) "2"#a
#endif
-#ifdef QT3_SUPPORT
-#define METHOD_CODE 0 // member type codes
-#define SLOT_CODE 1
-#define SIGNAL_CODE 2
-#endif
-
#define QMETHOD_CODE 0 // member type codes
#define QSLOT_CODE 1
#define QSIGNAL_CODE 2
@@ -461,10 +449,6 @@ struct Q_CORE_EXPORT QMetaObject
int static_metacall(Call, int, void **) const;
static int metacall(QObject *, Call, int, void **);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT const char *superClassName() const;
-#endif
-
struct { // private data
const QMetaObject *superdata;
const char *stringdata;
@@ -494,11 +478,6 @@ inline const char *QMetaObject::className() const
inline const QMetaObject *QMetaObject::superClass() const
{ return d.superdata; }
-#ifdef QT3_SUPPORT
-inline const char *QMetaObject::superClassName() const
-{ return d.superdata ? d.superdata->className() : 0; }
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp
index 2306450300..665b9e22b5 100644
--- a/src/corelib/kernel/qsignalmapper.cpp
+++ b/src/corelib/kernel/qsignalmapper.cpp
@@ -121,18 +121,6 @@ QSignalMapper::QSignalMapper(QObject* parent)
{
}
-#ifdef QT3_SUPPORT
-/*!
- \overload QSignalMapper()
- \obsolete
- */
-QSignalMapper::QSignalMapper(QObject *parent, const char *name)
- : QObject(*new QSignalMapperPrivate, parent)
-{
- setObjectName(QString::fromAscii(name));
-}
-#endif
-
/*!
Destroys the QSignalMapper.
*/
diff --git a/src/corelib/kernel/qsignalmapper.h b/src/corelib/kernel/qsignalmapper.h
index c28b9df319..72593679a9 100644
--- a/src/corelib/kernel/qsignalmapper.h
+++ b/src/corelib/kernel/qsignalmapper.h
@@ -85,11 +85,6 @@ public Q_SLOTS:
private:
Q_DISABLE_COPY(QSignalMapper)
Q_PRIVATE_SLOT(d_func(), void _q_senderDestroyed())
-
-#ifdef QT3_SUPPORT
-public:
- QT3_SUPPORT_CONSTRUCTOR QSignalMapper(QObject *parent, const char *name);
-#endif
};
#endif // QT_NO_SIGNALMAPPER
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index d59838ba23..5e99d1d483 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -185,40 +185,6 @@ QSocketNotifier::QSocketNotifier(int socket, Type type, QObject *parent)
}
}
-#ifdef QT3_SUPPORT
-/*!
- \obsolete
-
- Use the QSocketNotifier() constructor combined with the
- QObject::setObjectName() function instead.
-
- \oldcode
- QSocketNotifier *notifier = new QSocketNotifier(socket, type, parent, name);
- \newcode
- QSocketNotifier *notifier = new QSocketNotifier(socket, type, parent);
- notifier->setObjectName(name);
- \endcode
-*/
-
-QSocketNotifier::QSocketNotifier(int socket, Type type, QObject *parent,
- const char *name)
- : QObject(parent)
-{
- setObjectName(QString::fromAscii(name));
- if (socket < 0)
- qWarning("QSocketNotifier: Invalid socket specified");
- sockfd = socket;
- sntype = type;
- snenabled = true;
-
- Q_D(QObject);
- if (!d->threadData->eventDispatcher) {
- qWarning("QSocketNotifier: Can only be used with threads started with QThread");
- } else {
- d->threadData->eventDispatcher->registerSocketNotifier(this);
- }
-}
-#endif
/*!
Destroys this socket notifier.
*/
diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h
index 4390d17c62..07dc129825 100644
--- a/src/corelib/kernel/qsocketnotifier.h
+++ b/src/corelib/kernel/qsocketnotifier.h
@@ -59,9 +59,6 @@ public:
enum Type { Read, Write, Exception };
QSocketNotifier(int socket, Type, QObject *parent = 0);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QSocketNotifier(int socket, Type, QObject *parent, const char *name);
-#endif
~QSocketNotifier();
inline int socket() const { return sockfd; }
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 0edcb3b3ac..5870885c63 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -147,18 +147,6 @@ QTimer::QTimer(QObject *parent)
}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a timer called \a name, with a \a parent.
-*/
-
-QTimer::QTimer(QObject *parent, const char *name)
- : QObject(parent), id(INV_TIMER), single(0), nulltimer(0)
-{
- setObjectName(QString::fromAscii(name));
-}
-#endif
-
/*!
Destroys the timer.
*/
@@ -235,24 +223,6 @@ void QTimer::start(int msec)
}
-#ifdef QT3_SUPPORT
-/*! \overload start()
-
- Call setSingleShot(\a sshot) and start(\a msec) instead.
-*/
-
-int QTimer::start(int msec, bool sshot)
-{
- if (id >=0 && nulltimer && !msec && sshot)
- return id;
- stop();
- setInterval(msec);
- setSingleShot(sshot);
- start();
- return timerId();
-}
-#endif
-
/*!
Stops the timer.
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 02f6ba455b..707bc83d3c 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -61,9 +61,6 @@ class Q_CORE_EXPORT QTimer : public QObject
Q_PROPERTY(bool active READ isActive)
public:
explicit QTimer(QObject *parent = 0);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QTimer(QObject *parent, const char *name);
-#endif
~QTimer();
inline bool isActive() const { return id >= 0; }
@@ -83,11 +80,6 @@ public Q_SLOTS:
void start();
void stop();
-#ifdef QT3_SUPPORT
- inline QT_MOC_COMPAT void changeInterval(int msec) { start(msec); }
- QT_MOC_COMPAT int start(int msec, bool sshot);
-#endif
-
Q_SIGNALS:
void timeout();
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index d2554229e2..1b3e06dd69 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -332,18 +332,6 @@ QTranslator::QTranslator(QObject * parent)
{
}
-#ifdef QT3_SUPPORT
-/*!
- \overload QTranslator()
- \obsolete
- */
-QTranslator::QTranslator(QObject * parent, const char * name)
- : QObject(*new QTranslatorPrivate, parent)
-{
- setObjectName(QString::fromAscii(name));
-}
-#endif
-
/*!
Destroys the object and frees any allocated resources.
*/
diff --git a/src/corelib/kernel/qtranslator.h b/src/corelib/kernel/qtranslator.h
index 495137c4cd..0a9bbde953 100644
--- a/src/corelib/kernel/qtranslator.h
+++ b/src/corelib/kernel/qtranslator.h
@@ -61,9 +61,6 @@ class Q_CORE_EXPORT QTranslator : public QObject
Q_OBJECT
public:
explicit QTranslator(QObject *parent = 0);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QTranslator(QObject * parent, const char * name);
-#endif
~QTranslator();
// ### Qt 5: Merge (with "int n = -1")
@@ -85,11 +82,6 @@ public:
const QString & suffix = QString());
bool load(const uchar *data, int len);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT QString find(const char *context, const char *sourceText, const char * comment = 0) const
- { return translate(context, sourceText, comment); }
-#endif
-
private:
Q_DISABLE_COPY(QTranslator)
Q_DECLARE_PRIVATE(QTranslator)
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 7f750b38f2..01e12ee968 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2886,21 +2886,6 @@ void* QVariant::data()
}
-#ifdef QT3_SUPPORT
-/*! \internal
- */
-void *QVariant::castOrDetach(Type t)
-{
- if (d.type != uint(t)) {
- if (!convert(t))
- create(t, 0);
- } else {
- detach();
- }
- return data();
-}
-#endif
-
/*!
Returns true if this is a NULL variant, false otherwise.
*/
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 6aa0fabc2c..e77fc90b92 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -226,13 +226,6 @@ class Q_CORE_EXPORT QVariant
bool canConvert(Type t) const;
bool convert(Type t);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool canCast(Type t) const
- { return canConvert(t); }
- inline QT3_SUPPORT bool cast(Type t)
- { return convert(t); }
-#endif
-
inline bool isValid() const;
bool isNull() const;
@@ -280,27 +273,6 @@ class Q_CORE_EXPORT QVariant
QEasingCurve toEasingCurve() const;
#endif
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT int &asInt();
- inline QT3_SUPPORT uint &asUInt();
- inline QT3_SUPPORT qlonglong &asLongLong();
- inline QT3_SUPPORT qulonglong &asULongLong();
- inline QT3_SUPPORT bool &asBool();
- inline QT3_SUPPORT double &asDouble();
- inline QT3_SUPPORT QByteArray &asByteArray();
- inline QT3_SUPPORT QBitArray &asBitArray();
- inline QT3_SUPPORT QString &asString();
- inline QT3_SUPPORT QStringList &asStringList();
- inline QT3_SUPPORT QDate &asDate();
- inline QT3_SUPPORT QTime &asTime();
- inline QT3_SUPPORT QDateTime &asDateTime();
- inline QT3_SUPPORT QList<QVariant> &asList();
- inline QT3_SUPPORT QMap<QString,QVariant> &asMap();
- inline QT3_SUPPORT QPoint &asPoint();
- inline QT3_SUPPORT QRect &asRect();
- inline QT3_SUPPORT QSize &asSize();
-#endif //QT3_SUPPORT
-
#ifndef QT_NO_DATASTREAM
void load(QDataStream &ds);
void save(QDataStream &ds) const;
@@ -308,12 +280,6 @@ class Q_CORE_EXPORT QVariant
static const char *typeToName(Type type);
static Type nameToType(const char *name);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QVariant(bool val, int) { create(Bool, &val); }
- inline QT3_SUPPORT const QByteArray toCString() const { return toByteArray(); }
- inline QT3_SUPPORT QByteArray &asCString() { return *reinterpret_cast<QByteArray *>(castOrDetach(ByteArray)); }
-#endif
-
void *data();
const void *constData() const;
inline const void *data() const { return constData(); }
@@ -412,9 +378,6 @@ protected:
static const Handler *handler;
void create(int type, const void *copy);
-#ifdef QT3_SUPPORT
- void *castOrDetach(Type t);
-#endif
bool cmp(const QVariant &other) const;
private:
@@ -424,10 +387,6 @@ private:
// force compile error when implicit conversion is not wanted
inline QVariant(const char *) { Q_ASSERT(false); }
#endif
-#ifndef QT3_SUPPORT
- // force compile error, prevent QVariant(QVariant::Type, int) to be called
- inline QVariant(bool, int) { Q_ASSERT(false); }
-#endif
public:
typedef Private DataPtr;
inline DataPtr &data_ptr() { return d; }
@@ -477,45 +436,6 @@ inline void qVariantSetValue<QVariant>(QVariant &v, const QVariant &t)
inline QVariant::QVariant() {}
inline bool QVariant::isValid() const { return d.type != Invalid; }
-#ifdef QT3_SUPPORT
-inline int &QVariant::asInt()
-{ return *reinterpret_cast<int *>(castOrDetach(Int)); }
-inline uint &QVariant::asUInt()
-{ return *reinterpret_cast<uint *>(castOrDetach(UInt)); }
-inline qlonglong &QVariant::asLongLong()
-{ return *reinterpret_cast<qlonglong *>(castOrDetach(LongLong)); }
-inline qulonglong &QVariant::asULongLong()
-{ return *reinterpret_cast<qulonglong *>(castOrDetach(ULongLong)); }
-inline bool &QVariant::asBool()
-{ return *reinterpret_cast<bool *>(castOrDetach(Bool)); }
-inline double &QVariant::asDouble()
-{ return *reinterpret_cast<double *>(castOrDetach(Double)); }
-inline QByteArray& QVariant::asByteArray()
-{ return *reinterpret_cast<QByteArray *>(castOrDetach(ByteArray)); }
-inline QBitArray& QVariant::asBitArray()
-{ return *reinterpret_cast<QBitArray *>(castOrDetach(BitArray)); }
-inline QString& QVariant::asString()
-{ return *reinterpret_cast<QString *>(castOrDetach(String)); }
-inline QStringList& QVariant::asStringList()
-{ return *reinterpret_cast<QStringList *>(castOrDetach(StringList)); }
-inline QDate& QVariant::asDate()
-{ return *reinterpret_cast<QDate *>(castOrDetach(Date)); }
-inline QTime& QVariant::asTime()
-{ return *reinterpret_cast<QTime *>(castOrDetach(Time)); }
-inline QDateTime& QVariant::asDateTime()
-{ return *reinterpret_cast<QDateTime *>(castOrDetach(DateTime)); }
-inline QList<QVariant>& QVariant::asList()
-{ return *reinterpret_cast<QList<QVariant> *>(castOrDetach(List)); }
-inline QMap<QString, QVariant>& QVariant::asMap()
-{ return *reinterpret_cast<QMap<QString, QVariant> *>(castOrDetach(Map)); }
-inline QPoint &QVariant::asPoint()
-{ return *reinterpret_cast<QPoint *>(castOrDetach(Point)); }
-inline QRect &QVariant::asRect()
-{ return *reinterpret_cast<QRect *>(castOrDetach(Rect)); }
-inline QSize &QVariant::asSize()
-{ return *reinterpret_cast<QSize *>(castOrDetach(Size)); }
-#endif //QT3_SUPPORT
-
template<typename T>
inline void QVariant::setValue(const T &avalue)
{ qVariantSetValue(*this, avalue); }
diff --git a/src/corelib/plugin/qlibrary.h b/src/corelib/plugin/qlibrary.h
index 72ba054ec7..0154e949b3 100644
--- a/src/corelib/plugin/qlibrary.h
+++ b/src/corelib/plugin/qlibrary.h
@@ -99,10 +99,6 @@ public:
void setLoadHints(LoadHints hints);
LoadHints loadHints() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QString library() const { return fileName(); }
- inline QT3_SUPPORT void setAutoUnload( bool ) {}
-#endif
private:
QLibraryPrivate *d;
bool did_load;
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 0f3a72d43f..cc667560db 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -76,20 +76,6 @@ public:
void unlock(); //### Qt5: make inline;
inline void unlockInline();
-#if defined(QT3_SUPPORT)
- inline QT3_SUPPORT bool locked()
- {
- if (!tryLock())
- return true;
- unlock();
- return false;
- }
- inline QT3_SUPPORT_CONSTRUCTOR QMutex(bool recursive)
- {
- new (this) QMutex(recursive ? Recursive : NonRecursive);
- }
-#endif
-
private:
void lockInternal();
void unlockInternal();
@@ -217,10 +203,6 @@ public:
static inline void unlock() {}
static inline void unlockInline() {}
-#if defined(QT3_SUPPORT)
- static inline QT3_SUPPORT bool locked() { return false; }
-#endif
-
private:
Q_DISABLE_COPY(QMutex)
};
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index 878a13c882..bc529fd53b 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -116,12 +116,6 @@ protected:
static void msleep(unsigned long);
static void usleep(unsigned long);
-#ifdef QT3_SUPPORT
-public:
- inline QT3_SUPPORT bool finished() const { return isFinished(); }
- inline QT3_SUPPORT bool running() const { return isRunning(); }
-#endif
-
protected:
QThread(QThreadPrivate &dd, QObject *parent = 0);
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 13df3e6fea..461d93dd50 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -93,6 +93,8 @@ inline bool operator<(const QPostEvent &pe, int priority)
return priority < pe.priority;
}
+// This class holds the list of posted events.
+// The list has to be kept sorted by priority
class QPostEventList : public QList<QPostEvent>
{
public:
@@ -109,6 +111,25 @@ public:
inline QPostEventList()
: QList<QPostEvent>(), recursion(0), startOffset(0), insertionOffset(0)
{ }
+
+ void addEvent(const QPostEvent &ev) {
+ int priority = ev.priority;
+ if (isEmpty() || last().priority >= priority) {
+ // optimization: we can simply append if the last event in
+ // the queue has higher or equal priority
+ append(ev);
+ } else {
+ // insert event in descending priority order, using upper
+ // bound for a given priority (to ensure proper ordering
+ // of events with the same priority)
+ QPostEventList::iterator at = qUpperBound(begin() + insertionOffset, end(), priority);
+ insert(at, ev);
+ }
+ }
+private:
+ //hides because they do not keep that list sorted. addEvent must be used
+ using QList<QPostEvent>::append;
+ using QList<QPostEvent>::insert;
};
#ifndef QT_NO_THREAD
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 2cb79c3f51..9f54f1a831 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -110,19 +110,6 @@ Q_CORE_EXPORT int qstrnicmp(const char *, const char *, uint len);
Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...);
-#ifdef QT3_SUPPORT
-inline QT3_SUPPORT void *qmemmove(void *dst, const void *src, uint len)
-{ return memmove(dst, src, len); }
-inline QT3_SUPPORT uint cstrlen(const char *str)
-{ return uint(strlen(str)); }
-inline QT3_SUPPORT char *cstrcpy(char *dst, const char *src)
-{ return qstrcpy(dst,src); }
-inline QT3_SUPPORT int cstrcmp(const char *str1, const char *str2)
-{ return strcmp(str1,str2); }
-inline QT3_SUPPORT int cstrncmp(const char *str1, const char *str2, uint len)
-{ return strncmp(str1,str2,len); }
-#endif
-
// qChecksum: Internet checksum
Q_CORE_EXPORT quint16 qChecksum(const char *s, uint len);
@@ -234,13 +221,6 @@ public:
QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QByteArray leftJustify(uint width, char aFill = ' ', bool aTruncate = false) const
- { return leftJustified(int(width), aFill, aTruncate); }
- inline QT3_SUPPORT QByteArray rightJustify(uint width, char aFill = ' ', bool aTruncate = false) const
- { return rightJustified(int(width), aFill, aTruncate); }
-#endif
-
QByteArray &prepend(char c);
QByteArray &prepend(const char *s);
QByteArray &prepend(const char *s, int len);
@@ -356,29 +336,6 @@ public:
int length() const { return d->size; }
bool isNull() const;
- // compatibility
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QByteArray(int size);
- inline QT3_SUPPORT QByteArray& duplicate(const QByteArray& a) { *this = a; return *this; }
- inline QT3_SUPPORT QByteArray& duplicate(const char *a, uint n)
- { *this = QByteArray(a, n); return *this; }
- inline QT3_SUPPORT void resetRawData(const char *, uint) { clear(); }
- inline QT3_SUPPORT QByteArray lower() const { return toLower(); }
- inline QT3_SUPPORT QByteArray upper() const { return toUpper(); }
- inline QT3_SUPPORT QByteArray stripWhiteSpace() const { return trimmed(); }
- inline QT3_SUPPORT QByteArray simplifyWhiteSpace() const { return simplified(); }
- inline QT3_SUPPORT int find(char c, int from = 0) const { return indexOf(c, from); }
- inline QT3_SUPPORT int find(const char *c, int from = 0) const { return indexOf(c, from); }
- inline QT3_SUPPORT int find(const QByteArray &ba, int from = 0) const { return indexOf(ba, from); }
- inline QT3_SUPPORT int findRev(char c, int from = -1) const { return lastIndexOf(c, from); }
- inline QT3_SUPPORT int findRev(const char *c, int from = -1) const { return lastIndexOf(c, from); }
- inline QT3_SUPPORT int findRev(const QByteArray &ba, int from = -1) const { return lastIndexOf(ba, from); }
-#ifndef QT_NO_CAST_TO_ASCII
- QT3_SUPPORT int find(const QString &s, int from = 0) const;
- QT3_SUPPORT int findRev(const QString &s, int from = -1) const;
-#endif
-#endif
-
private:
operator QNoImplicitBoolCast() const;
static Data shared_null;
@@ -438,10 +395,6 @@ inline bool QByteArray::isDetached() const
{ return d->ref == 1; }
inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
{ d->ref.ref(); }
-#ifdef QT3_SUPPORT
-inline QByteArray::QByteArray(int aSize) : d(&shared_null)
-{ d->ref.ref(); if (aSize > 0) fill('\0', aSize); }
-#endif
inline int QByteArray::capacity() const
{ return d->alloc; }
diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h
index 16861c9869..c42a908f5c 100644
--- a/src/corelib/tools/qcache.h
+++ b/src/corelib/tools/qcache.h
@@ -96,10 +96,6 @@ class QCache
public:
inline explicit QCache(int maxCost = 100);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QCache(int maxCost, int /* dummy */)
- : f(0), l(0), mx(maxCost), total(0) {}
-#endif
inline ~QCache() { clear(); }
inline int maxCost() const { return mx; }
@@ -123,11 +119,6 @@ public:
private:
void trim(int m);
-
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT T *find(const Key &key) const { return object(key); }
-#endif
-
};
template <class Key, class T>
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 3ec53bd18e..b7793403bd 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -89,13 +89,6 @@ public:
ObjectReplacementCharacter = 0xfffc,
ByteOrderMark = 0xfeff,
ByteOrderSwapped = 0xfffe,
-#ifdef QT3_SUPPORT
- null = Null,
- replacement = ReplacementCharacter,
- byteOrderMark = ByteOrderMark,
- byteOrderSwapped = ByteOrderSwapped,
- nbsp = Nbsp,
-#endif
ParagraphSeparator = 0x2029,
LineSeparator = 0x2028
};
@@ -173,10 +166,6 @@ public:
Square,
Compat,
Fraction
-
-#ifdef QT3_SUPPORT
- , Single = NoDecomposition
-#endif
};
enum Joining
@@ -338,22 +327,6 @@ public:
static QString QT_FASTCALL decomposition(uint ucs4);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool mirrored() const { return hasMirrored(); }
- inline QT3_SUPPORT QChar lower() const { return toLower(); }
- inline QT3_SUPPORT QChar upper() const { return toUpper(); }
- static inline QT3_SUPPORT bool networkOrdered() {
- return QSysInfo::ByteOrder == QSysInfo::BigEndian;
- }
-#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
- inline QT3_SUPPORT const char latin1() const { return toLatin1(); }
- inline QT3_SUPPORT const char ascii() const { return toAscii(); }
-#else
- inline QT3_SUPPORT char latin1() const { return toLatin1(); }
- inline QT3_SUPPORT char ascii() const { return toAscii(); }
-#endif
-#endif
-
private:
#ifdef QT_NO_CAST_FROM_ASCII
QChar(char c);
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index be14df7841..62bdcab7cc 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -76,10 +76,6 @@ public:
int weekNumber(int *yearNum = 0) const;
#ifndef QT_NO_TEXTDATE
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QString monthName(int month) { return shortMonthName(month); }
- static QT3_SUPPORT QString dayName(int weekday) { return shortDayName(weekday); }
-#endif
// ### Qt 5: merge these functions.
static QString shortMonthName(int month);
static QString shortMonthName(int month, MonthNameType type);
@@ -118,18 +114,11 @@ public:
#endif
static bool isValid(int y, int m, int d);
static bool isLeapYear(int year);
-#ifdef QT3_SUPPORT
- inline static QT3_SUPPORT bool leapYear(int year) { return isLeapYear(year); }
-#endif
// ### Qt 5: remove these two functions
static uint gregorianToJulian(int y, int m, int d);
static void julianToGregorian(uint jd, int &y, int &m, int &d);
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QDate currentDate(Qt::TimeSpec spec);
-#endif
-
static inline QDate fromJulianDay(int jd) { QDate d; d.jd = jd; return d; }
inline int toJulianDay() const { return jd; }
@@ -187,10 +176,6 @@ public:
#endif
static bool isValid(int h, int m, int s, int ms = 0);
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QTime currentTime(Qt::TimeSpec spec);
-#endif
-
void start();
int restart();
int elapsed() const;
@@ -273,21 +258,6 @@ public:
static QDateTime fromMSecsSinceEpoch(qint64 msecs);
static qint64 currentMSecsSinceEpoch();
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void setTime_t(uint secsSince1Jan1970UTC, Qt::TimeSpec spec) {
- setTime_t(secsSince1Jan1970UTC);
- if (spec == Qt::UTC)
- *this = toUTC();
- }
- static inline QT3_SUPPORT QDateTime currentDateTime(Qt::TimeSpec spec) {
- if (spec == Qt::LocalTime)
- return currentDateTime();
- else
- return currentDateTime().toUTC();
- }
-
-#endif
-
private:
friend class QDateTimePrivate;
void detach();
@@ -300,24 +270,6 @@ private:
};
Q_DECLARE_TYPEINFO(QDateTime, Q_MOVABLE_TYPE);
-#ifdef QT3_SUPPORT
-inline QDate QDate::currentDate(Qt::TimeSpec spec)
-{
- if (spec == Qt::LocalTime)
- return currentDate();
- else
- return QDateTime::currentDateTime().toUTC().date();
-}
-
-inline QTime QTime::currentTime(Qt::TimeSpec spec)
-{
- if (spec == Qt::LocalTime)
- return currentTime();
- else
- return QDateTime::currentDateTime().toUTC().time();
-}
-#endif
-
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDate &);
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDate &);
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 18afb29e9e..9f2834a7d7 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -227,21 +227,6 @@ public:
{ std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
-#ifdef QT3_SUPPORT
- // compatibility
- inline QT3_SUPPORT iterator remove(iterator pos) { return erase(pos); }
- inline QT3_SUPPORT int findIndex(const T& t) const
- { int i=0; for (const_iterator it = begin(); it != end(); ++it, ++i) if(*it == t) return i; return -1;}
- inline QT3_SUPPORT iterator find(iterator from, const T& t)
- { while (from != end() && !(*from == t)) ++from; return from; }
- inline QT3_SUPPORT iterator find(const T& t)
- { return find(begin(), t); }
- inline QT3_SUPPORT const_iterator find(const_iterator from, const T& t) const
- { while (from != end() && !(*from == t)) ++from; return from; }
- inline QT3_SUPPORT const_iterator find(const T& t) const
- { return find(begin(), t); }
-#endif
-
// comfort
QLinkedList<T> &operator+=(const QLinkedList<T> &l);
QLinkedList<T> operator+(const QLinkedList<T> &l) const;
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 4eb05d63b6..f8f62cc8b2 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -310,20 +310,6 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT iterator remove(iterator pos) { return erase(pos); }
- inline QT3_SUPPORT int remove(const T &t) { return removeAll(t); }
- inline QT3_SUPPORT int findIndex(const T& t) const { return indexOf(t); }
- inline QT3_SUPPORT iterator find(const T& t)
- { int i = indexOf(t); return (i == -1 ? end() : (begin()+i)); }
- inline QT3_SUPPORT const_iterator find (const T& t) const
- { int i = indexOf(t); return (i == -1 ? end() : (begin()+i)); }
- inline QT3_SUPPORT iterator find(iterator from, const T& t)
- { int i = indexOf(t, from - begin()); return i == -1 ? end() : begin()+i; }
- inline QT3_SUPPORT const_iterator find(const_iterator from, const T& t) const
- { int i = indexOf(t, from - begin()); return i == -1 ? end() : begin()+i; }
-#endif
-
// comfort
QList<T> &operator+=(const QList<T> &l);
inline QList<T> operator+(const QList<T> &l) const
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 39b3eb8af1..36d8eefbdb 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -249,9 +249,6 @@ public:
inline const Key &key() const { return concrete(i)->key; }
inline T &value() const { return concrete(i)->value; }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT T &data() const { return concrete(i)->value; }
-#endif
inline T &operator*() const { return concrete(i)->value; }
inline T *operator->() const { return &concrete(i)->value; }
inline bool operator==(const iterator &o) const { return i == o.i; }
@@ -323,9 +320,6 @@ public:
inline const Key &key() const { return concrete(i)->key; }
inline const T &value() const { return concrete(i)->value; }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT const T &data() const { return concrete(i)->value; }
-#endif
inline const T &operator*() const { return concrete(i)->value; }
inline const T *operator->() const { return &concrete(i)->value; }
inline bool operator==(const const_iterator &o) const { return i == o.i; }
@@ -379,10 +373,6 @@ public:
inline const_iterator end() const { return const_iterator(e); }
inline const_iterator constEnd() const { return const_iterator(e); }
iterator erase(iterator it);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT iterator remove(iterator it) { return erase(it); }
- inline QT3_SUPPORT void erase(const Key &aKey) { remove(aKey); }
-#endif
// more Qt
typedef iterator Iterator;
@@ -396,13 +386,7 @@ public:
iterator upperBound(const Key &key);
const_iterator upperBound(const Key &key) const;
iterator insert(const Key &key, const T &value);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT iterator insert(const Key &key, const T &value, bool overwrite);
-#endif
iterator insertMulti(const Key &key, const T &value);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT iterator replace(const Key &aKey, const T &aValue) { return insert(aKey, aValue); }
-#endif
QMap<Key, T> &unite(const QMap<Key, T> &other);
// STL compatibility
@@ -571,26 +555,6 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key
return iterator(node);
}
-#ifdef QT3_SUPPORT
-template <class Key, class T>
-Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key &akey,
- const T &avalue,
- bool aoverwrite)
-{
- detach();
-
- QMapData::Node *update[QMapData::LastLevel + 1];
- QMapData::Node *node = mutableFindNode(update, akey);
- if (node == e) {
- node = node_create(d, update, akey, avalue);
- } else {
- if (aoverwrite)
- concrete(node)->value = avalue;
- }
- return iterator(node);
-}
-#endif
-
template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &akey,
const T &avalue)
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index cbed04f628..5d6db9867e 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -73,15 +73,6 @@ public:
int bottom() const;
QRect normalized() const;
-#ifdef QT3_SUPPORT
- QT3_SUPPORT int &rLeft() { return x1; }
- QT3_SUPPORT int &rTop() { return y1; }
- QT3_SUPPORT int &rRight() { return x2; }
- QT3_SUPPORT int &rBottom() { return y2; }
-
- QT3_SUPPORT QRect normalize() const { return normalized(); }
-#endif
-
int x() const;
int y() const;
void setLeft(int pos);
@@ -120,18 +111,10 @@ public:
void moveTo(int x, int t);
void moveTo(const QPoint &p);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT void moveBy(int dx, int dy) { translate(dx, dy); }
- QT3_SUPPORT void moveBy(const QPoint &p) { translate(p); }
-#endif
-
void setRect(int x, int y, int w, int h);
inline void getRect(int *x, int *y, int *w, int *h) const;
void setCoords(int x1, int y1, int x2, int y2);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT void addCoords(int x1, int y1, int x2, int y2);
-#endif
inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
inline void adjust(int x1, int y1, int x2, int y2);
@@ -162,12 +145,6 @@ public:
friend Q_CORE_EXPORT_INLINE bool operator==(const QRect &, const QRect &);
friend Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void rect(int *x, int *y, int *w, int *h) const { getRect(x, y, w, h); }
- inline QT3_SUPPORT void coords(int *ax1, int *ay1, int *ax2, int *ay2) const
- { getCoords(ax1, ay1, ax2, ay2); }
-#endif
-
private:
#if defined(Q_WS_X11)
friend void qt_setCoords(QRect *r, int xp1, int yp1, int xp2, int yp2);
@@ -421,13 +398,6 @@ inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2)
y2 = yp2;
}
-#ifdef QT3_SUPPORT
-inline void QRect::addCoords(int dx1, int dy1, int dx2, int dy2)
-{
- adjust(dx1, dy1, dx2, dy2);
-}
-#endif
-
inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h
index 12e42a95b7..4ce2f6e0be 100644
--- a/src/corelib/tools/qregexp.h
+++ b/src/corelib/tools/qregexp.h
@@ -45,9 +45,6 @@
#ifndef QT_NO_REGEXP
#include <QtCore/qstring.h>
-#ifdef QT3_SUPPORT
-#include <new>
-#endif
QT_BEGIN_HEADER
@@ -91,37 +88,16 @@ public:
void setPattern(const QString &pattern);
Qt::CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(Qt::CaseSensitivity cs);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool caseSensitive() const { return caseSensitivity() == Qt::CaseSensitive; }
- inline QT3_SUPPORT void setCaseSensitive(bool sensitive)
- { setCaseSensitivity(sensitive ? Qt::CaseSensitive : Qt::CaseInsensitive); }
-#endif
PatternSyntax patternSyntax() const;
void setPatternSyntax(PatternSyntax syntax);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool wildcard() const { return patternSyntax() == Wildcard; }
- inline QT3_SUPPORT void setWildcard(bool aWildcard)
- { setPatternSyntax(aWildcard ? Wildcard : RegExp); }
-#endif
bool isMinimal() const;
void setMinimal(bool minimal);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool minimal() const { return isMinimal(); }
-#endif
bool exactMatch(const QString &str) const;
int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT int search(const QString &str, int from = 0,
- CaretMode caretMode = CaretAtZero) const
- { return indexIn(str, from, caretMode); }
- inline QT3_SUPPORT int searchRev(const QString &str, int from = -1,
- CaretMode caretMode = CaretAtZero) const
- { return lastIndexIn(str, from, caretMode); }
-#endif
int matchedLength() const;
#ifndef QT_NO_REGEXP_CAPTURE
#ifdef QT_DEPRECATED
@@ -140,15 +116,6 @@ public:
static QString escape(const QString &str);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QRegExp(const QString &aPattern, bool cs, bool aWildcard = false)
- {
- new (this)
- QRegExp(aPattern, cs ? Qt::CaseSensitive : Qt::CaseInsensitive,
- aWildcard ? Wildcard : RegExp);
- }
-#endif
-
private:
QRegExpPrivate *priv;
};
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index b15bcacd97..a24f62e7ba 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -208,8 +208,10 @@ 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 = 0, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
+ explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
: QScopedPointer<T, Cleanup>(p)
{
}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index e27afb8586..afb396ce50 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -102,10 +102,6 @@ QT_BEGIN_NAMESPACE
QTextCodec *QString::codecForCStrings;
#endif
-#ifdef QT3_SUPPORT
-static QHash<void *, QByteArray> *asciiCache = 0;
-#endif
-
#ifdef QT_USE_ICU
// qlocale_icu.cpp
extern bool qt_ucol_strcoll(const QChar *source, int sourceLength, const QChar *target, int targetLength, int *result);
@@ -802,9 +798,9 @@ const QString::Null QString::null = { };
*/
QString::Data QString::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1),
- 0, 0, shared_null.array, 0, 0, 0, 0, 0, 0, {0} };
+ 0, 0, shared_null.array, 0, 0, 0, 0, 0, {0} };
QString::Data QString::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1),
- 0, 0, shared_empty.array, 0, 0, 0, 0, 0, 0, {0} };
+ 0, 0, shared_empty.array, 0, 0, 0, 0, 0, {0} };
int QString::grow(int size)
{
@@ -1058,7 +1054,7 @@ QString::QString(const QChar *unicode, int size)
Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
memcpy(d->array, unicode, size * sizeof(QChar));
d->array[size] = '\0';
@@ -1091,7 +1087,7 @@ QString::QString(const QChar *unicode)
Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
memcpy(d->array, unicode, size * sizeof(QChar));
d->array[size] = '\0';
@@ -1116,7 +1112,7 @@ QString::QString(int size, QChar ch)
Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
d->array[size] = '\0';
ushort *i = d->array + size;
@@ -1139,7 +1135,7 @@ QString::QString(int size, Qt::Initialization)
Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
d->array[size] = '\0';
}
@@ -1161,7 +1157,7 @@ QString::QString(QChar ch)
d = reinterpret_cast<Data *>(buf);
d->ref = 1;
d->alloc = d->size = 1;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
d->array[0] = ch.unicode();
d->array[1] = '\0';
@@ -1222,12 +1218,6 @@ QString::QString(QChar ch)
// ### Qt 5: rename freeData() to avoid confusion. See task 197625.
void QString::free(Data *d)
{
-#ifdef QT3_SUPPORT
- if (d->asciiCache) {
- Q_ASSERT(asciiCache);
- asciiCache->remove(d);
- }
-#endif
qFree(d);
}
@@ -1344,7 +1334,6 @@ void QString::realloc(int alloc)
x->size = qMin(alloc, d->size);
::memcpy(x->array, d->data, x->size * sizeof(QChar));
x->array[x->size] = 0;
- x->asciiCache = 0;
x->ref = 1;
x->alloc = alloc;
x->clean = d->clean;
@@ -1356,12 +1345,6 @@ void QString::realloc(int alloc)
QString::free(d);
d = x;
} else {
-#ifdef QT3_SUPPORT
- if (d->asciiCache) {
- Q_ASSERT(asciiCache);
- asciiCache->remove(d);
- }
-#endif
Data *p = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar)));
Q_CHECK_PTR(p);
d = p;
@@ -3794,7 +3777,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
d->data = d->array;
d->array[size] = '\0';
ushort *dst = d->data;
@@ -3868,44 +3851,6 @@ QString QString::fromLatin1(const char *str, int size)
}
-#ifdef QT3_SUPPORT
-
-/*!
- \internal
-*/
-const char *QString::ascii_helper() const
-{
- if (!asciiCache)
- asciiCache = new QHash<void *, QByteArray>();
-
- d->asciiCache = true;
- QByteArray ascii = toAscii();
- QByteArray old = asciiCache->value(d);
- if (old == ascii)
- return old.constData();
- asciiCache->insert(d, ascii);
- return ascii.constData();
-}
-
-/*!
- \internal
-*/
-const char *QString::latin1_helper() const
-{
- if (!asciiCache)
- asciiCache = new QHash<void *, QByteArray>();
-
- d->asciiCache = true;
- QByteArray ascii = toLatin1();
- QByteArray old = asciiCache->value(d);
- if (old == ascii)
- return old.constData();
- asciiCache->insert(d, ascii);
- return ascii.constData();
-}
-
-#endif
-
/*!
Returns a QString initialized with the first \a size characters
of the 8-bit string \a str.
@@ -4636,25 +4581,16 @@ QString& QString::fill(QChar ch, int size)
sensitivity setting \a cs.
*/
+
/*!
\overload compare()
+ \since 4.2
Lexically compares this string with the \a other string and
returns an integer less than, equal to, or greater than zero if
this string is less than, equal to, or greater than the other
string.
- Equivalent to \c {compare(*this, other)}.
-*/
-int QString::compare(const QString &other) const
-{
- return ucstrcmp(constData(), length(), other.constData(), other.length());
-}
-
-/*!
- \overload compare()
- \since 4.2
-
Same as compare(*this, \a other, \a cs).
*/
int QString::compare(const QString &other, Qt::CaseSensitivity cs) const
@@ -7196,7 +7132,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
x->ref = 1;
x->alloc = x->size = size;
*x->array = '\0';
- x->clean = x->asciiCache = x->simpletext = x->righttoleft = x->capacity = 0;
+ x->clean = x->simpletext = x->righttoleft = x->capacity = 0;
return QString(x, 0);
}
@@ -7219,12 +7155,6 @@ QString &QString::setRawData(const QChar *unicode, int size)
if (d->ref != 1 || (d->data == d->array && d->alloc)) {
*this = fromRawData(unicode, size);
} else {
-#ifdef QT3_SUPPORT
- if (d->asciiCache) {
- Q_ASSERT(asciiCache);
- asciiCache->remove(d);
- }
-#endif
if (unicode) {
d->data = (ushort *)unicode;
} else {
@@ -7233,7 +7163,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
}
d->alloc = d->size = size;
*d->array = '\0';
- d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->clean = d->simpletext = d->righttoleft = d->capacity = 0;
}
return *this;
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index c61d09e37d..154012d132 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -46,9 +46,6 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qatomic.h>
#include <QtCore/qnamespace.h>
-#ifdef QT_INCLUDE_COMPAT
-#include <Qt3Support/q3cstring.h>
-#endif
#ifndef QT_NO_STL
# include <string>
@@ -340,16 +337,10 @@ public:
QString &setUnicode(const QChar *unicode, int size);
inline QString &setUtf16(const ushort *utf16, int size);
- // ### Qt 5: merge these two functions
- int compare(const QString &s) const;
- int compare(const QString &s, Qt::CaseSensitivity cs) const;
-
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- // ### Qt 5: merge these two functions
- static inline int compare(const QString &s1, const QString &s2)
- { return s1.compare(s2); }
- static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
+ static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
{ return s1.compare(s2, cs); }
static inline int compare(const QString& s1, const QLatin1String &s2,
@@ -504,86 +495,6 @@ public:
inline QString &operator=(const Null &) { *this = QString(); return *this; }
inline bool isNull() const { return d == &shared_null; }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT const char *ascii() const { return ascii_helper(); }
- inline QT3_SUPPORT const char *latin1() const { return latin1_helper(); }
- inline QT3_SUPPORT QByteArray utf8() const { return toUtf8(); }
- inline QT3_SUPPORT QByteArray local8Bit() const{ return toLocal8Bit(); }
- inline QT3_SUPPORT void setLength(int nl) { resize(nl); }
- inline QT3_SUPPORT QString copy() const { return *this; }
- inline QT3_SUPPORT QString &remove(QChar c, bool cs)
- { return remove(c, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT QString &remove(const QString &s, bool cs)
- { return remove(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT QString &replace(QChar c, const QString &after, bool cs)
- { return replace(c, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT QString &replace(const QString &before, const QString &after, bool cs)
- { return replace(before, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
-#ifndef QT_NO_CAST_FROM_ASCII
- inline QT3_SUPPORT QString &replace(char c, const QString &after, bool cs)
- { return replace(QChar::fromAscii(c), after, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
- // strange overload, required to avoid GCC 3.3 error
- inline QT3_SUPPORT QString &replace(char c, const QString &after, Qt::CaseSensitivity cs)
- { return replace(QChar::fromAscii(c), after, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
-#endif
- inline QT3_SUPPORT int find(QChar c, int i = 0, bool cs = true) const
- { return indexOf(c, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT int find(const QString &s, int i = 0, bool cs = true) const
- { return indexOf(s, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT int findRev(QChar c, int i = -1, bool cs = true) const
- { return lastIndexOf(c, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT int findRev(const QString &s, int i = -1, bool cs = true) const
- { return lastIndexOf(s, i, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
-#ifndef QT_NO_REGEXP
- inline QT3_SUPPORT int find(const QRegExp &rx, int i=0) const
- { return indexOf(rx, i); }
- inline QT3_SUPPORT int findRev(const QRegExp &rx, int i=-1) const
- { return lastIndexOf(rx, i); }
- inline QT3_SUPPORT int find(QRegExp &rx, int i=0) const
- { return indexOf(rx, i); }
- inline QT3_SUPPORT int findRev(QRegExp &rx, int i=-1) const
- { return lastIndexOf(rx, i); }
-#endif
- inline QT3_SUPPORT QBool contains(QChar c, bool cs) const
- { return contains(c, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT QBool contains(const QString &s, bool cs) const
- { return contains(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT bool startsWith(const QString &s, bool cs) const
- { return startsWith(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT bool endsWith(const QString &s, bool cs) const
- { return endsWith(s, cs?Qt::CaseSensitive:Qt::CaseInsensitive); }
- inline QT3_SUPPORT QChar constref(uint i) const
- { return at(i); }
- QT3_SUPPORT QChar &ref(uint i);
- inline QT3_SUPPORT QString leftJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const
- { return leftJustified(width, aFill, trunc); }
- inline QT3_SUPPORT QString rightJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const
- { return rightJustified(width, aFill, trunc); }
- inline QT3_SUPPORT QString lower() const { return toLower(); }
- inline QT3_SUPPORT QString upper() const { return toUpper(); }
- inline QT3_SUPPORT QString stripWhiteSpace() const { return trimmed(); }
- inline QT3_SUPPORT QString simplifyWhiteSpace() const { return simplified(); }
- inline QT3_SUPPORT QString &setUnicodeCodes(const ushort *unicode_as_ushorts, int aSize)
- { return setUtf16(unicode_as_ushorts, aSize); }
- inline QT3_SUPPORT const ushort *ucs2() const { return utf16(); }
- inline static QT3_SUPPORT QString fromUcs2(const ushort *unicode, int size = -1)
- { return fromUtf16(unicode, size); }
- inline QT3_SUPPORT QString &setAscii(const char *str, int len = -1)
- { *this = fromAscii(str, len); return *this; }
- inline QT3_SUPPORT QString &setLatin1(const char *str, int len = -1)
- { *this = fromLatin1(str, len); return *this; }
-protected:
- friend class QObject;
- const char *ascii_helper() const;
- const char *latin1_helper() const;
-public:
-#ifndef QT_NO_CAST_TO_ASCII
- inline QT3_SUPPORT operator const char *() const { return ascii_helper(); }
-private:
- QT3_SUPPORT operator QNoImplicitBoolCast() const;
-public:
-#endif
-#endif
bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
bool isRightToLeft() const;
@@ -607,7 +518,6 @@ private:
ushort clean : 1;
ushort simpletext : 1;
ushort righttoleft : 1;
- ushort asciiCache : 1;
ushort capacity : 1;
ushort reserved : 11;
// ### Qt5: try to ensure that "array" is aligned to 16 bytes on both 32- and 64-bit
@@ -857,18 +767,6 @@ public:
#endif
ushort& unicode() { return s.data()[i].unicode(); }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT bool mirrored() const { return hasMirrored(); }
- inline QT3_SUPPORT QChar lower() const { return QChar(*this).toLower(); }
- inline QT3_SUPPORT QChar upper() const { return QChar(*this).toUpper(); }
-#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
- const QT3_SUPPORT char latin1() const { return QChar(*this).toLatin1(); }
- const QT3_SUPPORT char ascii() const { return QChar(*this).toAscii(); }
-#else
- QT3_SUPPORT char latin1() const { return QChar(*this).toLatin1(); }
- QT3_SUPPORT char ascii() const { return QChar(*this).toAscii(); }
-#endif
-#endif
};
inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
@@ -1008,12 +906,6 @@ inline int QByteArray::indexOf(const QString &s, int from) const
{ return indexOf(s.toAscii(), from); }
inline int QByteArray::lastIndexOf(const QString &s, int from) const
{ return lastIndexOf(s.toAscii(), from); }
-# ifdef QT3_SUPPORT
-inline int QByteArray::find(const QString &s, int from) const
-{ return indexOf(s.toAscii(), from); }
-inline int QByteArray::findRev(const QString &s, int from) const
-{ return lastIndexOf(s.toAscii(), from); }
-# endif // QT3_SUPPORT
#endif // QT_NO_CAST_TO_ASCII
#if !defined(QT_USE_FAST_OPERATOR_PLUS) && !defined(QT_USE_QSTRINGBUILDER)
@@ -1066,30 +958,11 @@ inline QString QString::fromStdWString(const QStdWString &s)
# endif
#endif
-#ifdef QT3_SUPPORT
-inline QChar &QString::ref(uint i)
-{
- if (int(i) > d->size || d->ref != 1)
- resize(qMax(int(i), d->size));
- return reinterpret_cast<QChar&>(d->data[i]);
-}
-#endif
-
#if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &);
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QString &);
#endif
-#ifdef QT3_SUPPORT
-class QConstString : public QString
-{
-public:
- inline QT3_SUPPORT_CONSTRUCTOR QConstString(const QChar *aUnicode, int aSize)
- :QString(aUnicode, aSize){} // cannot use fromRawData() due to changed semantics
- inline QT3_SUPPORT const QString &string() const { return *this; }
-};
-#endif
-
Q_DECLARE_TYPEINFO(QString, Q_MOVABLE_TYPE);
Q_DECLARE_SHARED(QString)
Q_DECLARE_OPERATORS_FOR_FLAGS(QString::SectionFlags)
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 45de6bc1c3..1cc7e5d2c3 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -162,6 +162,8 @@ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out
}
#endif
if (len == -1) {
+ if (!a)
+ return;
while (*a)
*out++ = QLatin1Char(*a++);
} else {
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 709d84a578..594ab2f183 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -352,6 +352,8 @@ template <> struct QConcatenable<const char *> : private QAbstractConcatenable
#endif
static inline void appendTo(const char *a, char *&out)
{
+ if (!a)
+ return;
while (*a)
*out++ = *a++;
}
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 8b47137fd8..44cc692b2f 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -234,42 +234,6 @@ void QtPrivate::QStringList_sort(QStringList *that)
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QStringList QStringList::split(const QChar &sep, const QString &str, bool allowEmptyEntries)
-
- \overload
-
- This version of the function uses a QChar as separator.
-
- \sa join() QString::section()
-*/
-
-/*!
- \fn QStringList QStringList::split(const QString &sep, const QString &str, bool allowEmptyEntries)
-
- \overload
-
- This version of the function uses a QString as separator.
-
- \sa join() QString::section()
-*/
-#ifndef QT_NO_REGEXP
-/*!
- \fn QStringList QStringList::split(const QRegExp &sep, const QString &str, bool allowEmptyEntries)
-
- Use QString::split(\a sep, QString::SkipEmptyParts) or
- QString::split(\a sep, QString::KeepEmptyParts) instead.
-
- Be aware that the QString::split()'s return value is a
- QStringList that always contains at least one element, even if \a
- str is empty.
-
- \sa join() QString::section()
-*/
-#endif
-#endif // QT3_SUPPORT
-
/*!
\fn QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 2159512b20..efb7f46c9b 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -48,9 +48,6 @@
#include <QtCore/qregexp.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringmatcher.h>
-#ifdef QT_INCLUDE_COMPAT
-#include <Qt3Support/q3valuelist.h>
-#endif
QT_BEGIN_HEADER
@@ -108,24 +105,6 @@ public:
inline int lastIndexOf(const QString &str, int from = -1) const
{ return QList<QString>::lastIndexOf(str, from); }
#endif
-#ifdef QT3_SUPPORT
- static inline QT3_SUPPORT QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries = false);
- static inline QT3_SUPPORT QStringList split(const QChar &sep, const QString &str, bool allowEmptyEntries = false);
- inline QT3_SUPPORT QStringList grep(const QString &str, bool cs = true) const
- { return filter(str, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
-
-#ifndef QT_NO_REGEXP
- static inline QT3_SUPPORT QStringList split(const QRegExp &sep, const QString &str, bool allowEmptyEntries = false);
- inline QT3_SUPPORT QStringList grep(const QRegExp &rx) const { return filter(rx); }
- inline QT3_SUPPORT QStringList &gres(const QRegExp &rx, const QString &after)
- { return replaceInStrings(rx, after); }
-#endif
- inline QT3_SUPPORT QStringList &gres(const QString &before, const QString &after, bool cs = true)
- { return replaceInStrings(before, after, cs ? Qt::CaseSensitive : Qt::CaseInsensitive); }
-
- inline Iterator QT3_SUPPORT fromLast() { return (isEmpty() ? end() : --end()); }
- inline ConstIterator QT3_SUPPORT fromLast() const { return (isEmpty() ? end() : --end()); }
-#endif
};
namespace QtPrivate {
@@ -214,36 +193,6 @@ inline int QStringList::lastIndexOf(QRegExp &rx, int from) const
#endif
-#ifdef QT3_SUPPORT
-inline QStringList QStringList::split(const QChar &sep, const QString &str, bool allowEmptyEntries)
-{
- if (str.isEmpty())
- return QStringList();
- return str.split(sep, allowEmptyEntries ? QString::KeepEmptyParts
- : QString::SkipEmptyParts);
-}
-
-inline QStringList QStringList::split(const QString &sep, const QString &str, bool allowEmptyEntries)
-{
- if (str.isEmpty())
- return QStringList();
- return str.split(sep, allowEmptyEntries ? QString::KeepEmptyParts
- : QString::SkipEmptyParts);
-}
-
-#ifndef QT_NO_REGEXP
-inline QStringList QStringList::split(const QRegExp &sep, const QString &str, bool allowEmptyEntries)
-{
- if (str.isEmpty())
- return QStringList();
- return str.split(sep, allowEmptyEntries ? QString::KeepEmptyParts
- : QString::SkipEmptyParts);
-}
-#endif // QT_NO_REGEXP
-
-#endif // QT3_SUPPORT
-
-
#ifndef QT_NO_DATASTREAM
inline QDataStream &operator>>(QDataStream &in, QStringList &list)
{