diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 17 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 3 | ||||
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 23 | ||||
-rw-r--r-- | src/corelib/io/qwindowspipewriter.cpp | 1 | ||||
-rw-r--r-- | src/corelib/io/qwindowspipewriter_p.h | 1 | ||||
-rw-r--r-- | src/corelib/tools/qlist.h | 19 | ||||
-rw-r--r-- | src/corelib/tools/qtimeline.cpp | 4 |
7 files changed, 53 insertions, 15 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index e1b8509..31f0841 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -157,6 +157,19 @@ #define DEFAULT_TIMER_INTERVAL 16 +#ifdef Q_WS_WIN + /// Fix for Qt 4.7 + //on windows if you're currently dragging a widget an inner eventloop was started by the system + //to make sure that this timer is getting fired, we need to make sure to use the system timers + //that will send a WM_TIMER event. We do that by settings the timer interval to 11 + //It is 11 because QEventDispatcherWin32Private::registerTimer specifically checks if the interval + //is greater than 10 to determine if it should use a system timer (or the multimedia timer). +#define STARTSTOP_TIMER_DELAY 11 +#else +#define STARTSTOP_TIMER_DELAY 0 +#endif + + QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer) @@ -217,7 +230,7 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation) if (animations.contains(animation) || animationsToStart.contains(animation)) return; animationsToStart << animation; - startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer + startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer } void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation) @@ -233,7 +246,7 @@ void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation) } else { animationsToStart.removeOne(animation); } - startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer + startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer } diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 8f34e30..93de911 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1655,7 +1655,8 @@ public: FramebufferObject = 0x07, // GL framebuffer object CustomRaster = 0x08, MacQuartz = 0x09, - PaintBuffer = 0x0a + PaintBuffer = 0x0a, + OpenGL = 0x0b }; enum RelayoutType { RelayoutNormal, diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 50b4af7..80ccda3 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -865,15 +865,22 @@ QString QFSFileEngine::fileName(FileName file) const QString ret; if (!isRelativePathSymbian(d->filePath)) { if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':') - && d->filePath.at(2) != slashChar || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt - d->filePath.startsWith(slashChar) // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt - ) { - ret = QString(QDir::currentPath().left(2) + QDir::fromNativeSeparators(d->filePath)); + && d->filePath.at(2) != slashChar){ + // It's a drive-relative path, so C:a.txt -> C:/currentpath/a.txt, + // or if it's different drive than current, Z:a.txt -> Z:/a.txt + QString currentPath = QDir::currentPath(); + if (0 == currentPath.left(1).compare(d->filePath.left(1), Qt::CaseInsensitive)) + ret = currentPath + slashChar + d->filePath.mid(2); + else + ret = d->filePath.left(2) + slashChar + d->filePath.mid(2); + } else if (d->filePath.startsWith(slashChar)) { + // It's a absolute path to the current drive, so /a.txt -> C:/a.txt + ret = QDir::currentPath().left(2) + d->filePath; } else { ret = d->filePath; } } else { - ret = QDir::cleanPath(QDir::currentPath() + slashChar + d->filePath); + ret = QDir::currentPath() + slashChar + d->filePath; } // The path should be absolute at this point. @@ -889,6 +896,12 @@ QString QFSFileEngine::fileName(FileName file) const ret[0] = ret.at(0).toUpper(); } + // Clean up the path + bool isDir = ret.endsWith(slashChar); + ret = QDir::cleanPath(ret); + if (isDir) + ret += slashChar; + if (file == AbsolutePathName) { int slash = ret.lastIndexOf(slashChar); if (slash < 0) diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index f32eb92..0e707f3 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -160,6 +160,7 @@ void QWindowsPipeWriter::run() hasWritten = true; lock.unlock(); } + emit bytesWritten(totalWritten); emit canWrite(); } CloseHandle(overl.hEvent); diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h index d651629..8f8c4a0 100644 --- a/src/corelib/io/qwindowspipewriter_p.h +++ b/src/corelib/io/qwindowspipewriter_p.h @@ -121,6 +121,7 @@ class Q_CORE_EXPORT QWindowsPipeWriter : public QThread Q_SIGNALS: void canWrite(); + void bytesWritten(qint64 bytes); public: QWindowsPipeWriter(HANDLE writePipe, QObject * parent = 0); diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index c2bdbee..f316fec 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -367,21 +367,26 @@ Q_INLINE_TEMPLATE void QList<T>::node_copy(Node *from, Node *to, Node *src) if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) { QT_TRY { while(current != to) { - (current++)->v = new T(*reinterpret_cast<T*>((src++)->v)); + current->v = new T(*reinterpret_cast<T*>(src->v)); + ++current; + ++src; } } QT_CATCH(...) { - while (current != from) - delete reinterpret_cast<T*>(current--); + while (current-- != from) + delete reinterpret_cast<T*>(current->v); QT_RETHROW; } } else if (QTypeInfo<T>::isComplex) { QT_TRY { - while(current != to) - new (current++) T(*reinterpret_cast<T*>(src++)); + while(current != to) { + new (current) T(*reinterpret_cast<T*>(src)); + ++current; + ++src; + } } QT_CATCH(...) { - while (current != from) - (reinterpret_cast<T*>(current--))->~T(); + while (current-- != from) + (reinterpret_cast<T*>(current))->~T(); QT_RETHROW; } } else { diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp index 052c456..28ec963 100644 --- a/src/corelib/tools/qtimeline.cpp +++ b/src/corelib/tools/qtimeline.cpp @@ -388,6 +388,10 @@ void QTimeLine::setDirection(Direction direction) By default, this value is 1000 (i.e., 1 second), but you can change this by either passing a duration to QTimeLine's constructor, or by calling setDuration(). The duration must be larger than 0. + + \note Changing the duration does not cause the current time to be reset + to zero or the new duration. You also need to call setCurrentTime() with + the desired value. */ int QTimeLine::duration() const { |