summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.h5
-rw-r--r--src/corelib/global/qnamespace.qdoc28
-rw-r--r--src/corelib/io/qdatastream.h6
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp4
-rw-r--r--src/corelib/io/qtextstream.cpp77
-rw-r--r--src/corelib/kernel/qcoreevent.cpp1
-rw-r--r--src/corelib/kernel/qcoreevent.h4
7 files changed, 83 insertions, 42 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 741c06f..473398b 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1627,6 +1627,11 @@ public:
NavigationModeCursorAuto,
NavigationModeCursorForceVisible
};
+
+ enum RenderHint {
+ QualityHint,
+ PerformanceHint
+ };
}
#ifdef Q_MOC_RUN
;
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 40dd1d2..684ebca 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2776,6 +2776,19 @@
*/
/*!
+ \enum Qt::CoordinateSystem
+ \since 4.6
+
+ This enum specifies the coordinate system.
+
+ \value DeviceCoordinates Coordinates are relative to the upper-left corner
+ of the object's paint device.
+
+ \value LogicalCoordinates Coordinates are relative to the upper-left corner
+ of the object.
+*/
+
+/*!
\enum Qt::GestureState
\since 4.6
@@ -2814,3 +2827,18 @@
\sa QApplication::setNavigationMode()
\sa QApplication::navigationMode()
*/
+
+/*!
+ \enum Qt::RenderHint
+ \since 4.6
+
+ This enum describes the possible hints that can be used to control various
+ rendering operations.
+
+ \value QualityHint Indicates that rendering quality is the most important factor,
+ at the potential cost of lower performance.
+
+ \value PerformanceHint Indicates that rendering performance is the most important factor,
+ at the potential cost of lower quality.
+*/
+
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 6e83204..7cf22f2 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -84,11 +84,7 @@ public:
Qt_4_3 = 9,
Qt_4_4 = 10,
Qt_4_5 = 11,
- Qt_4_6 = 12,
-#if QT_VERSION >= 0x040700
-#error Add the datastream version for this Qt version
- Qt_4_7 = Qt_4_6
-#endif
+ Qt_4_6 = 12
};
enum ByteOrder {
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 4ec5772..114da3b 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -595,7 +595,7 @@ QString QFSFileEngine::rootPath()
return QDir::cleanPath(QDir::fromNativeSeparators(qt_TDesC2QString(symbianPath)));
# else
# warning No fallback implementation of QFSFileEngine::rootPath()
- return QLatin1String();
+ return QString();
# endif
#else
return QLatin1String("/");
@@ -614,7 +614,7 @@ QString QFSFileEngine::tempPath()
QT_MKDIR(QFile::encodeName(temp), 0777);
# else
# warning No fallback implementation of QFSFileEngine::tempPath()
- return QString();
+ QString temp;
# endif
#else
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 5931267..594718e 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -241,6 +241,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
#include "private/qlocale_p.h"
#include <stdlib.h>
+#include <limits.h>
#include <new>
#if defined QTEXTSTREAM_DEBUG
@@ -375,10 +376,10 @@ public:
enum TokenDelimiter {
Space,
NotSpace,
- EndOfLine,
- EndOfFile
+ EndOfLine
};
+ QString read(int maxlen);
bool scan(const QChar **ptr, int *tokenLength,
int maxlen, TokenDelimiter delimiter);
inline const QChar *readPtr() const;
@@ -704,6 +705,25 @@ bool QTextStreamPrivate::flushWriteBuffer()
return flushed && bytesWritten == qint64(data.size());
}
+QString QTextStreamPrivate::read(int maxlen)
+{
+ QString ret;
+ if (string) {
+ lastTokenSize = qMin(maxlen, string->size() - stringOffset);
+ ret = string->mid(stringOffset, lastTokenSize);
+ } else {
+ while (readBuffer.size() - readBufferOffset < maxlen && fillReadBuffer()) ;
+ lastTokenSize = qMin(maxlen, readBuffer.size() - readBufferOffset);
+ ret = readBuffer.mid(readBufferOffset, lastTokenSize);
+ }
+ consumeLastToken();
+
+#if defined (QTEXTSTREAM_DEBUG)
+ qDebug("QTextStreamPrivate::read() maxlen = %d, token length = %d", maxlen, ret.length());
+#endif
+ return ret;
+}
+
/*! \internal
Scans no more than \a maxlen QChars in the current buffer for the
@@ -736,19 +756,28 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD
const QChar ch = *chPtr++;
++totalSize;
- if (delimiter == Space && ch.isSpace()) {
- foundToken = true;
- delimSize = 1;
- } else if (delimiter == NotSpace && !ch.isSpace()) {
- foundToken = true;
- delimSize = 1;
- } else if (delimiter == EndOfLine && ch == QLatin1Char('\n')) {
- foundToken = true;
- delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1;
- consumeDelimiter = true;
+ switch (delimiter) {
+ case Space:
+ if (ch.isSpace()) {
+ foundToken = true;
+ delimSize = 1;
+ }
+ break;
+ case NotSpace:
+ if (!ch.isSpace()) {
+ foundToken = true;
+ delimSize = 1;
+ }
+ break;
+ case EndOfLine:
+ if (ch == QLatin1Char('\n')) {
+ foundToken = true;
+ delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1;
+ consumeDelimiter = true;
+ }
+ lastChar = ch;
+ break;
}
-
- lastChar = ch;
}
} while (!foundToken
&& (!maxlen || totalSize < maxlen)
@@ -769,7 +798,7 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD
// if we find a '\r' at the end of the data when reading lines,
// don't make it part of the line.
- if (totalSize > 0 && !foundToken && delimiter == EndOfLine) {
+ if (delimiter == EndOfLine && totalSize > 0 && !foundToken) {
if (((string && stringOffset + totalSize == string->size()) || (device && device->atEnd()))
&& lastChar == QLatin1Char('\r')) {
consumeDelimiter = true;
@@ -1603,14 +1632,7 @@ QString QTextStream::readAll()
Q_D(QTextStream);
CHECK_VALID_STREAM(QString());
- const QChar *readPtr;
- int length;
- if (!d->scan(&readPtr, &length, /* maxlen = */ 0, QTextStreamPrivate::EndOfFile))
- return QString();
-
- QString tmp = QString(readPtr, length);
- d->consumeLastToken();
- return tmp;
+ return d->read(INT_MAX);
}
/*!
@@ -1662,14 +1684,7 @@ QString QTextStream::read(qint64 maxlen)
if (maxlen <= 0)
return QString::fromLatin1(""); // empty, not null
- const QChar *readPtr;
- int length;
- if (!d->scan(&readPtr, &length, int(maxlen), QTextStreamPrivate::EndOfFile))
- return QString();
-
- QString tmp = QString(readPtr, length);
- d->consumeLastToken();
- return tmp;
+ return d->read(int(maxlen));
}
/*! \internal
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 185c305..3bef0d4 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -270,7 +270,6 @@ QT_BEGIN_NAMESPACE
\omitvalue NetworkReplyUpdated
\omitvalue FutureCallOut
\omitvalue CocoaRequestModal
- \omitvalue SymbianDeferredFocusChanged
\omitvalue UpdateSoftKeys
\omitvalue NativeGesture
*/
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index bc96918..be25b41 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -281,9 +281,7 @@ public:
RequestSoftwareInputPanel = 199,
CloseSoftwareInputPanel = 200,
- SymbianDeferredFocusChanged = 201, // Internal for generating asynchronous focus events on Symbian
-
- UpdateSoftKeys = 202, // Internal for compressing soft key updates
+ UpdateSoftKeys = 201, // Internal for compressing soft key updates
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event