diff options
-rw-r--r-- | doc/src/snippets/code/src_gui_accessible_qaccessible.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 26 | ||||
-rw-r--r-- | src/3rdparty/phonon/qt7/videowidget.mm | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 10 | ||||
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 33 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 17 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 64 | ||||
-rw-r--r-- | src/sql/kernel/qsqldatabase.cpp | 8 |
8 files changed, 90 insertions, 74 deletions
diff --git a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp index 8434d81..c5ca441 100644 --- a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp +++ b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp @@ -46,3 +46,7 @@ if (child) { delete child; } //! [0] + +//! [1] +typedef QAccessibleInterface* myFactoryFunction(const QString &key, QObject *); +//! [1]
\ No newline at end of file diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 345bd3a..f32ba7e 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -996,7 +996,17 @@ void VcprojGenerator::initLinkerTool() { findLibraries(); // Need to add the highest version of the libs VCConfiguration &conf = vcProject.Configuration; - conf.linker.parseOptions(project->values("MSVCPROJ_LFLAGS")); + conf.linker.parseOptions(project->values("QMAKE_LFLAGS")); + + foreach (const QString &libDir, project->values("QMAKE_LIBDIR")) { + if (libDir.startsWith("/LIBPATH:")) + conf.linker.AdditionalLibraryDirectories += libDir.mid(9); + else + conf.linker.AdditionalLibraryDirectories += libDir; + } + + if (!project->values("DEF_FILE").isEmpty()) + conf.linker.ModuleDefinitionFile = project->first("DEF_FILE"); foreach(QString libs, project->values("MSVCPROJ_LIBS")) { if (libs.left(9).toUpper() == "/LIBPATH:") { @@ -1458,17 +1468,6 @@ void VcprojGenerator::initOld() // $$QMAKE.. -> $$MSVCPROJ.. ------------------------------------- project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS"); project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS_PRIVATE"); - project->values("MSVCPROJ_LFLAGS") += project->values("QMAKE_LFLAGS"); - if(!project->values("QMAKE_LIBDIR").isEmpty()) { - QStringList strl = project->values("QMAKE_LIBDIR"); - QStringList::iterator stri; - for(stri = strl.begin(); stri != strl.end(); ++stri) { - if(!(*stri).startsWith("/LIBPATH:")) - (*stri).prepend("/LIBPATH:"); - } - project->values("MSVCPROJ_LFLAGS") += strl; - } - project->values("MSVCPROJ_CXXFLAGS") += project->values("QMAKE_CXXFLAGS"); QStringList &incs = project->values("INCLUDEPATH"); for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { QString inc = (*incit); @@ -1507,9 +1506,6 @@ void VcprojGenerator::initOld() project->values("MSVCPROJ_COPY_DLL_DESC").append(deststr); } - if (!project->values("DEF_FILE").isEmpty()) - project->values("MSVCPROJ_LFLAGS").append("/DEF:"+project->first("DEF_FILE")); - project->values("QMAKE_INTERNAL_PRL_LIBS") << "MSVCPROJ_LIBS"; // Verbose output if "-d -d"... diff --git a/src/3rdparty/phonon/qt7/videowidget.mm b/src/3rdparty/phonon/qt7/videowidget.mm index 736dcdf..c281e16 100644 --- a/src/3rdparty/phonon/qt7/videowidget.mm +++ b/src/3rdparty/phonon/qt7/videowidget.mm @@ -278,7 +278,7 @@ public: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, GLsizei(w), GLsizei(h)); - gluOrtho2D(0, GLsizei(w), 0, GLsizei(h)); + glOrtho(0, GLsizei(w), 0, GLsizei(h), -1, 1); updateGL(); } diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index dd27f7e..bb06f3a 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -322,7 +322,6 @@ namespace QtSharedPointer { protected: typedef ExternalRefCountData Data; - inline void ref() const { d->weakref.ref(); d->strongref.ref(); } inline void deref() { deref(d, this->value); } static inline void deref(Data *d, T *value) @@ -387,7 +386,13 @@ namespace QtSharedPointer { template <class X> inline void internalCopy(const ExternalRefCount<X> &other) { - internalSet(other.d, other.data()); + Data *o = other.d; + T *actual = other.value; + if (o) + other.ref(); + qSwap(d, o); + qSwap(this->value, actual); + deref(o, actual); } inline void internalSwap(ExternalRefCount &other) @@ -403,6 +408,7 @@ namespace QtSharedPointer { template <class X> friend class QT_PREPEND_NAMESPACE(QWeakPointer); template <class X, class Y> friend QSharedPointer<X> copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src); #endif + inline void ref() const { d->weakref.ref(); d->strongref.ref(); } inline void internalSet(Data *o, T *actual) { diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 5aa7217..8005d7d 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -46,6 +46,10 @@ #include <windows.h> #endif +#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU) +#include <intrin.h> +#endif + QT_BEGIN_NAMESPACE uint qDetectCPUFeatures() @@ -261,31 +265,10 @@ uint qDetectCPUFeatures() : "%eax", "%ecx", "%edx" ); #elif defined (Q_OS_WIN64) - _asm { - push rax - push rbx - push rcx - push rdx - pushfd - pop rax - mov ebx, eax - xor eax, 00200000h - push rax - popfd - pushfd - pop rax - mov edx, 0 - xor eax, ebx - jz skip - - mov eax, 1 - cpuid - mov feature_result, ecx - skip: - pop rdx - pop rcx - pop rbx - pop rax + { + int info[4]; + __cpuid(info, 1); + feature_result = info[2]; } #endif diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 0921bdb..a6d1dbd 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -409,13 +409,18 @@ static void qAccessibleCleanup() /*! \typedef QAccessible::InterfaceFactory - A function pointer type. Use a function with this prototype to install - interface factories with installFactory(). + This is a typedef for a pointer to a function with the following + signature: - The function receives a QObject pointer. If the QObject - provides a QAccessibleInterface, it sets the second parameter to - point to the corresponding QAccessibleInterface, and returns true; - otherwise returns false. + \snippet doc/src/snippets/code/src_gui_accessible_qaccessible.cpp 1 + + The function receives a QString and a QObject pointer, where the + QString is the key identifying the interface. The QObject is used + to pass on to the QAccessibleInterface so that it can hold a reference + to it. + + If the key and the QObject does not have a corresponding + QAccessibleInterface, a null-pointer will be returned. Installed factories are called by queryAccessibilityInterface() until one provides an interface. diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 531e46b..9d27343 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1035,6 +1035,35 @@ QScriptItem &QTextLineItemIterator::next() return *si; } +static QFixed offsetInLigature(const unsigned short *logClusters, + const QGlyphLayout &glyphs, + int pos, int max, int glyph_pos) +{ + int offsetInCluster = 0; + for (int i = pos - 1; i >= 0; i--) { + if (logClusters[i] == glyph_pos) + offsetInCluster++; + else + break; + } + + // in the case that the offset is inside a (multi-character) glyph, + // interpolate the position. + if (offsetInCluster > 0) { + int clusterLength = 0; + for (int i = pos - offsetInCluster; i < max; i++) { + if (logClusters[i] == glyph_pos) + clusterLength++; + else + break; + } + if (clusterLength) + return glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; + } + + return 0; +} + bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const { *selectionX = *selectionWidth = 0; @@ -1074,8 +1103,19 @@ bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selec swidth += glyphs.effectiveAdvance(g); } - *selectionX = x + soff; - *selectionWidth = swidth; + // If the starting character is in the middle of a ligature, + // selection should only contain the right part of that ligature + // glyph, so we need to get the width of the left part here and + // add it to *selectionX + QFixed leftOffsetInLigature = offsetInLigature(logClusters, glyphs, from, + to, start_glyph); + *selectionX = x + soff + leftOffsetInLigature; + *selectionWidth = swidth - leftOffsetInLigature; + // If the ending character is also part of a ligature, swidth does + // not contain that part yet, we also need to find out the width of + // that left part + *selectionWidth += offsetInLigature(logClusters, glyphs, to, + eng->length(item), end_glyph); } return true; } @@ -2633,14 +2673,6 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const if(pos == l) x += si->width; } else { - int offsetInCluster = 0; - for (int i=pos-1; i >= 0; i--) { - if (logClusters[i] == glyph_pos) - offsetInCluster++; - else - break; - } - if (reverse) { int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; @@ -2652,17 +2684,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const for (int i = glyph_start; i < glyph_pos; i++) x += glyphs.effectiveAdvance(i); } - if (offsetInCluster > 0) { // in the case that the offset is inside a (multi-character) glyph, interpolate the position. - int clusterLength = 0; - for (int i=pos - offsetInCluster; i < line.length; i++) { - if (logClusters[i] == glyph_pos) - clusterLength++; - else - break; - } - if (clusterLength) - x+= glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; - } + x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos); } *cursorPos = pos + si->position; diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 76bc2b0..324a3ce 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -163,7 +163,7 @@ public: static QSqlDatabase database(const QString& name, bool open); static void addDatabase(const QSqlDatabase &db, const QString & name); static void removeDatabase(const QString& name); - static void invalidateDb(const QSqlDatabase &db, const QString &name); + static void invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn = true); static DriverDict &driverDict(); static void cleanConnections(); }; @@ -197,7 +197,7 @@ void QSqlDatabasePrivate::cleanConnections() QConnectionDict::iterator it = dict->begin(); while (it != dict->end()) { - invalidateDb(it.value(), it.key()); + invalidateDb(it.value(), it.key(), false); ++it; } dict->clear(); @@ -229,9 +229,9 @@ QSqlDatabasePrivate *QSqlDatabasePrivate::shared_null() return &n; } -void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name) +void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn) { - if (db.d->ref != 1) { + if (db.d->ref != 1 && doWarn) { qWarning("QSqlDatabasePrivate::removeDatabase: connection '%s' is still in use, " "all queries will cease to work.", name.toLocal8Bit().constData()); db.d->disable(); |