diff options
author | Tomasz Olszak <olszak.tomasz@gmail.com> | 2014-02-20 13:35:37 +0100 |
---|---|---|
committer | Tomasz Olszak <olszak.tomasz@gmail.com> | 2014-02-20 14:22:59 +0100 |
commit | 69ab8382f35259951500b1073a37b6fbfc0633ca (patch) | |
tree | dc4d404fea4d09e8f66391894d75dba783718aae | |
parent | 1c8c3084ab9f7c2e05b0eefbf8a633509e8c88ea (diff) | |
parent | 08cbbde61778276ccdda73d89fd64d02c623779f (diff) | |
download | qtbase-69ab8382f35259951500b1073a37b6fbfc0633ca.tar.gz qtbase-69ab8382f35259951500b1073a37b6fbfc0633ca.tar.bz2 qtbase-69ab8382f35259951500b1073a37b6fbfc0633ca.zip |
Merge remote-tracking branch 'origin/release' into wip/tizenupstream/5.2.2
Change-Id: Id5ba4b358c9fa7528182302cd83a119991df473a
67 files changed, 427 insertions, 293 deletions
diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index 0e3f18929a..56997a11d4 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -768,3 +768,10 @@ X11 * [QTBUG-34392][MSVS] Fixed /SAFESEH:NO with VS2010+. * [QTBUG-34357][MSVS] Fixed breakage with multiple VS versions in PATH. * [MSVS] Fixed sub-project dependency generation. + +- moc + * Porting moc to QCommandLineParser has changed one specific option in its + command line handling: using the -f option without argument + is not supported anymore (it wasn't necessary, since including the header + file is the default behavior). + diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc index 0a6e8dc5d1..15a4125250 100644 --- a/doc/global/externalsites/qtcreator.qdoc +++ b/doc/global/externalsites/qtcreator.qdoc @@ -467,3 +467,11 @@ \externalpage http://qt-project.org/doc/qtcreator/creator-debuggers.html \title Qt Creator: Adding Debuggers */ +/*! + \externalpage http://qt-project.org/doc/qtcreator/creator-android-app-tutorial.html + \title Qt Creator: Creating an Android Application +*/ +/*! + \externalpage http://qt-project.org/doc/qtcreator/creator-diff-editor.html + \title Qt Creator: Comparing Files +*/ diff --git a/examples/widgets/widgets/styles/styles.pro b/examples/widgets/widgets/styles/styles.pro index e326991535..235642f270 100644 --- a/examples/widgets/widgets/styles/styles.pro +++ b/examples/widgets/widgets/styles/styles.pro @@ -7,8 +7,6 @@ SOURCES = main.cpp \ widgetgallery.cpp RESOURCES = styles.qrc -REQUIRES += "contains(styles, windows)" - # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/styles INSTALLS += target diff --git a/examples/widgets/widgets/widgets.pro b/examples/widgets/widgets/widgets.pro index 8d9e15a7e8..fe3e289944 100644 --- a/examples/widgets/widgets/widgets.pro +++ b/examples/widgets/widgets/widgets.pro @@ -16,6 +16,7 @@ SUBDIRS = analogclock \ shapedclock \ sliders \ spinboxes \ + styles \ stylesheet \ tablet \ tetrix \ @@ -23,5 +24,3 @@ SUBDIRS = analogclock \ validators \ wiggly \ windowflags - -contains(styles, windows): SUBDIRS += styles diff --git a/mkspecs/devices/common/linux_device_pre.conf b/mkspecs/devices/common/linux_device_pre.conf index a4837a435d..16becbdd52 100644 --- a/mkspecs/devices/common/linux_device_pre.conf +++ b/mkspecs/devices/common/linux_device_pre.conf @@ -1,7 +1,7 @@ QT_QPA_DEFAULT_PLATFORM = eglfs MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-archos-gen8-g++/qmake.conf b/mkspecs/devices/linux-archos-gen8-g++/qmake.conf index 6f2b4736ac..891559f3bf 100644 --- a/mkspecs/devices/linux-archos-gen8-g++/qmake.conf +++ b/mkspecs/devices/linux-archos-gen8-g++/qmake.conf @@ -7,7 +7,7 @@ # http://github.com/KDAB/OpenEmbedded-Archos MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf index 90f0d90a3c..da2e046d08 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf index d734e97e89..011fc6fe28 100644 --- a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf @@ -5,7 +5,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/mkspecs/devices/linux-beagleboard-g++/qmake.conf index 0791693bbe..d78048951f 100644 --- a/mkspecs/devices/linux-beagleboard-g++/qmake.conf +++ b/mkspecs/devices/linux-beagleboard-g++/qmake.conf @@ -3,7 +3,7 @@ # http://beagleboard.org/ MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-maemo-n9-g++/qmake.conf b/mkspecs/devices/linux-maemo-n9-g++/qmake.conf index a9e2376d7c..1c18fc5c80 100644 --- a/mkspecs/devices/linux-maemo-n9-g++/qmake.conf +++ b/mkspecs/devices/linux-maemo-n9-g++/qmake.conf @@ -3,7 +3,7 @@ # http://wiki.qt-project.org/Devices/N9 MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_PLATFORM = maemo diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf index bdaaa391e5..e196f279d7 100644 --- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf index e3a28fb9c4..932b4d7fa7 100644 --- a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf @@ -5,7 +5,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf index f8ba5937c5..8bf2f63b04 100644 --- a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf @@ -5,7 +5,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/devices/linux-snowball-g++/qmake.conf b/mkspecs/devices/linux-snowball-g++/qmake.conf index 0d3a90d524..ebad2bfd27 100644 --- a/mkspecs/devices/linux-snowball-g++/qmake.conf +++ b/mkspecs/devices/linux-snowball-g++/qmake.conf @@ -3,7 +3,7 @@ # http://qt-project.org/wiki/Snowball MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../../common/linux.conf) diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf deleted file mode 100644 index 2b3dee6cc4..0000000000 --- a/mkspecs/features/unix/gdb_dwarf_index.prf +++ /dev/null @@ -1,23 +0,0 @@ -!separate_debug_info:have_target:debug:!static:!isEmpty(QMAKE_OBJCOPY) { - - contains(TEMPLATE, "lib") { - QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && - QMAKE_GDB_DIR = . - } else { - QMAKE_GDB_INDEX = { test -n \"$(DESTDIR)\" && DESTDIR=\"$(DESTDIR)\" || DESTDIR=.; } && - QMAKE_GDB_DIR = \$\$DESTDIR - } - - QMAKE_GDB_INDEX += \ - test \$\$(gdb --version | sed -e \'s,[^0-9][^0-9]*\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \ - gdb --nx --batch --quiet -ex \'set confirm off\' -ex \"save gdb-index $$QMAKE_GDB_DIR\" -ex quit \'$(TARGET)\' && \ - test -f $(TARGET).gdb-index && \ - $$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' && \ - $$QMAKE_DEL_FILE $(TARGET).gdb-index || true - - !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK - QMAKE_POST_LINK = $$QMAKE_GDB_INDEX $$QMAKE_POST_LINK - - silent:QMAKE_POST_LINK = @echo indexing $@ for gdb && $$QMAKE_POST_LINK -} - diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index cb6cd3131c..f736e183ec 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = freebsd bsd -CONFIG += gdb_dwarf_index QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE diff --git a/mkspecs/freebsd-g++46/qmake.conf b/mkspecs/freebsd-g++46/qmake.conf index 8f8e0cd21c..b94b1393e6 100644 --- a/mkspecs/freebsd-g++46/qmake.conf +++ b/mkspecs/freebsd-g++46/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = freebsd bsd -CONFIG += gdb_dwarf_index QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf index ef3be3b37b..261695f1ea 100644 --- a/mkspecs/hurd-g++/qmake.conf +++ b/mkspecs/hurd-g++/qmake.conf @@ -4,7 +4,7 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = hurd -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS_THREAD += -D_REENTRANT diff --git a/mkspecs/linux-arm-gnueabi-g++/qmake.conf b/mkspecs/linux-arm-gnueabi-g++/qmake.conf index b2653d8fea..365d5a219b 100644 --- a/mkspecs/linux-arm-gnueabi-g++/qmake.conf +++ b/mkspecs/linux-arm-gnueabi-g++/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) diff --git a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf index 56dfe8c1b2..340aa85e7c 100644 --- a/mkspecs/linux-g++-32/qmake.conf +++ b/mkspecs/linux-g++-32/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS = -m32 diff --git a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf index fc7672f19d..36fb6a83eb 100644 --- a/mkspecs/linux-g++-64/qmake.conf +++ b/mkspecs/linux-g++-64/qmake.conf @@ -6,7 +6,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS = -m64 diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf index f04a32c750..dc49676456 100644 --- a/mkspecs/linux-g++-maemo/qmake.conf +++ b/mkspecs/linux-g++-maemo/qmake.conf @@ -4,7 +4,7 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = maemo -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental CONFIG += nostrip QMAKE_INCREMENTAL_STYLE = sublib diff --git a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf index 0c9634adf8..35bce8f064 100644 --- a/mkspecs/linux-g++/qmake.conf +++ b/mkspecs/linux-g++/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index ee5f1f0ea4..f9a04d2cce 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -3,7 +3,6 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += gdb_dwarf_index QMAKE_COMPILER = gcc intel_icc # icc pretends to be gcc @@ -44,7 +43,8 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD -QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions +# Disabling exceptions disabled - workaround for QTBUG-36577 +#QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions QMAKE_CXXFLAGS_CXX11 = -std=c++0x QMAKE_INCDIR = diff --git a/mkspecs/linux-llvm/qmake.conf b/mkspecs/linux-llvm/qmake.conf index 6a9fed64c2..98b18fb373 100644 --- a/mkspecs/linux-llvm/qmake.conf +++ b/mkspecs/linux-llvm/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) diff --git a/mkspecs/linux-lsb-g++/qmake.conf b/mkspecs/linux-lsb-g++/qmake.conf index 10a4014d65..80353cd5f6 100644 --- a/mkspecs/linux-lsb-g++/qmake.conf +++ b/mkspecs/linux-lsb-g++/qmake.conf @@ -3,7 +3,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += incremental gdb_dwarf_index +CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf index 6c699aac53..6cb24d9bf9 100644 --- a/mkspecs/netbsd-g++/qmake.conf +++ b/mkspecs/netbsd-g++/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = netbsd bsd -CONFIG += gdb_dwarf_index QMAKE_COMPILER = gcc diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf index f0773e9d0d..2fdbd2c469 100644 --- a/mkspecs/openbsd-g++/qmake.conf +++ b/mkspecs/openbsd-g++/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = openbsd bsd -CONFIG += gdb_dwarf_index QMAKE_COMPILER = gcc diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 8159cf58e2..a2a441c6bf 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -510,6 +510,11 @@ bool VCCLCompilerTool::parseOption(const char* option) BrowseInformation = brAllInfo; BrowseInformationFile = option+3; break; + case 'S': + if (config->CompilerVersion < NET2013) + found = false; + // Ignore this flag. Visual Studio 2013 takes care of this setting. + break; case 'r': BrowseInformation = brNoLocalSymbols; BrowseInformationFile = option+3; diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index ce2afb9c28..5dd43a015e 100644 --- a/src/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h @@ -104,8 +104,10 @@ public: dirty = false; // This is a workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58800 -// Avoid using std::nth_element for stdlibc++ <= 4.7.3 || (>= 4.8.0 && <= 4.8.2) -#if defined(__GLIBCXX__) && (__GLIBCXX__ <= 20130411 || (__GLIBCXX__ >= 20130322 && __GLIBCXX__ <= 20131016)) +// Avoid using std::nth_element for the affected stdlibc++ releases 4.7.3 and 4.8.2. +// Note that the official __GLIBCXX__ value of the releases is not used since that +// one might be patched on some GNU/Linux distributions. +#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20140107 QVector<T> sorted = values; std::sort(sorted.begin(), sorted.end()); currentMedian = sorted.at(bufferSize / 2); diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 30db4e75cf..cd7899021d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -858,7 +858,7 @@ public: }; #define Q_FOREACH(variable, container) \ -for (QForeachContainer<__typeof__(container)> _container_(container); \ +for (QForeachContainer<__typeof__((container))> _container_((container)); \ !_container_.brk && _container_.i != _container_.e; \ __extension__ ({ ++_container_.brk; ++_container_.i; })) \ for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;})) @@ -1042,6 +1042,7 @@ QT_END_NAMESPACE #include <QtCore/qflags.h> #include <QtCore/qsysinfo.h> #include <QtCore/qtypeinfo.h> +#include <QtCore/qnumeric.h> #endif /* __cplusplus */ diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 05920f4575..3370cce6d5 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -383,7 +383,7 @@ QDebugStateSaver::QDebugStateSaver(QDebug &dbg) } /*! - Destroyes a QDebugStateSaver instance, which restores the settings + Destroys a QDebugStateSaver instance, which restores the settings used when the QDebugStateSaver instance was created. \sa QDebug::setAutoInsertSpaces(), QDebug::autoInsertSpaces() diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index b704126efa..c5a0db310a 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1944,8 +1944,9 @@ QString QDir::homePath() On Unix/Linux systems this is the path in the \c TMPDIR environment variable or \c{/tmp} if \c TMPDIR is not defined. On Windows this is usually the path in the \c TEMP or \c TMP environment - variable. Whether a directory separator is added to the end or - not, depends on the operating system. + variable. + The path returned by this method doesn't end with a directory separator + unless it is the root directory (of a drive). \sa temp(), currentPath(), homePath(), rootPath() */ diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index e6b4e5f754..2327c11c69 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -721,13 +721,13 @@ QString QFileSystemEngine::tempPath() if (temp.isEmpty()) { qWarning("Neither the TEMP nor the TMPDIR environment variable is set, falling back to /tmp."); - temp = QLatin1String("/tmp/"); + temp = QLatin1String("/tmp"); } return QDir::cleanPath(temp); #else QString temp = QFile::decodeName(qgetenv("TMPDIR")); if (temp.isEmpty()) - temp = QLatin1String("/tmp/"); + temp = QLatin1String("/tmp"); return QDir::cleanPath(temp); #endif } diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 10ca20629e..e2ed7c3766 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -259,10 +259,17 @@ static QStringList xdgDataDirs() dirs.append(QString::fromLatin1("/usr/local/share")); dirs.append(QString::fromLatin1("/usr/share")); } else { - dirs = xdgDataDirsEnv.split(QLatin1Char(':')); - // Normalize paths - for (int i = 0; i < dirs.count(); i++) - dirs[i] = QDir::cleanPath(dirs.at(i)); + dirs = xdgDataDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts); + + // Normalize paths, skip relative paths + QMutableListIterator<QString> it(dirs); + while (it.hasNext()) { + const QString dir = it.next(); + if (!dir.startsWith(QLatin1Char('/'))) + it.remove(); + else + it.setValue(QDir::cleanPath(dir)); + } // Remove duplicates from the list, there's no use for duplicated // paths in XDG_DATA_DIRS - if it's not found in the given diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index eac5a0b738..f17215964f 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -414,10 +414,16 @@ static inline QString fileScheme() return QStringLiteral("file"); } +#ifdef Q_COMPILER_CLASS_ENUM +# define colon_uchar : uchar +#else +# define colon_uchar +#endif + class QUrlPrivate { public: - enum Section { + enum Section colon_uchar { Scheme = 0x01, UserName = 0x02, Password = 0x04, @@ -432,6 +438,10 @@ public: FullUrl = 0xff }; + enum Flags colon_uchar { + IsLocalFile = 0x01 + }; + enum ErrorCode { // the high byte of the error code matches the Section // the first item in each value must be the generic "Invalid xxx Error" @@ -519,6 +529,8 @@ public: inline bool hasQuery() const { return sectionIsPresent & Query; } inline bool hasFragment() const { return sectionIsPresent & Fragment; } + inline bool isLocalFile() const { return flags & IsLocalFile; } + QString mergePaths(const QString &relativePath) const; QAtomicInt ref; @@ -539,12 +551,18 @@ public: // - Path (there's no path delimiter, so we optimize its use out of existence) // Schemes are never supposed to be empty, but we keep the flag anyway uchar sectionIsPresent; + uchar flags; + + // 32-bit: 2 bytes tail padding available + // 64-bit: 6 bytes tail padding available }; +#undef colon_uchar inline QUrlPrivate::QUrlPrivate() : ref(1), port(-1), error(0), - sectionIsPresent(0) + sectionIsPresent(0), + flags(0) { } @@ -558,7 +576,8 @@ inline QUrlPrivate::QUrlPrivate(const QUrlPrivate ©) query(copy.query), fragment(copy.fragment), error(copy.cloneError()), - sectionIsPresent(copy.sectionIsPresent) + sectionIsPresent(copy.sectionIsPresent), + flags(copy.flags) { } @@ -956,6 +975,12 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro schemeData[i] = c + 0x20; } } + + // did we set to the file protocol? + if (scheme == fileScheme()) + flags |= IsLocalFile; + else + flags &= ~IsLocalFile; return true; } @@ -1312,6 +1337,7 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode // / other path types here sectionIsPresent = 0; + flags = 0; clearError(); // find the important delimiters @@ -1867,6 +1893,7 @@ void QUrl::setScheme(const QString &scheme) if (scheme.isEmpty()) { // schemes are not allowed to be empty d->sectionIsPresent &= ~QUrlPrivate::Scheme; + d->flags &= ~QUrlPrivate::IsLocalFile; d->scheme.clear(); } else { d->setScheme(scheme, scheme.length(), /* do set error */ true); @@ -3104,6 +3131,7 @@ QUrl QUrl::resolved(const QUrl &relative) const t.d->sectionIsPresent |= QUrlPrivate::Scheme; else t.d->sectionIsPresent &= ~QUrlPrivate::Scheme; + t.d->flags |= d->flags & QUrlPrivate::IsLocalFile; } t.d->fragment = relative.d->fragment; if (relative.d->hasFragment()) @@ -3177,7 +3205,6 @@ QString QUrl::toString(FormattingOptions options) const // - there's no query or fragment to return // that is, either they aren't present, or we're removing them // - it's a local file - // (test done last since it's the most expensive) if (options.testFlag(QUrl::PreferLocalFile) && !options.testFlag(QUrl::RemovePath) && (!d->hasQuery() || options.testFlag(QUrl::RemoveQuery)) && (!d->hasFragment() || options.testFlag(QUrl::RemoveFragment)) @@ -3201,6 +3228,7 @@ QString QUrl::toString(FormattingOptions options) const url += QLatin1String("//"); d->appendAuthority(url, options, QUrlPrivate::FullUrl); } else if (isLocalFile() && pathIsAbsolute) { + // Comply with the XDG file URI spec, which requires triple slashes. url += QLatin1String("//"); } @@ -3755,11 +3783,7 @@ QString QUrl::toLocalFile() const */ bool QUrl::isLocalFile() const { - if (!d) return false; - - if (d->scheme != fileScheme()) - return false; // not file - return true; + return d && d->isLocalFile(); } /*! diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index ff2675dfc8..1e11887387 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -677,7 +677,7 @@ QByteArray QMetaObjectPrivate::decodeMethodSignature( const char *lparens = strchr(signature, '('); if (!lparens) return QByteArray(); - const char *rparens = strchr(lparens + 1, ')'); + const char *rparens = strrchr(lparens + 1, ')'); if (!rparens || *(rparens+1)) return QByteArray(); int nameLength = lparens - signature; diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h index c791f017d4..d26cd54e5d 100644 --- a/src/corelib/kernel/qmetaobject_moc_p.h +++ b/src/corelib/kernel/qmetaobject_moc_p.h @@ -155,21 +155,28 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc //template recursion const char* tt = t; int templdepth = 1; + int scopeDepth = 0; while (t != e) { c = *t++; - if (c == '<') - ++templdepth; - if (c == '>') - --templdepth; - if (templdepth == 0 || (templdepth == 1 && c == ',')) { - result += normalizeTypeInternal(tt, t-1, fixScope, false); - result += c; - if (templdepth == 0) { - if (*t == '>') - result += ' '; // avoid >> - break; + if (c == '{' || c == '(' || c == '[') + ++scopeDepth; + if (c == '}' || c == ')' || c == ']') + --scopeDepth; + if (scopeDepth == 0) { + if (c == '<') + ++templdepth; + if (c == '>') + --templdepth; + if (templdepth == 0 || (templdepth == 1 && c == ',')) { + result += normalizeTypeInternal(tt, t-1, fixScope, false); + result += c; + if (templdepth == 0) { + if (*t == '>') + result += ' '; // avoid >> + break; + } + tt = t; } - tt = t; } } } diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index e66a59a09c..ab7d72611e 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -621,9 +621,6 @@ unless you need to change the QSet through the iterator. Const iterators are slightly faster, and can improve code readability. - QSet\<T\>::iterator allows you to iterate over a QSet\<T\> and - modify it as you go (using QSet::erase()). However, - The default QSet::iterator constructor creates an uninitialized iterator. You must initialize it using a function like QSet::begin(), QSet::end(), or QSet::insert() before you can diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 70fe7b783f..0b2211defc 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3663,7 +3663,7 @@ static Image_Converter converter_map[QImage::NImageFormats][QImage::NImageFormat 0, convert_RGBA_to_RGB, convert_RGBA_to_ARGB, - convert_RGBA_to_ARGB_PM, + convert_RGBA_to_ARGB, 0, 0, 0, diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index e3fffe5a1c..d9b2e82d0b 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -1099,6 +1099,17 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target */ /*! + \enum QOpenGLTexture::Filter + This enum defines the filtering parameters for a QOpenGLTexture object. + \value Nearest Equivalent to GL_NEAREST + \value Linear Equivalent to GL_LINEAR + \value NearestMipMapNearest Equivalent to GL_NEAREST_MIPMAP_NEAREST + \value NearestMipMapLinear Equivalent to GL_NEAREST_MIPMAP_LINEAR + \value LinearMipMapNearest Equivalent to GL_LINEAR_MIPMAP_NEAREST + \value LinearMipMapLinear Equivalent to GL_LINEAR_MIPMAP_LINEAR +*/ + +/*! \enum QOpenGLTexture::Target This enum defines the texture target of a QOpenGLTexture object. @@ -1152,7 +1163,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target */ /*! - \enum TextureUnitReset + \enum QOpenGLTexture::TextureUnitReset This enum defines options ot control texture unit activation. \value ResetTextureUnit The previous active texture unit will be reset @@ -1308,7 +1319,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target */ /*! - \enum PixelType + \enum QOpenGLTexture::PixelType This enum defines the possible pixel data types for a pixel transfer operation \value NoPixelType Equivalent to GL_NONE @@ -1381,7 +1392,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target */ /*! - \enum WrapMode + \enum QOpenGLTexture::WrapMode This enum defines the possible texture coordinate wrapping modes. \value Repeat Texture coordinate is repeated. Equivalent to GL_REPEAT @@ -1392,7 +1403,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target */ /*! - \enum CoordinateDirection + \enum QOpenGLTexture::CoordinateDirection This enum defines the possible texture coordinate directions \value DirectionS The horizontal direction. Equivalent to GL_TEXTURE_WRAP_S diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index d3e5b645c4..c71d75cf94 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5507,7 +5507,7 @@ inline void qt_bitmapblit_template(QRasterBuffer *rasterBuffer, } } -static void qt_gradient_quint32(int count, const QSpan *spans, void *userData) +static void qt_gradient_argb32(int count, const QSpan *spans, void *userData) { QSpanData *data = reinterpret_cast<QSpanData *>(userData); @@ -5964,7 +5964,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_RGB32, { blend_color_argb, - qt_gradient_quint32, + qt_gradient_argb32, qt_bitmapblit_quint32, qt_alphamapblit_quint32, qt_alphargbblit_quint32, @@ -5973,7 +5973,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_ARGB32, { blend_color_generic, - qt_gradient_quint32, + qt_gradient_argb32, qt_bitmapblit_quint32, qt_alphamapblit_quint32, qt_alphargbblit_quint32, @@ -5982,7 +5982,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_ARGB32_Premultiplied { blend_color_argb, - qt_gradient_quint32, + qt_gradient_argb32, qt_bitmapblit_quint32, qt_alphamapblit_quint32, qt_alphargbblit_quint32, @@ -6048,7 +6048,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_RGBX8888 { blend_color_generic, - qt_gradient_quint32, + blend_src_generic, qt_bitmapblit_quint32, #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN qt_alphamapblit_quint32, @@ -6062,7 +6062,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_RGBA8888 { blend_color_generic, - qt_gradient_quint32, + blend_src_generic, qt_bitmapblit_quint32, #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN qt_alphamapblit_quint32, @@ -6076,7 +6076,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = // Format_RGB8888_Premultiplied { blend_color_generic, - qt_gradient_quint32, + blend_src_generic, qt_bitmapblit_quint32, #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN qt_alphamapblit_quint32, diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index 37610a9099..a25c814d4a 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -502,58 +502,60 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q } } } - if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) { - writingSystems.setSupported(QFontDatabase::Latin); - hasScript = true; - //qDebug("font %s supports Latin", familyName.latin1()); - } - if (codePageRange[0] & (1 << CyrillicCsbBit)) { - writingSystems.setSupported(QFontDatabase::Cyrillic); - hasScript = true; - //qDebug("font %s supports Cyrillic", familyName.latin1()); - } - if (codePageRange[0] & (1 << GreekCsbBit)) { - writingSystems.setSupported(QFontDatabase::Greek); - hasScript = true; - //qDebug("font %s supports Greek", familyName.latin1()); - } - if (codePageRange[0] & (1 << HebrewCsbBit)) { - writingSystems.setSupported(QFontDatabase::Hebrew); - hasScript = true; - //qDebug("font %s supports Hebrew", familyName.latin1()); - } - if (codePageRange[0] & (1 << ArabicCsbBit)) { - writingSystems.setSupported(QFontDatabase::Arabic); - hasScript = true; - //qDebug("font %s supports Arabic", familyName.latin1()); - } - if (codePageRange[0] & (1 << VietnameseCsbBit)) { - writingSystems.setSupported(QFontDatabase::Vietnamese); - hasScript = true; - //qDebug("font %s supports Vietnamese", familyName.latin1()); - } - if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) { - writingSystems.setSupported(QFontDatabase::SimplifiedChinese); - hasScript = true; - //qDebug("font %s supports Simplified Chinese", familyName.latin1()); - } - if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) { - writingSystems.setSupported(QFontDatabase::TraditionalChinese); - hasScript = true; - //qDebug("font %s supports Traditional Chinese", familyName.latin1()); - } - if (codePageRange[0] & (1 << JapaneseCsbBit)) { - writingSystems.setSupported(QFontDatabase::Japanese); - hasScript = true; - //qDebug("font %s supports Japanese", familyName.latin1()); - } - if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) { - writingSystems.setSupported(QFontDatabase::Korean); - hasScript = true; - //qDebug("font %s supports Korean", familyName.latin1()); + if (!hasScript) { + if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) { + writingSystems.setSupported(QFontDatabase::Latin); + hasScript = true; + //qDebug("font %s supports Latin", familyName.latin1()); + } + if (codePageRange[0] & (1 << CyrillicCsbBit)) { + writingSystems.setSupported(QFontDatabase::Cyrillic); + hasScript = true; + //qDebug("font %s supports Cyrillic", familyName.latin1()); + } + if (codePageRange[0] & (1 << GreekCsbBit)) { + writingSystems.setSupported(QFontDatabase::Greek); + hasScript = true; + //qDebug("font %s supports Greek", familyName.latin1()); + } + if (codePageRange[0] & (1 << HebrewCsbBit)) { + writingSystems.setSupported(QFontDatabase::Hebrew); + hasScript = true; + //qDebug("font %s supports Hebrew", familyName.latin1()); + } + if (codePageRange[0] & (1 << ArabicCsbBit)) { + writingSystems.setSupported(QFontDatabase::Arabic); + hasScript = true; + //qDebug("font %s supports Arabic", familyName.latin1()); + } + if (codePageRange[0] & (1 << VietnameseCsbBit)) { + writingSystems.setSupported(QFontDatabase::Vietnamese); + hasScript = true; + //qDebug("font %s supports Vietnamese", familyName.latin1()); + } + if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) { + writingSystems.setSupported(QFontDatabase::SimplifiedChinese); + hasScript = true; + //qDebug("font %s supports Simplified Chinese", familyName.latin1()); + } + if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) { + writingSystems.setSupported(QFontDatabase::TraditionalChinese); + hasScript = true; + //qDebug("font %s supports Traditional Chinese", familyName.latin1()); + } + if (codePageRange[0] & (1 << JapaneseCsbBit)) { + writingSystems.setSupported(QFontDatabase::Japanese); + hasScript = true; + //qDebug("font %s supports Japanese", familyName.latin1()); + } + if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) { + writingSystems.setSupported(QFontDatabase::Korean); + hasScript = true; + //qDebug("font %s supports Korean", familyName.latin1()); + } + if (!hasScript) + writingSystems.setSupported(QFontDatabase::Symbol); } - if (!hasScript) - writingSystems.setSupported(QFontDatabase::Symbol); return writingSystems; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index c2e352eff4..febdaaa86c 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -918,12 +918,9 @@ void QTextEngine::shapeText(int item) const QFontEngine *fontEngine = this->fontEngine(si, &si.ascent, &si.descent, &si.leading); // split up the item into parts that come from different font engines + // k * 3 entries, array[k] == index in string, array[k + 1] == index in glyphs, array[k + 2] == engine index QVector<uint> itemBoundaries; - itemBoundaries.reserve(16); - // k * 2 entries, array[k] == index in string, array[k + 1] == index in glyphs - itemBoundaries.append(0); - itemBoundaries.append(0); - + itemBoundaries.reserve(24); if (fontEngine->type() == QFontEngine::Multi) { // ask the font engine to find out which glyphs (as an index in the specific font) // to use for the text in one item. @@ -947,22 +944,31 @@ void QTextEngine::shapeText(int item) const } } - uint lastEngine = 0; + uint lastEngine = ~0u; for (int i = 0, glyph_pos = 0; i < itemLength; ++i, ++glyph_pos) { const uint engineIdx = initialGlyphs.glyphs[glyph_pos] >> 24; - if (lastEngine != engineIdx && glyph_pos > 0) { + if (lastEngine != engineIdx) { itemBoundaries.append(i); itemBoundaries.append(glyph_pos); + itemBoundaries.append(engineIdx); + + if (engineIdx != 0) { + QFontEngine *actualFontEngine = static_cast<QFontEngineMulti *>(fontEngine)->engine(engineIdx); + si.ascent = qMax(actualFontEngine->ascent(), si.ascent); + si.descent = qMax(actualFontEngine->descent(), si.descent); + si.leading = qMax(actualFontEngine->leading(), si.leading); + } - QFontEngine *actualFontEngine = static_cast<QFontEngineMulti *>(fontEngine)->engine(engineIdx); - si.ascent = qMax(actualFontEngine->ascent(), si.ascent); - si.descent = qMax(actualFontEngine->descent(), si.descent); - si.leading = qMax(actualFontEngine->leading(), si.leading); + lastEngine = engineIdx; } - lastEngine = engineIdx; + if (QChar::isHighSurrogate(string[i]) && i + 1 < itemLength && QChar::isLowSurrogate(string[i + 1])) ++i; } + } else { + itemBoundaries.append(0); + itemBoundaries.append(0); + itemBoundaries.append(0); } bool kerningEnabled; @@ -1039,16 +1045,6 @@ void QTextEngine::shapeText(int item) const si.width += glyphs.advances_x[i] * !glyphs.attributes[i].dontPrint; } -static inline void moveGlyphData(const QGlyphLayout &destination, const QGlyphLayout &source, int num) -{ - if (num > 0 && destination.glyphs != source.glyphs) { - memmove(destination.glyphs, source.glyphs, num * sizeof(glyph_t)); - memmove(destination.attributes, source.attributes, num * sizeof(QGlyphAttributes)); - memmove(destination.advances_x, source.advances_x, num * sizeof(QFixed)); - memmove(destination.offsets, source.offsets, num * sizeof(QFixedPoint)); - } -} - #ifdef QT_ENABLE_HARFBUZZ_NG QT_BEGIN_INCLUDE_NAMESPACE @@ -1075,20 +1071,15 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st uint glyphs_shaped = 0; int remaining_glyphs = itemLength; - for (int k = 0; k < itemBoundaries.size(); k += 2) { // for the +2, see the comment at the definition of itemBoundaries + for (int k = 0; k < itemBoundaries.size(); k += 3) { uint item_pos = itemBoundaries[k]; - uint item_length = itemLength; + uint item_length = (k + 4 < itemBoundaries.size() ? itemBoundaries[k + 3] : itemLength) - item_pos; uint item_glyph_pos = itemBoundaries[k + 1]; - if (k + 3 < itemBoundaries.size()) - item_length = itemBoundaries[k + 2]; - item_length -= item_pos; + uint engineIdx = itemBoundaries[k + 2]; QFontEngine *actualFontEngine = fontEngine; - uint engineIdx = 0; - if (fontEngine->type() == QFontEngine::Multi) { - engineIdx = availableGlyphs(&si).glyphs[glyphs_shaped] >> 24; + if (fontEngine->type() == QFontEngine::Multi) actualFontEngine = static_cast<QFontEngineMulti *>(fontEngine)->engine(engineIdx); - } // prepare buffer @@ -1105,18 +1096,6 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st buffer_flags |= HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES; hb_buffer_set_flags(buffer, hb_buffer_flags_t(buffer_flags)); - const uint num_codes = hb_buffer_get_length(buffer); - { - // adjust clusters - hb_glyph_info_t *infos = hb_buffer_get_glyph_infos(buffer, 0); - const ushort *uc = string + item_pos; - for (uint i = 0, code_pos = 0; i < item_length; ++i, ++code_pos) { - if (QChar::isHighSurrogate(uc[i]) && i + 1 < item_length && QChar::isLowSurrogate(uc[i + 1])) - ++i; - infos[code_pos].cluster = code_pos + item_glyph_pos; - } - } - // shape bool shapedOk = false; @@ -1139,8 +1118,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st if (si.analysis.bidiLevel % 2) hb_buffer_reverse(buffer); - - remaining_glyphs -= num_codes; + remaining_glyphs -= item_glyph_pos; // ensure we have enough space for shaped glyphs and metrics const uint num_glyphs = hb_buffer_get_length(buffer); @@ -1151,44 +1129,34 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st // fetch the shaped glyphs and metrics QGlyphLayout g = availableGlyphs(&si).mid(glyphs_shaped, num_glyphs); - if (num_glyphs > num_codes) - moveGlyphData(g.mid(num_glyphs), g.mid(num_codes), remaining_glyphs); ushort *log_clusters = logClusters(&si) + item_pos; hb_glyph_info_t *infos = hb_buffer_get_glyph_infos(buffer, 0); hb_glyph_position_t *positions = hb_buffer_get_glyph_positions(buffer, 0); - uint last_cluster = -1; + uint str_pos = 0; + uint last_cluster = ~0u; + uint last_glyph_pos = glyphs_shaped; for (uint i = 0; i < num_glyphs; ++i) { g.glyphs[i] = infos[i].codepoint; - log_clusters[i] = infos[i].cluster; g.advances_x[i] = QFixed::fromFixed(positions[i].x_advance); g.advances_y[i] = QFixed::fromFixed(positions[i].y_advance); g.offsets[i].x = QFixed::fromFixed(positions[i].x_offset); g.offsets[i].y = QFixed::fromFixed(positions[i].y_offset); - if (infos[i].cluster != last_cluster) { - last_cluster = infos[i].cluster; + uint cluster = infos[i].cluster; + if (last_cluster != cluster) { + // fix up clusters so that the cluster indices will be monotonic + // and thus we never return out-of-order indices + while (last_cluster++ < cluster && str_pos < item_length) + log_clusters[str_pos++] = last_glyph_pos; + last_glyph_pos = i + glyphs_shaped; + last_cluster = cluster; g.attributes[i].clusterStart = true; } } - - { - // adjust clusters - uint glyph_pos = 0; - for (uint i = 0; i < item_length; ++i) { - if (i + item_pos != infos[glyph_pos].cluster) { - for (uint j = glyph_pos + 1; j < num_glyphs; ++j) { - if (i + item_pos <= infos[j].cluster) { - if (i + item_pos == infos[j].cluster) - glyph_pos = j; - break; - } - } - } - log_clusters[i] = glyph_pos + item_glyph_pos; - } - } + while (str_pos < item_length) + log_clusters[str_pos++] = last_glyph_pos; if (engineIdx != 0) { for (quint32 i = 0; i < num_glyphs; ++i) @@ -1217,6 +1185,12 @@ Q_STATIC_ASSERT(sizeof(HB_GlyphAttributes) == sizeof(QGlyphAttributes)); Q_STATIC_ASSERT(sizeof(HB_Fixed) == sizeof(QFixed)); Q_STATIC_ASSERT(sizeof(HB_FixedPoint) == sizeof(QFixedPoint)); +static inline void moveGlyphData(const QGlyphLayout &destination, const QGlyphLayout &source, int num) +{ + if (num > 0 && destination.glyphs != source.glyphs) + memmove(destination.glyphs, source.glyphs, num * sizeof(glyph_t)); +} + int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *string, int itemLength, QFontEngine *fontEngine, const QVector<uint> &itemBoundaries, bool kerningEnabled) const { HB_ShaperItem entire_shaper_item; @@ -1245,14 +1219,12 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri int remaining_glyphs = entire_shaper_item.num_glyphs; int glyph_pos = 0; // for each item shape using harfbuzz and store the results in our layoutData's glyphs array. - for (int k = 0; k < itemBoundaries.size(); k += 2) { // for the +2, see the comment at the definition of itemBoundaries - + for (int k = 0; k < itemBoundaries.size(); k += 3) { HB_ShaperItem shaper_item = entire_shaper_item; - shaper_item.item.pos = itemBoundaries[k]; - if (k < itemBoundaries.size() - 3) { - shaper_item.item.length = itemBoundaries[k + 2] - shaper_item.item.pos; - shaper_item.num_glyphs = itemBoundaries[k + 3] - itemBoundaries[k + 1]; + if (k + 4 < itemBoundaries.size()) { + shaper_item.item.length = itemBoundaries[k + 3] - shaper_item.item.pos; + shaper_item.num_glyphs = itemBoundaries[k + 4] - itemBoundaries[k + 1]; } else { // last combo in the list, avoid out of bounds access. shaper_item.item.length -= shaper_item.item.pos - entire_shaper_item.item.pos; shaper_item.num_glyphs -= itemBoundaries[k + 1]; @@ -1261,10 +1233,9 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri if (shaper_item.num_glyphs < shaper_item.item.length) shaper_item.num_glyphs = shaper_item.item.length; + uint engineIdx = itemBoundaries[k + 2]; QFontEngine *actualFontEngine = fontEngine; - uint engineIdx = 0; if (fontEngine->type() == QFontEngine::Multi) { - engineIdx = uint(availableGlyphs(&si).glyphs[glyph_pos] >> 24); actualFontEngine = static_cast<QFontEngineMulti *>(fontEngine)->engine(engineIdx); shaper_item.glyphIndicesPresent = true; @@ -1280,7 +1251,7 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri return 0; const QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos); - if (shaper_item.num_glyphs > shaper_item.item.length) + if (fontEngine->type() == QFontEngine::Multi && shaper_item.num_glyphs > shaper_item.item.length) moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); shaper_item.glyphs = reinterpret_cast<HB_Glyph *>(g.glyphs); @@ -1297,7 +1268,8 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri } while (!qShapeItem(&shaper_item)); // this does the actual shaping via harfbuzz. QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos, shaper_item.num_glyphs); - moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); + if (fontEngine->type() == QFontEngine::Multi) + moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); for (quint32 i = 0; i < shaper_item.item.length; ++i) shaper_item.log_clusters[i] += glyph_pos; diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index b4c593fa73..3b7fa4da09 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -341,8 +341,9 @@ static QByteArray _q_SubjectInfoToString(QSslCertificate::SubjectInfo info) \fn QString QSslCertificate::issuerInfo(SubjectInfo subject) const Returns the issuer information for the \a subject from the - certificate, or an empty string if there is no information for - \a subject in the certificate. + certificate, or an empty list if there is no information for + \a subject in the certificate. There can be more than one entry + of each type. \sa subjectInfo() */ @@ -359,8 +360,8 @@ QStringList QSslCertificate::issuerInfo(SubjectInfo info) const /*! Returns the issuer information for \a attribute from the certificate, - or an empty string if there is no information for \a attribute in the - certificate. + or an empty list if there is no information for \a attribute in the + certificate. There can be more than one entry for an attribute. \sa subjectInfo() */ @@ -379,8 +380,9 @@ QStringList QSslCertificate::issuerInfo(const QByteArray &attribute) const \fn QString QSslCertificate::subjectInfo(SubjectInfo subject) const - Returns the information for the \a subject, or an empty string if - there is no information for \a subject in the certificate. + Returns the information for the \a subject, or an empty list if + there is no information for \a subject in the certificate. There + can be more than one entry of each type. \sa issuerInfo() */ @@ -396,8 +398,9 @@ QStringList QSslCertificate::subjectInfo(SubjectInfo info) const } /*! - Returns the subject information for \a attribute, or an empty string if - there is no information for \a attribute in the certificate. + Returns the subject information for \a attribute, or an empty list if + there is no information for \a attribute in the certificate. There + can be more than one entry for an attribute. \sa issuerInfo() */ diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index 739be17ef3..736bf10f2e 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qgraphicsshadereffect_p.h" + +#ifndef QT_NO_GRAPHICSEFFECT + #include "qglshaderprogram.h" #include "gl2paintengineex/qglcustomshaderstage_p.h" #define QGL_HAVE_CUSTOM_SHADERS 1 @@ -311,3 +314,5 @@ void QGraphicsShaderEffect::setUniforms(QGLShaderProgram *program) } QT_END_NAMESPACE + +#endif // QT_NO_GRAPHICSEFFECT diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h index 8a7c082afa..3f879fc2d2 100644 --- a/src/opengl/qgraphicsshadereffect_p.h +++ b/src/opengl/qgraphicsshadereffect_p.h @@ -54,6 +54,9 @@ // #include <QtWidgets/qgraphicseffect.h> + +#ifndef QT_NO_GRAPHICSEFFECT + #include <QtOpenGL/qtopenglglobal.h> QT_BEGIN_NAMESPACE @@ -87,4 +90,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_GRAPHICSEFFECT + #endif // QGRAPHICSSHADEREFFECT_P_H diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 8850f18bab..1ccab0a859 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1391,13 +1391,6 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS if (interface->tableInterface()) { setSpiStateBit(&spiState, ATSPI_STATE_MANAGES_DESCENDANTS); } -// FIXME: figure out if this is a top level window and set its active state accordingly -// if (interface->object() && interface->object()->isWidgetType()) { -// QWidget *w = qobject_cast<QWidget*>(interface->object()); -// if (w->topLevelWidget() && w->isActiveWindow()) { -// setSpiStateBit(&spiState, ATSPI_STATE_ACTIVE); -// } -// } QAccessible::Role role = interface->role(); if (role == QAccessible::TreeItem || role == QAccessible::ListItem) { diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp index f8bfaf4753..9de667158b 100644 --- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp +++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp @@ -61,6 +61,8 @@ quint64 spiStatesFromQState(QAccessible::State state) { quint64 spiState = 0; + if (state.active) + setSpiStateBit(&spiState, ATSPI_STATE_ACTIVE); if (state.editable) setSpiStateBit(&spiState, ATSPI_STATE_EDITABLE); if (!state.disabled) { diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp index b477a6acb7..b24106d223 100644 --- a/src/plugins/accessible/widgets/itemviews.cpp +++ b/src/plugins/accessible/widgets/itemviews.cpp @@ -1068,7 +1068,6 @@ QString QAccessibleTableCell::text(QAccessible::Text t) const QAbstractItemModel *model = view->model(); QString value; switch (t) { - case QAccessible::Value: case QAccessible::Name: value = model->data(m_index, Qt::AccessibleTextRole).toString(); if (value.isEmpty()) @@ -1160,7 +1159,6 @@ QString QAccessibleTableHeaderCell::text(QAccessible::Text t) const QAbstractItemModel *model = view->model(); QString value; switch (t) { - case QAccessible::Value: case QAccessible::Name: value = model->headerData(index, orientation, Qt::AccessibleTextRole).toString(); if (value.isEmpty()) diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index 79a5c82fe0..71d22eabc4 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -631,7 +631,7 @@ QDockWidget *QAccessibleDockWidget::dockWidget() const QString QAccessibleDockWidget::text(QAccessible::Text t) const { - if (t == QAccessible::Name || t == QAccessible::Value) { + if (t == QAccessible::Name) { return qt_accStripAmp(dockWidget()->windowTitle()); } return QString(); diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index c275ec071d..893be2df04 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -507,8 +507,10 @@ QString QAccessibleGroupBox::text(QAccessible::Text t) const switch (t) { case QAccessible::Name: txt = qt_accStripAmp(groupBox()->title()); + break; case QAccessible::Description: - txt = qt_accStripAmp(groupBox()->title()); + txt = qt_accStripAmp(groupBox()->toolTip()); + break; default: break; } diff --git a/src/plugins/generic/tslib/qtslib.cpp b/src/plugins/generic/tslib/qtslib.cpp index 773939b485..9905d9cc9e 100644 --- a/src/plugins/generic/tslib/qtslib.cpp +++ b/src/plugins/generic/tslib/qtslib.cpp @@ -48,8 +48,6 @@ #include <QPoint> #include <qpa/qwindowsysteminterface.h> -#include <Qt> - #include <errno.h> #include <tslib.h> @@ -65,21 +63,21 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key, setObjectName(QLatin1String("TSLib Mouse Handler")); QByteArray device = qgetenv("TSLIB_TSDEVICE"); - if (device.isEmpty()) - device = QByteArrayLiteral("/dev/input/event1"); if (specification.startsWith("/dev/")) device = specification.toLocal8Bit(); + if (device.isEmpty()) + device = QByteArrayLiteral("/dev/input/event1"); + m_dev = ts_open(device.constData(), 1); if (!m_dev) { qErrnoWarning(errno, "ts_open() failed"); return; } - if (ts_config(m_dev)) { + if (ts_config(m_dev)) perror("Error configuring\n"); - } m_rawMode = !key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive); @@ -89,7 +87,6 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key, connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData())); } else { qWarning("Cannot open mouse input device '%s': %s", device.constData(), strerror(errno)); - return; } } @@ -103,12 +100,10 @@ QTsLibMouseHandler::~QTsLibMouseHandler() static bool get_sample(struct tsdev *dev, struct ts_sample *sample, bool rawMode) { - if (rawMode) { + if (rawMode) return (ts_read_raw(dev, sample, 1) == 1); - } else { - int ret = ts_read(dev, sample, 1); - return ( ret == 1); - } + else + return (ts_read(dev, sample, 1) == 1); } diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 5a8664747e..7335deb800 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -79,6 +79,10 @@ QCocoaMenuBar::~QCocoaMenuBar() if (m_window && m_window->menubar() == this) { m_window->setMenubar(0); + // Delete the children first so they do not cause + // the native menu items to be hidden after + // the menu bar was updated + qDeleteAll(children()); updateMenuBarImmediately(); } } diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index 0a5f6ec241..9f5bd46ef4 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -258,7 +258,7 @@ int runMoc(int argc, char **argv) parser.addOption(pathPrefixOption); QCommandLineOption forceIncludeOption(QStringLiteral("f")); - forceIncludeOption.setDescription(QStringLiteral("Force #include [optional <file>] (overwrite default).")); + forceIncludeOption.setDescription(QStringLiteral("Force #include <file> (overwrite default).")); forceIncludeOption.setValueName(QStringLiteral("file")); parser.addOption(forceIncludeOption); diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 8ff481d5b1..b26fac5dcf 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -224,14 +224,11 @@ Type Moc::parseType() ; } if (test(LANGLE)) { - QByteArray templ = lexemUntil(RANGLE); - for (int i = 0; i < templ.size(); ++i) { - type.name += templ.at(i); - if ((templ.at(i) == '<' && i+1 < templ.size() && templ.at(i+1) == ':') - || (templ.at(i) == '>' && i+1 < templ.size() && templ.at(i+1) == '>')) { - type.name += ' '; - } + if (type.name.isEmpty()) { + // '<' cannot start a type + return type; } + type.name += lexemUntil(RANGLE); } if (test(SCOPE)) { type.name += lexem(); @@ -1395,10 +1392,14 @@ QByteArray Moc::lexemUntil(Token target) QByteArray s; while (from <= index) { QByteArray n = symbols.at(from++-1).lexem(); - if (s.size() && n.size() - && is_ident_char(s.at(s.size()-1)) - && is_ident_char(n.at(0))) - s += ' '; + if (s.size() && n.size()) { + char prev = s.at(s.size()-1); + char next = n.at(0); + if ((is_ident_char(prev) && is_ident_char(next)) + || (prev == '<' && next == ':') + || (prev == '>' && next == '>')) + s += ' '; + } s += n; } return s; @@ -1433,9 +1434,20 @@ bool Moc::until(Token target) { case RBRACK: --brackCount; break; case LPAREN: ++parenCount; break; case RPAREN: --parenCount; break; - case LANGLE: ++angleCount; break; - case RANGLE: --angleCount; break; - case GTGT: angleCount -= 2; t = RANGLE; break; + case LANGLE: + if (parenCount == 0 && braceCount == 0 && parenCount == 0) + ++angleCount; + break; + case RANGLE: + if (parenCount == 0 && braceCount == 0) + --angleCount; + break; + case GTGT: + if (parenCount == 0 && braceCount == 0) { + angleCount -= 2; + t = RANGLE; + } + break; default: break; } if (t == target diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index b14a79dfab..71c550d4ab 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -246,16 +246,15 @@ QMultiMap<QString,QString> outFileNames; */ void Generator::writeOutFileNames() { - QFile* files = new QFile("/Users/msmith/depot/qt5/qtdoc/outputlist.txt"); - files->open(QFile::WriteOnly); - QTextStream* filesout = new QTextStream(files); + QFile files("outputlist.txt"); + if (!files.open(QFile::WriteOnly)) + return; + QTextStream filesout(&files); QMultiMap<QString,QString>::ConstIterator i = outFileNames.begin(); while (i != outFileNames.end()) { - (*filesout) << i.key() << "\n"; + filesout << i.key() << "\n"; ++i; } - filesout->flush(); - files->close(); } /*! diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index 7b32cae54f..4e5fade3f4 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -425,10 +425,9 @@ QString QAccessibleWidget::text(QAccessible::Text t) const } break; case QAccessible::Description: - if (!widget()->accessibleDescription().isEmpty()) - str = widget()->accessibleDescription(); + str = widget()->accessibleDescription(); #ifndef QT_NO_TOOLTIP - else + if (str.isEmpty()) str = widget()->toolTip(); #endif break; diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp index b981aef98b..105aefb14c 100644 --- a/src/widgets/styles/qgtkstyle.cpp +++ b/src/widgets/styles/qgtkstyle.cpp @@ -2499,7 +2499,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if ((option->subControls & SC_SliderGroove) && groove.isValid()) { GtkRange *range = (GtkRange*)scaleWidget; - GtkAdjustment *adjustment = d->gtk_range_get_adjustment(range); + GtkAdjustment *adjustment = 0; + if (d->gtk_adjustment_configure) + adjustment = d->gtk_range_get_adjustment(range); if (adjustment) { d->gtk_adjustment_configure(adjustment, slider->sliderPosition, diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index fa49bcb884..79a52c00cb 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1719,8 +1719,9 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD } } - int width = int(macRect.size.width) + extraWidth; - int height = int(macRect.size.height) + extraHeight; + int devicePixelRatio = p->device()->devicePixelRatio(); + int width = devicePixelRatio * (int(macRect.size.width) + extraWidth); + int height = devicePixelRatio * (int(macRect.size.height) + extraHeight); if (width <= 0 || height <= 0) return; // nothing to draw @@ -1732,6 +1733,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD QPixmap pm; if (!QPixmapCache::find(key, pm)) { QPixmap activePixmap(width, height); + activePixmap.setDevicePixelRatio(devicePixelRatio); activePixmap.fill(Qt::transparent); { if (combo){ @@ -1782,6 +1784,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD QImage colorlessImage; { QPixmap colorlessPixmap(width, height); + colorlessPixmap.setDevicePixelRatio(devicePixelRatio); colorlessPixmap.fill(Qt::transparent); QMacCGContext cg(&colorlessPixmap); @@ -1815,7 +1818,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD } QPixmapCache::insert(key, pm); } - p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width, height, pm); + p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width / devicePixelRatio, height / devicePixelRatio , pm); } QMacStyle::QMacStyle() @@ -6719,6 +6722,8 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev) } CGContextTranslateCTM(ret, 0, pm->height()); + int devicePixelRatio = pdev->devicePixelRatio(); + CGContextScaleCTM(ret, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(ret, 1, -1); return ret; } else if (pdev->devType() == QInternal::Widget) { diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index f08689cb9b..497bc52109 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -778,15 +778,16 @@ void QToolButtonPrivate::popupTimerDone() actualMenu->d_func()->causedPopup.action = defaultAction; actionsCopy = q->actions(); //(the list of action may be modified in slots) actualMenu->exec(p); + + if (!that) + return; + QObject::disconnect(actualMenu, SIGNAL(aboutToHide()), q, SLOT(_q_updateButtonDown())); if (mustDeleteActualMenu) delete actualMenu; else QObject::disconnect(actualMenu, SIGNAL(triggered(QAction*)), q, SLOT(_q_menuTriggered(QAction*))); - if (!that) - return; - actionsCopy.clear(); if (repeat) diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 0d08e912f8..4eb3e4fc98 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -101,6 +101,13 @@ void tst_QGlobal::for_each() QCOMPARE(i, counter++); } QCOMPARE(counter, list.count()); + + // check whether we can pass a constructor as container argument + counter = 0; + foreach (int i, QList<int>(list)) { + QCOMPARE(i, counter++); + } + QCOMPARE(counter, list.count()); } void tst_QGlobal::qassert() diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 5c0485d228..4503f6fcbc 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -77,6 +77,7 @@ private slots: void testAllWritableLocations_data(); void testAllWritableLocations(); void testCleanPath(); + void testXdgPathCleanup(); private: #ifdef Q_XDG_PLATFORM @@ -491,6 +492,19 @@ void tst_qstandardpaths::testCleanPath() } } +void tst_qstandardpaths::testXdgPathCleanup() +{ +#ifdef Q_XDG_PLATFORM + setCustomLocations(); + const QString uncleanGlobalAppDir = "/./" + QFile::encodeName(m_globalAppDir); + qputenv("XDG_DATA_DIRS", QFile::encodeName(uncleanGlobalAppDir) + "::relative/path"); + const QStringList appsDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation); + QVERIFY(!appsDirs.contains("/applications")); + QVERIFY(!appsDirs.contains(uncleanGlobalAppDir + "/applications")); + QVERIFY(!appsDirs.contains("relative/path/applications")); +#endif +} + QTEST_MAIN(tst_qstandardpaths) #include "tst_qstandardpaths.moc" diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 27c0f6e66a..4c4e46de05 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -201,6 +201,9 @@ private slots: void linearGradientSymmetry(); void gradientInterpolation(); + void gradientPixelFormat_data(); + void gradientPixelFormat(); + void fpe_pixmapTransform(); void fpe_zeroLengthLines(); void fpe_divByZero(); @@ -3723,6 +3726,49 @@ void tst_QPainter::linearGradientSymmetry() QCOMPARE(a, b); } +void tst_QPainter::gradientPixelFormat_data() +{ + QTest::addColumn<QImage::Format>("format"); + + QTest::newRow("argb32") << QImage::Format_ARGB32; + QTest::newRow("rgb32") << QImage::Format_RGB32; + QTest::newRow("rgb888") << QImage::Format_RGB888; + QTest::newRow("rgbx8888") << QImage::Format_RGBX8888; + QTest::newRow("rgba8888") << QImage::Format_RGBA8888; + QTest::newRow("rgba8888_pm") << QImage::Format_RGBA8888_Premultiplied; +} + +void tst_QPainter::gradientPixelFormat() +{ + QFETCH(QImage::Format, format); + + QImage a(8, 64, QImage::Format_ARGB32_Premultiplied); + QImage b(8, 64, format); + + + QGradientStops stops; + stops << qMakePair(qreal(0.0), QColor(Qt::blue)); + stops << qMakePair(qreal(0.3), QColor(Qt::red)); + stops << qMakePair(qreal(0.6), QColor(Qt::green)); + stops << qMakePair(qreal(1.0), QColor(Qt::black)); + + a.fill(0); + b.fill(0); + + QLinearGradient gradient(QRectF(b.rect()).topLeft(), QRectF(b.rect()).bottomLeft()); + gradient.setStops(stops); + + QPainter pa(&a); + pa.fillRect(a.rect(), gradient); + pa.end(); + + QPainter pb(&b); + pb.fillRect(b.rect(), gradient); + pb.end(); + + QCOMPARE(a, b.convertToFormat(QImage::Format_ARGB32_Premultiplied)); +} + void tst_QPainter::gradientInterpolation() { QImage image(256, 8, QImage::Format_ARGB32_Premultiplied); diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 47ab7c2e99..8e0090e486 100644 --- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -160,7 +160,6 @@ void tst_QHttpNetworkConnection::head_data() QTest::addColumn<int>("contentLength"); QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962; - QTest::newRow("success-external") << "http://" << "www.ietf.org" << "/rfc/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962; QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1; QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1; @@ -217,7 +216,6 @@ void tst_QHttpNetworkConnection::get_data() QTest::addColumn<int>("downloadSize"); QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962; - QTest::newRow("success-external") << "http://" << "www.ietf.org" << "/rfc/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962; QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1 << -1; QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1 << -1; diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 8ce55cbdf5..bf2d6afdb4 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -128,6 +128,7 @@ public: emit send(value); } + bool operator< ( const Sender & ) const { /* QTBUG-36834 */ return true;} signals: void send(const String::Type&); void send(const Int::Type&); @@ -1538,13 +1539,30 @@ class QTBUG12260_defaultTemplate_Object : public QObject public slots: #if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN) void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>() ) { Q_UNUSED(values); } + void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val + = QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >() ) + { Q_UNUSED(val); } #else // we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has. typedef QHash<QString, QVariant> WorkaroundGCCBug; void doSomething(QHash<QString, QVariant> values = WorkaroundGCCBug() ) { Q_UNUSED(values); } + void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val + = (QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >()) ) + { Q_UNUSED(val); } #endif void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } + +#if defined(Q_MOC_RUN) || (defined(Q_COMPILER_AUTO_TYPE) && !(defined(Q_CC_CLANG) && (__clang_major__ * 100) + __clang_minor__) < 304) + // There is no Q_COMPILER_>> but if compiler support auto, it should also support >> + void performSomething(QVector<QList<QString>> e = QVector<QList<QString>>(8 < 1), + QHash<int, QVector<QString>> h = QHash<int, QVector<QString>>()) + { Q_UNUSED(e); Q_UNUSED(h); } +#else + void performSomething(QVector<QList<QString> > e = QVector<QList<QString> >(), + QHash<int, QVector<QString> > h = (QHash<int, QVector<QString> >())) + { Q_UNUSED(e); Q_UNUSED(h); } +#endif }; @@ -1552,6 +1570,8 @@ void tst_Moc::QTBUG12260_defaultTemplate() { QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1); QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomethingElse(QSharedPointer<QVarLengthArray<QString,(16>>2)> >)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QVector<QList<QString> >,QHash<int,QVector<QString> >)") != -1); } void tst_Moc::notifyError() diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp index cebd4883a4..aaff322c4b 100644 --- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp +++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp @@ -63,6 +63,7 @@ private slots: void collapseTextOnPriority(); void task230994_iconSize(); void task176137_autoRepeatOfAction(); + void qtbug_26956_popupTimerDone(); protected slots: void sendMouseClick(); @@ -223,5 +224,14 @@ void tst_QToolButton::sendMouseClick() QTest::mouseClick(w, Qt::LeftButton, 0, QPoint(7,7)); } +void tst_QToolButton::qtbug_26956_popupTimerDone() +{ + QToolButton *tb = new QToolButton; + tb->setMenu(new QMenu(tb)); + tb->menu()->addAction("Qt"); + tb->deleteLater(); + tb->showMenu(); +} + QTEST_MAIN(tst_QToolButton) #include "tst_qtoolbutton.moc" |