From 0792943d59eaa41f5e04b6ccaf39322eb8657f2a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Nov 2014 21:30:45 -0800 Subject: [PATCH 01/99] Update the ChangeLog for 5.4.0 for the rest of qtbase Change-Id: I255892a9c84a8d873195f9440f9c1808cbe2b5a8 Reviewed-by: Oswald Buddenhagen --- dist/changes-5.4.0 | 443 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 437 insertions(+), 6 deletions(-) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index 614f57afe2..f989904484 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -16,26 +16,398 @@ Each of these identifiers can be entered in the bug tracker to obtain more information about a particular change. **************************************************************************** -* Library * +* Deprecation Notice * **************************************************************************** + - The Q_COMPILER_xxx macros for C++14 compiler features introduced in Qt + 5.3 are deprecated and will not be updated for new compilers either. + User code should be changed to use the macros from Standing Document 6 + instead: + http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations. + This does not affect C++11 feature macros. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - QExplicitelySharedDataPointer's copy constructor which performs a + static_cast from "X *" to "T *" (when constructing a + QExplicitlySharedDataPointer from a QExplicitlySharedDataPointer) + doesn't perform a static_cast from "X *" to "T *" any more. Instead, an + implicit cast is now performed. This change will break compilation of code + that relied on the downcast (i.e. cast towards a more derived type) of the + templated type when copy constructing a QExplicitelySharedDataPointer + object. Please refer to the class documentation for more information about + this issue and a workaround to keep old code compiling. + - QImageReader now automatically rotates JPEG images according to Exif + orientation + - [QTBUG-18980] HarfBuzz-NG is now the default shaper on all platforms. + This results in a better shaping results for various languages, better + performance, and lower memory consumption. + - [QTBUG-41858] Changed QStringRef::right() to be consistent with + QString::right(). The function now returns the N right-most characters, + like the documentation already claimed. + - The mutable Java-style iterators like QListMutableIterator and + QHashMutableIterator no longer set the parent container to unsharable + mode. If you create a copy of the container being iterated on after the + iterator, any changes done with the iterator might affect the copy too. + + - Logging (including qDebug and qWarning): + * Support for the deprecated environment variables QT_NO_JOURNALD_LOG + and QT_ANDROID_PLAIN_LOG has been removed. Instead, set + QT_LOGGING_TO_CONSOLE to 1 to force logging to the console (stderr). + Set that variable to 0 to force logging to the system-specific event + log (if any). + * [QTCREATORBUG-12564] Log output will now go to the system log (if + support for it was compiled into Qt) if the application has no + controlling terminal or console window. Set QT_LOGGING_TO_CONSOLE to 1 + to force logging to go to stderr. + + - QSettings: + * [QTBUG-41812] QSettings::value() now returns an invalid QVariant when + passing an empty key. The code path ran into an assert, which was only + noticeable in debug builds. + * [QTBUG-21739] The locking mechanism inside QSettings has changed + and is no longer compatible with the one of previous versions of + Qt. There might be corruption if two applications running different + versions of Qt are writing to the same config file at the same + time. You must also now have write permissions in the directory + containing the settings file in order to write settings. + +**************************************************************************** +* Library * +**************************************************************************** + +QtConcurrent +------------ + + - [QTBUG-17220] run() now optionally takes as its first argument the + QThreadPool to run the task on. + QtCore ------ - Added QEnableSharedFromThis, a class that allows obtaining a QSharedPointer for an object already managed by a shared pointer. + - Added qHashBits() to aid implementing qHash() overloads for custom + types. + - Added new QByteArrayList class. + - Added QStorageInfo class to retrive information about mounted volumes + and drives + - Logging: + * QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} + * Added QtMsgType argument to QLoggingCategory constructor and + Q_LOGGING_CATEGORY macro that controls the default category + configuration. + * File, line, function information are not recorded anymore for logging + statements in release builds. Set QT_MESSAGELOGCONTEXT explicitly to + enable recording in all configurations. + + - QAbstractProxyModel: + * [QTBUG-39549] QAbstractProxyModel now forwards the drop-related API. + + - QByteArray: + * Added convenience methods to convert directly to and from std::string. + * Fixed a bug that would cause QByteArray to stop converting toUpper or + toLower at the first embedded null character. + + - QCommandLineParser: + * Added addOptions() method. + + - QElapsedTimer: + * Is no longer a POD; its default constructor now initializes the object to + an invalid QElapsedTimer + + - QFlags: + * [QTBUG-39786] Added initializer_list constructor + + - QFuture: + * [QTBUG-17220] Can now be used with any QThreadPool, not just + globalInstance(). + + - QPair: + * Can now be used in C++11 constexpr contexts. + + - QSaveFile: + * Now follows symbolic links when writing to a link instead of + replacing the link with the contents. + + - QSettings: + * [QTBUG-21739] Fixed data loss while writing the config to the disk + fails. + + - QStandardPaths: + * [QTBUG-38483] QStandardPaths now has new enumeration values + AppDataLocation, AppLocalDataLocation to be able to differentiate + between roaming and local paths on the Windows operating system. + DataLocation is deprecated in favor of AppDataLocation. + + - QString: + * QString can now split a string to a list of QStringRef. + * Added the QStringRef::split() function + + - QTextStream: + * QTextStream now uses group separators when writing floating-point + numbers when the locale is not the C locale. The old behavior can be + restored by setting QLocale::OmitGroupSeparator on the locale. + + - QTimer: + * [QTBUG-26406] Implemented new style connect syntax, including + functors, in QTimer::singleShot + + - QUrl: + * QUrl::fromLocalFile now returns an empty URL if the input string is + empty. + + - QVariant: + * [QTBUG-40363] Fixed ordered comparison between QVariants that do not + match but produce identical toString output. + + - QVector: + * Added removeOne() and removeAll() for QList compatibility. + + - QWeakPointer: + * Added lock() method for std::weak_ptr compatibility. + * Added member-swap function. + + - QtJson: + * [QTBUG-26606] QJsonArray and QJsonObject now supports C++11 + initializer lists. + + - QtMath: + * Introduced qNextPowerOfTwo methods. + +QtDBus +------ + + - Blocking calls that take a long time will now generate a warning. The + time taken may be tuned using the environment variables + Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS and + Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS. The value represents (in + milliseconds) how long before a blocking call is warned about. A value + below zero disables the warning, a value of zero will warn about all + blocking calls. + +QtGui +----- + + - Added QPixelFormat class. + - [QTBUG-38168] QtGui's OpenGL headers are now automatically including the + highest available header (gl31.h, gl3.h or gl2.h) in OpenGL ES builds. + - [QTBUG-36483] Dynamic OpenGL implementation loading is now supported on + Windows. This requires Qt to be configured with -opengl dynamic. + - [QTBUG-39583] Keymaps are now changeable at runtime when using eglfs. + - [QTBUG-40841] environment variable QT_DBL_CLICK_DIST customizes the + amount of movement allowed when detecting a double click. + + - Clipboard: + * [QTBUG-41852] Fixed a memory leak in setMimeData() when the platform + plugin did not support the requested mode. + + - Painting: + *[QTBUG-41413] Fixed some very rare cases of mismatched raster modes + in QPainter. + + - QEvent: + * [QTBUG-38858] The debug output for events has been significantly + improved. + + - QFont: + * [QTBUG-22814][QTBUG-22946] QFont now serializes its data properly, + without any data loss. + + - QGuiApplication: + * Add support for -icon command line argument on X11, add -qwindowicon + on all platforms. + * Added QGuiApplication::screenRemoved signal to inform that a screen + has been removed, before Qt reacts to it. + + - QImage: + * [QTBUG-25998] Added support for 10-bit per color channel image + formats. + + - QOpenGLBuffer: + * [QTBUG-38168] Added QOpenGLBuffer::mapBufferRange(). + + - QOpenGLFramebufferObject: + * Introduced an argument to QOpenGLFramebufferObject::toImage() to save + mirroring the result. + * Added support 10-bit per color channels formats as the internal + framebuffer format, making it possible to render in that precision. + + - QOpenGLTextureCache: + * Added support for uploading common QImage formats directly to OpenGL, + if supported by the OpenGL implementation. + + - QPicture: + * [QTBUG-20578] QPicture now serializes its data properly by also + accounting for QDataStream versions greater than Qt 4.5. + + - Tablet support: + * [QTBUG-39458] Added buttons to QTabletEvent + + - Text: + * [QTBUG-41372] Fixed regression when rendering Uchen text in WebKit + on Windows. + * Fixed use of uninitialized memory in the FreeType font engine + +QtNetwork +--------- + + - QNetworkAccessManager: + * Fixed behavior of upload QIODevice that generate data on readyRead() + for HTTP PUT/POST + + - QSsl: + * QSsl::SecureProtocols now also excludes SSLv3 + + - QSslCertificate: + * Can now be used as a key in QSet/QHash. + + - QSslError: + * Can now be used in QSet/QHash. + + - QSslSocket: + * [QTBUG-28471] Added support for finding the version of SSL/TLS in + use by a connection. + * Added accessors for the version of OpenSSL used at build-time. This + will help when debugging problems caused by a mismatch with the + run-time version. + * [QTBUG-1565] Support for loading PKCS#12 bundles was added. These are + often used to conveniently transport keys and certificates, + particularly when making use of client certificates. + +QtPrintSupport +-------------- + + - QPrinter: + * [QTBUG-11332] Added duplex support for Windows and OS X. QtSql ----- - - qsql ibase: fix memory corruption due to LONG being 4 bytes in firebird. - - QSqlDriver::dbmsType(): New method reports DBMS type. Especially useful when using ODBC. + - ibase: Fixed memory corruption due to LONG being 4 bytes in firebird. + + - QSqlDriver: + * Add support for determining DBMS type from SQL driver using + QSqlDriver::dbmsType() + +QtTest +------ + + - Tests now output build information. + +QtWidgets +--------- + + - All widgets with a setReadOnly method now send a ReadOnlyChange event + (e.g., for app-specific palette changes) + - [QTBUG-32888] Accessibility for widgets is now included in the widget + library instead of being a separate plugin. For static builds this means + that libqtaccessiblewidgets is no longer required. + + - QComboBox: + * [QTBUG-33537] Fixed positions of items when QComboBox is set as + editable in Fusion style. + * [QTBUG-33537] Fixed updating appearance of popup menu when changing + the editable state of the combo box. + + - QDialog / Windows: + * [QTBUG-2027] Dialogs can now be menuless. + + - QGraphicsScene: + * Added the minimumRenderSize property which can be used to speed up + rendering by not painting items smaller than a give size. + * The removal of items when using the linear index is now more + efficient. + + - QLayout: + * [QTBUG-37673] Widgets and dialogs containing layouts with + heightForWidth (such as a label with word wrap) will no longer get a + minimum size of 0x0. + + - QLineEdit: + * [QTBUG-40287] The signal textEdited() is now emitted when the user + clicks the clear button created by setClearButtonEnabled() as well. + + - QMainWindow: + * [QTBUG-40410] Dock widgets will now be resized properly when the + central widget has a fixed size. + + - QPlainTextEdit: + * [QTBUG-36415] Fixed a crash when using full width selections and + issuing a complex undo command chain which removes and inserts an + empty block in one go. + * [QTBUG-40347] Fixed a possible divide by zero crash when font metrics + were missing for the font. + + - QTabBar: + * Added changeCurrentOnDrag property. + + - QTableView / QTableWidget: + * [QTBUG-29239] currentIndex() now reflects the top left cell when in a + span. + + - QTreeView: + * Indentation is now style-dependent by default. + * Added resetIndentation(). + + - Styles: + * Allow overriding standardIcon() in a proxy style **************************************************************************** * Platform Specific Changes * **************************************************************************** +Android +------- + + - [QTBUG-36019] Enable using native style also when Ministro deployment + mechanism is not in use. + - [QTBUG-29069] Release all windows when the application is suspended. + - Added Gradle support to build the APK. + - [QTBUG-39688] Back key no longer kills the application when no window is + visible. + - [QTBUG-41365] Default open-source license for Qt for Android is now + LGPLv3. For compatibility with the LGPLv2.1 license, add + "-no-android-style-assets" to your configuration. + - [QTBUG-32399] Input panels are now hidden when focus changes to an object + that does not accept input. + - [QTBUG-41854] Added support for QClipboard::clear() + - [QTBUG-41852] Fixed memory leak in QClipboard::setMimeData() + - [QTBUG-41817] QClipboard::mimeData() now returns an empty object instead + of null pointer from QClipboard when clipboard is empty for consistency + with other platforms. + + - Important Behavior Changes: + * [QTBUG-36274] The main event loop is now stopped when the app is + suspended + +iOS +--- + + - [QTBUG-39097] Accessibility was added to the iOS platform port. This + enables Qt applications to be read by VoiceOver on iOS devices. + - [QTBUG-42276] Fixed path to QStandardPaths::DataLocation. Until now, + DataLocation was pointing to the Document directory. With this patch, + it will return the more accurate Library/Application Support. + Applications making use of DataLocation should move these data to the + new location. This can be done using the path provided by + DocumentLocation as the source path. + +Linux/XCB +--------- + + - [QTBUG-35832] Fixed transparency of tray icons in cases where there + is no alpha channel or system tray visual. + - environment variables QT_XCB_DEBUG_XINPUT and + QT_XCB_DEBUG_XINPUT_DEVICES are deprecated and replaced with logging + categories qt.qpa.events.input and qt.qpa.devices respectively + - [QTBUG-39572] Wacom touch devices are not mistaken for additional + graphics tablets any more. + + OS X ---- @@ -43,17 +415,51 @@ OS X - OS X 10.10 is now supported. - QMacStyle has been updated with better OS 10.10 support. - The Qt binary packages are now configured with C++11 enabled. + - [QTBUG-41208] Fixed detection of writing system support in fonts for + some scripts such as Mkhedruli. + - [QTBUG-41192] Fixed menu item shortcuts without keyboard modifiers. + - [QTBUG-31301] Drag-and-drop QMimeData requests are now delayed until + drop time. + - [QTBUG-10899] Added support for ApplicationState + capability. Application can now detect when an application states + have changed as well when the dock icon has been clicked. + + - Fonts: + * [QTBUG-40986][QTBUG-40549] Fixed missing glyph box shown in place of + some uncommon Unicode code points. Windows ------- - - [QTBUG-38259] Changed configure defaults so that Qt5Core does not - link against ICU libraries anymore. Pass '-icu' to enable it. + - [QTBUG-38259] Changed configure defaults so that Qt5Core does not link + against ICU libraries anymore. Pass '-icu' to enable it. + - [QTBUG-35432][QTBUG-23687] Command line parsing on Windows now uses + the WinAPI function CommandLineToArgvW() to exactly match the quoting + behavior used by the majority of applications. + + - Fonts: + * [QTBUG-41783] Fix off-by-one in font descent when using the + DirectWrite font engine. + * [QTBUG-39961] Set default fallback font to MS Shell Dlg 2 instead of + Arial. **************************************************************************** -* Tools * +* Compiler Specific Changes * **************************************************************************** + - Release builds with Microsoft Visual Studio 2013 now enable the + standard-conforming C and C++ strict string behavior. This option will + be enabled in all builds with future Visual Studio versions. + Non-conforming code should be fixed for maximum portability and + correctness. See http://msdn.microsoft.com/en-us/library/dn449508.aspx + for more information. + +**************************************************************************** +* Tools * +**************************************************************************** + + - [QTBUG-30900] The obsolete findtr script was removed. + configure & build system ------------------------ @@ -66,6 +472,12 @@ configure & build system from a pre-existing Qt installation. - [QTBUG-41267] Fixed parallelized (jom) -debug-and-release builds. +moc +--- + + - Fixed "zero as null pointer constant" warnings in moc's generated + code. + qmake ----- @@ -86,3 +498,22 @@ qmake - QMAKE_EXTRA_COMPILERS' commands and depend_command are no longer mangled. Use $$shell_path() and $$shell_quote() to prepare the commands correctly. - Added link-time optimization support for Clang, GCC and ICC. CONFIG+=ltgc. + +rcc +--- + + - rcc now supports an optional, two-pass compilation that improves build + times for large resource bundles. This feature can be enabled by adding + "CONFIG += resources_big" to your .pro file. Note that this feature may + interfere with builds that enable link-time code generation or other + optimization techniques. + +**************************************************************************** +* Third-party libraries * +**************************************************************************** + + - ANGLE has been upgraded to version 2.1, bringing partial support for + OpenGL ES3 over Direct3D 11, numerous bug fixes, and several new vendor + extensions. + - [QTBUG-40649][QTBUG-40658][QTBUG-41031][QTBUG-41081][QTBUG-41308][QTBUG- + 41563] ANGLE updated to 2.1~f8602ad91e4f From bb07737614d3fdf867e8e5da835554ae731ba04f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 19 Nov 2014 14:14:36 -0800 Subject: [PATCH 02/99] Fix the %{time} printing to *not* default to the process's time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default should be the actual time of day. Showing the process's time is the optional case. In the future, we'll provide a way to showing the monotonic reference time ("boot") and we should improve the detection of actual application runtime. Change-Id: I41936d77ab9fad2073dc0ce1c97cabe57ec39f16 Reviewed-by: Jan Arve Sæther Reviewed-by: Shawn Rutledge --- dist/changes-5.4.0 | 5 +++++ src/corelib/global/qlogging.cpp | 18 +++++++++++------- .../corelib/global/qlogging/tst_qlogging.cpp | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index f989904484..fc3e3a5466 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -97,6 +97,11 @@ QtCore - Logging: * QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} + * QT_MESSAGE_PATTERN can include a timestamp using %{time}. By + default, this shows the time in ISO format (YYYY-MM-DDTHH:mm:ss), + but a different format string can be specified in the tag (e.g., + %{time YYYYMMDDHHmmsszzz}). If the format is "process", Qt will + display the elapsed time since the process started. * Added QtMsgType argument to QLoggingCategory constructor and Q_LOGGING_CATEGORY macro that controls the default category configuration. diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 39c5ac602e..843ec6b0ca 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1201,11 +1201,14 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con } #endif } else if (token == timeTokenC) { - quint64 ms = pattern->timer.elapsed(); - if (pattern->timeFormat.isEmpty()) + if (pattern->timeFormat == QLatin1String("process")) { + quint64 ms = pattern->timer.elapsed(); message.append(QString().sprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000))); - else - message.append(pattern->startTime.addMSecs(ms).toString(pattern->timeFormat)); + } else if (pattern->timeFormat.isEmpty()) { + message.append(QDateTime::currentDateTime().toString(Qt::ISODate)); + } else { + message.append(QDateTime::currentDateTime().toString(pattern->timeFormat)); + } #endif } else if (token == ifCategoryTokenC) { if (!context.category || (strcmp(context.category, "default") == 0)) @@ -1550,9 +1553,10 @@ void qErrnoWarning(int code, const char *msg, ...) \row \li \c %{pid} \li QCoreApplication::applicationPid() \row \li \c %{threadid} \li ID of current thread \row \li \c %{type} \li "debug", "warning", "critical" or "fatal" - \row \li \c %{time} \li time of the message, in seconds since the process started - \row \li \c %{time format} \li system time when the message occurred, formatted by - passing the \c format to \l QDateTime::toString() + \row \li \c %{time process} \li time of the message, in seconds since the process started (the token "process" is literal) + \row \li \c %{time [format]} \li system time when the message occurred, formatted by + passing the \c format to \l QDateTime::toString(). If the format is + not specified, the format of Qt::ISODate is used. \row \li \c{%{backtrace [depth=N] [separator="..."]}} \li A backtrace with the number of frames specified by the optional \c depth parameter (defaults to 5), and separated by the optional \c separator parameter (defaults to "|"). diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 0a55da5b7e..749c7da789 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -765,7 +765,7 @@ void tst_qmessagehandler::qMessagePattern_data() // %{time} should have a padding of 6 so if it takes less than 10 seconds to show // the first message, there should be 5 spaces - QTest::newRow("time") << "<%{time}>%{message}" << true << (QList() + QTest::newRow("time-process") << "<%{time process}>%{message}" << true << (QList() << "< "); #ifdef __GLIBC__ From d0ef89caaba9ee8c57428447f04a17233b8888f5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 21 Nov 2014 10:15:58 +0100 Subject: [PATCH 03/99] Android: Make old manifests work on Android 5 On newer Androids, exceptions have started happening when using old manifests that refer to splash.xml because the layout is missing some required attributes. We add these to avoid crashing with these apps. Change-Id: Iefd4718e811df844e53890ee5bc772871d0a9803 Task-number: QTBUG-42807 Reviewed-by: Christian Stromme --- src/android/java/res/layout/splash.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/java/res/layout/splash.xml b/src/android/java/res/layout/splash.xml index 6875521a12..476d91a844 100644 --- a/src/android/java/res/layout/splash.xml +++ b/src/android/java/res/layout/splash.xml @@ -1,2 +1,4 @@ - + From f9408cc81c7d3cb3fa212005fb30cd8318ebf247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Fri, 21 Nov 2014 11:33:09 +0100 Subject: [PATCH 04/99] Android: protect global jni cache. This fixes a issue that has been neglected for a while, namely, that the access to the global jni caches where not sufficiently protected for concurrent usage. This change also fixes an issue with the thread-name storage. Task-number: QTBUG-42755 Change-Id: I22f95ae7f44d1f6a13e289e52b050d98ccb9fb28 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/kernel/qjni.cpp | 83 ++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index b179323fdc..9d74fd69de 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -37,6 +37,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -45,11 +46,6 @@ static inline QString keyBase() return QStringLiteral("%1%2%3"); } -static inline QByteArray threadBaseName() -{ - return QByteArrayLiteral("QtThread-"); -} - static QString qt_convertJString(jstring string) { QJNIEnvironmentPrivate env; @@ -74,6 +70,7 @@ static inline bool exceptionCheckAndClear(JNIEnv *env) typedef QHash JClassHash; Q_GLOBAL_STATIC(JClassHash, cachedClasses) +Q_GLOBAL_STATIC(QReadWriteLock, cachedClassesLock) static QString toDotEncodedClassName(const char *className) { @@ -82,8 +79,9 @@ static QString toDotEncodedClassName(const char *className) static jclass getCachedClass(const QString &classDotEnc, bool *isCached = 0) { - QHash::iterator it = cachedClasses->find(classDotEnc); - const bool found = (it != cachedClasses->end()); + QReadLocker locker(cachedClassesLock); + const QHash::const_iterator &it = cachedClasses->constFind(classDotEnc); + const bool found = (it != cachedClasses->constEnd()); if (isCached != 0) *isCached = found; @@ -102,6 +100,12 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env) if (!classLoader.isValid()) return 0; + QWriteLocker locker(cachedClassesLock); + // did we lose the race? + const QHash::const_iterator &it = cachedClasses->constFind(classDotEnc); + if (it != cachedClasses->constEnd()) + return it.value(); + QJNIObjectPrivate stringName = QJNIObjectPrivate::fromString(classDotEnc); QJNIObjectPrivate classObject = classLoader.callObjectMethod("loadClass", "(Ljava/lang/String;)Ljava/lang/Class;", @@ -121,6 +125,7 @@ inline static jclass loadClass(const char *className, JNIEnv *env) typedef QHash JMethodIDHash; Q_GLOBAL_STATIC(JMethodIDHash, cachedMethodID) +Q_GLOBAL_STATIC(QReadWriteLock, cachedMethodIDLock) static jmethodID getCachedMethodID(JNIEnv *env, jclass clazz, @@ -128,11 +133,24 @@ static jmethodID getCachedMethodID(JNIEnv *env, const char *sig, bool isStatic = false) { - jmethodID id = 0; // TODO: We need to use something else then the ref. from clazz to avoid collisions. - QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig)); - QHash::iterator it = cachedMethodID->find(key); - if (it == cachedMethodID->end()) { + const QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig)); + QHash::const_iterator it; + + { + QReadLocker locker(cachedMethodIDLock); + it = cachedMethodID->constFind(key); + if (it != cachedMethodID->constEnd()) + return it.value(); + } + + { + QWriteLocker locker(cachedMethodIDLock); + it = cachedMethodID->constFind(key); + if (it != cachedMethodID->constEnd()) + return it.value(); + + jmethodID id = 0; if (isStatic) id = env->GetStaticMethodID(clazz, name, sig); else @@ -142,14 +160,13 @@ static jmethodID getCachedMethodID(JNIEnv *env, id = 0; cachedMethodID->insert(key, id); - } else { - id = it.value(); + return id; } - return id; } typedef QHash JFieldIDHash; Q_GLOBAL_STATIC(JFieldIDHash, cachedFieldID) +Q_GLOBAL_STATIC(QReadWriteLock, cachedFieldIDLock) static jfieldID getCachedFieldID(JNIEnv *env, jclass clazz, @@ -157,10 +174,23 @@ static jfieldID getCachedFieldID(JNIEnv *env, const char *sig, bool isStatic = false) { - jfieldID id = 0; - QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig)); - QHash::iterator it = cachedFieldID->find(key); - if (it == cachedFieldID->end()) { + const QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig)); + QHash::const_iterator it; + + { + QReadLocker locker(cachedFieldIDLock); + it = cachedFieldID->constFind(key); + if (it != cachedFieldID->constEnd()) + return it.value(); + } + + { + QWriteLocker locker(cachedFieldIDLock); + it = cachedFieldID->constFind(key); + if (it != cachedFieldID->constEnd()) + return it.value(); + + jfieldID id = 0; if (isStatic) id = env->GetStaticFieldID(clazz, name, sig); else @@ -170,10 +200,8 @@ static jfieldID getCachedFieldID(JNIEnv *env, id = 0; cachedFieldID->insert(key, id); - } else { - id = it.value(); + return id; } - return id; } class QJNIEnvironmentPrivateTLS @@ -187,14 +215,14 @@ public: Q_GLOBAL_STATIC(QThreadStorage, jniEnvTLS) +static const char qJniThreadName[] = "QtThread"; + QJNIEnvironmentPrivate::QJNIEnvironmentPrivate() : jniEnv(0) { JavaVM *vm = QtAndroidPrivate::javaVM(); if (vm->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) == JNI_EDETACHED) { - const qulonglong id = reinterpret_cast(QThread::currentThreadId()); - const QByteArray threadName = threadBaseName() + QByteArray::number(id); - JavaVMAttachArgs args = { JNI_VERSION_1_6, threadName, Q_NULLPTR }; + JavaVMAttachArgs args = { JNI_VERSION_1_6, qJniThreadName, Q_NULLPTR }; if (vm->AttachCurrentThread(&jniEnv, &args) != JNI_OK) return; } @@ -223,6 +251,12 @@ jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env) return clazz; if (env != 0) { // We got an env. pointer (We expect this to be the right env. and call FindClass()) + QWriteLocker locker(cachedClassesLock); + const QHash::const_iterator &it = cachedClasses->constFind(classDotEnc); + // Did we lose the race? + if (it != cachedClasses->constEnd()) + return it.value(); + jclass fclazz = env->FindClass(className); if (!exceptionCheckAndClear(env)) { clazz = static_cast(env->NewGlobalRef(fclazz)); @@ -400,7 +434,6 @@ QJNIObjectPrivate::QJNIObjectPrivate(jobject obj) d->m_jclass = static_cast(env->NewGlobalRef(objectClass)); env->DeleteLocalRef(objectClass); } - template <> void QJNIObjectPrivate::callMethodV(const char *methodName, const char *sig, va_list args) const { From c9c40af130763d81531ebee35d22d3b5573f48ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Wed, 12 Nov 2014 12:27:39 +0200 Subject: [PATCH 05/99] Mark QSocks5SocketEngine tests blacklisted This patch is cherry-picked from 63ae74f36533d92c5b38df1eb2a7fcf4c586bf11 and 07f234d2a8283081aabdd1465f09b04a26bec1a3 Task-number: QTBUG-42528 Change-Id: I5f86679e62a4be48ce25afa5a4987a2b6678a357 Reviewed-by: Frederik Gladhorn --- tests/auto/network/socket/qsocks5socketengine/BLACKLIST | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/auto/network/socket/qsocks5socketengine/BLACKLIST diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST new file mode 100644 index 0000000000..bf4afa8c45 --- /dev/null +++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST @@ -0,0 +1,4 @@ +[udpTest] +* +[passwordAuth] +* From 800f832201267bcbf6a7e9b4b9dbc69f9029dcc0 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 21 Nov 2014 15:30:01 +0100 Subject: [PATCH 06/99] Apply r1513 to our PCRE bundled copy Fixes CVE-2014-8964. Upstream diff: http://www.exim.org/viewvc/pcre?view=revision&revision=1513 Change-Id: I59dc1f4c290e29ab5f22ed68eaeba702f4232e0e Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll Reviewed-by: Richard J. Moore --- src/3rdparty/pcre/patches/pcre-r1513.patch | 18 ++++++++++++++++++ src/3rdparty/pcre/pcre_exec.c | 7 +++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/3rdparty/pcre/patches/pcre-r1513.patch diff --git a/src/3rdparty/pcre/patches/pcre-r1513.patch b/src/3rdparty/pcre/patches/pcre-r1513.patch new file mode 100644 index 0000000000..d84aa0cc61 --- /dev/null +++ b/src/3rdparty/pcre/patches/pcre-r1513.patch @@ -0,0 +1,18 @@ +Index: pcre_exec.c +=================================================================== +--- pcre_exec.c (revisione 1512) ++++ pcre_exec.c (revisione 1513) +@@ -1404,8 +1404,11 @@ + condition = TRUE; + + /* Advance ecode past the assertion to the start of the first branch, +- but adjust it so that the general choosing code below works. */ +- ++ but adjust it so that the general choosing code below works. If the ++ assertion has a quantifier that allows zero repeats we must skip over ++ the BRAZERO. This is a lunatic thing to do, but somebody did! */ ++ ++ if (*ecode == OP_BRAZERO) ecode++; + ecode += GET(ecode, 1); + while (*ecode == OP_ALT) ecode += GET(ecode, 1); + ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode]; diff --git a/src/3rdparty/pcre/pcre_exec.c b/src/3rdparty/pcre/pcre_exec.c index b0101da351..7755aaf13a 100644 --- a/src/3rdparty/pcre/pcre_exec.c +++ b/src/3rdparty/pcre/pcre_exec.c @@ -1394,8 +1394,11 @@ for (;;) condition = TRUE; /* Advance ecode past the assertion to the start of the first branch, - but adjust it so that the general choosing code below works. */ - + but adjust it so that the general choosing code below works. If the + assertion has a quantifier that allows zero repeats we must skip over + the BRAZERO. This is a lunatic thing to do, but somebody did! */ + + if (*ecode == OP_BRAZERO) ecode++; ecode += GET(ecode, 1); while (*ecode == OP_ALT) ecode += GET(ecode, 1); ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode]; From d958a16bc15603dc3dfce36d126b4917d4290945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 13 Nov 2014 13:25:12 +0200 Subject: [PATCH 07/99] Blacklist one test function in tst_QNetworkReply This patch is cherry-picked from c38f1f19b87d20f79394bca151268fc3cdcdd189 and d29d727d720fa4ac7ba046b6bfb96707586de7d3 Task-number: QTBUG-32435 Change-Id: I6dbbb668b96737a5791bc688949a00bc09f1357f Reviewed-by: Frederik Gladhorn --- tests/auto/network/access/qnetworkreply/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST index fbd72492d8..7792e05e0f 100644 --- a/tests/auto/network/access/qnetworkreply/BLACKLIST +++ b/tests/auto/network/access/qnetworkreply/BLACKLIST @@ -7,3 +7,6 @@ osx [SslHandshakeFailedError] osx [httpAbort] +* +[backgroundRequestInterruption:ftp, bg, nobg] +* From 0fc578829115d593c9a09bd4b2a5e9fea1a759d1 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 21 Nov 2014 16:08:29 +0100 Subject: [PATCH 08/99] Fix for HTC Pinyin input method HTC does not do beginBatchEdit/endBatchEdit when committing text. We implement the commit in two steps: first set the text, then move the cursor. To avoid sending an updateSelection for the intermediate state, we need to block updates when we set the text in the editor. Task-number: QTBUG-42300 Change-Id: Icd18700ecf1fba5acb9f8a78762555c1309b221b Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/qandroidinputcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index a3848c9c2b..7e81735de9 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -611,6 +611,9 @@ jboolean QAndroidInputContext::endBatchEdit() */ jboolean QAndroidInputContext::commitText(const QString &text, jint newCursorPosition) { + bool updateSelectionWasBlocked = m_blockUpdateSelection; + m_blockUpdateSelection = true; + QInputMethodEvent event; event.setCommitString(text); sendInputMethodEventThreadSafe(&event); @@ -630,6 +633,7 @@ jboolean QAndroidInputContext::commitText(const QString &text, jint newCursorPos newLocalPos, 0, QVariant())); } } + m_blockUpdateSelection = updateSelectionWasBlocked; updateCursorPosition(); return JNI_TRUE; From 78c43ce8ea882839bb507ebb2a71ec6752697d8e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 22 Nov 2014 19:37:29 +0100 Subject: [PATCH 09/99] Update 5.4.0 changes with missing entries Change-Id: I2bd0fb79817ac391a2a7c6b9d12ccef5c19ebd88 Reviewed-by: Thiago Macieira --- dist/changes-5.4.0 | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index fc3e3a5466..2b6cd2b4db 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -198,6 +198,10 @@ QtGui ----- - Added QPixelFormat class. + - Added QOpenGLWidget class. + - Added QOpenGLWindow class. + - Added QRasterWindow class. + - QOpenGLContext is now able to adopt existing native contexts. - [QTBUG-38168] QtGui's OpenGL headers are now automatically including the highest available header (gl31.h, gl3.h or gl2.h) in OpenGL ES builds. - [QTBUG-36483] Dynamic OpenGL implementation loading is now supported on @@ -205,6 +209,10 @@ QtGui - [QTBUG-39583] Keymaps are now changeable at runtime when using eglfs. - [QTBUG-40841] environment variable QT_DBL_CLICK_DIST customizes the amount of movement allowed when detecting a double click. + - [QTBUG-37552] The eglfs mouse cursor properly resets the array buffer + from now on to avoid rendering issues. + - [QTBUG-40093] QWindow::close() is changed to send a QCloseEvent which + must be accepted before destroy() will be called. - Clipboard: * [QTBUG-41852] Fixed a memory leak in setMimeData() when the platform @@ -250,7 +258,11 @@ QtGui accounting for QDataStream versions greater than Qt 4.5. - Tablet support: - * [QTBUG-39458] Added buttons to QTabletEvent + * [QTBUG-39458] Added buttons to QTabletEvent. + * [QTBUG-39666] Events correctly identify the tool. + * [QTBUG-39570][QTBUG-40469] Corrected valuator ranges across platforms. + * Better support for non-Wacom devices. + * Better manual test to verify more features. - Text: * [QTBUG-41372] Fixed regression when rendering Uchen text in WebKit @@ -311,6 +323,8 @@ QtWidgets - [QTBUG-32888] Accessibility for widgets is now included in the widget library instead of being a separate plugin. For static builds this means that libqtaccessiblewidgets is no longer required. + - [QTBUG-39814] Accessors for Qt::MouseEventSource and Qt::MouseEventFlags + are now available in QGraphicsSceneMouseEvent. - QComboBox: * [QTBUG-33537] Fixed positions of items when QComboBox is set as @@ -365,6 +379,10 @@ QtWidgets * Platform Specific Changes * **************************************************************************** +- Several QPA logging categories are added under qt.qpa to enable logging + of various platform-specific details. qt.qpa.input is now used + consistently. + Android ------- @@ -408,10 +426,9 @@ Linux/XCB is no alpha channel or system tray visual. - environment variables QT_XCB_DEBUG_XINPUT and QT_XCB_DEBUG_XINPUT_DEVICES are deprecated and replaced with logging - categories qt.qpa.events.input and qt.qpa.devices respectively - - [QTBUG-39572] Wacom touch devices are not mistaken for additional - graphics tablets any more. - + categories qt.qpa.input and qt.qpa.input.devices respectively + - [QTBUG-39572] Wacom touch devices are now working correctly. + - [QTBUG-42249] A path to a font file can now contain non-Latin characters. OS X ---- @@ -522,3 +539,6 @@ rcc extensions. - [QTBUG-40649][QTBUG-40658][QTBUG-41031][QTBUG-41081][QTBUG-41308][QTBUG- 41563] ANGLE updated to 2.1~f8602ad91e4f + - [QTBUG-41031] The ANGLE D3D11 renderer is now enabled by default. Systems + which cannot use the new renderer will automatically fall back to the D3D9 + renderer at runtime. From f88ab80c8a7510ff01410631eeaec81d48365316 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Fri, 21 Nov 2014 12:44:33 +0100 Subject: [PATCH 10/99] Use camel case in PKCS#12 function This makes it follow the coding style, which says to camel case acronyms too, and makes it consistent with the rest of the class. Change-Id: I4a1b21de1815530e476fc5aa8a0d41c724fc8021 Reviewed-by: Richard J. Moore Reviewed-by: hjk --- src/network/ssl/qsslcertificate.cpp | 4 ++-- src/network/ssl/qsslcertificate.h | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/network/ssl/qsslsocket_openssl_p.h | 2 +- src/network/ssl/qsslsocket_winrt.cpp | 2 +- src/network/ssl/qsslsocket_winrt_p.h | 2 +- .../auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 13bddcb3ea..125a7a0250 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -575,12 +575,12 @@ QList QSslCertificate::verify(QList certificateChain \note The \a device must be open and ready to be read from. */ -bool QSslCertificate::importPKCS12(QIODevice *device, +bool QSslCertificate::importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList *caCertificates, const QByteArray &passPhrase) { - return QSslSocketBackendPrivate::importPKCS12(device, key, certificate, caCertificates, passPhrase); + return QSslSocketBackendPrivate::importPkcs12(device, key, certificate, caCertificates, passPhrase); } // These certificates are known to be fraudulent and were created during the comodo diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index e34ea97fc4..6aa7544815 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -138,7 +138,7 @@ public: static QList verify(QList certificateChain, const QString &hostName = QString()); - static bool importPKCS12(QIODevice *device, + static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList *caCertificates=0, const QByteArray &passPhrase=QByteArray()); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 84b0d9c75e..13fc534259 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1671,7 +1671,7 @@ QList QSslSocketBackendPrivate::verify(QList certifi return errors; } -bool QSslSocketBackendPrivate::importPKCS12(QIODevice *device, +bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList *caCertificates, const QByteArray &passPhrase) diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index 8b02f32be0..29907e9ae7 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -136,7 +136,7 @@ public: static QList STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509); static QList verify(QList certificateChain, const QString &hostName); static QString getErrorsFromOpenSsl(); - static bool importPKCS12(QIODevice *device, + static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList *caCertificates, const QByteArray &passPhrase); diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp index da4c72be01..418a7416e4 100644 --- a/src/network/ssl/qsslsocket_winrt.cpp +++ b/src/network/ssl/qsslsocket_winrt.cpp @@ -661,7 +661,7 @@ QList QSslSocketBackendPrivate::verify(QList certifi return errors; } -bool QSslSocketBackendPrivate::importPKCS12(QIODevice *device, +bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList *caCertificates, const QByteArray &passPhrase) diff --git a/src/network/ssl/qsslsocket_winrt_p.h b/src/network/ssl/qsslsocket_winrt_p.h index aa31c85d6e..f0df7c6ef1 100644 --- a/src/network/ssl/qsslsocket_winrt_p.h +++ b/src/network/ssl/qsslsocket_winrt_p.h @@ -92,7 +92,7 @@ public: static QList defaultCiphers(); static QList verify(QList certificateChain, const QString &hostName); - static bool importPKCS12(QIODevice *device, + static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList *caCertificates, const QByteArray &passPhrase); diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index 49ff1b48fe..82050e73fd 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -1312,7 +1312,7 @@ void tst_QSslCertificate::pkcs12() #ifdef QT_NO_OPENSSL QEXPECT_FAIL("", "QTBUG-40884: WinRT API does not support pkcs12 imports", Abort); #endif - ok = QSslCertificate::importPKCS12(&f, &key, &cert, &caCerts); + ok = QSslCertificate::importPkcs12(&f, &key, &cert, &caCerts); QVERIFY(ok); f.close(); From 155306ffee1941194d44dd632a7993fce4a05606 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 24 Nov 2014 10:52:03 +0100 Subject: [PATCH 11/99] ANGLE: Fix releasing textures after we kill D3D11 Cherry-pick upstream commit cc4cd2925b9a4f1142a86df131345a861c9d7cd9 to fix crashes on exit. Task-number: QTBUG-42772 Change-Id: Ib74be17f2b5fdd58f9e0568e1da74ba19e943019 Reviewed-by: Andrew Knight Reviewed-by: Friedemann Kleint --- src/3rdparty/angle/src/libGLESv2/Context.cpp | 6 - src/3rdparty/angle/src/libGLESv2/Context.h | 1 - .../libGLESv2/renderer/d3d/RendererD3D.cpp | 5 + .../src/libGLESv2/renderer/d3d/RendererD3D.h | 2 + .../renderer/d3d/d3d11/Renderer11.cpp | 2 + .../libGLESv2/renderer/d3d/d3d9/Renderer9.cpp | 2 + ...leasing-textures-after-we-kill-D3D11.patch | 106 ++++++++++++++++++ 7 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 src/angle/patches/0018-ANGLE-Fix-releasing-textures-after-we-kill-D3D11.patch diff --git a/src/3rdparty/angle/src/libGLESv2/Context.cpp b/src/3rdparty/angle/src/libGLESv2/Context.cpp index b87689cd3f..3772da6f42 100644 --- a/src/3rdparty/angle/src/libGLESv2/Context.cpp +++ b/src/3rdparty/angle/src/libGLESv2/Context.cpp @@ -162,12 +162,6 @@ Context::~Context() deleteTransformFeedback(mTransformFeedbackMap.begin()->first); } - for (TextureMap::iterator i = mIncompleteTextures.begin(); i != mIncompleteTextures.end(); i++) - { - i->second.set(NULL); - } - mIncompleteTextures.clear(); - for (TextureMap::iterator i = mZeroTextures.begin(); i != mZeroTextures.end(); i++) { i->second.set(NULL); diff --git a/src/3rdparty/angle/src/libGLESv2/Context.h b/src/3rdparty/angle/src/libGLESv2/Context.h index 1e890de3ef..0699592d91 100644 --- a/src/3rdparty/angle/src/libGLESv2/Context.h +++ b/src/3rdparty/angle/src/libGLESv2/Context.h @@ -247,7 +247,6 @@ class Context int mClientVersion; TextureMap mZeroTextures; - TextureMap mIncompleteTextures; typedef std::unordered_map FramebufferMap; FramebufferMap mFramebufferMap; diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp index 97da6da7fd..5cddd8ab5e 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp +++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp @@ -26,6 +26,11 @@ RendererD3D::RendererD3D(egl::Display *display) } RendererD3D::~RendererD3D() +{ + cleanup(); +} + +void RendererD3D::cleanup() { for (gl::TextureMap::iterator i = mIncompleteTextures.begin(); i != mIncompleteTextures.end(); ++i) { diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h index 9919207667..a2f778763c 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h +++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h @@ -160,6 +160,8 @@ class RendererD3D : public Renderer const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) = 0; + void cleanup(); + egl::Display *mDisplay; private: diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp index e6d7f3025b..777308e6cc 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp +++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp @@ -1870,6 +1870,8 @@ bool Renderer11::testDeviceResettable() void Renderer11::release() { + RendererD3D::cleanup(); + releaseShaderCompiler(); releaseDeviceResources(); diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp index 601cd24b10..18e6e2d7f0 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp +++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp @@ -151,6 +151,8 @@ Renderer9::~Renderer9() void Renderer9::release() { + RendererD3D::cleanup(); + releaseShaderCompiler(); releaseDeviceResources(); diff --git a/src/angle/patches/0018-ANGLE-Fix-releasing-textures-after-we-kill-D3D11.patch b/src/angle/patches/0018-ANGLE-Fix-releasing-textures-after-we-kill-D3D11.patch new file mode 100644 index 0000000000..97847ad684 --- /dev/null +++ b/src/angle/patches/0018-ANGLE-Fix-releasing-textures-after-we-kill-D3D11.patch @@ -0,0 +1,106 @@ +From 014d3fcf6011109491b0489da9c1abb1fdc6dbdc Mon Sep 17 00:00:00 2001 +From: Kai Koehne +Date: Mon, 24 Nov 2014 10:52:03 +0100 +Subject: [PATCH] ANGLE: Fix releasing textures after we kill D3D11 + +Cherry-pick upstream commit cc4cd2925b9a4f1142a86df131345a861c9d7cd9 +to fix crashes on exit. + +Task-number: QTBUG-42772 +Change-Id: Ib74be17f2b5fdd58f9e0568e1da74ba19e943019 +--- + src/3rdparty/angle/src/libGLESv2/Context.cpp | 6 ------ + src/3rdparty/angle/src/libGLESv2/Context.h | 1 - + src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp | 5 +++++ + src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h | 2 ++ + src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp | 2 ++ + src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp | 2 ++ + 6 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/src/3rdparty/angle/src/libGLESv2/Context.cpp b/src/3rdparty/angle/src/libGLESv2/Context.cpp +index b87689c..3772da6 100644 +--- a/src/3rdparty/angle/src/libGLESv2/Context.cpp ++++ b/src/3rdparty/angle/src/libGLESv2/Context.cpp +@@ -162,12 +162,6 @@ Context::~Context() + deleteTransformFeedback(mTransformFeedbackMap.begin()->first); + } + +- for (TextureMap::iterator i = mIncompleteTextures.begin(); i != mIncompleteTextures.end(); i++) +- { +- i->second.set(NULL); +- } +- mIncompleteTextures.clear(); +- + for (TextureMap::iterator i = mZeroTextures.begin(); i != mZeroTextures.end(); i++) + { + i->second.set(NULL); +diff --git a/src/3rdparty/angle/src/libGLESv2/Context.h b/src/3rdparty/angle/src/libGLESv2/Context.h +index 1e890de..0699592 100644 +--- a/src/3rdparty/angle/src/libGLESv2/Context.h ++++ b/src/3rdparty/angle/src/libGLESv2/Context.h +@@ -247,7 +247,6 @@ class Context + int mClientVersion; + + TextureMap mZeroTextures; +- TextureMap mIncompleteTextures; + + typedef std::unordered_map FramebufferMap; + FramebufferMap mFramebufferMap; +diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp +index 97da6da..5cddd8a 100644 +--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp ++++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp +@@ -27,6 +27,11 @@ RendererD3D::RendererD3D(egl::Display *display) + + RendererD3D::~RendererD3D() + { ++ cleanup(); ++} ++ ++void RendererD3D::cleanup() ++{ + for (gl::TextureMap::iterator i = mIncompleteTextures.begin(); i != mIncompleteTextures.end(); ++i) + { + i->second.set(NULL); +diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h +index 9919207..a2f7787 100644 +--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h ++++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h +@@ -160,6 +160,8 @@ class RendererD3D : public Renderer + const gl::Rectangle *scissor, bool blitRenderTarget, + bool blitDepth, bool blitStencil, GLenum filter) = 0; + ++ void cleanup(); ++ + egl::Display *mDisplay; + + private: +diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp +index e6d7f30..777308e 100644 +--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp ++++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp +@@ -1870,6 +1870,8 @@ bool Renderer11::testDeviceResettable() + + void Renderer11::release() + { ++ RendererD3D::cleanup(); ++ + releaseShaderCompiler(); + releaseDeviceResources(); + +diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp +index 601cd24..18e6e2d 100644 +--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp ++++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp +@@ -151,6 +151,8 @@ Renderer9::~Renderer9() + + void Renderer9::release() + { ++ RendererD3D::cleanup(); ++ + releaseShaderCompiler(); + releaseDeviceResources(); + +-- +1.9.4.msysgit.0 + From 9b01589e58d458b6367b3578079e73ddc2ef458f Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Tue, 25 Nov 2014 13:31:20 +0200 Subject: [PATCH 12/99] Turn off optimizations of qt_depthForFormat on Windows Runtime ARM This function is apparently optimized in a way that gives a bad return value (or leaves the variable where it is used uninitialized), leading to extreme memory allocations and eventual heap exhaustion. Task-number: QTBUG-42038 Change-Id: Ia4ee9fc6475a0bf40e25eed356b027a4dc68d119 Reviewed-by: Maurice Kalinowski --- src/gui/image/qimage_p.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index eec54ed4eb..7e2d4305ef 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -116,6 +116,9 @@ void qInitImageConversions(); const uchar *qt_get_bitflip_array(); Q_GUI_EXPORT void qGamma_correct_back_to_linear_cs(QImage *image); +#if defined(Q_OS_WINRT) && defined(_M_ARM) // QTBUG-42038 +#pragma optimize("", off) +#endif inline int qt_depthForFormat(QImage::Format format) { int depth = 0; @@ -158,6 +161,9 @@ inline int qt_depthForFormat(QImage::Format format) } return depth; } +#if defined(Q_OS_WINRT) && defined(_M_ARM) +#pragma optimize("", on) +#endif QT_END_NAMESPACE From aed71b6832703e0c6cb953ac9a5cd7cfba95f7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Tue, 25 Nov 2014 11:05:10 +0200 Subject: [PATCH 13/99] Blacklist one tst_qsslsocket test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-29941 Change-Id: Ieb3418a2d6d88ebd399964b5df20d9fe4d6ca37b Reviewed-by: Simo Fält --- tests/auto/network/ssl/qsslsocket/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/network/ssl/qsslsocket/BLACKLIST diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST new file mode 100644 index 0000000000..17b606e2be --- /dev/null +++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST @@ -0,0 +1,2 @@ +[waitForConnectedEncryptedReadyRead:WithSocks5ProxyAuth] +* From 89867f86fc5766c30253748560b8c16f721e808e Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 24 Nov 2014 16:44:31 +0100 Subject: [PATCH 14/99] iOS, QComboBox: don't apply special case for OS X on iOS The special-case that was added for OS X before the iOS port came to be stops the virtual keyboard from working correctly. Task-number: QTBUG-41613 Change-Id: I0b8c83e98584389ea4a8aada16a1ee1a64300400 Reviewed-by: Jake Petroules --- src/widgets/widgets/qcombobox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index fda37c49de..40cf2f0f95 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -942,8 +942,8 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent) void QComboBoxPrivate::init() { Q_Q(QComboBox); -#ifdef Q_OS_MAC - // On Mac, only line edits and list views always get tab focus. It's only +#ifdef Q_OS_OSX + // On OS X, only line edits and list views always get tab focus. It's only // when we enable full keyboard access that other controls can get tab focus. // When it's not editable, a combobox looks like a button, and it behaves as // such in this respect. From 503b9c318164122b0111f6d0d9d3b680c8ca016f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 24 Nov 2014 11:21:07 +0100 Subject: [PATCH 15/99] iOS: fallback to use [UIScreen mainScreen] when [UIScreen screens] fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On iOS 7.1 [UIScreen screens] sometimes (and against documentation) returns an empty array, which will lead to a crash. This patch will add a fallback path that uses [UIScreen mainScreen] instead when the screen count is 0. Task-number: QTBUG-42345 Change-Id: Ie72578ff7ecd0c8fbc971fafea45047bf1347cd9 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosintegration.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index 9a722ead37..461f160892 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -88,7 +88,13 @@ QIOSIntegration::QIOSIntegration() // Set current directory to app bundle folder QDir::setCurrent(QString::fromUtf8([[[NSBundle mainBundle] bundlePath] UTF8String])); - for (UIScreen *screen in [UIScreen screens]) + NSMutableArray *screens = [[[UIScreen screens] mutableCopy] autorelease]; + if (![screens containsObject:[UIScreen mainScreen]]) { + // Fallback for iOS 7.1 (QTBUG-42345) + [screens insertObject:[UIScreen mainScreen] atIndex:0]; + } + + for (UIScreen *screen in screens) addScreen(new QIOSScreen(screen)); // Depends on a primary screen being present From 37fb892767baa08fca6f5172c51bdc1e270c72ec Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 24 Nov 2014 12:15:34 +0100 Subject: [PATCH 16/99] Android: Report error when OpenSSL is on and headers are missing There was an override for Android which would disable the configure error when doing an OpenSSL build without having the headers available. This has several times lead to packaging errors where OpenSSL gets disabled but it's not noticed before the package testing, which delays the process. I'm not 100% sure of the reasoning behind the override, but I think it's a left-over from Necessitas where OpenSSL was statically linked into Qt. Change-Id: I2bdc33fb60c59cd493987959d4bbbbb4e9735a92 Task-number: QTBUG-42851 Reviewed-by: Frederik Gladhorn Reviewed-by: BogDan Vatra Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 1a002b4081..d95d8a2a4a 100755 --- a/configure +++ b/configure @@ -5481,7 +5481,7 @@ if [ "$CFG_OPENSSL" != "no" ]; then CFG_OPENSSL=yes fi else - if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ] && [ "$XPLATFORM_ANDROID" = "no" ]; then + if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "OpenSSL support cannot be enabled due to functionality tests!" echo " Turn on verbose messaging (-v) to $0 to see the final report." echo " If you believe this message is in error you may use the continue" From 6ea6ee7a129523dfe2973b92359afd672ef92f47 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Thu, 20 Nov 2014 12:55:56 +0100 Subject: [PATCH 17/99] Adjust DBMSType to DbmsType to follow conventions The enum was made public in f84b00c6d26eb7a3a6802210d2a8b12ddbf815aa, but this makes it follow the convention to camel case acronyms too before it's too late to change it. Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08 Reviewed-by: Thiago Macieira --- src/sql/kernel/qsqldriver.cpp | 6 +-- src/sql/kernel/qsqldriver.h | 6 +-- src/sql/kernel/qsqldriver_p.h | 4 +- .../sql/kernel/qsqldatabase/tst_databases.h | 10 ++-- .../kernel/qsqldatabase/tst_qsqldatabase.cpp | 32 ++++++------- .../sql/kernel/qsqldriver/tst_qsqldriver.cpp | 6 +-- .../sql/kernel/qsqlquery/tst_qsqlquery.cpp | 46 +++++++++---------- .../qsqlquerymodel/tst_qsqlquerymodel.cpp | 8 ++-- .../tst_qsqlrelationaltablemodel.cpp | 20 ++++---- .../qsqltablemodel/tst_qsqltablemodel.cpp | 6 +-- .../benchmarks/sql/kernel/qsqlquery/main.cpp | 6 +-- 11 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp index 736fe310e3..f218016876 100644 --- a/src/sql/kernel/qsqldriver.cpp +++ b/src/sql/kernel/qsqldriver.cpp @@ -237,11 +237,11 @@ bool QSqlDriver::isOpenError() const */ /*! - \enum QSqlDriver::DBMSType + \enum QSqlDriver::DbmsType This enum contains DBMS types. - \value UnknownDBMS + \value UnknownDbms \value MSSqlServer \value MySqlServer \value PostgreSQL @@ -787,7 +787,7 @@ QSql::NumericalPrecisionPolicy QSqlDriver::numericalPrecisionPolicy() const Returns the current DBMS type for the database connection. */ -QSqlDriver::DBMSType QSqlDriver::dbmsType() const +QSqlDriver::DbmsType QSqlDriver::dbmsType() const { return d_func()->dbmsType; } diff --git a/src/sql/kernel/qsqldriver.h b/src/sql/kernel/qsqldriver.h index 767c1ac74d..eabda74da5 100644 --- a/src/sql/kernel/qsqldriver.h +++ b/src/sql/kernel/qsqldriver.h @@ -71,8 +71,8 @@ public: enum NotificationSource { UnknownSource, SelfSource, OtherSource }; - enum DBMSType { - UnknownDBMS, + enum DbmsType { + UnknownDbms, MSSqlServer, MySqlServer, PostgreSQL, @@ -123,7 +123,7 @@ public: void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy); QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const; - DBMSType dbmsType() const; + DbmsType dbmsType() const; public Q_SLOTS: virtual bool cancelQuery(); diff --git a/src/sql/kernel/qsqldriver_p.h b/src/sql/kernel/qsqldriver_p.h index 427e3984fa..c511f8e13b 100644 --- a/src/sql/kernel/qsqldriver_p.h +++ b/src/sql/kernel/qsqldriver_p.h @@ -61,14 +61,14 @@ public: isOpen(false), isOpenError(false), precisionPolicy(QSql::LowPrecisionDouble), - dbmsType(QSqlDriver::UnknownDBMS) + dbmsType(QSqlDriver::UnknownDbms) { } uint isOpen; uint isOpenError; QSqlError error; QSql::NumericalPrecisionPolicy precisionPolicy; - QSqlDriver::DBMSType dbmsType; + QSqlDriver::DbmsType dbmsType; }; QT_END_NAMESPACE diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h index d5ccc194bb..af6dc6b9f4 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h +++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h @@ -385,7 +385,7 @@ public: bool wasDropped; QSqlQuery q( db ); QStringList dbtables=db.tables(); - QSqlDriver::DBMSType dbType = getDatabaseType(db); + QSqlDriver::DbmsType dbType = getDatabaseType(db); foreach(const QString &tableName, tableNames) { wasDropped = true; @@ -462,7 +462,7 @@ public: // blobSize is only used if the db doesn't have a generic blob type static QString blobTypeName( QSqlDatabase db, int blobSize = 10000 ) { - const QSqlDriver::DBMSType dbType = getDatabaseType(db); + const QSqlDriver::DbmsType dbType = getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) return "longblob"; @@ -491,7 +491,7 @@ public: static QString dateTimeTypeName(QSqlDatabase db) { - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) return QLatin1String("timestamp"); if (dbType == QSqlDriver::Oracle && getOraVersion(db) >= 9) @@ -501,7 +501,7 @@ public: static QString autoFieldName( QSqlDatabase db ) { - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) return "AUTO_INCREMENT"; if (dbType == QSqlDriver::Sybase || dbType == QSqlDriver::MSSqlServer) @@ -538,7 +538,7 @@ public: return result.toLocal8Bit(); } - static QSqlDriver::DBMSType getDatabaseType(QSqlDatabase db) + static QSqlDriver::DbmsType getDatabaseType(QSqlDatabase db) { QSqlDriverPrivate *d = static_cast(QObjectPrivate::get(db.driver())); return d->dbmsType; diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 6faf8b7ed5..c314528065 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -234,7 +234,7 @@ struct FieldDef { // excluding the primary key field static int createFieldTable(const FieldDef fieldDefs[], QSqlDatabase db) { - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString tableName = qTableName("qtestfields", __FILE__, db); tst_Databases::safeDropTable(db, tableName); QSqlQuery q(db); @@ -281,7 +281,7 @@ void tst_QSqlDatabase::createTestTables(QSqlDatabase db) return; const QString tableName = qTableName("qtest", __FILE__, db); QSqlQuery q(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) { // ### stupid workaround until we find a way to hardcode this // in the MySQL server startup script @@ -318,7 +318,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db) if (!db.isValid()) return; - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) { QSqlQuery q(db); QVERIFY_SQL( q, exec("set client_min_messages='warning'")); @@ -485,7 +485,7 @@ void tst_QSqlDatabase::open() QVERIFY(!db.isOpenError()); } - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::SQLite && db.databaseName() == ":memory:") { // tables in in-memory databases don't survive an open/close createTestTables(db); @@ -498,7 +498,7 @@ void tst_QSqlDatabase::tables() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString qtest(qTableName("qtest", __FILE__, db)), qtest_view(qTableName("qtest_view", __FILE__, db)), temp_tab(qTableName("test_tab", __FILE__, db)); @@ -562,7 +562,7 @@ void tst_QSqlDatabase::whitespaceInIdentifiers() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (testWhiteSpaceNames(db.driverName())) { const QString tableName(qTableName("qtest", __FILE__, db) + " test"); @@ -830,7 +830,7 @@ void tst_QSqlDatabase::recordPSQL() QSqlQuery q(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) QVERIFY_SQL( q, exec("set client_min_messages='warning'")); const QString tableName = qTableName("qtestfields", __FILE__, db); @@ -1017,7 +1017,7 @@ void tst_QSqlDatabase::recordSQLServer() QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer) QSKIP("SQL server specific test"); @@ -1076,7 +1076,7 @@ void tst_QSqlDatabase::transaction() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString qtest(qTableName("qtest", __FILE__, db)); if (!db.driver()->hasFeature(QSqlDriver::Transactions)) @@ -1124,7 +1124,7 @@ void tst_QSqlDatabase::bigIntField() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString qtest_bigint(qTableName("qtest_bigint", __FILE__, db)); QSqlQuery q(db); @@ -1189,7 +1189,7 @@ void tst_QSqlDatabase::caseSensivity() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); bool cs = false; if (dbType == QSqlDriver::MySqlServer || dbType == QSqlDriver::SQLite || dbType == QSqlDriver::Sybase @@ -1222,7 +1222,7 @@ void tst_QSqlDatabase::noEscapedFieldNamesInRecord() CHECK_DATABASE(db); QString fieldname("t_varchar"); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Oracle || dbType == QSqlDriver::Interbase || dbType == QSqlDriver::DB2) fieldname = fieldname.toUpper(); @@ -1405,7 +1405,7 @@ void tst_QSqlDatabase::precisionPolicy() QString query = QString("SELECT num FROM %1 WHERE id = 1").arg(tableName); QVERIFY_SQL(q, exec(query)); QVERIFY_SQL(q, next()); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::SQLite) QEXPECT_FAIL("", "SQLite returns this value as determined by contents of the field, not the declaration", Continue); QCOMPARE(q.value(0).type(), QVariant::String); @@ -1742,7 +1742,7 @@ void tst_QSqlDatabase::odbc_bindBoolean() QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) QSKIP("MySql has inconsistent behaviour of bit field type across versions."); @@ -1777,7 +1777,7 @@ void tst_QSqlDatabase::odbc_testqGetString() const QString testqGetString(qTableName("testqGetString", __FILE__, db)); QSqlQuery q(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MSSqlServer) QVERIFY_SQL(q, exec("CREATE TABLE " + testqGetString + "(id int, vcvalue varchar(MAX))")); else if(tst_Databases::isMSAccess(db)) @@ -1957,7 +1957,7 @@ void tst_QSqlDatabase::odbc_uniqueidentifier() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer) QSKIP("SQL Server (ODBC) specific test"); diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp index fa0f7eaf34..7c0b4ebc88 100644 --- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp +++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp @@ -71,7 +71,7 @@ void tst_QSqlDriver::recreateTestTables(QSqlDatabase db) QSqlQuery q(db); const QString relTEST1(qTableName("relTEST1", __FILE__, db)); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) QVERIFY_SQL( q, exec("set client_min_messages='warning'")); @@ -122,7 +122,7 @@ void tst_QSqlDriver::record() QSqlRecord rec = db.driver()->record(tablename); QCOMPARE(rec.count(), 4); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); // QTBUG-1363: QSqlField::length() always return -1 when using QODBC3 driver and QSqlDatabase::record() if (dbType == QSqlDriver::MSSqlServer && db.driverName().startsWith("QODBC")) QCOMPARE(rec.field(1).length(), 20); @@ -174,7 +174,7 @@ void tst_QSqlDriver::primaryIndex() QSqlIndex index = db.driver()->primaryIndex(tablename); QCOMPARE(index.count(), 1); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Interbase || dbType == QSqlDriver::Oracle || dbType == QSqlDriver::DB2) QCOMPARE(index.fieldName(0), QString::fromLatin1("ID")); else diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index b4863d4a82..f5d71a75cf 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -283,7 +283,7 @@ void tst_QSqlQuery::cleanup() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if ( QTest::currentTestFunction() == QLatin1String( "numRowsAffected" ) || QTest::currentTestFunction() == QLatin1String( "transactions" ) || QTest::currentTestFunction() == QLatin1String( "size" ) @@ -311,7 +311,7 @@ void tst_QSqlQuery::generic_data(const QString& engine) void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) { - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QStringList tablenames; // drop all the table in case a testcase failed tablenames << qtest @@ -374,7 +374,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) void tst_QSqlQuery::createTestTables( QSqlDatabase db ) { QSqlQuery q( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) // ### stupid workaround until we find a way to hardcode this // in the MySQL server startup script @@ -426,7 +426,7 @@ void tst_QSqlQuery::char1Select() QVERIFY_SQL(q, exec("insert into " + tbl + " values ('a')")); QVERIFY_SQL(q, exec("select * from " + tbl)); QVERIFY( q.next() ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Interbase) QCOMPARE( q.value( 0 ).toString().left( 1 ), QString( "a" ) ); else @@ -441,7 +441,7 @@ void tst_QSqlQuery::char1SelectUnicode() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::DB2) QSKIP("Needs someone with more Unicode knowledge than I have to fix"); @@ -588,7 +588,7 @@ void tst_QSqlQuery::bindBool() QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); QSqlQuery q(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString tableName(qTableName("bindBool", __FILE__, db)); q.exec("DROP TABLE " + tableName); @@ -845,7 +845,7 @@ void tst_QSqlQuery::outValues() QSqlQuery q( db ); q.setForwardOnly( true ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Oracle) { QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x out int) is\n" "begin\n" @@ -934,7 +934,7 @@ void tst_QSqlQuery::value() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQuery q( db ); QVERIFY_SQL( q, exec( "select id, t_varchar, t_char from " + qtest + " order by id" ) ); int i = 1; @@ -1520,7 +1520,7 @@ void tst_QSqlQuery::precision() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Interbase) QSKIP("DB unable to store high precision"); @@ -1596,7 +1596,7 @@ void tst_QSqlQuery::transaction() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if ( !db.driver()->hasFeature( QSqlDriver::Transactions ) ) QSKIP( "DBMS not transaction capable"); @@ -1679,7 +1679,7 @@ void tst_QSqlQuery::joins() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString qtestj1(qTableName("qtestj1", __FILE__, db)), qtestj2(qTableName("qtestj2", __FILE__, db)); if (dbType == QSqlDriver::Oracle || dbType == QSqlDriver::Sybase @@ -1763,7 +1763,7 @@ void tst_QSqlQuery::prepare_bind_exec() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); const QString qtest_prepare(qTableName("qtest_prepare", __FILE__, db)); if (dbType == QSqlDriver::Interbase && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb")) @@ -1785,7 +1785,7 @@ void tst_QSqlQuery::prepare_bind_exec() useUnicode = false; QString createQuery; - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) QVERIFY_SQL( q, exec("set client_min_messages='warning'")); @@ -2059,7 +2059,7 @@ void tst_QSqlQuery::sqlServerLongStrings() QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer) QSKIP( "SQL Server specific test"); @@ -2105,7 +2105,7 @@ void tst_QSqlQuery::invalidQuery() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQuery q( db ); QVERIFY( !q.exec() ); @@ -2442,7 +2442,7 @@ void tst_QSqlQuery::createQueryOnClosedDatabase() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); // Only supported by these drivers if (dbType != QSqlDriver::PostgreSQL && dbType != QSqlDriver::Oracle @@ -2574,7 +2574,7 @@ void tst_QSqlQuery::nextResult() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if ( !db.driver()->hasFeature( QSqlDriver::MultipleResultSets ) || !db.driver()->hasFeature( QSqlDriver::BatchOperations ) ) QSKIP( "DBMS does not support multiple result sets or batch operations"); @@ -2774,7 +2774,7 @@ void tst_QSqlQuery::blobsPreparedQuery() // In PostgreSQL a BLOB is not called a BLOB, but a BYTEA! :-) // ... and in SQL Server it can be called a lot, but IMAGE will do. - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QString typeName( "BLOB" ); if (dbType == QSqlDriver::PostgreSQL) typeName = "BYTEA"; @@ -3053,7 +3053,7 @@ void tst_QSqlQuery::sqlServerReturn0() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer) QSKIP("SQL Server specific test"); @@ -3169,7 +3169,7 @@ void tst_QSqlQuery::QTBUG_18435() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer || !db.driverName().startsWith("QODBC")) QSKIP("SQL Server specific test"); @@ -3251,7 +3251,7 @@ void tst_QSqlQuery::QTBUG_6618() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::MSSqlServer) QSKIP("SQL Server specific test"); @@ -3668,7 +3668,7 @@ void tst_QSqlQuery::sqlite_constraint() QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::SQLite) QSKIP("Sqlite3 specific test"); @@ -3720,7 +3720,7 @@ void tst_QSqlQuery::aggregateFunctionTypes() CHECK_DATABASE(db); QVariant::Type intType = QVariant::Int; // QPSQL uses LongLong for manipulation of integers - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer || dbType == QSqlDriver::PostgreSQL) intType = QVariant::LongLong; else if (dbType == QSqlDriver::Oracle) diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp index 84e2fd57de..fc10f21904 100644 --- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp +++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp @@ -150,7 +150,7 @@ void tst_QSqlQueryModel::createTestTables(QSqlDatabase db) { dropTestTables(db); QSqlQuery q(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::PostgreSQL) QVERIFY_SQL( q, exec("set client_min_messages='warning'")); QVERIFY_SQL( q, exec("create table " + qTableName("test", __FILE__, db) + "(id integer not null, name varchar(20), title integer, primary key (id))")); @@ -305,7 +305,7 @@ void tst_QSqlQueryModel::insertColumn() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); DBTestModel model; model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__, db), db)); @@ -409,7 +409,7 @@ void tst_QSqlQueryModel::record() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQueryModel model; model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__, db), db)); @@ -440,7 +440,7 @@ void tst_QSqlQueryModel::setHeaderData() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQueryModel model; diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index e97c391a52..a32c672370 100644 --- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -143,7 +143,7 @@ void tst_QSqlRelationalTableModel::initTestCase() { foreach (const QString &dbname, dbs.dbNames) { QSqlDatabase db=QSqlDatabase::database(dbname); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Interbase) { db.exec("SET DIALECT 3"); } else if (dbType == QSqlDriver::MSSqlServer) { @@ -238,7 +238,7 @@ void tst_QSqlRelationalTableModel::setData() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); // set the values using OnRowChange Strategy { @@ -554,7 +554,7 @@ void tst_QSqlRelationalTableModel::insertWithStrategies() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlRelationalTableModel model(0, db); @@ -746,7 +746,7 @@ void tst_QSqlRelationalTableModel::sort() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlRelationalTableModel model(0, db); @@ -912,7 +912,7 @@ void tst_QSqlRelationalTableModel::clearDisplayValuesCache() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlRelationalTableModel model(0, db); @@ -966,7 +966,7 @@ void tst_QSqlRelationalTableModel::insertRecordDuplicateFieldNames() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlRelationalTableModel model(0, db); model.setTable(reltest3); @@ -1088,7 +1088,7 @@ void tst_QSqlRelationalTableModel::casing() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::Interbase || dbType == QSqlDriver::SQLite || dbType == QSqlDriver::MSSqlServer) QSKIP("The casing test for this database is irrelevant since this database does not treat different cases as separate entities"); @@ -1155,7 +1155,7 @@ void tst_QSqlRelationalTableModel::escapedRelations() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); recreateTestTables(db); @@ -1266,7 +1266,7 @@ void tst_QSqlRelationalTableModel::escapedTableName() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); // set the values using OnRowChange Strategy with an escaped tablename { @@ -1455,7 +1455,7 @@ void tst_QSqlRelationalTableModel::psqlSchemaTest() QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType != QSqlDriver::PostgreSQL) QSKIP("Postgresql specific test"); diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp index b77b883b03..f0aaa36170 100644 --- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp @@ -160,7 +160,7 @@ void tst_QSqlTableModel::dropTestTables() { for (int i = 0; i < dbs.dbNames.count(); ++i) { QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i)); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQuery q(db); if (dbType == QSqlDriver::PostgreSQL) QVERIFY_SQL( q, exec("set client_min_messages='warning'")); @@ -189,7 +189,7 @@ void tst_QSqlTableModel::createTestTables() { for (int i = 0; i < dbs.dbNames.count(); ++i) { QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i)); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQuery q(db); QVERIFY_SQL( q, exec("create table " + test + "(id int, name varchar(20), title int)")); @@ -1699,7 +1699,7 @@ void tst_QSqlTableModel::primaryKeyOrder() QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QSqlQuery q(db); diff --git a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp index 769dbe6d47..c8375a6d28 100644 --- a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp +++ b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp @@ -109,7 +109,7 @@ void tst_QSqlQuery::cleanup() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - const QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if ( QTest::currentTestFunction() == QLatin1String( "numRowsAffected" ) || QTest::currentTestFunction() == QLatin1String( "transactions" ) @@ -138,7 +138,7 @@ void tst_QSqlQuery::generic_data(const QString& engine) void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) { - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); QStringList tablenames; // drop all the table in case a testcase failed tablenames << qtest @@ -199,7 +199,7 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db ) { const QString qtestNull = qTableName("qtest_null", __FILE__, db); QSqlQuery q( db ); - QSqlDriver::DBMSType dbType = tst_Databases::getDatabaseType(db); + QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); if (dbType == QSqlDriver::MySqlServer) // ### stupid workaround until we find a way to hardcode this // in the MySQL server startup script From 5ed2f422fc3c80731be7a07da3875aaa5572d4e6 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 31 Oct 2014 14:20:20 +0100 Subject: [PATCH 18/99] Doc: corrected autolink errors corelib/io Task-number: QTBUG-40362 Change-Id: I1cdbde1f6b003556ba4b5e97a49c6d918518da0d Reviewed-by: Venugopal Shivashankar Reviewed-by: Jerome Pasion --- .../widgets/tools/codecs/doc/src}/codecs.qdoc | 8 ++++---- src/corelib/codecs/qtextcodec.cpp | 4 ++-- src/corelib/io/qdebug.cpp | 4 ++-- src/corelib/io/qfiledevice.cpp | 6 +++--- src/corelib/io/qloggingcategory.cpp | 8 ++++---- src/corelib/io/qprocess.cpp | 10 +++++----- src/corelib/io/qstandardpaths.cpp | 8 ++++---- src/corelib/io/qtemporarydir.cpp | 2 +- src/corelib/io/qtextstream.cpp | 16 ++++++++-------- src/corelib/io/qurl.cpp | 13 +++++++------ 10 files changed, 40 insertions(+), 39 deletions(-) rename {doc/src/examples => examples/widgets/tools/codecs/doc/src}/codecs.qdoc (86%) diff --git a/doc/src/examples/codecs.qdoc b/examples/widgets/tools/codecs/doc/src/codecs.qdoc similarity index 86% rename from doc/src/examples/codecs.qdoc rename to examples/widgets/tools/codecs/doc/src/codecs.qdoc index d9f69563ac..e81cc00c54 100644 --- a/doc/src/examples/codecs.qdoc +++ b/examples/widgets/tools/codecs/doc/src/codecs.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -26,10 +26,10 @@ ****************************************************************************/ /*! - \example codecs - \title Codecs Example + \example tools/codecs + \title Text Codecs Example - The Codecs example demonstrates the principles behind importing and exporting text + The Text Codecs example demonstrates the principles behind importing and exporting text using codecs to ensure that characters are encoded properly, avoiding loss of data and retaining the correct symbols used in various scripts. diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index d2857c03b6..6eae9e598d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -380,7 +380,7 @@ QTextCodec::ConverterState::~ConverterState() If Qt is compiled with ICU support enabled, most codecs supported by ICU will also be available to the application. - QTextCodecs can be used as follows to convert some locally encoded + \l {QTextCodec}s can be used as follows to convert some locally encoded string to Unicode. Suppose you have some string encoded in Russian KOI8-R encoding, and want to convert it to Unicode. The simple way to do it is like this: @@ -453,7 +453,7 @@ QTextCodec::ConverterState::~ConverterState() \li Converts a Unicode string to an 8-bit character string. \endtable - \sa QTextStream, QTextDecoder, QTextEncoder, {Codecs Example} + \sa QTextStream, QTextDecoder, QTextEncoder, {Text Codecs Example} */ /*! diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index c1e0125cb1..5c77ccdcbf 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -403,8 +403,8 @@ QDebug &QDebug::resetFormat() \brief Convenience class for custom QDebug operators Saves the settings used by QDebug, and restores them upon destruction, - then calls maybeSpace(), to separate arguments with a space if - autoInsertSpaces() was true at the time of constructing the QDebugStateSaver. + then calls \l {QDebug::maybeSpace()}{maybeSpace()}, to separate arguments with a space if + \l {QDebug::autoInsertSpaces()}{autoInsertSpaces()} was true at the time of constructing the QDebugStateSaver. The automatic insertion of spaces between writes is one of the settings that QDebugStateSaver stores for the duration of the current block. diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index 598347a56f..29b59f1dcc 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -240,7 +240,7 @@ bool QFileDevice::isSequential() const Returns the file handle of the file. This is a small positive integer, suitable for use with C library - functions such as fdopen() and fcntl(). On systems that use file + functions such as \c fdopen() and \c fcntl(). On systems that use file descriptors for sockets (i.e. Unix systems, but not Windows) the handle can be used with QSocketNotifier as well. @@ -389,9 +389,9 @@ bool QFileDevice::atEnd() const return false. Seeking beyond the end of a file: - If the position is beyond the end of a file, then seek() shall not + If the position is beyond the end of a file, then seek() will not immediately extend the file. If a write is performed at this position, - then the file shall be extended. The content of the file between the + then the file will be extended. The content of the file between the previous end of file and the newly written data is UNDEFINED and varies between platforms and file systems. */ diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index fef48a9040..79d20601a6 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -149,10 +149,10 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) Order of evaluation: \list - \li Rules from QtProject/qtlogging.ini - \li Rules set by \l setFilterRules() - \li Rules from file in \c QT_LOGGING_CONF - \li Rules from environment variable QT_LOGGING_RULES + \li QtProject/qtlogging.ini + \li \l setFilterRules() + \li \c QT_LOGGING_CONF + \li \c QT_LOGGING_RULES \endlist The \c QtProject/qtlogging.ini file is looked up in all directories returned diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index e76a836954..a234050777 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1853,8 +1853,8 @@ void QProcess::setProcessState(ProcessState state) /*! This function is called in the child process context just before the - program is executed on Unix or Mac OS X (i.e., after \e fork(), but before - \e execve()). Reimplement this function to do last minute initialization + program is executed on Unix or OS X (i.e., after \c fork(), but before + \c execve()). Reimplement this function to do last minute initialization of the child process. Example: \snippet code/src_corelib_io_qprocess.cpp 4 @@ -1864,7 +1864,7 @@ void QProcess::setProcessState(ProcessState state) execution, your workaround is to emit finished() and then call exit(). - \warning This function is called by QProcess on Unix and Mac OS X + \warning This function is called by QProcess on Unix and OS X only. On Windows and QNX, it is not called. */ void QProcess::setupChildProcess() @@ -2272,7 +2272,7 @@ void QProcess::setArguments(const QStringList &arguments) On Windows, terminate() posts a WM_CLOSE message to all toplevel windows of the process and then to the main thread of the process itself. On Unix - and Mac OS X the SIGTERM signal is sent. + and OS X the \c SIGTERM signal is sent. Console applications on Windows that do not run an event loop, or whose event loop does not handle the WM_CLOSE message, can only be terminated by @@ -2289,7 +2289,7 @@ void QProcess::terminate() /*! Kills the current process, causing it to exit immediately. - On Windows, kill() uses TerminateProcess, and on Unix and Mac OS X, the + On Windows, kill() uses TerminateProcess, and on Unix and OS X, the SIGKILL signal is sent to the process. \sa terminate() diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index c206e432f6..538292f0a5 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -588,11 +588,11 @@ QString QStandardPaths::displayName(StandardLocation type) GenericCacheLocation, CacheLocation. Other locations are not affected. - On Unix, XDG_DATA_HOME is set to ~/.qttest/share, XDG_CONFIG_HOME is - set to ~/.qttest/config, and XDG_CACHE_HOME is set to ~/.qttest/cache. + On Unix, \c XDG_DATA_HOME is set to \e ~/.qttest/share, \c XDG_CONFIG_HOME is + set to \e ~/.qttest/config, and \c XDG_CACHE_HOME is set to \e ~/.qttest/cache. - On Mac, data goes to "~/.qttest/Application Support", cache goes to - ~/.qttest/Cache, and config goes to ~/.qttest/Preferences. + On OS X, data goes to \e ~/.qttest/Application Support, cache goes to + \e ~/.qttest/Cache, and config goes to \e ~/.qttest/Preferences. On Windows, everything goes to a "qttest" directory under Application Data. */ diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 7ce37fd320..5e0def74ee 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -180,7 +180,7 @@ void QTemporaryDirPrivate::create(const QString &templateName) \snippet code/src_corelib_io_qtemporarydir.cpp 0 It is very important to test that the temporary directory could be - created, using isValid(). Do not use exists(), since a default-constructed + created, using isValid(). Do not use \l {QDir::exists()}{exists()}, since a default-constructed QDir represents the current directory, which exists. The path to the temporary dir can be found by calling path(). diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 66727e7dc4..089a915a36 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -85,8 +85,8 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \li Chunk by chunk, by calling readLine() or readAll(). - \li Word by word. QTextStream supports streaming into QStrings, - QByteArrays and char* buffers. Words are delimited by space, and + \li Word by word. QTextStream supports streaming into \l {QString}s, + \l {QByteArray}s and char* buffers. Words are delimited by space, and leading white space is automatically skipped. \li Character by character, by streaming into QChar or char types. @@ -158,7 +158,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; parameter: qSetFieldWidth(), qSetPadChar(), and qSetRealNumberPrecision(). - \sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket, {Codecs Example} + \sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket, {Text Codecs Example} */ /*! \enum QTextStream::RealNumberNotation @@ -1531,7 +1531,7 @@ bool QTextStream::atEnd() const QString. Avoid this function when working on large files, as it will consume a significant amount of memory. - Calling readLine() is better if you do not know how much data is + Calling \l {QTextStream::readLine()}{readLine()} is better if you do not know how much data is available. \sa readLine() @@ -1556,9 +1556,9 @@ QString QTextStream::readAll() The returned line has no trailing end-of-line characters ("\\n" or "\\r\\n"), so calling QString::trimmed() is unnecessary. - If the stream has read to the end of the file, readLine() will return a - null QString. For strings, or for devices that support it, you can - explicitly test for the end of the stream using atEnd(). + If the stream has read to the end of the file, \l {QTextStream::readLine()}{readLine()} + will return a null QString. For strings, or for devices that support it, + you can explicitly test for the end of the stream using atEnd(). \sa readAll(), QIODevice::readLine() */ @@ -2790,7 +2790,7 @@ QTextStream &endl(QTextStream &stream) /*! \relates QTextStream - Calls QTextStream::flush() on \a stream and returns \a stream. + Calls \l{QTextStream::flush()}{flush()} on \a stream and returns \a stream. \sa endl(), reset(), {QTextStream manipulators} */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index d4c5e03058..d4c5a34cef 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2671,8 +2671,8 @@ void QUrl::setQuery(const QUrlQuery &query) Sets the query string of the URL to an encoded version of \a query. The contents of \a query are converted to a string internally, each pair delimited by the character returned by - queryPairDelimiter(), and the key and value are delimited by - queryValueDelimiter(). + \l {QUrlQuery::queryPairDelimiter()}{queryPairDelimiter()}, and the key and value are delimited by + \l {QUrlQuery::queryValueDelimiter()}{queryValueDelimiter()} \note This method does not encode spaces (ASCII 0x20) as plus (+) signs, like HTML forms do. If you need that kind of encoding, you must encode @@ -2691,8 +2691,8 @@ void QUrl::setQuery(const QUrlQuery &query) Sets the query string of the URL to the encoded version of \a query. The contents of \a query are converted to a string internally, each pair delimited by the character returned by - queryPairDelimiter(), and the key and value are delimited by - queryValueDelimiter(). + \l {QUrlQuery::queryPairDelimiter()}{queryPairDelimiter()}, and the key and value are delimited by + \l {QUrlQuery::queryValueDelimiter()}{queryValueDelimiter()}. \obsolete Use QUrlQuery and setQuery(). @@ -2709,8 +2709,9 @@ void QUrl::setQuery(const QUrlQuery &query) The key-value pair is encoded before it is added to the query. The pair is converted into separate strings internally. The \a key and \a value is first encoded into UTF-8 and then delimited by the - character returned by queryValueDelimiter(). Each key-value pair is - delimited by the character returned by queryPairDelimiter(). + character returned by \l {QUrlQuery::queryValueDelimiter()}{queryValueDelimiter()}. + Each key-value pair is delimited by the character returned by + \l {QUrlQuery::queryPairDelimiter()}{queryPairDelimiter()} \note This method does not encode spaces (ASCII 0x20) as plus (+) signs, like HTML forms do. If you need that kind of encoding, you must encode From b7f6e6282b9220c28a2f0b3e703ba9b9aceac52b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 26 Nov 2014 16:04:13 -0800 Subject: [PATCH 19/99] Removed wrong task number from changelog entry See http://lists.qt-project.org/pipermail/development/2014-November/019331.html Change-Id: I54876dd210c87690117b6aacf78aef0961e704ef Reviewed-by: Jani Heikkinen --- dist/changes-5.4.0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index 2b6cd2b4db..48c2507ea6 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -439,7 +439,7 @@ OS X - The Qt binary packages are now configured with C++11 enabled. - [QTBUG-41208] Fixed detection of writing system support in fonts for some scripts such as Mkhedruli. - - [QTBUG-41192] Fixed menu item shortcuts without keyboard modifiers. + - Fixed menu item shortcuts without keyboard modifiers. - [QTBUG-31301] Drag-and-drop QMimeData requests are now delayed until drop time. - [QTBUG-10899] Added support for ApplicationState From 7c539579b9e883c87e5f7fb3bbec80847fc83ae2 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Wed, 26 Nov 2014 14:55:51 +0200 Subject: [PATCH 20/99] Use Holo theme on Android 5.0. This is a temporary "fix" until we'll fix all the problems with the new Android Material theme. Task-number: QTBUG-42900 Change-Id: I5485cfd5ac5fdd66cb85da423fe2e63e65be010f Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: J-P Nurmi --- .../java/src/org/qtproject/qt5/android/bindings/QtActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java index 0c52bc7530..75f10ad3ba 100644 --- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java +++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java @@ -187,7 +187,7 @@ public class QtActivity extends Activity QT_ANDROID_THEMES = new String[] {"Theme_Light"}; QT_ANDROID_DEFAULT_THEME = "Theme_Light"; } - else if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) { + else if ((Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) || Build.VERSION.SDK_INT == 21){ QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"}; QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light"; } else { From 7b33faa1e97353d658fc7cd13ca789fccfa7ec1f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 26 Nov 2014 14:54:33 +0100 Subject: [PATCH 21/99] changes-5.4.0: additional changes for iOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie8dc10be7ac8a73857a2b47e9bfb00954a7421a9 Reviewed-by: Tor Arne Vestbø --- dist/changes-5.4.0 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index 48c2507ea6..2cdf52e4d3 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -418,6 +418,13 @@ iOS Applications making use of DataLocation should move these data to the new location. This can be done using the path provided by DocumentLocation as the source path. + - [QTBUG-41458] screen resolution update after device rotation now works. + - [QTBUG-42345] fixed crash on startup on iOS 7.1 + - iOS is now using fat builds with both 32-, and 64-bit support. + - New launch screen added to support iPhone6/6+. + - QtQuick Controls now support native text selection and popup menus. + - Virtual keyboard visibility is now automatically managed by the platform plugin. + - Default theme fonts now uses Dynamic Type, which is based on user system settings. Linux/XCB --------- From 38d3a7bb6eec46f1bab5ed53334ff2639e9b6eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 27 Nov 2014 11:47:42 +0100 Subject: [PATCH 22/99] changes-5.4.0: Additional changes for Android Mention the new bearer plugin. Change-Id: Icf5f53ef1f920a13a1820dedceb0fa64f0155887 Reviewed-by: Eskil Abrahamsen Blomfeldt --- dist/changes-5.4.0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 index 2cdf52e4d3..efd5d9149e 100644 --- a/dist/changes-5.4.0 +++ b/dist/changes-5.4.0 @@ -402,7 +402,8 @@ Android - [QTBUG-41817] QClipboard::mimeData() now returns an empty object instead of null pointer from QClipboard when clipboard is empty for consistency with other platforms. - + - New bearer plugin. It's now possible to get more information about the + different network configurations on Android. - Important Behavior Changes: * [QTBUG-36274] The main event loop is now stopped when the app is suspended From e4eb9bfbf74385cb3ee5d7225814be697aa47285 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 27 Nov 2014 13:27:06 +0100 Subject: [PATCH 23/99] Break after handling the read/write The loop is there because watchers may have two Watcher for the same fd, one for read and one for write, but after we're processed the correct one we don't need to keep looping. This fixes a crash since it's possible that while in processing q_dbus_watch_handle we get a watch added/remove this invalidating the iterator and crashing Change-Id: Icb61deae272d2f237a4c616fae598404d419af90 Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index f27d45b142..dd92602dce 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1184,6 +1184,7 @@ void QDBusConnectionPrivate::socketRead(int fd) if (it->watch && it->read && it->read->isEnabled()) { if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_READABLE)) qDebug("OUT OF MEM"); + break; } ++it; } @@ -1198,6 +1199,7 @@ void QDBusConnectionPrivate::socketWrite(int fd) if (it->watch && it->write && it->write->isEnabled()) { if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_WRITABLE)) qDebug("OUT OF MEM"); + break; } ++it; } From 504ab80f6d3756fea79851a6d92e3353f401f70b Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 18 Nov 2014 21:34:01 +0100 Subject: [PATCH 24/99] tst_qsortfilterproxymodel: remove unused member var (clang warning) Change-Id: Id751443e03be4f2bd1721cbe9d9a898d9619b29b Reviewed-by: Friedemann Kleint --- .../qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index d05ed6c20f..53ed1bc9a0 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -3586,7 +3586,7 @@ class SignalArgumentChecker : public QObject Q_OBJECT public: SignalArgumentChecker(QAbstractItemModel *model, QAbstractProxyModel *proxy, QObject *parent = 0) - : QObject(parent), m_model(model), m_proxy(proxy) + : QObject(parent), m_proxy(proxy) { connect(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), SLOT(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), SLOT(rowsMoved(QModelIndex,int,int,QModelIndex,int))); @@ -3636,7 +3636,6 @@ private slots: } private: - QAbstractItemModel *m_model; QAbstractProxyModel *m_proxy; QPersistentModelIndex m_p1PersistentBefore; QPersistentModelIndex m_p2PersistentBefore; From 8d2da358b7088837191a7fae8a19b711ecb47dfa Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 27 Nov 2014 12:58:42 +0100 Subject: [PATCH 25/99] macx-ios-clang: only provide default LaunchScreen.xib if using Xcode 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If using an older version of Xcode, Xcode will sometimes complain that LaunchScreen.xib uses auto layout while the project at the same time has deployment target set to 5.0 (where auto layout is not supported). This is a bug in Xcode really, since LaunchScreen.xib will only be used when running on iOS 7 (otherwise a LaunchImage will be used). This has been fixed in Xcode 6. This patch adds a check for this early on. Change-Id: Ie612c25b413add23e15fc3cb4f9e30bb5292369d Reviewed-by: Tor Arne Vestbø --- .../macx-ios-clang/features/default_post.prf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 643a17e23e..45ba777630 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -185,13 +185,17 @@ macx-xcode { launch_images.files = $$copy_image.output QMAKE_BUNDLE_DATA += launch_images - # Set up default LaunchScreen to support iPhone6/6+ - launch_screen = LaunchScreen.xib - copy_launch_screen.input = $$QMAKESPEC/$$launch_screen - copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_screen - QMAKE_SUBSTITUTES += copy_launch_screen - launch_screens.files = $$copy_launch_screen.output - QMAKE_BUNDLE_DATA += launch_screens + lessThan(QMAKE_XCODE_VERSION, "6.0") { + warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+") + } else { + # Set up default LaunchScreen to support iPhone6/6+ + launch_screen = LaunchScreen.xib + copy_launch_screen.input = $$QMAKESPEC/$$launch_screen + copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_screen + QMAKE_SUBSTITUTES += copy_launch_screen + launch_screens.files = $$copy_launch_screen.output + QMAKE_BUNDLE_DATA += launch_screens + } } macx-xcode { From 799f83fc9a5e11194ae56e9d13cd6eb45f2aea24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 12:59:16 +0100 Subject: [PATCH 26/99] Decouple caching of iOS/OSX SDK path and version in sdk.prf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Combining them could lead to intermediate builds having cached the path, but not the version, resulting in later version checks failing. Change-Id: Ia10f4268ce7b9e82c81627970236d68c00b80391 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Tor Arne Vestbø --- mkspecs/features/mac/sdk.prf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 97be211595..d2e698894f 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -9,11 +9,15 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) { QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null") isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'") cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH) +} else { + QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) +} + +isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) { QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version SDKVersion 2>/dev/null") isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$$QMAKE_MAC_SDK\'") cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version, set stash, QMAKE_MAC_SDK_VERSION) } else { - QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) } From a2da88712f1e057747f68a28361b300faac5e605 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 24 Nov 2014 23:41:00 -0800 Subject: [PATCH 27/99] Make QtDBus compile without libdbus-1 headers, if dlopening Most of QtDBus already needs very little from libdus-1, so create an extra header containing the minimum API we actually need. One large advantage of this solution is that now QtDBus can always be enabled, even if the system doesn't have libdbus-1 installed. This is interesting on OS X, where libdbus-1 is often installed by Homebrew or MacPorts, which may include extra libraries we don't want in our packaging. Change-Id: I1b397121ec12eeca333ef778cf8e1c7b64d6b223 Reviewed-by: Lars Knoll --- configure | 4 +- src/dbus/dbus.pro | 3 +- src/dbus/dbus_minimal_p.h | 275 ++++++++++++++++++ src/dbus/qdbus_symbols_p.h | 7 +- .../dbus/qdbusmarshall/tst_qdbusmarshall.cpp | 6 +- 5 files changed, 289 insertions(+), 6 deletions(-) create mode 100644 src/dbus/dbus_minimal_p.h diff --git a/configure b/configure index d95d8a2a4a..6f21ba76ab 100755 --- a/configure +++ b/configure @@ -4642,8 +4642,8 @@ if [ "$CFG_DBUS" != "no" ]; then fi QMakeVar set QT_HOST_CFLAGS_DBUS "$QT_CFLAGS_DBUS" else - if [ "$CFG_DBUS" = "auto" ]; then - CFG_DBUS=no + if [ "$CFG_DBUS" != "linked" ]; then + CFG_DBUS=runtime elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then # CFG_DBUS is "yes" or "linked" here diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index c5afe8c4d2..3ef8e6c80c 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -61,7 +61,8 @@ HEADERS += $$PUB_HEADERS \ qdbusintegrator_p.h \ qdbuspendingcall_p.h \ qdbus_symbols_p.h \ - qdbusintrospection_p.h + qdbusintrospection_p.h \ + dbus_minimal_p.h SOURCES += qdbusconnection.cpp \ qdbusconnectioninterface.cpp \ qdbuserror.cpp \ diff --git a/src/dbus/dbus_minimal_p.h b/src/dbus/dbus_minimal_p.h new file mode 100644 index 0000000000..862e8201a1 --- /dev/null +++ b/src/dbus/dbus_minimal_p.h @@ -0,0 +1,275 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Intel Corporation +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DBUS_MINIMAL_P_H +#define DBUS_MINIMAL_P_H + +extern "C" { + +// Equivalent to dbus-arch-deps.h +typedef qint64 dbus_int64_t; +typedef quint64 dbus_uint64_t; +typedef qint32 dbus_int32_t; +typedef quint32 dbus_uint32_t; +typedef qint16 dbus_int16_t; +typedef quint16 dbus_uint16_t; + +// simulate minimum version we support +#define DBUS_MAJOR_VERSION 1 +#define DBUS_MINOR_VERSION 2 +#define DBUS_VERSION ((1 << 16) | (2 << 8)) + +// forward declaration to opaque types we use +struct DBusConnection; +struct DBusMessage; +struct DBusPendingCall; +struct DBusServer; +struct DBusTimeout; +struct DBusWatch; + +// This file contains constants and typedefs from libdbus-1 headers, +// which carry the following copyright: +/* + * Copyright (C) 2002, 2003 CodeFactory AB + * Copyright (C) 2004, 2005 Red Hat, Inc. + * + * Licensed under the Academic Free License version 2.1 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* dbus-types.h */ +typedef dbus_uint32_t dbus_unichar_t; +typedef dbus_uint32_t dbus_bool_t; + +/* dbus-shared.h */ +#define DBUS_SERVICE_DBUS "org.freedesktop.DBus" +#define DBUS_PATH_DBUS "/org/freedesktop/DBus" +#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" +#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable" +#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties" + +#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */ +#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */ +#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */ + +#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */ +#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */ +#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */ +#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */ + +#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */ +#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */ +#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */ + +typedef enum +{ + DBUS_BUS_SESSION, /**< The login session bus */ + DBUS_BUS_SYSTEM, /**< The systemwide bus */ + DBUS_BUS_STARTER /**< The bus that started us, if any */ +} DBusBusType; + +typedef enum +{ + DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ + DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ + DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ +} DBusHandlerResult; + +/* dbus-memory.h */ +typedef void (* DBusFreeFunction) (void *memory); + +/* dbus-connection.h */ +typedef enum +{ + DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */ + DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */ + DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for + * this, but can be present in + * current state passed to + * dbus_watch_handle()). + */ + DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for + * it, but can be present in current + * state passed to + * dbus_watch_handle()). + */ + /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */ +} DBusWatchFlags; + +typedef enum +{ + DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */ + DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */ + DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */ +} DBusDispatchStatus; + +typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch, + void *data); +typedef void (* DBusWatchToggledFunction) (DBusWatch *watch, + void *data); +typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch, + void *data); +typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout, + void *data); +typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout, + void *data); +typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout, + void *data); +typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection, + DBusDispatchStatus new_status, + void *data); +typedef void (* DBusWakeupMainFunction) (void *data); +typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending, + void *user_data); +typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection, + DBusMessage *message, + void *user_data); + +/* dbus-errors.h */ +struct DBusError +{ + const char *name; /**< public error name field */ + const char *message; /**< public error message field */ + + unsigned int dummy1 : 1; /**< placeholder */ + unsigned int dummy2 : 1; /**< placeholder */ + unsigned int dummy3 : 1; /**< placeholder */ + unsigned int dummy4 : 1; /**< placeholder */ + unsigned int dummy5 : 1; /**< placeholder */ + + void *padding1; /**< placeholder */ +}; + +/* dbus-message.h */ +struct DBusMessageIter +{ + void *dummy1; /**< Don't use this */ + void *dummy2; /**< Don't use this */ + dbus_uint32_t dummy3; /**< Don't use this */ + int dummy4; /**< Don't use this */ + int dummy5; /**< Don't use this */ + int dummy6; /**< Don't use this */ + int dummy7; /**< Don't use this */ + int dummy8; /**< Don't use this */ + int dummy9; /**< Don't use this */ + int dummy10; /**< Don't use this */ + int dummy11; /**< Don't use this */ + int pad1; /**< Don't use this */ + int pad2; /**< Don't use this */ + void *pad3; /**< Don't use this */ +}; + +/* dbus-protocol.h */ +#define DBUS_TYPE_INVALID ((int) '\0') +#define DBUS_TYPE_INVALID_AS_STRING "\0" +#define DBUS_TYPE_BYTE ((int) 'y') +#define DBUS_TYPE_BYTE_AS_STRING "y" +#define DBUS_TYPE_BOOLEAN ((int) 'b') +#define DBUS_TYPE_BOOLEAN_AS_STRING "b" +#define DBUS_TYPE_INT16 ((int) 'n') +#define DBUS_TYPE_INT16_AS_STRING "n" +#define DBUS_TYPE_UINT16 ((int) 'q') +#define DBUS_TYPE_UINT16_AS_STRING "q" +#define DBUS_TYPE_INT32 ((int) 'i') +#define DBUS_TYPE_INT32_AS_STRING "i" +#define DBUS_TYPE_UINT32 ((int) 'u') +#define DBUS_TYPE_UINT32_AS_STRING "u" +#define DBUS_TYPE_INT64 ((int) 'x') +#define DBUS_TYPE_INT64_AS_STRING "x" +#define DBUS_TYPE_UINT64 ((int) 't') +#define DBUS_TYPE_UINT64_AS_STRING "t" +#define DBUS_TYPE_DOUBLE ((int) 'd') +#define DBUS_TYPE_DOUBLE_AS_STRING "d" +#define DBUS_TYPE_STRING ((int) 's') +#define DBUS_TYPE_STRING_AS_STRING "s" +#define DBUS_TYPE_OBJECT_PATH ((int) 'o') +#define DBUS_TYPE_OBJECT_PATH_AS_STRING "o" +#define DBUS_TYPE_SIGNATURE ((int) 'g') +#define DBUS_TYPE_SIGNATURE_AS_STRING "g" +#define DBUS_TYPE_UNIX_FD ((int) 'h') +#define DBUS_TYPE_UNIX_FD_AS_STRING "h" +#define DBUS_TYPE_ARRAY ((int) 'a') +#define DBUS_TYPE_ARRAY_AS_STRING "a" +#define DBUS_TYPE_VARIANT ((int) 'v') +#define DBUS_TYPE_VARIANT_AS_STRING "v" + +#define DBUS_TYPE_STRUCT ((int) 'r') +#define DBUS_TYPE_STRUCT_AS_STRING "r" +#define DBUS_TYPE_DICT_ENTRY ((int) 'e') +#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e" + +#define DBUS_STRUCT_BEGIN_CHAR ((int) '(') +#define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "(" +#define DBUS_STRUCT_END_CHAR ((int) ')') +#define DBUS_STRUCT_END_CHAR_AS_STRING ")" +#define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{') +#define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{" +#define DBUS_DICT_ENTRY_END_CHAR ((int) '}') +#define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}" + +#define DBUS_MESSAGE_TYPE_INVALID 0 +#define DBUS_MESSAGE_TYPE_METHOD_CALL 1 +#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2 +#define DBUS_MESSAGE_TYPE_ERROR 3 +#define DBUS_MESSAGE_TYPE_SIGNAL 4 + +#define DBUS_MAXIMUM_NAME_LENGTH 255 + +#define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus" +#define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +#define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" +#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "\n" + +/* dbus-server.h */ +typedef void (* DBusNewConnectionFunction) (DBusServer *server, + DBusConnection *new_connection, + void *data); + +} // extern "C" + +#endif // DBUS_MINIMAL_P_H + diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index 71658f84c6..88c51947ed 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -47,10 +47,15 @@ #define QDBUS_SYMBOLS_P_H #include -#include #ifndef QT_NO_DBUS +#ifdef QT_LINKED_LIBDBUS +# include +#else +# include "dbus_minimal_p.h" +#endif + QT_BEGIN_NAMESPACE #if !defined QT_LINKED_LIBDBUS diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp index 6372fbb0e2..972205566a 100644 --- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp @@ -33,14 +33,16 @@ #include #include #include -#include -#include #include "common.h" #include #include +#define QT_LINKED_LIBDBUS +#include +#include + static const char serviceName[] = "org.qtproject.autotests.qpong"; static const char objectPath[] = "/org/qtproject/qpong"; static const char *interfaceName = serviceName; From 03b5ecce4ab8dc879e27dc8f07d6f3ef846efde0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 1 Dec 2014 09:10:43 +0100 Subject: [PATCH 28/99] FSEvents file system watcher: Do not watch whole parent hierarchies. Unfortunately the FSEvents implementation for watching parent hierarchies has the major flaw, that watching a path will then create watches for the whole parent hierarchy even if that hierarchy is already watched. Watching /A/B/C and /A/B/D will create two watches each for /A and /A/B. This leads to an explosion of open file handles. Luckily we do not need to watch the parent hierarchy since this is not a supported usecase of QFileSystemWatcher anyhow, so just don't do it. Task-number: QTCREATORBUG-13531 Change-Id: I9ecb5f08e4be35e4fbd58a7ca3155867fcb1589f Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemwatcher_fsevents.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index eebca1cfb0..90ef7a6336 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -518,7 +518,6 @@ bool QFseventsFileSystemWatcherEngine::startStream() NULL }; const CFAbsoluteTime latency = .5; // in seconds - FSEventStreamCreateFlags flags = kFSEventStreamCreateFlagWatchRoot; // Never start with kFSEventStreamEventIdSinceNow, because this will generate an invalid // soft-assert in FSEventStreamFlushSync in CarbonCore when no event occurred. @@ -530,7 +529,7 @@ bool QFseventsFileSystemWatcherEngine::startStream() reinterpret_cast(pathsToWatch), lastReceivedEvent, latency, - flags); + FSEventStreamCreateFlags(0)); if (!stream) { DEBUG() << "Failed to create stream!"; From 2903db0469487944f035aff1c44e69605d48fa8f Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Mon, 1 Dec 2014 09:57:15 +0200 Subject: [PATCH 29/99] winrt: Fix Windows Store Certification WinRT requires that IDXGIDevice3::Trim() is called on application suspend in order to pass Store Certification. Task-number: QTBUG-38481 Change-Id: Ia3cb5d3f6a2db8f11e4bfa4fd5c7791e18d6c36d Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index fadcd01b06..612a50f6b7 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -37,6 +37,9 @@ #include #include #include +#ifndef Q_OS_WINPHONE +#include +#endif #include "qwinrtbackingstore.h" #include "qwinrtinputcontext.h" @@ -1113,6 +1116,16 @@ HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args HRESULT QWinRTScreen::onSuspended(IInspectable *, ISuspendingEventArgs *) { +#ifndef Q_OS_WINPHONE + Q_D(QWinRTScreen); + ComPtr d3dDevice; + const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, EGL_NO_SURFACE, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf()); + if (ok && d3dDevice) { + ComPtr dxgiDevice; + if (SUCCEEDED(d3dDevice.As(&dxgiDevice))) + dxgiDevice->Trim(); + } +#endif QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); QWindowSystemInterface::flushWindowSystemEvents(); return S_OK; From f9f270a6c85fbf42de1e7bf34cc1887e90a0dcf1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 28 Nov 2014 12:13:19 +0100 Subject: [PATCH 30/99] Doc: add navigation info to qmake Manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the navigation.landingpage variable to the qdocconf file. Task-number: QTBUG-42965 Change-Id: Ia5ee411fc0dbd5cd8c2d238f346b0f1818b54289 Reviewed-by: Friedemann Kleint Reviewed-by: Topi Reiniö --- qmake/doc/qmake.qdocconf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf index bfdf1d1798..1a23237999 100644 --- a/qmake/doc/qmake.qdocconf +++ b/qmake/doc/qmake.qdocconf @@ -73,3 +73,5 @@ depends += \ qtx11extras \ qtxml \ qtxmlpatterns + +navigation.landingpage = "qmake Manual" From 2dbcaf5d96ffc2bbd41a6bd6b7d3d36131edb69b Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Wed, 26 Nov 2014 11:13:16 +0200 Subject: [PATCH 31/99] QOpenGLFramebufferObject: pass sized format also with dynamic GL The GL_RGBA8_OES define is not in scope for dynamic OpenGL builds, so pass in GL_RGBA8 instead (it is defined as the same value, 0x8058) when in ES mode. The functionality check already ensures the extension is available, so the ifdef guards can be removed. This fixes default multisampled FBO creation under ANGLE when using -opengl dynamic. Task-number: QTBUG-40921 Change-Id: Iac4b7e230a463c27b61af75c3307421f9deac856 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglframebufferobject.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index b185e332e6..cbc992b7e8 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -479,11 +479,9 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi GLenum storageFormat = internal_format; // ES requires a sized format. The older desktop extension does not. Correct the format on ES. if (ctx->isOpenGLES() && internal_format == GL_RGBA) { -#ifdef GL_RGBA8_OES if (funcs.hasOpenGLExtension(QOpenGLExtensions::Sized8Formats)) - storageFormat = GL_RGBA8_OES; + storageFormat = GL_RGBA8; else -#endif storageFormat = GL_RGBA4; } From 2b258dc80b34dc785257efa2292457e32da9408d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Nov 2014 20:31:16 -0800 Subject: [PATCH 32/99] Make sure plugins under LTCG get the right flags too. Change-Id: I51384b4c3ceca25b6e010ccf67fa0f1995cfa557 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/ltcg.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index b418135014..1459ccdc40 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -41,10 +41,12 @@ CONFIG(release, debug|release) { QMAKE_LFLAGS_LTCG += $$QMAKE_CFLAGS $$QMAKE_CFLAGS_LTCG QMAKE_LFLAGS_APP += $$QMAKE_CFLAGS_APP QMAKE_LFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB + QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB } else { QMAKE_LFLAGS_LTCG = $$QMAKE_CXXFLAGS $$QMAKE_LFLAGS_LTCG QMAKE_LFLAGS_APP += $$QMAKE_CXXFLAGS_APP QMAKE_LFLAGS_SHLIB += $$QMAKE_CXXFLAGS_SHLIB + QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB } } From fe6f4b9ad7eff15e6201baea9dad737c792a328c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Nov 2014 21:00:34 -0800 Subject: [PATCH 33/99] Fix linking of sources without LTCG to a static lib with LTCG Whenever a binary is created and linked against a static lib that was compiled with LTCG, the final linking step requires the compiler flags so that the pre-compiled data in the shared library can get properly compiled. This could happen for a static build of Qt with LTCG, but also happens frequently for Qt's own build when linking regular libraries and applications against QtBootstrap or QtPlatformSupport. The linking fails when the target is a shared library (example: QtWaylandClient linking against QtPlatformSupport). The .prl file actually contains the "ltcg" flag, so the best solution would actually be to process that flag there and add link_ltcg if any dependent .prl has "ltcg", but I couldn't find out how to do that. Change-Id: I4a75a14d1dcb8c2089a427285e25d5555df7d7d3 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/link_ltcg.prf | 18 ++++++++++++++++++ mkspecs/features/ltcg.prf | 18 +----------------- mkspecs/features/qt_functions.prf | 1 + mkspecs/features/qt_module_pris.prf | 2 ++ 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 mkspecs/features/link_ltcg.prf diff --git a/mkspecs/features/link_ltcg.prf b/mkspecs/features/link_ltcg.prf new file mode 100644 index 0000000000..537021f11b --- /dev/null +++ b/mkspecs/features/link_ltcg.prf @@ -0,0 +1,18 @@ +gcc { + # When doing link-time code generation, we need to pass the compiler + # flags during linking the stage too. This file is processed after + # default_post.prf, so the QMAKE_CXXFLAGS already contains + # QMAKE_CXXFLAGS_DEBUG or _RELEASE. + use_c_linker { + # use_c_linker.prf is in effect, use the C flags + QMAKE_LFLAGS_LTCG += $$QMAKE_CFLAGS $$QMAKE_CFLAGS_LTCG + QMAKE_LFLAGS_APP += $$QMAKE_CFLAGS_APP + QMAKE_LFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB + QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB + } else { + QMAKE_LFLAGS_LTCG = $$QMAKE_CXXFLAGS $$QMAKE_LFLAGS_LTCG + QMAKE_LFLAGS_APP += $$QMAKE_CXXFLAGS_APP + QMAKE_LFLAGS_SHLIB += $$QMAKE_CXXFLAGS_SHLIB + QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB + } +} diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index 1459ccdc40..b0765a85c3 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -31,25 +31,9 @@ CONFIG(release, debug|release) { QMAKE_CXXFLAGS_LTCG = QMAKE_LFLAGS_LTCG = } - - # When doing link-time code generation, we need to pass the compiler - # flags during linking stage too. This file is processed after - # default_post.prf, so the QMAKE_CXXFLAGS already contains - # QMAKE_CXXFLAGS_DEBUG or _RELEASE. - use_c_linker { - # use_c_linker.prf is in effect, use the C flags - QMAKE_LFLAGS_LTCG += $$QMAKE_CFLAGS $$QMAKE_CFLAGS_LTCG - QMAKE_LFLAGS_APP += $$QMAKE_CFLAGS_APP - QMAKE_LFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB - QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB - } else { - QMAKE_LFLAGS_LTCG = $$QMAKE_CXXFLAGS $$QMAKE_LFLAGS_LTCG - QMAKE_LFLAGS_APP += $$QMAKE_CXXFLAGS_APP - QMAKE_LFLAGS_SHLIB += $$QMAKE_CXXFLAGS_SHLIB - QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB - } } + load(link_ltcg) QMAKE_CFLAGS *= $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS *= $$QMAKE_CXXFLAGS_LTCG QMAKE_LFLAGS *= $$QMAKE_LFLAGS_LTCG diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index a9a622dd1d..7961f6512a 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -68,6 +68,7 @@ defineTest(qtAddModule) { using_privates = true export(using_privates) } + contains(MODULE_CONFIG, ltcg): CONFIG += link_ltcg qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG) qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9a876caf5e..03a8e5db71 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -66,6 +66,8 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri module_build_type = internal_module: \ module_build_type += internal_module + ltcg: \ + module_build_type += ltcg !isEmpty(MODULE_CONFIG): \ module_config = "QT.$${MODULE_ID}.CONFIG = $$MODULE_CONFIG" else: \ From 2bfc010b83974776f03fee011f5b2ab815fdbc2e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Nov 2014 14:59:28 -0800 Subject: [PATCH 34/99] Un-tighten the WinRT specific code out of qfunctions_winrt.h Keep the WinRT specific parts for WinRT only. This commit is a partial reversal of 67c83f329e7fb6fbf5d8e402f42ea8916c34f01c "Tighten Q_OS_WINRT ifdefs in qfunctions_winrt.h", which let the WinRT definitions out too wide. Strictly speaking, the C++ code that uses Microsoft::WRL::ComPtr without the #include is broken. The forward definition is not enough, but since Visual Studio is also broken, two wrongs made a right... (MSVC does not implement two-stage parsing of template code properly). But if you accidentally tried to compile qfunctions_winrt.h with a non-broken compiler, like GCC (MinGW), it would correctly complain. Change-Id: I7591015861d291a82050afe0f4df0cb18b43e23d Reviewed-by: Andrew Knight Reviewed-by: Maurice Kalinowski --- src/corelib/kernel/qfunctions_winrt.h | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h index 04ebda5cfe..c8e082795e 100644 --- a/src/corelib/kernel/qfunctions_winrt.h +++ b/src/corelib/kernel/qfunctions_winrt.h @@ -42,6 +42,23 @@ #include #include +// Convenience macros for handling HRESULT values +#define RETURN_IF_FAILED(msg, ret) \ + if (FAILED(hr)) { \ + qErrnoWarning(hr, msg); \ + ret; \ + } + +#define RETURN_HR_IF_FAILED(msg) RETURN_IF_FAILED(msg, return hr) +#define RETURN_OK_IF_FAILED(msg) RETURN_IF_FAILED(msg, return S_OK) +#define RETURN_FALSE_IF_FAILED(msg) RETURN_IF_FAILED(msg, return false) +#define RETURN_VOID_IF_FAILED(msg) RETURN_IF_FAILED(msg, return) + +#define Q_ASSERT_SUCCEEDED(hr) \ + Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr))); + +#ifdef Q_OS_WINRT + QT_BEGIN_NAMESPACE #ifdef QT_BUILD_CORE_LIB @@ -49,7 +66,6 @@ QT_BEGIN_NAMESPACE QT_END_NAMESPACE -#ifdef Q_OS_WINRT // Environment ------------------------------------------------------ errno_t qt_winrt_getenv_s(size_t*, char*, size_t, const char*); @@ -116,24 +132,6 @@ generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *) generate_inline_return_func0(tzset, void) generate_inline_return_func0(_tzset, void) -#endif // Q_OS_WINRT - -// Convenience macros for handling HRESULT values -#define RETURN_IF_FAILED(msg, ret) \ - if (FAILED(hr)) { \ - qErrnoWarning(hr, msg); \ - ret; \ - } - -#define RETURN_HR_IF_FAILED(msg) RETURN_IF_FAILED(msg, return hr) -#define RETURN_OK_IF_FAILED(msg) RETURN_IF_FAILED(msg, return S_OK) -#define RETURN_FALSE_IF_FAILED(msg) RETURN_IF_FAILED(msg, return false) -#define RETURN_VOID_IF_FAILED(msg) RETURN_IF_FAILED(msg, return) - -#define Q_ASSERT_SUCCEEDED(hr) \ - Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr))); - - namespace Microsoft { namespace WRL { template class ComPtr; } } namespace QWinRTFunctions { @@ -207,6 +205,8 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr &asyncOp, U *results } // QWinRTFunctions +#endif // Q_OS_WINRT + #endif // Q_OS_WIN #endif // QFUNCTIONS_WINRT_H From 2409ed7d48e8c0e34e79d8b750fe3e5432a0d3f9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Nov 2014 15:13:52 -0800 Subject: [PATCH 35/99] Fix placement of QT_{BEGIN,END}_NAMESPACE in qfunctions_winrt.h Those functions weren't getting properly namespaced. Even if we're testing WinRT namespaced builds, it wouldn't catch this mistake: those functions would simply all be in the global namespace. I guess we don't have a "namespace cleanliness" test. Change-Id: I2d3d09dc66dad476563dbf51c171683be155ebfd Reviewed-by: Maurice Kalinowski Reviewed-by: Andrew Knight --- src/corelib/kernel/qfunctions_winrt.cpp | 4 +++- src/corelib/kernel/qfunctions_winrt.h | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/corelib/kernel/qfunctions_winrt.cpp b/src/corelib/kernel/qfunctions_winrt.cpp index 84e7b5688f..60faead122 100644 --- a/src/corelib/kernel/qfunctions_winrt.cpp +++ b/src/corelib/kernel/qfunctions_winrt.cpp @@ -37,7 +37,7 @@ #include "qbytearray.h" #include "qhash.h" -QT_USE_NAMESPACE +QT_BEGIN_NAMESPACE // Environment ------------------------------------------------------ inline QHash &qt_app_environment() @@ -94,4 +94,6 @@ void qt_winrt__tzset() { } +QT_END_NAMESPACE + #endif // Q_OS_WINRT diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h index c8e082795e..2bec1fc2ff 100644 --- a/src/corelib/kernel/qfunctions_winrt.h +++ b/src/corelib/kernel/qfunctions_winrt.h @@ -64,15 +64,14 @@ QT_BEGIN_NAMESPACE #ifdef QT_BUILD_CORE_LIB #endif -QT_END_NAMESPACE - - // Environment ------------------------------------------------------ errno_t qt_winrt_getenv_s(size_t*, char*, size_t, const char*); errno_t qt_winrt__putenv_s(const char*, const char*); void qt_winrt_tzset(); void qt_winrt__tzset(); +QT_END_NAMESPACE + // As Windows Runtime lacks some standard functions used in Qt, these got // reimplemented. Other projects do this as well. Inline functions are used // that there is a central place to disable functions for newer versions if @@ -85,42 +84,42 @@ void qt_winrt__tzset(); #define generate_inline_return_func0(funcname, returntype) \ inline returntype funcname() \ { \ - return qt_winrt_##funcname(); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(); \ } #define generate_inline_return_func1(funcname, returntype, param1) \ inline returntype funcname(param1 p1) \ { \ - return qt_winrt_##funcname(p1); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1); \ } #define generate_inline_return_func2(funcname, returntype, param1, param2) \ inline returntype funcname(param1 p1, param2 p2) \ { \ - return qt_winrt_##funcname(p1, p2); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2); \ } #define generate_inline_return_func3(funcname, returntype, param1, param2, param3) \ inline returntype funcname(param1 p1, param2 p2, param3 p3) \ { \ - return qt_winrt_##funcname(p1, p2, p3); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3); \ } #define generate_inline_return_func4(funcname, returntype, param1, param2, param3, param4) \ inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4) \ { \ - return qt_winrt_##funcname(p1, p2, p3, p4); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4); \ } #define generate_inline_return_func5(funcname, returntype, param1, param2, param3, param4, param5) \ inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \ { \ - return qt_winrt_##funcname(p1, p2, p3, p4, p5); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5); \ } #define generate_inline_return_func6(funcname, returntype, param1, param2, param3, param4, param5, param6) \ inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \ { \ - return qt_winrt_##funcname(p1, p2, p3, p4, p5, p6); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6); \ } #define generate_inline_return_func7(funcname, returntype, param1, param2, param3, param4, param5, param6, param7) \ inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, param7 p7) \ { \ - return qt_winrt_##funcname(p1, p2, p3, p4, p5, p6, p7); \ + return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6, p7); \ } typedef unsigned (__stdcall *StartAdressExFunc)(void *); @@ -132,6 +131,8 @@ generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *) generate_inline_return_func0(tzset, void) generate_inline_return_func0(_tzset, void) +QT_BEGIN_NAMESPACE + namespace Microsoft { namespace WRL { template class ComPtr; } } namespace QWinRTFunctions { @@ -205,6 +206,8 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr &asyncOp, U *results } // QWinRTFunctions +QT_END_NAMESPACE + #endif // Q_OS_WINRT #endif // Q_OS_WIN From 4958cadeda4baf20f74f6b46689ca05d3f2b7875 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Nov 2014 17:02:49 +0100 Subject: [PATCH 36/99] QMainWindow: Observe left contents margin when positioning status bar. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-38152 Change-Id: I4c762a113dbfe47472d1087aa34c0e327083ee16 Reviewed-by: Jan Arve Sæther --- src/widgets/widgets/qmainwindowlayout.cpp | 2 +- .../widgets/qmainwindow/tst_qmainwindow.cpp | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 8f8642a72a..827e2ed2ba 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -1440,7 +1440,7 @@ void QMainWindowLayout::setGeometry(const QRect &_r) QLayout::setGeometry(r); if (statusbar) { - QRect sbr(QPoint(0, 0), + QRect sbr(QPoint(r.left(), 0), QSize(r.width(), statusbar->heightForWidth(r.width())) .expandedTo(statusbar->minimumSize())); sbr.moveBottom(r.bottom()); diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 751a16c59d..f2ce2d1d96 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -132,6 +133,8 @@ private slots: void saveRestore_data(); void statusBar(); #endif + void contentsMargins_data(); + void contentsMargins(); void isSeparator(); #ifndef QTEST_NO_CURSOR void setCursor(); @@ -749,8 +752,38 @@ void tst_QMainWindow::statusBar() QVERIFY(indexOfSb == -1); } } + #endif +void tst_QMainWindow::contentsMargins_data() +{ + QTest::addColumn("contentsMargin"); + QTest::newRow("0") << 0; + QTest::newRow("10") << 10; +} + +void tst_QMainWindow::contentsMargins() +{ + QFETCH(int, contentsMargin); + + QMainWindow mw; + const QRect availGeometry = QApplication::desktop()->availableGeometry(); + mw.menuBar()->addMenu("File"); + mw.setWindowTitle(QLatin1String(QTest::currentTestFunction()) + + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag())); + mw.resize(availGeometry.size() / 4); + mw.move((availGeometry.width() - mw.width()) / 2, + (availGeometry.height() - mw.height()) / 2); + mw.setContentsMargins(contentsMargin, contentsMargin, contentsMargin, contentsMargin); + mw.statusBar()->showMessage("Hello"); + + mw.show(); + QVERIFY(QTest::qWaitForWindowExposed(&mw)); + + QCOMPARE(mw.statusBar()->geometry().left(), contentsMargin); + QCOMPARE(mw.statusBar()->geometry().bottom() + 1, mw.height() - contentsMargin); +} + void tst_QMainWindow::centralWidget() { { From 03c4b52e1314f0f54d65e163b5f85dce212c6cf6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Nov 2014 10:24:58 +0100 Subject: [PATCH 37/99] QLayout: Observe contents margin when positioning the menu bar. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-38152 Change-Id: I53ea6bce33057251265a7eca1651aeabca314ba9 Reviewed-by: Jan Arve Sæther --- src/widgets/kernel/qlayout.cpp | 3 ++- tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index 46cab90ab4..f124f1ed8e 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -576,11 +576,12 @@ void QLayoutPrivate::doResize(const QSize &r) int mbh = menuBarHeightForWidth(menubar, r.width()); QWidget *mw = q->parentWidget(); QRect rect = mw->testAttribute(Qt::WA_LayoutOnEntireRect) ? mw->rect() : mw->contentsRect(); + const int mbTop = rect.top(); rect.setTop(rect.top() + mbh); q->setGeometry(rect); #ifndef QT_NO_MENUBAR if (menubar) - menubar->setGeometry(0,0,r.width(), mbh); + menubar->setGeometry(rect.left(), mbTop, r.width(), mbh); #endif } diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index f2ce2d1d96..15f2f88a8d 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -780,6 +780,9 @@ void tst_QMainWindow::contentsMargins() mw.show(); QVERIFY(QTest::qWaitForWindowExposed(&mw)); + QCOMPARE(mw.menuBar()->geometry().left(), contentsMargin); + QCOMPARE(mw.menuBar()->geometry().top(), contentsMargin); + QCOMPARE(mw.statusBar()->geometry().left(), contentsMargin); QCOMPARE(mw.statusBar()->geometry().bottom() + 1, mw.height() - contentsMargin); } From 68cab0b25061c4d9789af246ac5be9776756510e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 10 Nov 2014 17:06:36 +0100 Subject: [PATCH 38/99] QNetworkReply::abort will also call finished() Change-Id: I86e493178bf523c47eed36015354c0fbbebd56d2 Reviewed-by: Thiago Macieira --- src/network/access/qnetworkreply.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 39762e2324..18ff05fcd7 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -275,7 +275,7 @@ QNetworkReplyPrivate::QNetworkReplyPrivate() processing. After this signal is emitted, there will be no more updates to the reply's data or metadata. - Unless close() has been called, the reply will be still be opened + Unless close() or abort() have been called, the reply will be still be opened for reading, so the data can be retrieved by calls to read() or readAll(). In particular, if no calls to read() were made as a result of readyRead(), a call to readAll() will retrieve the full @@ -364,7 +364,9 @@ QNetworkReplyPrivate::QNetworkReplyPrivate() connections still open. Uploads still in progress are also aborted. - \sa close() + The finished() signal will also be emitted. + + \sa close(), finished() */ /*! From 9d2edfe5248fce8b16693fad8304f94a1f101bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Sat, 29 Nov 2014 21:15:07 +0000 Subject: [PATCH 39/99] Fix build due to source incompatible change with FreeType 2.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b3500af717010137046ec4076d1e1c0641e33727 ../gui/text/qfontengine_ft.cpp: In member function ‘QFontEngineFT::Glyph* QFontEngineFT::loadGlyph(QFontEngineFT::QGlyphSet*, uint, QFixed, QFontEngine::GlyphFormat, bool) const’: ../gui/text/qfontengine_ft.cpp:1126:39: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (int x = 0; x < slot->bitmap.width; x++) { Change-Id: Idb58f9e5895aac8c02163870d7c7d4a49237086b Reviewed-by: Konstantin Ritt Reviewed-by: Thiago Macieira Reviewed-by: Shawn Rutledge --- src/gui/text/qfontengine_ft.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 8191629003..44c0a50bfc 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1123,7 +1123,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, while (h--) { uint *dd = (uint *)dst; *dd++ = 0; - for (int x = 0; x < slot->bitmap.width; x++) { + for (int x = 0; x < static_cast(slot->bitmap.width); x++) { uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000); *dd++ = a; } @@ -1134,7 +1134,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, } else if (vfactor != 1) { while (h--) { uint *dd = (uint *)dst; - for (int x = 0; x < slot->bitmap.width; x++) { + for (int x = 0; x < static_cast(slot->bitmap.width); x++) { uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000); *dd++ = a; } @@ -1143,7 +1143,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, } } else { while (h--) { - for (int x = 0; x < slot->bitmap.width; x++) { + for (int x = 0; x < static_cast(slot->bitmap.width); x++) { unsigned char a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xff : 0x00); dst[x] = a; } From 1018502722ee70dd077304e35ff4600853143571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 15:13:05 +0100 Subject: [PATCH 40/99] iOS: Use DISTCLEAN_DEPS instead of custom distclean target Change-Id: I1fb6dc4c9ef3623f58a9c8412499df7b9f9ff9bf Reviewed-by: Oswald Buddenhagen --- mkspecs/macx-ios-clang/features/default_post.prf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 45ba777630..aa849eb8b1 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -68,8 +68,7 @@ equals(TEMPLATE, app) { debug-iphonesimulator-distclean debug-iphoneos-distclean \ release-iphonesimulator-distclean release-iphoneos-distclean QMAKE_EXTRA_TARGETS += xcode_distclean - distclean.depends = xcode_distclean - QMAKE_EXTRA_TARGETS += distclean + DISTCLEAN_DEPS += xcode_distclean mkpath($$OUT_PWD)|error("Aborting.") args = From c59c8ddf1f98938441925e01d9931c3c1eb3f5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Nov 2014 15:08:04 +0100 Subject: [PATCH 41/99] iOS: Refactor QIOSKeyboardListener implementation and usage QIOSKeyboardListener takes care of both maintaining the virtual keyboard state, and acting as a gesture recognizer for the hide keyboard gesture. We make this explicit though a union in QIOSInputContext, so that we can access each 'mode' separately. This improved code readability and allows later refactoring of the state and gesture into separate classes without changing the call sites. Change-Id: Icc60f4a542983cda7ca0fd6622963d32d1e90db9 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.h | 6 +- src/plugins/platforms/ios/qiosinputcontext.mm | 137 ++++++++++-------- 2 files changed, 83 insertions(+), 60 deletions(-) diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h index b4ff695f1a..174c44751c 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.h +++ b/src/plugins/platforms/ios/qiosinputcontext.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE @class QIOSKeyboardListener; @class QIOSTextInputResponder; +@protocol KeyboardState; struct ImeState { @@ -90,7 +91,10 @@ public: static QIOSInputContext *instance(); private: - QIOSKeyboardListener *m_keyboardListener; + union { + QIOSKeyboardListener *m_keyboardHideGesture; + id m_keyboardState; + }; QIOSTextInputResponder *m_textResponder; ImeState m_imeState; }; diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index e417e9a1fb..72437fea6e 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -63,30 +63,40 @@ static QUIView *focusView() // ------------------------------------------------------------------------- -@interface QIOSKeyboardListener : UIGestureRecognizer { -@public - QIOSInputContext *m_context; - BOOL m_keyboardVisible; - BOOL m_keyboardVisibleAndDocked; - QRectF m_keyboardRect; - CGRect m_keyboardEndRect; - NSTimeInterval m_duration; - UIViewAnimationCurve m_curve; +@protocol KeyboardState +- (void)updateKeyboardRect; +@property(nonatomic) BOOL keyboardVisible; +@property(nonatomic) BOOL keyboardVisibleAndDocked; +@property(nonatomic, assign) QRectF keyboardRect; +@property(nonatomic) CGRect keyboardEndRect; +@property(nonatomic) NSTimeInterval animationDuration; +@property(nonatomic) UIViewAnimationCurve animationCurve; +@end + +// ------------------------------------------------------------------------- + +@interface QIOSKeyboardListener : UIGestureRecognizer { + @public UIViewController *m_viewController; + @private + QIOSInputContext *m_context; } @end @implementation QIOSKeyboardListener +// KeyboardState protocol +@synthesize keyboardVisible; +@synthesize keyboardVisibleAndDocked; +@synthesize keyboardRect; +@synthesize keyboardEndRect; +@synthesize animationDuration; +@synthesize animationCurve; + - (id)initWithQIOSInputContext:(QIOSInputContext *)context { - self = [super initWithTarget:self action:@selector(gestureStateChanged:)]; - if (self) { + if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) { m_context = context; - m_keyboardVisible = NO; - m_keyboardVisibleAndDocked = NO; - m_duration = 0; - m_curve = UIViewAnimationCurveEaseOut; m_viewController = 0; if (isQtApplication()) { @@ -107,6 +117,11 @@ static QUIView *focusView() [m_viewController.view.window addGestureRecognizer:self]; } + self.keyboardVisible = NO; + self.keyboardVisibleAndDocked = NO; + self.animationDuration = 0; + self.animationCurve = UIViewAnimationCurveEaseOut; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) @@ -120,10 +135,11 @@ static QUIView *focusView() selector:@selector(keyboardDidChangeFrame:) name:@"UIKeyboardDidChangeFrameNotification" object:nil]; } + return self; } -- (void) dealloc +- (void)dealloc { [m_viewController.view.window removeGestureRecognizer:self]; [m_viewController release]; @@ -137,29 +153,31 @@ static QUIView *focusView() [[NSNotificationCenter defaultCenter] removeObserver:self name:@"UIKeyboardDidChangeFrameNotification" object:nil]; + [super dealloc]; } -- (void) keyboardDidChangeFrame:(NSNotification *)notification +- (void)keyboardDidChangeFrame:(NSNotification *)notification { Q_UNUSED(notification); - [self handleKeyboardRectChanged]; + + [self updateKeyboardRect]; // If the keyboard was visible and docked from before, this is just a geometry // change (normally caused by an orientation change). In that case, update scroll: - if (m_keyboardVisibleAndDocked) + if (self.keyboardVisibleAndDocked) m_context->scrollToCursor(); } -- (void) keyboardWillShow:(NSNotification *)notification +- (void)keyboardWillShow:(NSNotification *)notification { // Note that UIKeyboardWillShowNotification is only sendt when the keyboard is docked. - m_keyboardVisibleAndDocked = YES; - m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + self.keyboardVisibleAndDocked = YES; + self.keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - if (!m_duration) { - m_duration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - m_curve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]); + if (!self.animationDuration) { + self.animationDuration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; + self.animationCurve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]); } UIResponder *firstResponder = [UIResponder currentFirstResponder]; @@ -172,11 +190,11 @@ static QUIView *focusView() m_context->scrollToCursor(); } -- (void) keyboardWillHide:(NSNotification *)notification +- (void)keyboardWillHide:(NSNotification *)notification { // Note that UIKeyboardWillHideNotification is also sendt when the keyboard is undocked. - m_keyboardVisibleAndDocked = NO; - m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + self.keyboardVisibleAndDocked = NO; + self.keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; if (self.state != UIGestureRecognizerStateBegan) { // Only disable the gesture if the hiding of the keyboard was not caused by it. // Otherwise we need to await the final touchEnd callback for doing some clean-up. @@ -185,27 +203,27 @@ static QUIView *focusView() m_context->scroll(0); } -- (void) handleKeyboardRectChanged +- (void)updateKeyboardRect { // QInputmethod::keyboardRectangle() is documented to be in window coordinates. // If there is no focus window, we return an empty rectangle UIView *view = focusView(); - QRectF convertedRect = fromCGRect([view convertRect:m_keyboardEndRect fromView:nil]); + QRectF convertedRect = fromCGRect([view convertRect:self.keyboardEndRect fromView:nil]); // Set height to zero if keyboard is hidden. Otherwise the rect will not change // when the keyboard hides on a scrolled screen (since the keyboard will already // be at the bottom of the 'screen' in that case) - if (!m_keyboardVisibleAndDocked) + if (!self.keyboardVisibleAndDocked) convertedRect.setHeight(0); - if (convertedRect != m_keyboardRect) { - m_keyboardRect = convertedRect; + if (convertedRect != self.keyboardRect) { + self.keyboardRect = convertedRect; m_context->emitKeyboardRectChanged(); } - BOOL visible = CGRectIntersectsRect(m_keyboardEndRect, [UIScreen mainScreen].bounds); - if (m_keyboardVisible != visible) { - m_keyboardVisible = visible; + BOOL visible = CGRectIntersectsRect(self.keyboardEndRect, [UIScreen mainScreen].bounds); + if (self.keyboardVisible != visible) { + self.keyboardVisible = visible; m_context->emitInputPanelVisibleChanged(); } } @@ -216,7 +234,7 @@ static QUIView *focusView() { [super touchesBegan:touches withEvent:event]; - Q_ASSERT(m_keyboardVisibleAndDocked); + Q_ASSERT(self.keyboardVisibleAndDocked); if ([touches count] != 1) self.state = UIGestureRecognizerStateFailed; @@ -230,7 +248,7 @@ static QUIView *focusView() return; CGPoint touchPoint = [[touches anyObject] locationInView:m_viewController.view.window]; - if (CGRectContainsPoint(m_keyboardEndRect, touchPoint)) + if (CGRectContainsPoint(self.keyboardEndRect, touchPoint)) self.state = UIGestureRecognizerStateBegan; } @@ -280,7 +298,7 @@ static QUIView *focusView() { [super reset]; - if (!m_keyboardVisibleAndDocked) { + if (!self.keyboardVisibleAndDocked) { qImDebug() << "keyboard was hidden, disabling hide-keyboard gesture"; self.enabled = NO; } else { @@ -328,7 +346,7 @@ QIOSInputContext *QIOSInputContext::instance() QIOSInputContext::QIOSInputContext() : QPlatformInputContext() - , m_keyboardListener([[QIOSKeyboardListener alloc] initWithQIOSInputContext:this]) + , m_keyboardHideGesture([[QIOSKeyboardListener alloc] initWithQIOSInputContext:this]) , m_textResponder(0) { if (isQtApplication()) @@ -338,15 +356,10 @@ QIOSInputContext::QIOSInputContext() QIOSInputContext::~QIOSInputContext() { - [m_keyboardListener release]; + [m_keyboardHideGesture release]; [m_textResponder release]; } -QRectF QIOSInputContext::keyboardRect() const -{ - return m_keyboardListener->m_keyboardRect; -} - void QIOSInputContext::showInputPanel() { // No-op, keyboard controlled fully by platform based on focus @@ -377,12 +390,17 @@ void QIOSInputContext::clearCurrentFocusObject() bool QIOSInputContext::isInputPanelVisible() const { - return m_keyboardListener->m_keyboardVisible; + return m_keyboardState.keyboardVisible; +} + +QRectF QIOSInputContext::keyboardRect() const +{ + return m_keyboardState.keyboardRect; } void QIOSInputContext::cursorRectangleChanged() { - if (!m_keyboardListener->m_keyboardVisibleAndDocked || !qApp->focusObject()) + if (!m_keyboardState.keyboardVisibleAndDocked || !qApp->focusObject()) return; // Check if the cursor has changed position inside the input item. Since @@ -402,14 +420,14 @@ void QIOSInputContext::scrollToCursor() if (!isQtApplication()) return; - if (m_keyboardListener.state == UIGestureRecognizerStatePossible && m_keyboardListener.numberOfTouches == 1) { + if (m_keyboardHideGesture.state == UIGestureRecognizerStatePossible && m_keyboardHideGesture.numberOfTouches == 1) { // Don't scroll to the cursor if the user is touching the screen and possibly // trying to trigger the hide-keyboard gesture. qImDebug() << "preventing scrolling to cursor as we're still waiting for a possible gesture"; return; } - UIView *view = m_keyboardListener->m_viewController.view; + UIView *view = m_keyboardHideGesture->m_viewController.view; if (view.window != focusView().window) return; @@ -417,7 +435,7 @@ void QIOSInputContext::scrollToCursor() QRectF translatedCursorPos = qApp->inputMethod()->cursorRectangle(); translatedCursorPos.translate(focusView().qwindow->geometry().topLeft()); - qreal keyboardY = [view convertRect:m_keyboardListener->m_keyboardEndRect fromView:nil].origin.y; + qreal keyboardY = [view convertRect:m_keyboardState.keyboardEndRect fromView:nil].origin.y; int statusBarY = qGuiApp->primaryScreen()->availableGeometry().y(); scroll((translatedCursorPos.bottomLeft().y() < keyboardY - margin) ? 0 @@ -426,15 +444,15 @@ void QIOSInputContext::scrollToCursor() void QIOSInputContext::scroll(int y) { - UIView *rootView = m_keyboardListener->m_viewController.view; + UIView *rootView = m_keyboardHideGesture->m_viewController.view; CATransform3D translationTransform = CATransform3DMakeTranslation(0.0, -y, 0.0); if (CATransform3DEqualToTransform(translationTransform, rootView.layer.sublayerTransform)) return; QPointer self = this; - [UIView animateWithDuration:m_keyboardListener->m_duration delay:0 - options:(m_keyboardListener->m_curve << 16) | UIViewAnimationOptionBeginFromCurrentState + [UIView animateWithDuration:m_keyboardState.animationDuration delay:0 + options:(m_keyboardState.animationCurve << 16) | UIViewAnimationOptionBeginFromCurrentState animations:^{ // The sublayerTransform property of CALayer is not implicitly animated for a // layer-backed view, even inside a UIView animation block, so we need to set up @@ -464,7 +482,7 @@ void QIOSInputContext::scroll(int y) } completion:^(BOOL){ if (self) - [m_keyboardListener handleKeyboardRectChanged]; + [m_keyboardState updateKeyboardRect]; } ]; } @@ -477,7 +495,7 @@ void QIOSInputContext::setFocusObject(QObject *focusObject) qImDebug() << "new focus object =" << focusObject; - if (m_keyboardListener.state == UIGestureRecognizerStateChanged) { + if (m_keyboardHideGesture.state == UIGestureRecognizerStateChanged) { // A new focus object may be set as part of delivering touch events to // application during the hide-keyboard gesture, but we don't want that // to result in a new object getting focus and bringing the keyboard up @@ -489,7 +507,7 @@ void QIOSInputContext::setFocusObject(QObject *focusObject) reset(); - if (m_keyboardListener->m_keyboardVisibleAndDocked) + if (m_keyboardState.keyboardVisibleAndDocked) scrollToCursor(); } @@ -501,8 +519,9 @@ void QIOSInputContext::focusWindowChanged(QWindow *focusWindow) reset(); - [m_keyboardListener handleKeyboardRectChanged]; - if (m_keyboardListener->m_keyboardVisibleAndDocked) + [m_keyboardState updateKeyboardRect]; + + if (m_keyboardState.keyboardVisibleAndDocked) scrollToCursor(); } From 44e9e7fe199f197fe1e639e5fbcf858f4775d31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Nov 2014 15:43:52 +0100 Subject: [PATCH 42/99] iOS: Simplify view management in QIOSKeyboardListener We don't need to keep track of the view-controller or add ourselves as a gesture recognizer inside QIOSKeyboardListener. In fact, leaving the call to removeGestureRecognizer in [QIOSKeyboardListener dealloc] will result in QIOSKeyboardListener never being released, as the view that we add the recognizer to will keep a strong reference to the recognizer, so dealloc is never called unless the view is also released, which is unlikely to happen. We now fully control the lifetime of the recognizer. Change-Id: I6755e8cdfcc8f1062314db51aa54a2b7ecd1b967 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.h | 2 + src/plugins/platforms/ios/qiosinputcontext.mm | 69 +++++++++++-------- src/plugins/platforms/ios/qiosscreen.h | 1 + src/plugins/platforms/ios/qiosscreen.mm | 5 ++ 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h index 174c44751c..eb6b04a2ac 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.h +++ b/src/plugins/platforms/ios/qiosinputcontext.h @@ -91,6 +91,8 @@ public: static QIOSInputContext *instance(); private: + UIView* scrollableRootView(); + union { QIOSKeyboardListener *m_keyboardHideGesture; id m_keyboardState; diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 72437fea6e..49eff2b88a 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -45,6 +45,7 @@ #include "qiosglobal.h" #include "qiosintegration.h" +#include "qiosscreen.h" #include "qiostextresponder.h" #include "qiosviewcontroller.h" #include "qioswindow.h" @@ -76,8 +77,6 @@ static QUIView *focusView() // ------------------------------------------------------------------------- @interface QIOSKeyboardListener : UIGestureRecognizer { - @public - UIViewController *m_viewController; @private QIOSInputContext *m_context; } @@ -97,26 +96,13 @@ static QUIView *focusView() { if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) { m_context = context; - m_viewController = 0; - if (isQtApplication()) { - // Get the root view controller that is on the same screen as the keyboard: - for (UIWindow *uiWindow in [[UIApplication sharedApplication] windows]) { - if (uiWindow.screen == [UIScreen mainScreen]) { - m_viewController = [uiWindow.rootViewController retain]; - break; - } - } - Q_ASSERT(m_viewController); - - // Attach 'hide keyboard' gesture to the window, but keep it disabled when the - // keyboard is not visible. - self.enabled = NO; - self.cancelsTouchesInView = NO; - self.delaysTouchesEnded = NO; - [m_viewController.view.window addGestureRecognizer:self]; - } + // UIGestureRecognizer + self.enabled = NO; + self.cancelsTouchesInView = NO; + self.delaysTouchesEnded = NO; + /// KeyboardState self.keyboardVisible = NO; self.keyboardVisibleAndDocked = NO; self.animationDuration = 0; @@ -141,9 +127,6 @@ static QUIView *focusView() - (void)dealloc { - [m_viewController.view.window removeGestureRecognizer:self]; - [m_viewController release]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"UIKeyboardWillShowNotification" object:nil]; @@ -247,7 +230,7 @@ static QUIView *focusView() if (self.state != UIGestureRecognizerStatePossible) return; - CGPoint touchPoint = [[touches anyObject] locationInView:m_viewController.view.window]; + CGPoint touchPoint = [[touches anyObject] locationInView:self.view]; if (CGRectContainsPoint(self.keyboardEndRect, touchPoint)) self.state = UIGestureRecognizerStateBegan; } @@ -349,14 +332,21 @@ QIOSInputContext::QIOSInputContext() , m_keyboardHideGesture([[QIOSKeyboardListener alloc] initWithQIOSInputContext:this]) , m_textResponder(0) { - if (isQtApplication()) + if (isQtApplication()) { + QIOSScreen *iosScreen = static_cast(QGuiApplication::primaryScreen()->handle()); + [iosScreen->uiWindow() addGestureRecognizer:m_keyboardHideGesture]; + connect(qGuiApp->inputMethod(), &QInputMethod::cursorRectangleChanged, this, &QIOSInputContext::cursorRectangleChanged); + } + connect(qGuiApp, &QGuiApplication::focusWindowChanged, this, &QIOSInputContext::focusWindowChanged); } QIOSInputContext::~QIOSInputContext() { + [m_keyboardHideGesture.view removeGestureRecognizer:m_keyboardHideGesture]; [m_keyboardHideGesture release]; + [m_textResponder release]; } @@ -398,6 +388,8 @@ QRectF QIOSInputContext::keyboardRect() const return m_keyboardState.keyboardRect; } +// ------------------------------------------------------------------------- + void QIOSInputContext::cursorRectangleChanged() { if (!m_keyboardState.keyboardVisibleAndDocked || !qApp->focusObject()) @@ -415,6 +407,18 @@ void QIOSInputContext::cursorRectangleChanged() prevCursor = cursor; } +UIView *QIOSInputContext::scrollableRootView() +{ + if (!m_keyboardHideGesture.view) + return 0; + + UIWindow *window = static_cast(m_keyboardHideGesture.view); + if (![window.rootViewController isKindOfClass:[QIOSViewController class]]) + return 0; + + return window.rootViewController.view; +} + void QIOSInputContext::scrollToCursor() { if (!isQtApplication()) @@ -427,24 +431,29 @@ void QIOSInputContext::scrollToCursor() return; } - UIView *view = m_keyboardHideGesture->m_viewController.view; - if (view.window != focusView().window) + UIView *rootView = scrollableRootView(); + if (!rootView) + return; + + if (rootView.window != focusView().window) return; const int margin = 20; QRectF translatedCursorPos = qApp->inputMethod()->cursorRectangle(); translatedCursorPos.translate(focusView().qwindow->geometry().topLeft()); - qreal keyboardY = [view convertRect:m_keyboardState.keyboardEndRect fromView:nil].origin.y; + qreal keyboardY = [rootView convertRect:m_keyboardState.keyboardEndRect fromView:nil].origin.y; int statusBarY = qGuiApp->primaryScreen()->availableGeometry().y(); scroll((translatedCursorPos.bottomLeft().y() < keyboardY - margin) ? 0 - : qMin(view.bounds.size.height - keyboardY, translatedCursorPos.y() - statusBarY - margin)); + : qMin(rootView.bounds.size.height - keyboardY, translatedCursorPos.y() - statusBarY - margin)); } void QIOSInputContext::scroll(int y) { - UIView *rootView = m_keyboardHideGesture->m_viewController.view; + UIView *rootView = scrollableRootView(); + if (!rootView) + return; CATransform3D translationTransform = CATransform3DMakeTranslation(0.0, -y, 0.0); if (CATransform3DEqualToTransform(translationTransform, rootView.layer.sublayerTransform)) diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h index 7987ef82d5..7aa62b9190 100644 --- a/src/plugins/platforms/ios/qiosscreen.h +++ b/src/plugins/platforms/ios/qiosscreen.h @@ -63,6 +63,7 @@ public: void setOrientationUpdateMask(Qt::ScreenOrientations mask); UIScreen *uiScreen() const; + UIWindow *uiWindow() const; void updateProperties(); diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index e70b369b79..4af2a4965f 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -321,6 +321,11 @@ UIScreen *QIOSScreen::uiScreen() const return m_uiScreen; } +UIWindow *QIOSScreen::uiWindow() const +{ + return m_uiWindow; +} + #include "moc_qiosscreen.cpp" QT_END_NAMESPACE From df75cb4c093dfc0a6a3e926bbfd6e6943c9cdd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 13:54:36 +0100 Subject: [PATCH 43/99] iOS: Properly support QInputMethod's visible and animating properties We now emit and change the 'visible' and 'animating' properties of the QInputMethod according to the documentation, which means the 'visible' property will change immediately when the keyboard is about to become visible, or about to hide, and the 'animating' property will determine if the visibility-change is just starting out, or has ended. The keyboard rect will at all times reflect the currently visible area of the virtual keyboard on screen (in focus-window-coordinates), not future state after the animating completes. Getting the future state is a missing piece of the QInputMethod API, and could be solved in the future by adding arguments to the animatingChanged signal that allow platform plugins to pass on the before- and after states. The logic for determining the keyboard state has been moved into a central function, updateKeyboardState(), which allows us to change and emit property changes atomically. There is still some parts left of the old approach, but these are left in to make further changes to the code easier to diff and understand in isolation. Change-Id: Ica52718eba503165ba101f1f82c4a425e3621002 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.h | 26 ++- src/plugins/platforms/ios/qiosinputcontext.mm | 209 ++++++++++-------- 2 files changed, 136 insertions(+), 99 deletions(-) diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h index eb6b04a2ac..863e503c3b 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.h +++ b/src/plugins/platforms/ios/qiosinputcontext.h @@ -50,6 +50,21 @@ QT_BEGIN_NAMESPACE @class QIOSTextInputResponder; @protocol KeyboardState; +struct KeyboardState +{ + KeyboardState() : + keyboardVisible(false), keyboardAnimating(false), + animationDuration(0), animationCurve(UIViewAnimationCurve(-1)) + {} + + bool keyboardVisible; + bool keyboardAnimating; + QRectF keyboardRect; + CGRect keyboardEndRect; + NSTimeInterval animationDuration; + UIViewAnimationCurve animationCurve; +}; + struct ImeState { ImeState() : currentState(0), focusObject(0) {} @@ -70,6 +85,7 @@ public: void hideInputPanel() Q_DECL_OVERRIDE; bool isInputPanelVisible() const Q_DECL_OVERRIDE; + bool isAnimating() const Q_DECL_OVERRIDE; QRectF keyboardRect() const Q_DECL_OVERRIDE; void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE; @@ -85,7 +101,11 @@ public: void scrollToCursor(); void scroll(int y); + void updateKeyboardState(NSNotification *notification = 0); + const ImeState &imeState() { return m_imeState; }; + const KeyboardState &keyboardState() { return m_keyboardState; }; + bool inputMethodAccepted() const; static QIOSInputContext *instance(); @@ -93,11 +113,9 @@ public: private: UIView* scrollableRootView(); - union { - QIOSKeyboardListener *m_keyboardHideGesture; - id m_keyboardState; - }; + QIOSKeyboardListener *m_keyboardHideGesture; QIOSTextInputResponder *m_textResponder; + KeyboardState m_keyboardState; ImeState m_imeState; }; diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 49eff2b88a..e2e764d231 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -64,19 +64,7 @@ static QUIView *focusView() // ------------------------------------------------------------------------- -@protocol KeyboardState -- (void)updateKeyboardRect; -@property(nonatomic) BOOL keyboardVisible; -@property(nonatomic) BOOL keyboardVisibleAndDocked; -@property(nonatomic, assign) QRectF keyboardRect; -@property(nonatomic) CGRect keyboardEndRect; -@property(nonatomic) NSTimeInterval animationDuration; -@property(nonatomic) UIViewAnimationCurve animationCurve; -@end - -// ------------------------------------------------------------------------- - -@interface QIOSKeyboardListener : UIGestureRecognizer { +@interface QIOSKeyboardListener : UIGestureRecognizer { @private QIOSInputContext *m_context; } @@ -84,14 +72,6 @@ static QUIView *focusView() @implementation QIOSKeyboardListener -// KeyboardState protocol -@synthesize keyboardVisible; -@synthesize keyboardVisibleAndDocked; -@synthesize keyboardRect; -@synthesize keyboardEndRect; -@synthesize animationDuration; -@synthesize animationCurve; - - (id)initWithQIOSInputContext:(QIOSInputContext *)context { if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) { @@ -102,24 +82,23 @@ static QUIView *focusView() self.cancelsTouchesInView = NO; self.delaysTouchesEnded = NO; - /// KeyboardState - self.keyboardVisible = NO; - self.keyboardVisibleAndDocked = NO; - self.animationDuration = 0; - self.animationCurve = UIViewAnimationCurveEaseOut; + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - [[NSNotificationCenter defaultCenter] - addObserver:self + [notificationCenter addObserver:self selector:@selector(keyboardWillShow:) - name:@"UIKeyboardWillShowNotification" object:nil]; - [[NSNotificationCenter defaultCenter] - addObserver:self + name:UIKeyboardWillShowNotification object:nil]; + [notificationCenter addObserver:self + selector:@selector(keyboardWillOrDidChange:) + name:UIKeyboardDidShowNotification object:nil]; + [notificationCenter addObserver:self selector:@selector(keyboardWillHide:) - name:@"UIKeyboardWillHideNotification" object:nil]; - [[NSNotificationCenter defaultCenter] - addObserver:self + name:UIKeyboardWillHideNotification object:nil]; + [notificationCenter addObserver:self + selector:@selector(keyboardWillOrDidChange:) + name:UIKeyboardDidHideNotification object:nil]; + [notificationCenter addObserver:self selector:@selector(keyboardDidChangeFrame:) - name:@"UIKeyboardDidChangeFrameNotification" object:nil]; + name:UIKeyboardDidChangeFrameNotification object:nil]; } return self; @@ -127,41 +106,16 @@ static QUIView *focusView() - (void)dealloc { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"UIKeyboardWillShowNotification" object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"UIKeyboardWillHideNotification" object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"UIKeyboardDidChangeFrameNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } -- (void)keyboardDidChangeFrame:(NSNotification *)notification -{ - Q_UNUSED(notification); - - [self updateKeyboardRect]; - - // If the keyboard was visible and docked from before, this is just a geometry - // change (normally caused by an orientation change). In that case, update scroll: - if (self.keyboardVisibleAndDocked) - m_context->scrollToCursor(); -} +// ------------------------------------------------------------------------- - (void)keyboardWillShow:(NSNotification *)notification { - // Note that UIKeyboardWillShowNotification is only sendt when the keyboard is docked. - self.keyboardVisibleAndDocked = YES; - self.keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - - if (!self.animationDuration) { - self.animationDuration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - self.animationCurve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]); - } + [self keyboardWillOrDidChange:notification]; UIResponder *firstResponder = [UIResponder currentFirstResponder]; if (![firstResponder isKindOfClass:[QIOSTextInputResponder class]]) @@ -175,9 +129,8 @@ static QUIView *focusView() - (void)keyboardWillHide:(NSNotification *)notification { - // Note that UIKeyboardWillHideNotification is also sendt when the keyboard is undocked. - self.keyboardVisibleAndDocked = NO; - self.keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + [self keyboardWillOrDidChange:notification]; + if (self.state != UIGestureRecognizerStateBegan) { // Only disable the gesture if the hiding of the keyboard was not caused by it. // Otherwise we need to await the final touchEnd callback for doing some clean-up. @@ -186,29 +139,19 @@ static QUIView *focusView() m_context->scroll(0); } -- (void)updateKeyboardRect +- (void)keyboardDidChangeFrame:(NSNotification *)notification { - // QInputmethod::keyboardRectangle() is documented to be in window coordinates. - // If there is no focus window, we return an empty rectangle - UIView *view = focusView(); - QRectF convertedRect = fromCGRect([view convertRect:self.keyboardEndRect fromView:nil]); + [self keyboardWillOrDidChange:notification]; - // Set height to zero if keyboard is hidden. Otherwise the rect will not change - // when the keyboard hides on a scrolled screen (since the keyboard will already - // be at the bottom of the 'screen' in that case) - if (!self.keyboardVisibleAndDocked) - convertedRect.setHeight(0); + // If the keyboard was visible and docked from before, this is just a geometry + // change (normally caused by an orientation change). In that case, update scroll: + if (m_context->isInputPanelVisible()) + m_context->scrollToCursor(); +} - if (convertedRect != self.keyboardRect) { - self.keyboardRect = convertedRect; - m_context->emitKeyboardRectChanged(); - } - - BOOL visible = CGRectIntersectsRect(self.keyboardEndRect, [UIScreen mainScreen].bounds); - if (self.keyboardVisible != visible) { - self.keyboardVisible = visible; - m_context->emitInputPanelVisibleChanged(); - } +- (void)keyboardWillOrDidChange:(NSNotification *)notification +{ + m_context->updateKeyboardState(notification); } // ------------------------------------------------------------------------- @@ -217,7 +160,7 @@ static QUIView *focusView() { [super touchesBegan:touches withEvent:event]; - Q_ASSERT(self.keyboardVisibleAndDocked); + Q_ASSERT(m_context->isInputPanelVisible()); if ([touches count] != 1) self.state = UIGestureRecognizerStateFailed; @@ -231,7 +174,7 @@ static QUIView *focusView() return; CGPoint touchPoint = [[touches anyObject] locationInView:self.view]; - if (CGRectContainsPoint(self.keyboardEndRect, touchPoint)) + if (CGRectContainsPoint(m_context->keyboardState().keyboardEndRect, touchPoint)) self.state = UIGestureRecognizerStateBegan; } @@ -281,7 +224,7 @@ static QUIView *focusView() { [super reset]; - if (!self.keyboardVisibleAndDocked) { + if (!m_context->isInputPanelVisible()) { qImDebug() << "keyboard was hidden, disabling hide-keyboard gesture"; self.enabled = NO; } else { @@ -378,11 +321,75 @@ void QIOSInputContext::clearCurrentFocusObject() static_cast(QObjectPrivate::get(focusWindow))->clearFocusObject(); } +// ------------------------------------------------------------------------- + +void QIOSInputContext::updateKeyboardState(NSNotification *notification) +{ + static CGRect currentKeyboardRect = CGRectZero; + + KeyboardState previousState = m_keyboardState; + + if (notification) { + NSDictionary *userInfo = [notification userInfo]; + + CGRect frameBegin = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + CGRect frameEnd = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + + bool atEndOfKeyboardTransition = [notification.name rangeOfString:@"Did"].location != NSNotFound; + + currentKeyboardRect = atEndOfKeyboardTransition ? frameEnd : frameBegin; + + // The isInputPanelVisible() property is based on whether or not the virtual keyboard + // is visible on screen, and does not follow the logic of the iOS WillShow and WillHide + // notifications which are not emitted for undocked keyboards, and are buggy when dealing + // with input-accesosory-views. The reason for using frameEnd here (the future state), + // instead of the current state reflected in frameBegin, is that QInputMethod::isVisible() + // is documented to reflect the future state in the case of animated transitions. + m_keyboardState.keyboardVisible = CGRectIntersectsRect(frameEnd, [UIScreen mainScreen].bounds); + + // Used for auto-scroller, and will be used for animation-signal in the future + m_keyboardState.keyboardEndRect = frameEnd; + + if (m_keyboardState.animationCurve < 0) { + // We only set the animation curve the first time it has a valid value, since iOS will sometimes report + // an invalid animation curve even if the keyboard is animating, and we don't want to overwrite the + // curve in that case. + m_keyboardState.animationCurve = UIViewAnimationCurve([[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]); + } + + m_keyboardState.animationDuration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; + m_keyboardState.keyboardAnimating = m_keyboardState.animationDuration > 0 && !atEndOfKeyboardTransition; + + qImDebug() << qPrintable(QString::fromNSString(notification.name)) << "from" << fromCGRect(frameBegin) << "to" << fromCGRect(frameEnd) + << "(curve =" << m_keyboardState.animationCurve << "duration =" << m_keyboardState.animationDuration << "s)"; + } else { + qImDebug() << "No notification to update keyboard state based on, just updating keyboard rect"; + } + + if (!focusView() || CGRectIsEmpty(currentKeyboardRect)) + m_keyboardState.keyboardRect = QRectF(); + else // QInputmethod::keyboardRectangle() is documented to be in window coordinates. + m_keyboardState.keyboardRect = fromCGRect([focusView() convertRect:currentKeyboardRect fromView:nil]); + + // Emit for all changed properties + if (m_keyboardState.keyboardVisible != previousState.keyboardVisible) + emitInputPanelVisibleChanged(); + if (m_keyboardState.keyboardAnimating != previousState.keyboardAnimating) + emitAnimatingChanged(); + if (m_keyboardState.keyboardRect != previousState.keyboardRect) + emitKeyboardRectChanged(); +} + bool QIOSInputContext::isInputPanelVisible() const { return m_keyboardState.keyboardVisible; } +bool QIOSInputContext::isAnimating() const +{ + return m_keyboardState.keyboardAnimating; +} + QRectF QIOSInputContext::keyboardRect() const { return m_keyboardState.keyboardRect; @@ -392,7 +399,7 @@ QRectF QIOSInputContext::keyboardRect() const void QIOSInputContext::cursorRectangleChanged() { - if (!m_keyboardState.keyboardVisibleAndDocked || !qApp->focusObject()) + if (!isInputPanelVisible() || !qApp->focusObject()) return; // Check if the cursor has changed position inside the input item. Since @@ -438,6 +445,12 @@ void QIOSInputContext::scrollToCursor() if (rootView.window != focusView().window) return; + // We only support auto-scroll for docked keyboards for now, so make sure that's the case + if (CGRectGetMaxY(m_keyboardState.keyboardEndRect) != CGRectGetMaxY([UIScreen mainScreen].bounds)) { + qImDebug() << "Keyboard not docked, ignoring request to scroll to reveal cursor"; + return; + } + const int margin = 20; QRectF translatedCursorPos = qApp->inputMethod()->cursorRectangle(); translatedCursorPos.translate(focusView().qwindow->geometry().topLeft()); @@ -490,8 +503,12 @@ void QIOSInputContext::scroll(int y) [rootView.qtViewController updateProperties]; } completion:^(BOOL){ - if (self) - [m_keyboardState updateKeyboardRect]; + if (self) { + // Scrolling the root view results in the keyboard being moved + // relative to the focus window, so we need to re-evaluate the + // keyboard rectangle. + updateKeyboardState(); + } } ]; } @@ -516,7 +533,7 @@ void QIOSInputContext::setFocusObject(QObject *focusObject) reset(); - if (m_keyboardState.keyboardVisibleAndDocked) + if (isInputPanelVisible()) scrollToCursor(); } @@ -528,9 +545,11 @@ void QIOSInputContext::focusWindowChanged(QWindow *focusWindow) reset(); - [m_keyboardState updateKeyboardRect]; + // The keyboard rectangle depend on the focus window, so + // we need to re-evaluate the keyboard state. + updateKeyboardState(); - if (m_keyboardState.keyboardVisibleAndDocked) + if (isInputPanelVisible()) scrollToCursor(); } From afae4ee0b12a598c4b02d8ccd950489d190235ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 14:48:06 +0100 Subject: [PATCH 44/99] iOS: Guard against UIGestureRecognizer messing with self We pass in self to initWithTarget, so we need to be sure that the init doesn't return a new self. Change-Id: I90d0d10d2fd1a5d38ef1ff3f23169dcce00b28e2 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index e2e764d231..fe9ee18155 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -74,7 +74,10 @@ static QUIView *focusView() - (id)initWithQIOSInputContext:(QIOSInputContext *)context { + id originalSelf = self; if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) { + Q_ASSERT(self == originalSelf); + m_context = context; // UIGestureRecognizer From 438b65badaf8f4178c2b06ff2b1112bfb889fa3f Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 13 Nov 2014 14:41:03 +0100 Subject: [PATCH 45/99] Make sure that created surfaces are stacked on top of previous ones. The old code would stack the new surface just below the topmost surface. It also did not consider if the m_editText was added to the layout or not (thus, m_layout.getChildCount() - m_nativeViews.size() - 1) was only correct if the editText was added. Spotted by plain code reading while investigating some accessiblity issues. Change-Id: I12c9f373a471c0a7ee624a47232e8952d69c9067 Reviewed-by: Christian Stromme --- .../qt5/android/QtActivityDelegate.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index f44465b4c5..96be5b1550 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -1179,8 +1179,8 @@ public class QtActivityDelegate // Native views are always inserted in the end of the stack (i.e., on top). // All other views are stacked based on the order they are created. - final int index = m_layout.getChildCount() - m_nativeViews.size() - 1; - m_layout.addView(surface, index < 0 ? 0 : index); + final int index = getSurfaceCount(); + m_layout.addView(surface, index); m_surfaces.put(id, surface); } @@ -1221,12 +1221,19 @@ public class QtActivityDelegate } } + public int getSurfaceCount() + { + return m_surfaces.size(); + } + + public void bringChildToFront(int id) { View view = m_surfaces.get(id); if (view != null) { - final int index = m_layout.getChildCount() - m_nativeViews.size() - 1; - m_layout.moveChild(view, index < 0 ? 0 : index); + final int surfaceCount = getSurfaceCount(); + if (surfaceCount > 0) + m_layout.moveChild(view, surfaceCount - 1); return; } @@ -1245,7 +1252,7 @@ public class QtActivityDelegate view = m_nativeViews.get(id); if (view != null) { - final int index = m_layout.getChildCount() - m_nativeViews.size(); + final int index = getSurfaceCount(); m_layout.moveChild(view, index); } } From 35222edfc8b7ceddd5d8fd8c9f441d57ba515ddf Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Mon, 1 Dec 2014 13:50:33 +0100 Subject: [PATCH 46/99] Remove unneeded call to m_editText.bringToFront() There is no need to call bringToFront() when the item was just made to be the last child in the two previous lines. (Child views are ordered in stacking/paint order) Change-Id: Ie9fbe5de6dce2bbc96cd44a8a6a779504cd0becd Reviewed-by: Christian Stromme --- .../jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 96be5b1550..3af8a7aa5d 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -321,7 +321,6 @@ public class QtActivityDelegate m_layout.removeView(m_editText); m_layout.addView(m_editText, new QtLayout.LayoutParams(width, height, x, y)); - m_editText.bringToFront(); m_editText.requestFocus(); m_editText.postDelayed(new Runnable() { @Override From 69d36948314e2f3a83931a11de96df3d28d91524 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 2 Dec 2014 11:43:47 +0100 Subject: [PATCH 47/99] Pass cflags, not incdir, to libudev config test The compile.test script expects -I... parameters. Passing just the include path is therefore wrong. Pass cflags instead. Change-Id: I0f9b155d1e710fe7d77c64a867a89290d4f31db3 Reviewed-by: Oswald Buddenhagen --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index b54ff1ebfd..c668f29a97 100755 --- a/configure +++ b/configure @@ -4938,10 +4938,11 @@ if [ "$CFG_LIBUDEV" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'` QMAKE_LIBS_LIBUDEV=`$PKG_CONFIG --libs libudev 2>/dev/null` + QMAKE_CFLAGS_LIBUDEV=`$PKG_CONFIG --cflags libudev 2>/dev/null` QMakeVar set QMAKE_INCDIR_LIBUDEV "$QMAKE_INCDIR_LIBUDEV" QMakeVar set QMAKE_LIBS_LIBUDEV "$QMAKE_LIBS_LIBUDEV" fi - if compileTest unix/libudev "libudev" $QMAKE_INCDIR_LIBUDEV $QMAKE_LIBS_LIBUDEV; then + if compileTest unix/libudev "libudev" $QMAKE_CFLAGS_LIBUDEV $QMAKE_LIBS_LIBUDEV; then CFG_LIBUDEV=yes QT_CONFIG="$QT_CONFIG libudev" elif [ "$CFG_LIBUDEV" = "yes" ]; then From 98d130fc46ef5ff7c3d1138a4a9949a1c2594c47 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Dec 2014 11:20:43 +0100 Subject: [PATCH 48/99] fix rc compilation in vcxproj files We don't need to modify ResourceOutputFileName. The default is fine, and $(InputName) evaluates to nothing in VS >= 2010. Change-Id: Ib203d36261e1b5449c5a139b1950bd0d66197297 Task-number: QTBUG-43026 Reviewed-by: Oswald Buddenhagen Reviewed-by: Andy Shaw --- qmake/generators/win32/msvc_vcproj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 9385a50e02..f271eb0679 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1177,7 +1177,7 @@ void VcprojGenerator::initResourceTool() // to add it for the compiler) However, the resource tool does not do this. if(project->isActiveConfig("debug")) conf.resource.PreprocessorDefinitions += "_DEBUG"; - if(project->isActiveConfig("staticlib")) + if (conf.CompilerVersion < NET2010 && project->isActiveConfig("staticlib")) conf.resource.ResourceOutputFileName = "$(OutDir)\\$(InputName).res"; } From e7e6d6f95a029abb52dcbb541bc333fa05cc4929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 2 Dec 2014 13:28:08 +0000 Subject: [PATCH 49/99] QFontEngine_FT: Don't check for null after dereferencing. Must have been a copy paste mistake, the check is used in other places to make sure we don't unlockFace() without a lockFace(), but here we're certain lockFace() was called first. Makes Coverity happy. Change-Id: I679129727b29a40d780f4fa903f44f7cbc9ec8cf Reviewed-by: Friedemann Kleint Reviewed-by: Konstantin Ritt --- src/gui/text/qfontengine_ft.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 44c0a50bfc..e2c8f905b9 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1771,8 +1771,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe overall.x = TRUNC(left); overall.y = -TRUNC(top); overall.xoff = TRUNC(ROUND(face->glyph->advance.x)); - if (face) - unlockFace(); + unlockFace(); } return overall; } From 1ed09b486eaca10c11aa454d648ad857f819b183 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 3 Dec 2014 10:12:18 +0100 Subject: [PATCH 50/99] Doc: Update external links to point to doc.qt.io Task-number: QTBUG-43062 Change-Id: Ic630f0c7af20ab5ffa88a71a6ab99d42250cf272 Reviewed-by: Leena Miettinen --- doc/global/externalsites/qch-urls.qdoc | 18 +- doc/global/externalsites/qtcreator.qdoc | 234 ++++++++++++------------ 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/doc/global/externalsites/qch-urls.qdoc b/doc/global/externalsites/qch-urls.qdoc index f8ff8df7a0..53ab94091e 100644 --- a/doc/global/externalsites/qch-urls.qdoc +++ b/doc/global/externalsites/qch-urls.qdoc @@ -38,7 +38,7 @@ \title external: Publishing Applications to Ovi Store */ /*! - \externalpage http://qt-project.org/doc/qtcreator + \externalpage http://doc.qt.io/qtcreator \title external: Qt Creator Manual */ /*! @@ -50,31 +50,31 @@ \title external: Qt Mobility QML Plugins */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-managing.html + \externalpage http://doc.qt.io/qtcreator/creator-project-managing.html \title external: Creating Qt Projects in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-building-running.html + \externalpage http://doc.qt.io/qtcreator/creator-building-running.html \title external: Building and Running Applications in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-running-targets.html + \externalpage http://doc.qt.io/qtcreator/creator-running-targets.html \title external: Set Compiler Targets in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-build-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-build-settings.html \title external: Build Settings in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-run-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-run-settings.html \title external: Run Settings in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-using-qt-designer.html + \externalpage http://doc.qt.io/qtcreator/creator-using-qt-designer.html \title external: Designer in Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugging.html + \externalpage http://doc.qt.io/qtcreator/creator-debugging.html \title external: Debugging Applications in Creator */ /*! @@ -90,6 +90,6 @@ \title external: Qt Mobility Examples */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-overview.html + \externalpage http://doc.qt.io/qtcreator/creator-overview.html \title external: Qt Creator Overview */ diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc index a98fbd0a56..c2eed07c6d 100644 --- a/doc/global/externalsites/qtcreator.qdoc +++ b/doc/global/externalsites/qtcreator.qdoc @@ -26,472 +26,472 @@ ****************************************************************************/ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-deployment-qnx.html + \externalpage http://doc.qt.io/qtcreator/creator-deployment-qnx.html \title Qt Creator: Deploying Applications to QNX Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-baremetal.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-baremetal.html \title Qt Creator: Connecting Bare Metal Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-bb10.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-bb10.html \title Qt Creator: Connecting BlackBerry 10 Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-qnx.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-qnx.html \title Qt Creator: Connecting QNX Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-deployment-bb10.html + \externalpage http://doc.qt.io/qtcreator/creator-deployment-bb10.html \title Qt Creator: Deploying Applications to BlackBerry 10 Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-generic-linux.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-generic-linux.html \title Qt Creator: Connecting Embedded Linux Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-deployment-embedded-linux.html + \externalpage http://doc.qt.io/qtcreator/creator-deployment-embedded-linux.html \title Qt Creator: Deploying Applications to Embedded Linux Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-faq.html + \externalpage http://doc.qt.io/qtcreator/creator-faq.html \title Qt Creator: FAQ */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-tips.html + \externalpage http://doc.qt.io/qtcreator/creator-tips.html \title Qt Creator: Tips and Tricks */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-help.html + \externalpage http://doc.qt.io/qtcreator/creator-help.html \title Qt Creator: Using the Help Mode */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-quick-tour.html + \externalpage http://doc.qt.io/qtcreator/creator-quick-tour.html \title Qt Creator: User Interface */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-cli.html + \externalpage http://doc.qt.io/qtcreator/creator-cli.html \title Qt Creator: Using Command Line Options */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-task-lists.html + \externalpage http://doc.qt.io/qtcreator/creator-task-lists.html \title Qt Creator: Showing Task List Files in Issues Pane */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-managing-sessions.html + \externalpage http://doc.qt.io/qtcreator/creator-project-managing-sessions.html \title Qt Creator: Managing Sessions */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-external.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-external.html \title Qt Creator: Using External Tools */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-version-control.html + \externalpage http://doc.qt.io/qtcreator/creator-version-control.html \title Qt Creator: Using Version Control Systems */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-keyboard-shortcuts.html + \externalpage http://doc.qt.io/qtcreator/creator-keyboard-shortcuts.html \title Qt Creator: Keyboard Shortcuts */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-screens.html + \externalpage http://doc.qt.io/qtcreator/quick-screens.html \title Qt Creator: Creating Screens */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-qml-application.html + \externalpage http://doc.qt.io/qtcreator/creator-qml-application.html \title Qt Creator: Creating a Qt Quick Application */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-export-to-qml.html + \externalpage http://doc.qt.io/qtcreator/quick-export-to-qml.html \title Qt Creator: Exporting Designs from Graphics Software */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-qml-modules-with-plugins.html + \externalpage http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html \title Qt Creator: Using QML Modules with Plugins */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-visual-editor.html + \externalpage http://doc.qt.io/qtcreator/creator-visual-editor.html \title Qt Creator: Developing Qt Quick Applications */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-using-qt-quick-designer.html + \externalpage http://doc.qt.io/qtcreator/creator-using-qt-quick-designer.html \title Qt Creator: Using Qt Quick Designer */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-projects.html + \externalpage http://doc.qt.io/qtcreator/quick-projects.html \title Qt Creator: Creating Qt Quick Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-components.html + \externalpage http://doc.qt.io/qtcreator/quick-components.html \title Qt Creator: Creating Components */ /*! - \externalpage http://qt-project.org/doc/qtcreator/qt-quick-toolbars.html + \externalpage http://doc.qt.io/qtcreator/qt-quick-toolbars.html \title Qt Creator: Using Qt Quick Toolbars */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-buttons.html + \externalpage http://doc.qt.io/qtcreator/quick-buttons.html \title Qt Creator: Creating Buttons */ /*! - \externalpage http://qt-project.org/doc/qtcreator/quick-scalable-image.html + \externalpage http://doc.qt.io/qtcreator/quick-scalable-image.html \title Qt Creator: Creating Scalable Buttons and Borders */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-options.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-options.html \title Qt Creator: Configuring the Editor */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-functions.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-functions.html \title Qt Creator: Writing Code */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-coding-navigating.html + \externalpage http://doc.qt.io/qtcreator/creator-coding-navigating.html \title Qt Creator: Working in Edit Mode */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-highlighting.html + \externalpage http://doc.qt.io/qtcreator/creator-highlighting.html \title Qt Creator: Semantic Highlighting */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-checking-code-syntax.html + \externalpage http://doc.qt.io/qtcreator/creator-checking-code-syntax.html \title Qt Creator: Checking Code Syntax */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-completing-code.html + \externalpage http://doc.qt.io/qtcreator/creator-completing-code.html \title Qt Creator: Completing Code */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-codepasting.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-codepasting.html \title Qt Creator: Pasting and Fetching Code Snippets */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-macros.html + \externalpage http://doc.qt.io/qtcreator/creator-macros.html \title Qt Creator: Using Text Editing Macros */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-fakevim.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-fakevim.html \title Qt Creator: Using FakeVim Mode */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-indenting-code.html + \externalpage http://doc.qt.io/qtcreator/creator-indenting-code.html \title Qt Creator: Indenting Text or Code */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-finding.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-finding.html \title Qt Creator: Finding and Replacing */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-refactoring.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-refactoring.html \title Qt Creator: Refactoring */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-locator.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-locator.html \title Qt Creator: Searching with the Locator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-coding.html + \externalpage http://doc.qt.io/qtcreator/creator-coding.html \title Qt Creator: Coding */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-options-text.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-options-text.html \title Qt Creator: Specifying Text Editor Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-finding-overview.html + \externalpage http://doc.qt.io/qtcreator/creator-finding-overview.html \title Qt Creator: Finding */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-mime-types.html + \externalpage http://doc.qt.io/qtcreator/creator-mime-types.html \title Qt Creator: Editing MIME Types */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-qml-debugging-example.html + \externalpage http://doc.qt.io/qtcreator/creator-qml-debugging-example.html \title Qt Creator: Debugging a Qt Quick Example Application */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugging-example.html + \externalpage http://doc.qt.io/qtcreator/creator-debugging-example.html \title Qt Creator: Debugging a C++ Example Application */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugger-engines.html + \externalpage http://doc.qt.io/qtcreator/creator-debugger-engines.html \title Qt Creator: Setting Up Debugger */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugging-qml.html + \externalpage http://doc.qt.io/qtcreator/creator-debugging-qml.html \title Qt Creator: Debugging Qt Quick Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugging.html + \externalpage http://doc.qt.io/qtcreator/creator-debugging.html \title Qt Creator: Debugging */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugger-operating-modes.html + \externalpage http://doc.qt.io/qtcreator/creator-debugger-operating-modes.html \title Qt Creator: Launching the Debugger */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debug-mode.html + \externalpage http://doc.qt.io/qtcreator/creator-debug-mode.html \title Qt Creator: Interacting with the Debugger */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debugging-helpers.html + \externalpage http://doc.qt.io/qtcreator/creator-debugging-helpers.html \title Qt Creator: Using Debugging Helpers */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-troubleshooting-debugging.html + \externalpage http://doc.qt.io/qtcreator/creator-troubleshooting-debugging.html \title Qt Creator: Troubleshooting Debugger */ /*! - \externalpage http://qt-project.org/doc/qtcreator/index.html + \externalpage http://doc.qt.io/qtcreator/index.html \title Qt Creator Manual */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-advanced.html + \externalpage http://doc.qt.io/qtcreator/creator-advanced.html \title Qt Creator: Advanced Use */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-os-supported-platforms.html + \externalpage http://doc.qt.io/qtcreator/creator-os-supported-platforms.html \title Qt Creator: Supported Platforms */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-connecting-mobile.html + \externalpage http://doc.qt.io/qtcreator/creator-connecting-mobile.html \title Qt Creator: Connecting Mobile Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-usability.html + \externalpage http://doc.qt.io/qtcreator/creator-usability.html \title Qt Creator: Optimizing Applications for Mobile Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-acknowledgements.html + \externalpage http://doc.qt.io/qtcreator/creator-acknowledgements.html \title Qt Creator: Acknowledgements */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-help-overview.html + \externalpage http://doc.qt.io/qtcreator/creator-help-overview.html \title Qt Creator: Getting Help */ /*! - \externalpage http://qt-project.org/doc/qtcreator/technical-support.html + \externalpage http://doc.qt.io/qtcreator/technical-support.html \title Qt Creator: Technical Support */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-overview.html + \externalpage http://doc.qt.io/qtcreator/creator-overview.html \title Qt Creator: IDE Overview */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-testing.html + \externalpage http://doc.qt.io/qtcreator/creator-testing.html \title Qt Creator: Debugging and Analyzing */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-deployment.html + \externalpage http://doc.qt.io/qtcreator/creator-deployment.html \title Qt Creator: Deploying to Mobile Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-tutorials.html + \externalpage http://doc.qt.io/qtcreator/creator-tutorials.html \title Qt Creator: Tutorials */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-known-issues.html + \externalpage http://doc.qt.io/qtcreator/creator-known-issues.html \title Qt Creator: Known Issues */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-design-mode.html + \externalpage http://doc.qt.io/qtcreator/creator-design-mode.html \title Qt Creator: Designing User Interfaces */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-publish-ovi.html + \externalpage http://doc.qt.io/qtcreator/creator-publish-ovi.html \title Qt Creator: Publishing */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-glossary.html + \externalpage http://doc.qt.io/qtcreator/creator-glossary.html \title Qt Creator: Glossary */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-getting-started.html + \externalpage http://doc.qt.io/qtcreator/creator-getting-started.html \title Qt Creator: Getting Started */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-analyzer.html + \externalpage http://doc.qt.io/qtcreator/creator-analyzer.html \title Qt Creator: Detecting Memory Leaks */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-cache-profiler.html + \externalpage http://doc.qt.io/qtcreator/creator-cache-profiler.html \title Qt Creator: Profiling Function Execution */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-running-valgrind-remotely.html + \externalpage http://doc.qt.io/qtcreator/creator-running-valgrind-remotely.html \title Qt Creator: Running Valgrind Tools Remotely */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-valgrind-overview.html + \externalpage http://doc.qt.io/qtcreator/creator-valgrind-overview.html \title Qt Creator: Using Valgrind Code Analysis Tools */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-analyze-mode.html + \externalpage http://doc.qt.io/qtcreator/creator-analyze-mode.html \title Qt Creator: Analyzing Code */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-qml-performance-monitor.html + \externalpage http://doc.qt.io/qtcreator/creator-qml-performance-monitor.html \title Qt Creator: Profiling QML Applications */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-deploying-android.html + \externalpage http://doc.qt.io/qtcreator/creator-deploying-android.html \title Qt Creator: Deploying Applications to Android Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-ios.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-ios.html \title Qt Creator: Connecting iOS devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-android.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-android.html \title Qt Creator: Connecting Android Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-build-example-application.html + \externalpage http://doc.qt.io/qtcreator/creator-build-example-application.html \title Qt Creator: Building and Running an Example */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-generic.html + \externalpage http://doc.qt.io/qtcreator/creator-project-generic.html \title Qt Creator: Setting Up a Generic Project */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-sharing-project-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-sharing-project-settings.html \title Qt Creator: Sharing Project Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-opening.html + \externalpage http://doc.qt.io/qtcreator/creator-project-opening.html \title Qt Creator: Opening Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-managing.html + \externalpage http://doc.qt.io/qtcreator/creator-project-managing.html \title Qt Creator: Managing Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-cmake.html + \externalpage http://doc.qt.io/qtcreator/creator-project-cmake.html \title Qt Creator: Setting Up a CMake Project */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-targets.html + \externalpage http://doc.qt.io/qtcreator/creator-targets.html \title Qt Creator: Adding Kits */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-tool-chains.html + \externalpage http://doc.qt.io/qtcreator/creator-tool-chains.html \title Qt Creator: Adding Compilers */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-qbs.html + \externalpage http://doc.qt.io/qtcreator/creator-project-qbs.html \title Qt Creator: Setting Up a Qbs Project */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-creating.html + \externalpage http://doc.qt.io/qtcreator/creator-project-creating.html \title Qt Creator: Creating Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-wizards.html + \externalpage http://doc.qt.io/qtcreator/creator-project-wizards.html \title Qt Creator: Adding New Custom Wizards */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-projects-autotools.html + \externalpage http://doc.qt.io/qtcreator/creator-projects-autotools.html \title Qt Creator: Setting Up an Autotools Project */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-configuring-projects.html + \externalpage http://doc.qt.io/qtcreator/creator-configuring-projects.html \title Qt Creator: Configuring Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-build-process-customizing.html + \externalpage http://doc.qt.io/qtcreator/creator-build-process-customizing.html \title Qt Creator: Customizing the Build Process */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-build-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-build-settings.html \title Qt Creator: Specifying Build Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-code-style-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-code-style-settings.html \title Qt Creator: Specifying Code Style Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-run-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-run-settings.html \title Qt Creator: Specifying Run Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-qmake-libraries.html + \externalpage http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html \title Qt Creator: Adding Libraries to Projects */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-other.html + \externalpage http://doc.qt.io/qtcreator/creator-project-other.html \title Qt Creator: Using Other Build Systems */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-running-targets.html + \externalpage http://doc.qt.io/qtcreator/creator-running-targets.html \title Qt Creator: Running on Multiple Platforms */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-build-dependencies.html + \externalpage http://doc.qt.io/qtcreator/creator-build-dependencies.html \title Qt Creator: Specifying Dependencies */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-building-running.html + \externalpage http://doc.qt.io/qtcreator/creator-building-running.html \title Qt Creator: Building and Running */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-editor-settings.html + \externalpage http://doc.qt.io/qtcreator/creator-editor-settings.html \title Qt Creator: Specifying Editor Settings */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-project-qmake.html + \externalpage http://doc.qt.io/qtcreator/creator-project-qmake.html \title Qt Creator: Adding Qt Versions */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-building-targets.html + \externalpage http://doc.qt.io/qtcreator/creator-building-targets.html \title Qt Creator: Building for Multiple Platforms */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-using-qt-designer.html + \externalpage http://doc.qt.io/qtcreator/creator-using-qt-designer.html \title Qt Creator: Developing Widget Based Applications */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-writing-program.html + \externalpage http://doc.qt.io/qtcreator/creator-writing-program.html \title Qt Creator: Creating a Qt Widget Based Application */ /*! - \externalpage http://qt-project.org/doc/qtcreator/adding-plugins.html + \externalpage http://doc.qt.io/qtcreator/adding-plugins.html \title Qt Creator: Adding Qt Designer Plugins */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-configuring.html + \externalpage http://doc.qt.io/qtcreator/creator-configuring.html \title Qt Creator: Configuring Qt Creator */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-debuggers.html + \externalpage http://doc.qt.io/qtcreator/creator-debuggers.html \title Qt Creator: Adding Debuggers */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-mobile-app-tutorial.html + \externalpage http://doc.qt.io/qtcreator/creator-mobile-app-tutorial.html \title Qt Creator: Creating a Mobile Application */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-diff-editor.html + \externalpage http://doc.qt.io/qtcreator/creator-diff-editor.html \title Qt Creator: Comparing Files */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-beautifier.html + \externalpage http://doc.qt.io/qtcreator/creator-beautifier.html \title Qt Creator: Beautifying Source Code */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-developing-winrt.html + \externalpage http://doc.qt.io/qtcreator/creator-developing-winrt.html \title Qt Creator: Connecting Windows Runtime Devices */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-clang-codemodel.html + \externalpage http://doc.qt.io/qtcreator/creator-clang-codemodel.html \title Qt Creator: Parsing C++ Files */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-quick-ui-forms.html + \externalpage http://doc.qt.io/qtcreator/creator-quick-ui-forms.html \title Qt Creator: Qt Quick UI Forms */ /*! - \externalpage http://qt-project.org/doc/qtcreator/creator-clang-static-analyzer.html + \externalpage http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html \title Qt Creator: Using Clang Static Analyzer */ From 457496b83090006b232c56c04042bf6c9b8b2c31 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 21 Oct 2014 14:57:50 +0200 Subject: [PATCH 51/99] Doc: new template for qt.io online style An online documentation template that follows the style of qt.io site. Update the url variable for Qt modules to point to doc.qt.io/qt-5/. Task-number: QTBUG-42086 Change-Id: I5428a02cd503aef2217efd7361f4c8b7b5895a52 Reviewed-by: Leena Miettinen --- doc/global/config.qdocconf | 3 +- doc/global/fileextensions.qdocconf | 2 +- doc/global/html-footer-online.qdocconf | 84 + doc/global/html-header-online.qdocconf | 179 +- doc/global/includes-online/search.qdoc | 39 + doc/global/qt-html-templates-online.qdocconf | 18 +- .../qt-module-defaults-offline.qdocconf | 3 + ...module-defaults-online-commercial.qdocconf | 29 + doc/global/qt-module-defaults-online.qdocconf | 19 +- doc/global/template/scripts/extras.js | 23 + doc/global/template/scripts/main.js | 241 ++ doc/global/template/style/doc_search.png | Bin 0 -> 2151 bytes doc/global/template/style/gsc.css | 192 ++ doc/global/template/style/icomoon.eot | Bin 0 -> 4624 bytes doc/global/template/style/icomoon.svg | 20 + doc/global/template/style/icomoon.ttf | Bin 0 -> 4460 bytes doc/global/template/style/icomoon.woff | Bin 0 -> 4536 bytes doc/global/template/style/list_arrow.png | Bin 0 -> 1115 bytes doc/global/template/style/online.css | 2517 ++++++++++------- 19 files changed, 2302 insertions(+), 1067 deletions(-) create mode 100644 doc/global/html-footer-online.qdocconf create mode 100644 doc/global/includes-online/search.qdoc create mode 100644 doc/global/qt-module-defaults-online-commercial.qdocconf create mode 100644 doc/global/template/scripts/extras.js create mode 100644 doc/global/template/scripts/main.js create mode 100644 doc/global/template/style/doc_search.png create mode 100644 doc/global/template/style/gsc.css create mode 100755 doc/global/template/style/icomoon.eot create mode 100755 doc/global/template/style/icomoon.svg create mode 100755 doc/global/template/style/icomoon.ttf create mode 100755 doc/global/template/style/icomoon.woff create mode 100644 doc/global/template/style/list_arrow.png diff --git a/doc/global/config.qdocconf b/doc/global/config.qdocconf index 295a5ed08b..a6ab546b75 100644 --- a/doc/global/config.qdocconf +++ b/doc/global/config.qdocconf @@ -9,8 +9,7 @@ dita.metadata.default.audience = programmer #Set the main Qt index.html navigation.homepage = "Qt $QT_VER" -buildversion = "Qt $QT_VERSION Reference Documentation" sourcedirs += includes -url = http://qt-project.org/doc/qt-5 +url = http://doc.qt.io/qt-5 diff --git a/doc/global/fileextensions.qdocconf b/doc/global/fileextensions.qdocconf index 0a106d5bef..88e51595f1 100644 --- a/doc/global/fileextensions.qdocconf +++ b/doc/global/fileextensions.qdocconf @@ -1,4 +1,4 @@ -naturallanguage = en_US +naturallanguage = en outputencoding = UTF-8 sourceencoding = UTF-8 diff --git a/doc/global/html-footer-online.qdocconf b/doc/global/html-footer-online.qdocconf new file mode 100644 index 0000000000..326900160c --- /dev/null +++ b/doc/global/html-footer-online.qdocconf @@ -0,0 +1,84 @@ +# HTML footer for qt.io + +HTML.footer += \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "
\n" \ + "\n" \ + "
\n" diff --git a/doc/global/html-header-online.qdocconf b/doc/global/html-header-online.qdocconf index 5c21644a39..7e9aae66f1 100644 --- a/doc/global/html-header-online.qdocconf +++ b/doc/global/html-header-online.qdocconf @@ -1,64 +1,149 @@ -#HTML Header with Qt Project branding and online links +# HTML Header with qt.io branding and online links -HTML.stylesheets = template/style/online.css +HTML.stylesheets = template/style/online.css \ + template/style/gsc.css \ + template/style/list_arrow.png \ + template/style/icomoon.eot \ + template/style/icomoon.svg \ + template/style/icomoon.ttf \ + template/style/icomoon.woff \ + template/style/doc_search.png #for including files into the qch file. Relative to the outputdir of a QDoc build. -# $QT_INSTALL_DOCS/qtquick/style/online.css for example -qhp.extraFiles += style/online.css +qhp.extraFiles += style/online.css \ + style/gsc.css \ + style/list_arrow.png \ + style/icomoon.eot \ + style/icomoon.svg \ + style/icomoon.ttf \ + style/icomoon.woff HTML.headerstyles = \ - " \n" + " \n" \ + " \n" + +HTML.headerscripts = \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" + +HTML.scripts = template/scripts/extras.js \ + template/scripts/main.js HTML.endheader = \ "\n" +# minimal header HTML.postheader = \ "\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " Qt Home\n" \ - " Bug Tracker\n" \ - " Code Review\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - " \"Qt\"\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "

Qt Documentation Snapshots

\n" \ - "
\n" \ - "
\n" \ - "
    \n" \ - "
  • \n" \ - " Snapshots\n" \ - "
  • \n" \ - "
  • \n" \ - " Released\n" \ - "
  • \n" \ - "
  • \n" \ - " Archives\n" \ - "
  • \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + " \n" \ + "

\n" \ + " We bake cookies in your browser for a better experience. Using this site means that you consent. Read More\n" \ + "

\n" \ + " \n" \ + "
\n" \ "
\n" \ + "
\n" \ + "
\n" \ + " \n" \ + "
\n" \ + " \n" \ + "
\n" \ + " Menu\n" \ + "
\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "

\n" \ + "
\n" \ + "

\n" \ "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
    \n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + "
\n" \ + " \n" \ + "
\n" \ + "

Qt Documentation

\n" \ + "
\n" \ + " \n" \ + " \n" \ + "
\n" \ + "
    \n" HTML.postpostheader = \ - "
\n" \ - "
\n" \ + " \n" \ + "
\n" \ "
\n" \ "
\n" \ - "
\n" \ + "
\n" + +HTML.prologue = \ + "
\n" diff --git a/doc/global/includes-online/search.qdoc b/doc/global/includes-online/search.qdoc new file mode 100644 index 0000000000..25c4563df6 --- /dev/null +++ b/doc/global/includes-online/search.qdoc @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page search-results.html +\title Search Results + +\raw HTML + + + +\endraw +*/ diff --git a/doc/global/qt-html-templates-online.qdocconf b/doc/global/qt-html-templates-online.qdocconf index 88abc3429b..78d0d497c8 100644 --- a/doc/global/qt-html-templates-online.qdocconf +++ b/doc/global/qt-html-templates-online.qdocconf @@ -1,23 +1,9 @@ #include standard set of HTML header and footer. include(html-config.qdocconf) include(html-header-online.qdocconf) -include(html-footer.qdocconf) +include(html-footer-online.qdocconf) #uncomment if navigation bar is not wanted #HTML.nonavigationbar = "true" -HTML.stylesheets = template/style/online.css -HTML.extraimages += template/images/ico_out.png \ - template/images/ico_note.png \ - template/images/ico_note_attention.png \ - template/images/btn_prev.png \ - template/images/btn_next.png \ - template/images/bullet_dn.png \ - template/images/bullet_sq.png \ - template/images/bgrContent.png \ - template/images/Qt-logo.png \ - template/images/Qt-dark_gradient.png \ - template/images/Qt-footer-bg.jpg \ - template/images/Qt-footer_shadow.png \ - template/images/Qt-gradient.png \ - template/images/Qt-header-bg.jpg +sourcedirs += includes-online diff --git a/doc/global/qt-module-defaults-offline.qdocconf b/doc/global/qt-module-defaults-offline.qdocconf index bdca212960..af7afdd96f 100644 --- a/doc/global/qt-module-defaults-offline.qdocconf +++ b/doc/global/qt-module-defaults-offline.qdocconf @@ -11,3 +11,6 @@ include(qt-html-templates-offline.qdocconf) #extra configuration data such as file extensions include(config.qdocconf) + +# Show Qt version as part of the navigation bar +buildversion = "Qt $QT_VERSION Reference Documentation" diff --git a/doc/global/qt-module-defaults-online-commercial.qdocconf b/doc/global/qt-module-defaults-online-commercial.qdocconf new file mode 100644 index 0000000000..23b0998ccb --- /dev/null +++ b/doc/global/qt-module-defaults-online-commercial.qdocconf @@ -0,0 +1,29 @@ +# This template uses the default online template for qt.io +# and modifies it for a commercial Qt component + +# Start of footer - the rest is defined in the default template +HTML.footer = \ + "

Available under certain Qt licenses.
Find out more.

\n" \ + "
\n" + +include(macros.qdocconf) +include(qt-cpp-defines.qdocconf) +include(compat.qdocconf) +#include(manifest-meta.qdocconf) +include(fileextensions.qdocconf) +include(qt-html-templates-online.qdocconf) + +#extra configuration data DITA information +include(config.qdocconf) + +HTML.prologue = \ + "
\n" \ + "

C

\n" + +# Turn off single-directory output mode +HTML.nosubdirs = "false" + +# Set navigation homepage +navigation.homepage = "Qt Documentation" + +sourcedirs += includes-online diff --git a/doc/global/qt-module-defaults-online.qdocconf b/doc/global/qt-module-defaults-online.qdocconf index 258295b4f9..fcff1976d1 100644 --- a/doc/global/qt-module-defaults-online.qdocconf +++ b/doc/global/qt-module-defaults-online.qdocconf @@ -1,7 +1,20 @@ #The online onfiguration for a Qt 5 module, including Add-Ons and Tools. -#Online version contains a different header. #Include this file for a standard Qt 5 module; builds with the online style. +# Start of footer - the rest is defined in qt-html-templates-online.qdocconf +HTML.footer = \ + "
\n" \ + "

\n" \ + " © 2014 Digia Plc and/or its\n" \ + " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ + " their respective owners. " \ + " The documentation provided herein is licensed under the terms of the" \ + " GNU Free Documentation" \ + " License version 1.3 as published by the Free Software Foundation. " \ + " Digia, Qt and their respective logos are trademarks of Digia Plc " \ + " in Finland and/or other countries worldwide. All other trademarks are property\n" \ + " of their respective owners.

\n" + #include standard set of macros and C++ defines and ignores include(macros.qdocconf) include(qt-cpp-defines.qdocconf) @@ -12,3 +25,7 @@ include(qt-html-templates-online.qdocconf) #extra configuration data DITA information include(config.qdocconf) + +# single-directory output mode +HTML.nosubdirs = "true" +HTML.outputsubdir = "html" diff --git a/doc/global/template/scripts/extras.js b/doc/global/template/scripts/extras.js new file mode 100644 index 0000000000..cb1102d493 --- /dev/null +++ b/doc/global/template/scripts/extras.js @@ -0,0 +1,23 @@ +var vOffset = 65; + +$(function () { + $('a[href*=#]:not([href=#])').on('click', function () { + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); + if (target.length) { + setTimeout(function () { + $('html, body').animate({scrollTop: target.offset().top - vOffset}, 50);}, 50); + // return false; + } + }); +}); + +$(window).load(function () { + var h = window.location.hash; + var re = /[^a-z0-9_\#\-]/i + if (h.length > 1 && !re.test(h)) { + setTimeout(function () { + $(window).scrollTop($(h).offset().top - vOffset); + }, 0); + } +}); diff --git a/doc/global/template/scripts/main.js b/doc/global/template/scripts/main.js new file mode 100644 index 0000000000..79de4ea5b2 --- /dev/null +++ b/doc/global/template/scripts/main.js @@ -0,0 +1,241 @@ +"use strict"; + +function createCookie(name, value, days) { + var expires; + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = "; expires=" + date.toGMTString(); + } else { + expires = ""; + } + document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/"; + $('.cookies_yum').click(function() { + $(this).fadeOut() + }); +} +function readCookie(name) { + var nameEQ = escape(name) + "="; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) === ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) === 0) return unescape(c.substring(nameEQ.length, c.length)); + } + return null; +} +function eraseCookie(name) { + createCookie(name, "", -1); +} +function load_sdk(s, id, src) { + var js, fjs = document.getElementsByTagName(s)[0]; + if (document.getElementById(id)) return; + js = document.createElement(s); + js.id = id; + js.src = src; + fjs.parentNode.insertBefore(js, fjs); +} +$(document).ready(function($) { + if (document.documentElement.clientWidth < 1220) { + oneQt.extraLinksToMain(); + } + + $('#menuextras .search').click(function(e){ + e.preventDefault(); + $('.big_bar.account').slideUp(); + $('.big_bar.search').slideToggle(); + $('.big_bar_search').focus(); + $(this).toggleClass('open'); + }); + $('.cookies_yum').click(function() { + $('.cookies_yum').fadeOut(); + createCookie("cookies_nom", "yum", 180); + var cookie_added = 1; + }); + if (!(readCookie('cookies_nom') == 'yum')) { + $('.cookies_yum').fadeIn(); + } else { + var cookie_added = 1; + } + + Modernizr.load({test: Modernizr.input.placeholder, + nope: wpThemeFolder + '/js/placeholders.min.js'}); + + $('#navbar .navbar-toggle').click(function(e) { + e.preventDefault(); + if ($(this).hasClass('opened')) { + $(this).removeClass('opened'); + $('#navbar .navbar-menu').css('max-height', '0px'); + } + else { + $(this).addClass('opened'); + $('#navbar .navbar-menu').css('max-height', $('#navbar .navbar-menu ul').outerHeight() + 'px'); + } + }); + + $(window).resize(function() { + oneQt.stickySidebar(); + oneQt.footerPosition(); + if (document.documentElement.clientWidth < 1220) { + oneQt.extraLinksToMain(); + } else { + oneQt.mainLinkstoExtra(); + } + }); + + $(window).scroll(function() { + oneQt.stickySidebar(); + oneQt.stickyHeader(); + }); + + oneQt.stickySidebar(); + oneQt.footerPosition(); + oneQt.tabContents(); +}); + +$( window ).load(function() { + load_sdk('script', 'facebook-jssdk','//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=207346529386114&version=v2.0'); + load_sdk('script', 'twitter-wjs', '//platform.twitter.com/widgets.js'); + $.getScript("//www.google.com/jsapi", function(){ + google.load("feeds", "1", {"callback": oneQt.liveFeeds}); + }); +}); + +var oneQt = { + stickySidebar: function() { + if ($('#sidebar').length && $('#sidebar').outerHeight() > 20) { + var $sidebar = $('#sidebar'); + var $win = $(window); + var $sidebarContainer = $sidebar.parent(); + var headerHeight = $('#navbar').outerHeight(); + if ($win.outerHeight() - headerHeight > $sidebar.innerHeight() && + $win.scrollTop() > $sidebarContainer.offset().top) { + var newTop = headerHeight + $win.scrollTop() - $sidebarContainer.offset().top; + if (newTop + $sidebar.innerHeight() > $sidebarContainer.innerHeight()) + newTop = $sidebarContainer.innerHeight() - $sidebar.innerHeight(); + + $sidebar.css({top: newTop +'px'}) + } + else { + $sidebar.css({top: '0'}) + } + } + }, + + footerPosition: function () { + $('#footerbar').removeClass('fixed'); + if (($('.hbspt-form').length > 0) || ($('#customerInfo').length > 0) || ($('.purchase_bar').length > 0)) { + var footerBottomPos = $('#footerbar').offset().top + $('#footerbar').outerHeight(); + if (footerBottomPos < $(window).height()) + $('#footerbar').addClass('fixed'); + } + }, + + stickyHeader: function () { + var originalHeaderHeight = 79; + if ($(window).scrollTop() > originalHeaderHeight) { + $('#navbar').addClass('fixed'); + $('#bottom_header').fadeOut(); + + if (!(cookie_added == 1)) { + $('.cookies_yum').fadeOut(); + createCookie("cookies_nom", "yum", 180); + var cookie_added = 1; + } + } + else { + $('#navbar').removeClass('fixed'); + $('#bottom_header').fadeIn(); + } + }, + + tabContents: function () { + $('.tab-container').each(function(i) { + var $el = $(this); + $el.find('.tab-titles li:eq(0)').addClass('active'); + $el.find('.tab-contents .tab:eq(0)').addClass('active'); + $el.find('.tab-titles a').click(function(e) { + e.preventDefault(); + var index = $(this).parent().index(); + $el.find('.tab-titles li').removeClass('active'); + $el.find('.tab-contents .tab').removeClass('active'); + $(this).parent().addClass('active'); + $el.find('.tab-contents .tab').eq(index).addClass('active'); + }) + }); + }, + + liveFeeds: function () { + $('.feed-container').each(function(i) { + var feedUrl = $(this).data('url'); + if (feedUrl != "") oneQt.blogFeed($(this), feedUrl); + }); + }, + + blogFeed: function ($container, feedUrl) { + var feed = new google.feeds.Feed(feedUrl); + feed.setNumEntries(3); + feed.load(function(result) { + $container.html(''); + if (!result.error) { + for (var i = 0; i < result.feed.entries.length; i++) { + var entry = result.feed.entries[i]; + var $article = $('
'); + $container.append($article); + var html = '
'; + html += ' '; + html += '
'; + html += '
'; + html += '

' + html += '

' + html += '

'; + html += '
    '; + html += '
'; + html += '
'; + $article.append(html); + $article.find('h4 a').text(result.feed.title); + $article.find('h3 a').text(entry.title); + $article.find('p a').text(entry.author); + try { + for (var j=0; j'); + $li.find('a').text(entry.categories[j]); + $article.find('.taglist').append($li); + } + } catch(e) {} + } + if (result.feed.link && result.feed.link != "") { + var linkHtml = 'Show all'; + $container.append(linkHtml); + } + } + }); + }, + + extraLinksToMain: function() { + var extramenuLinks = $('#menuextras').find('li'); + var mainmenu = $('#mainmenu'); + var count = 0; + if ($(extramenuLinks).length > 3) { + $(extramenuLinks).each(function() { + if (count < 3) { + var newLink = $(this); + $(newLink).addClass('dynamic-add'); + $(mainmenu).append(newLink); + } + count++; + }); + } + }, + + mainLinkstoExtra: function() { + var mainmenuLinks = $('#mainmenu').find('.dynamic-add'); + var extramenu = $('#menuextras'); + var count = 0; + $(mainmenuLinks).each(function() { + var newLink = $(this); + $(extramenu).prepend(newLink); + count++; + }); + } +} diff --git a/doc/global/template/style/doc_search.png b/doc/global/template/style/doc_search.png new file mode 100644 index 0000000000000000000000000000000000000000..0d7bccd46f95748946bad81b2cecb8d0df7f6ca2 GIT binary patch literal 2151 zcmaJ?c~lek77mM)Ee4BVM1@H}WhqG}2_h*=LlR7cP&Qd)k&sM6ge)XMmS-(X1Qa}M zVgW;;6{YqSB7z)1i)?}*778d)z!kBG3$943@)9cc{qcBn&dhH)_xtX5@BPl1Lw>$H z;D#24Fc=KZpi=|XD_-;J>#4t%9y#^uWxb3RDhm{GWl1av1S4}qF%ZBIuy{}a#NwnR z^g*sLn2s$!C{z~8^dYfD0t`zNgGm;M)o2*Z)gxKVV#h%;AO_;`g>L9)=P#lGKF19m z;>5%;#S|!(PfwLVfvLVh?9@263kU7t4!9L z6e5drL;o!*l<5ahL=p&a!ZZzBpQY21a8OCwo&jz5Tp^w zG%unj&I?B*Qt&P=pz|`8Dq<%JAfap-%lQZEwIWty2!U9gnF>kx`yh^&L?i%~3McVb z)9r;5kTB+;Lut3de1+>9X zRKPV5u8a21F*mk10QLr4LeSHW$)i_ou&TbWM*jL+)uPSp)UAq#zQ>B+oqaNSqikW& zZC)WA6#h1B-Bp6PqSaEht^g67wzVBL1P{G~Y1aQOqxg>gcKri7Nnd$F?Jry{w>sap z3`)1abv{sKGr-cG=Uvf8D!4E}%sDoD7r6$vdZW(y2x@hM#1C;mOPT)Jz0c9YSNbX~ z_ZlM_i?$!AOg~_0#f?VcKWNA5Dq9uz_lR{OR)xH^U%b6?Z$~_uTY@A2)Q& zTh@WP7vMda*~F-V9b=oA{)NrK9)H&P%A2o@DQagdX|}C{;Z?@_`@%-bBIZxq%5ydd zrURunp)*BaKcTkARcMt|t#0Js!s=ROu4Wzd(X)2yy?ifH*L=s?bH~!>7sQHf$N>ZE zYSYT2BQ~Z=Se&(QH~ytJyij0J%m+|`Wduc&)fXXU_1EqMX69Z+psA%$=(>hoT!G~* zzJ~eo_yVo_M0COQueDX1yF6`tH~ z!6QFv#9#FMel*W2=z00m)cgfI+XwA!<}U@>fOkvTi-38e!n|&(ThcCX&DZS96E9>o~t8Uo#0~^Iu=Ls@}WurYj22TBcl;D znF`g zQh8~Wbblg}34*bIO6R|Q-i zr$8ly@XsdR2ZPhH9lpWNm|=|_rdCV6jUr=W%cZZ-{=417J5?XfANkk zRXp*G2Yc;K?J7RHxqnlum0T4wm2GHdzmRKmTHiMT-iH|fe9-_0gK@O4nwOu5(ER!t MG+%0+XLQDY0RK2*5&!@I literal 0 HcmV?d00001 diff --git a/doc/global/template/style/gsc.css b/doc/global/template/style/gsc.css new file mode 100644 index 0000000000..e3d6391d6b --- /dev/null +++ b/doc/global/template/style/gsc.css @@ -0,0 +1,192 @@ +.gsc-control-cse table, table td, table th { + border: none !important; + margin-bottom: 10px !important +} +.gsc-control-cse { + width: 100% !important; + box-sizing: border-box !important +} +.gsc-control-cse * { + font-family: 'Open Sans', Arial, Helvetica, sans-serif !important; + line-height: 1.5 !important; + font-weight: 300 !important +} +.gsc-control-cse, +.gsc-control-cse .gsc-table-result { + width: 100% !important; + font-family: 'Open Sans', Arial, Helvetica, sans-serif !important; + font-weight: 300 !important; + font-size: 13px !important +} +.gsc-resultsHeader { + width: 100% !important; + clear: both !important +} +.gsc-resultsHeader td.gsc-twiddleRegionCell { + width: 75% !important +} +.gsc-resultsbox-visible { + display: block !important +} +.gsc-resultsbox-invisible { + display: none !important +} +.gsc-results { + padding-bottom: 2px !important; + width: 99% !important +} +.gsc-result { + margin-bottom: 10px !important +} +.gsc-result .gs-title { + height: 1.4em !important; + overflow: hidden !important +} +.gsc-result div.gs-watermark { + display: none !important +} +.gsc-results .gsc-result img.gs-ad-marker { + display: none !important +} +.gsc-webResult:after { + content: "." !important; + display: block !important; + height: 0 !important; + clear: both !important; + visibility: hidden !important +} +.gsc-webResult { + zoom: 1 !important +} +.gsc-webResult .gsc-result { + margin: 0 !important; + padding: .5em 0 !important; + border-bottom: 1px solid #ebebeb !important +} +.gsc-above-wrapper-area { + border-bottom: 1px solid #E9E9E9 !important; + padding: 5px 0 5px 0 !important +} +.gsc-above-wrapper-area-invisible { + display: none !important +} +.gsc-above-wrapper-area-container { + width: 100% !important +} +.gsc-result-info { + text-align: left !important; + color: #676767 !important; + font-size: 13px !important; + padding-left: 8px !important; + margin: 10px 0 10px 0 !important +} +.gsc-result-info-container { + text-align: left !important +} +.gsc-result-info-invisible { + display: none !important +} +.gsc-orderby-container { + text-align: right !important; + background: transparent !important +} +.gsc-orderby-invisible { + display: none !important +} +.gsc-orderby-label { + color: #676767 !important; + padding: 5px 5px 6px 0 !important +} +.gsc-selected-option-container { + background-color: transparent !important; + border: 1px solid #eee !important; + border: 1px solid rgba(0, 0, 0, 0.1) !important; + border-radius: 2px !important; + box-shadow: none !important; + color: #444 !important; + cursor: default !important; + font-size: 11px !important; + font-weight: bold !important; + height: 20px !important; + line-height: 20px !important; + max-width: 90% !important; + min-width: 54px !important; + outline: 0 !important; + padding: 0 28px 0 6px !important; + position: relative !important; + text-align: center !important; + width: 50px !important !important +} +.gsc-selected-option { + position: relative !important; + width: 100% !important; +} +.gsc-control-cse .gsc-option-selector { + border: none !important; + height: 11px !important; + margin-top: -4px !important; + position: absolute !important; + right: 5px !important; + top: 8px !important; + width: 7px !important; + padding: 0 5px 0 5px !important; + background: url(//ssl.gstatic.com/ui/v1/disclosure/small-grey-disclosure-arrow-down.png) center no-repeat +} +.gsc-results .gsc-cursor-box .gsc-trailing-more-results { + margin-bottom: 0 !important; + display: inline !important +} +.gsc-results .gsc-cursor { + display: inline !important +} +.gsc-results .gsc-cursor-box { + margin: 10px 5px 10px !important +} +.gsc-results .gsc-cursor-box .gsc-cursor-page { + cursor: pointer !important; + color: #000000 !important; + text-decoration: underline !important; + margin-right: 8px !important; + display: inline !important +} +.gsc-results .gsc-cursor-box .gsc-cursor-current-page { + cursor: default !important; + color: white !important; + background-color: #5caa15 !important; + font-weight: bold !important; + text-decoration: none !important; + padding: 0 3px 0 3px !important; + margin-top: 10px !important; + cursor: pointer !important +} +.gs-result .gs-title, +.gs-result .gs-title * { + color: #5caa15 !important; + text-decoration: underline !important +} +.gs-webResult div.gs-visibleUrl-long, +.gs-promotion div.gs-visibleUrl-long { + overflow: hidden !important; + display: none !important +} +.gs-webResult div.gs-per-result-labels a.gs-label { + text-decoration: underline !important; + cursor: pointer !important; + padding: 3px !important; + color: #26282a !important +} +.gs-webResult div.gs-per-result-labels a.gs-label.gs-labelActive { + cursor: default !important; + text-decoration: none !important +} +.gsc-control-cse:after { + content: "." !important; + display: block !important; + clear: both !important; + height: 0 !important; + visibility: hidden !important +} + +*:first-child + html .gsc-inline-block { + display: inline !important +} diff --git a/doc/global/template/style/icomoon.eot b/doc/global/template/style/icomoon.eot new file mode 100755 index 0000000000000000000000000000000000000000..68f0fa6ae6f0c2e28b928f3cb3d8b78abeede398 GIT binary patch literal 4624 zcma)ATWnlM8J?MQX6D>4-aWgHg zl=cCEC{WZQA|dg>15yz}AR)v<00|*c#N`3?fhVNCG`5KH2o+LAABfF2b9Ogt0H^?kmCX4uA zCQBF)kh5ftTqj>53uK1e0w+ga2Im&Jjj?J>fsB(;GN#9Foeic^=#sAxgN&Vi=|IIQ z{^xh#{1*S0XBTHydd|Ol8H0M!p1wYFdj-D{+Vl9et}ncLjV>L37j5wUcjo72uA28A zzfVZ0)J@ETAr{To&{pGz<`?hW&1XQ7@GVr63(K=J$<_E5X#WxI{>7QQE2M{>LHi-v zg{7IrxmR}m_#aSdLdU09mT%vIohb3N>L&&x^d8~po2J*md9L~UA=yPNZ*Do48xY(mol~uX}DdM z6>u&MW}uIox46wsn^S{YzR88(b|VA8gBh3m%-G1sc3INa@diIqVa7o0hFt+4sP)dE~e~QPktQ zu@p8|t`^TlUua``IsWdWDN~z-B_1_EA^rY~(DL8LY zpRAni>nl`-he~rtL*^KU!@A2s7}3!ro1Gk5g^=RjE#fXq&&1ZWWPsqF_@G+o>pNRH zIyY1*-=O)eOE*B>OWk_d_9z7UdxDY-+H#Rn>_74cy)_InEZ3nHgoT5-ijJGjCq0}Z=(3p_VRgTe# zS~-QKEohVih&rAr6lo+%4=>iW<#^~L^Ys@@3y8o?(*+p6B{-%ju8=<8)^S&+MJTP<-d>rT*ew$f z$-&?33%a^VR$-i|DZL*WbVnt)i?2iM>- zP)0H8!NH-7cH54l{3PI~HM*g3H^rL^NZFo_y}%qHV|80sChBo*xP*;;hIZmmV=JTn zu?)H~QYvmn<6>##+Ygn|j6KBq=qYa8G;m9yn&ie$75S73n~TX?1ir!8`bSC*wHW(@ zn$3XECflEqh&Q%h1syI`bnVxDnpAt_sT;{FpdYj-KJosZ`<7w#@Jmjh~8BuWsni6Q;ZcrZCD7SJ|7IQ-d>_WYJ@bbz#J!* zYM_Xn^9FnT5#;}Qa`LV3%K+JNH5jUk|%t*{z07M0*D9T`vgM=g2-&X6X>oznfM0s7)(VWo(~Wg<18BuvUQx^Om3jr1 z$|@vazPyKjD|Ws$gj-H{9jmeuAY?Z-wbvW0&@+coRE(;7e+~KL8uG^>a$pApL$<+m zw$TV_qkN1G;I%<#9>q&4A8e&^mjEJH7RTk@#nYLYE1A + + +Generated by IcoMoon + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/global/template/style/icomoon.ttf b/doc/global/template/style/icomoon.ttf new file mode 100755 index 0000000000000000000000000000000000000000..4518527c8b4cadba1fdb54c4f9987cb5877e605d GIT binary patch literal 4460 zcma)9U2I%O6`q-UXXgI@c=zr)j(^sB9j}uT$KD^Wlg3E}A}x)Rv}w{xkc2pn69?j- zG(k%HfIt)|YAYfk@xTL85kep##6tlIAyLH71L^}$NW3(*i1G*(Qbiw#%{Oy*Hyh)) zTwl+gIWu$4nK^U5b1tET5SM&~7-Ztq3kRxJ`9Hq}=QsGjIKMQv+IRN7i-gdA^k=Wm z-CV_Qg#IFat*h5xxk8tZy@x*d{=16{bC=CK58fvvoWS_hA{b)Hd=-5)e`Im#*6m^r z6bau%Gktw!elEEj{~Y~4pg*`YcYBre(dW>=hkj{!ZfW7AT|fED85+w_qop zcvg)QgAsa%aE#5;E8slc`u&jXBCn}=T@Q`AI+}cnkoz`W+r%GTgEWZI{H#%ZLKyy) z#ynaznkOci#;-#xj6ppq-M2R%Y;J-_Kod>V&A<1VtrdCz4J8z_LMcfY9xIww$F@sWr zg@!PkP?*9nII}__U6V`3m|+;U@KWQYHXQfhe|3K+$UMcgnflTuR}CWmaWF#u8AFs1nfWonW~>0KsmYgf2&^bm7x ztKibp^^IRB<1NE-m9!G0oEz9hXfY{xVB3YjABuCOASl?T?IM;X#RqGu0>=gx)CEKE!+sPh8? zc66R5U)w>etYj$E72_RDP$=~XENDz97OF?-RK1eH(iSwz07PBS42m=oWtSKG+HyVg zmHGO!rUgXcrs)C@96NE{yko}_S4Tgdf(a+@T7i_lm^EF~G0nenn;{?#W^?Wf8Cq6| z1st)gA4_m7Q(Pf^zOCaf&5BT3vAw-AH?i9$Ad-bKYnqPXnlFehvAnGeCP;vWHbFe( zDnB4Qbo_8<2QTmpZo9F*K8hgiKHUtD9|2=MKRt+)pvU7&ZiYAK z$kGn}0_F%At887JYQ*)?6bJhR?Z%GvKqy_GcvGjqO)Khop+3{d!E3>Wo}< zm(4eDM&sl(d5OG@TISERpB|x~qR-G1sErzjX|r9Nv?`NEEk?#^-?|nM;M(G9Hv8rPsdv+zmPnExwt>SF;m6 z9gOQTVXCS^tf^G;EV42qlG^{ODdY#*HUcCCdR;-+*-Y~=EJwD5G+9GfsvyjaYu9D~ zQI)%(xK;`1WI~g)Q5#kb!7cSmQ9K;kdB@3FO@ z0!{RCj+3|ToMY!KIy*g0eZ{k#9xEzg8G6~{4@OE3c!Nrm=#8SWf>ZRoUQ{MQFyJG2 zgr}-0fFuOiJwQZDtwmJYImLp^UqZo*-yej7kv|;AL*8yvFw?i~-UxH-9vDP#E0c1l zh}12{4xlzHh0%Zy23T(|Qy?`$8dhM96H7Hw#LiiRJ@^Rn|1>@Q=J#ZP>QR_d*LRG* zy75zmHl73rECjwOkOzGEW7J_cf*3bg30Fm^83*50x^<_%u}+6J-T`0_s`CRLv=)l* z04b!GX=uw6zTEgAE^qc?Qv`b94mZ3biam7)mMuBvH~ zKXBA1pX z<=&-Jxw%WZQ{O)x&YamZdS)h^UEi(@Nu&AjOmyOUt#1XTX!xT z`M)gNz7V>wTJ=U(pU+*soO^!TQfObaP&^r(T&~xbPeO0&TkUUA|2v-#4}VBp7=q_7 zH{VA_ZvSdzTSr%YC1wxSsc%gbqi-k%+Lokj7;Vs@K&V0bO}$MmLW$}AS5g=zwZ-F$ zG*1TU6#X?TvCkTV#=p$h#EasGVyz`CpeGgP;^{2Wy{rky&sz3SZAWGs1O0T1Z-5?Y z(I)7#Et-=8df9wIB&oJ&ht$cu`UW;_aMa#1I+K~vnaqsNWM*_GGouC89&D}6WL|^Z z739+u{4J9g$pU$q+$7g@uY~WMaWa8k*PLtfD@!XY%a1aVbQZ`}@+ESe%t62-3&=4o m>=r3u#sZWm6?5bkelLS}iM)dLGg`%omKo#f91$-&J^uyb$pB&i literal 0 HcmV?d00001 diff --git a/doc/global/template/style/icomoon.woff b/doc/global/template/style/icomoon.woff new file mode 100755 index 0000000000000000000000000000000000000000..5c8466c40fbeb6d98c53192c2e9fcfc0507f8c83 GIT binary patch literal 4536 zcmai1TWp+16`q;@pZV`M@6B;yd%f#;os>BCUcAo5Nd+P;jdN+5v=SsCj^oAwUy>$> zv_eRT0<8)n5)wi@AQd455<)zLi%=zs5Imqh@Py!{u|<_fsE{i9Ky1D<|E|3@jywDR zvomLA&N(w@&UeoL#WN>PFwRht-!M=A&r`i!IrH4XDr4Nn*cE#1(tm$9voL)Vv^n&r z=}4`K1}mi(~Zr=*?YAez7op7jolK^o#oK;b#}87iK{_ z3)!Ef_k~?Q{^!l5+jp?v@2$@>&@u$$_n5?-DGp89Q?36G*e>=e`kjT7*iGe0#vVF+ zc@00ltfljg@uF@E)Fdg3nnttC)cbL9LIOX|iVvN&M{8?(cJU$8ZNB!89<#MV51`_V zV^*ZOq%`nu9?~K=0f%xgJImCB`|$_U@`H0tA6mOiy=zNVL9C7xWCI9r93-+rF1pXB96p;^ck za+O>*k7>2h>R5HWnXAwYy#ng!k(5oXI$FbcTS%kcp+yF&RmW@P!iliQaXo&~iIh^S zZ~xGAlnQJi4K58|7@Qj-GL+#)%2b9Sg&ir&Go>YjFbu=7WMEl|V_1gQW!s^YmLUv` zN%JM?NYjzr;C5h26?FN#`}+mgoL%{A&bjSN2oM|(7D>afP0mfrFeP|{i~+EchH05k za6yxN&L0TNv3EtQ#}5n7vGX23S6}@lDQ_FLN8E~nOKD&iku5AGL&wR7L4T4dhGE{Z ze8YqgOA-EHOkLM+patbc(D zVs&V+JbNq>u3@;MyAnn*AIW926NAfOQrfqL-4)9>aWrinXh>hZUn}k@CM-sN*_g7YxZL7yt z+wSlgM`e_wtE*Il0s1o=R0ho1uxV+BeH;`KFIde&MXLatsmQVuXM15@&S|RvPgcg1 zX}X4IKBqd^%C<15U;#9=3TlH&cIdSIy&bF|Q@HKK`uY%@wDWXRJl+JxdVcv3LI%Np z`^oL$g$}c&CV@T3ByZpy>ot^|?0l@@@*UKQ7 zn_2|Hb7(tVuABEruCJ6QrGqGdiI8GR)04_qFuW7n7A{4gq-O$Rp&v|xU_eRvSM-uqjaJjS@ zjZ5X>Z@ouK3-KQI$4^V+mVqdRYC;-6rRHNQ94;1bVfdO5s~-{{ZVT}TS}lOjrZ|u` z;cwyqIURy3h7Ra4-J~-@-nzDIzJW6uVdvNj>`mk{f98AmG5!huG(UyhsBx4x+sR2Q zGilTkM4a}mYXJeSEv|Mm)7yyjN|4AG||hrZq{)!u9LC()Wif2h~~Imc3i|V^wJXa#l#1+ zK4PW1<9Iml7JR=OnMoM-25=tbQ#J*V1OulFh-lMVc%_pe5_tX!0w#k!Vbm7~14+{F z?>3b%1IOu(F~{kGLi{eNltD&Bw-`Hs*r*uAy#WXyy}8JN)NpBNfi-So(L|NF7Yy;} zL-7C8#KbqhZ-vMnm1*hxPViS&e@1BITcCgh$2S$?Kw$j@dDyKm!3`$nl!Tf|_+65% zJN4BS-oJVufZa#u2RvvkRNnzoSbi#@%})i^>ibDvDj*(!?_&ZPphh%ly!h=Pp(Ion zLqO{1{Y141LOdivF|u9CX%Rr`z%M;lO9e*a>Bc^#0ko2ytkQM@5>H@BS|I@otb2Iv z#C?4bQBL_CyRvgY$Zj0!9)F<9&mKV`AEmgzg8Xp>`QsovxC4SA+Ymb2XhytQInMj> z*`PCz(q+mA+o{}TfXLN_F>Bw#nauRn%$XmYj3&?T9XdZ5O|5K~hLq!(=zM%?zE+z* zb$j^yQGaU6KYD(cbnA?T`09LYUb~^$_KDEtn^k}4=Che=*D}v;n+olZXA7s}(~I@` z;%UfjeXIRF-gE!6(a{f>2Srf+a{FCGK3PT7Pat+r%&^wRl?S*+S>yR6P;=o{E{K%u>*?UZNQ zPI;#7lxNybd8TcJwTD`3Q=T`#cM0)y3BN`5Jey@NvD@s1?iKN!Gr~sE>zH$6W@%w* zX>l_VL1&g-XJ26RY#IzUEnp`!vpcMa8M6>VBBt3L{9gm@Dtj6Ar?iMuEj32y9N{lJ GmHz=YMFm9w literal 0 HcmV?d00001 diff --git a/doc/global/template/style/list_arrow.png b/doc/global/template/style/list_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..a6a6be665bfea5a4f202d2981db3211eb3158f68 GIT binary patch literal 1115 zcmaJ=OK8+U7>+KMrCO|tqD3*pQXlK))x_<_uI-w%cEyykF1QDUW|L_f+ho#Y>TY{+ zD?Sf}s#Ub8R8jGw9`sP~;6+6dQ9(gPK}1nO@E}+ap-#5l)`M$cGBZE__x-PLjW)!UNu|{`Qid)d zMOqB&EYFdVD9wptB*Jebd6p9xmSecuFc*~sL1I~Q`lE0(*XWRvO7nCqe2Y=KycALo^g4Nc@z^F~5J^n62d55Zqv(sKTgD-RwXIcX5f zZss!&&Qu4+29K=FAE;hI-0rP8arI?mV4`yAP}>vo^Myh8`y4TJvZ}0e_*G5y{khM6 zzI!;D*xu6k4TyC=+hIU!|lg977F3vb7vcS_b a.nextPage { - background-image: url('../images/btn_next.png'); - background-repeat: no-repeat; - background-position: right; - padding-right: 20px; - height: 20px; - margin-left: 30px; - } - -.naviNextPrevious > a.prevPage { - background-image: url('../images/btn_prev.png'); - background-repeat: no-repeat; - background-position: left; - padding-left: 20px; - height: 20px; - padding-left: 20px; - } - -.navigationbar { - background-repeat: no-repeat; - height: 33px; - margin: 0px !important; - padding: 0px !important; - border-bottom: 1px solid rgb(209, 209, 209); - background-image: -moz-linear-gradient(center top , rgb(246, 245, 245), rgb(239, 239, 239)); - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.0, #efefef), color-stop(0.5, #f6f5f5) ); - border-radius: 10px 10px 0px 0px; -} - -.navigationbar ul { - margin: 0px; - padding: 8px 0px 15px 15px; - height: 20px; - } - -.navigationbar li { - list-style-type: none; - float: left; - font-size: 15px; - } - - .navigationbar li a { - display: block; - text-decoration: none; - background: url('../images/arrow_bc.png'); - background-repeat: no-repeat; - background-position: right; - padding-right: 25px; - font-size: inherit; +@media (min-width: 1120px) { + #navbar.fixed,#navbar.shadow_bottom { + -moz-box-shadow:0px 0px 8px rgba(0,0,0,0.2); + -webkit-box-shadow:0px 0px 8px rgba(0,0,0,0.2); + box-shadow:0px 0px 8px rgba(0,0,0,0.2) } - -#buildversion { - font-style: italic; - font-size: small; - float: right; - margin-right: 5px; -} - -/* ------------ -headers ------------ -*/ - -@media screen { - .title { - color: #313131; - font-size: 18px; - font-weight: normal; - left: 0; - padding-bottom: 20px; - padding-left: 10px; - padding-top: 20px; - border-bottom: 1px #CCC solid; - font-weight: bold; - margin-left: 0px; - margin-right: 0px; - } -} - -h1 { - margin: 0 -} - -h2, p.h2 { - font: 500 16px/1.2 Arial; - font-weight: 100; - background-color: #F2F3F4; - padding: 4px; - padding-left: 14px; - margin-bottom: 30px; - margin-top: 30px; - margin-left: -10px; - margin-right: -5px; - border-top: #E0E0DE 1px solid; - border-bottom: #E0E0DE 1px solid; - max-width: 99%; - overflow: hidden; -} - -h2:target { - background-color: #F2F3D4; -} - -h3 { - font: 500 14px/1.2 Arial; - font-weight: 100; - text-decoration: underline; - margin-bottom: 30px; - margin-top: 30px; -} - -h3.fn:target { - background-color: #F6F6D6; -} - -h3.fn, span.fn { - border-width: 1px; - border-style: solid; - border-color: #E6E6E6; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - background-color: #F6F6F6; - word-spacing: 3px; - padding: 5px 5px; - text-decoration: none; - font-weight: bold; - max-width: 75%; - font-size: 14px; - margin: 0px; - margin-top: 45px; -} - -.name { - color: #1A1A1A -} - -.type { - color: #808080 -} - -@media print { - .title { - color: #0066CB; - font-size: 32px; - font-weight: normal; - left: 0; - position: absolute; - right: 0; - top: 0; - } -} - -/* ------------------ -table styles ------------------ -*/ - -.table img { - border: none; - margin-left: 0px; - -moz-box-shadow: 0px 0px 0px #fff; - -webkit-box-shadow: 0px 0px 0px #fff; - box-shadow: 0px 0px 0px #fff; -} - -/* table with border alternative colours*/ - -table, pre { - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - background-color: #F6F6F6; - border: 1px solid #E6E6E6; - border-collapse: separate; - font-size: 12px; - line-height: 1.2; - margin-bottom: 25px; - margin-left: 15px; - font-size: 12px; - line-height: 1.2; - margin-bottom: 25px; - margin-left: 15px; -} - - table tr.even { - background-color: white; - color: #66666E; - } - - table tr.odd { - background-color: #F6F6F6; - color: #66666E; - } - - table tr:target { - background-color: #F6F6D6; - } - - table thead { - text-align: left; - padding-left: 20px; - background-color: #e1e0e0; - border-left: none; - border-right: none; - } - - table thead th { - padding-top: 5px; - padding-left: 10px; - padding-bottom: 5px; - border-bottom: 2px solid #D1D1D1; - padding-right: 10px; + #navbar.fixed #menuextras li a,#navbar.shadow_bottom #menuextras li a { + padding-top:9px; + height:50px + } + #navbar.fixed #menuextras li a span,#navbar.shadow_bottom #menuextras li a span { + max-height:0 + } + #navbar.fixed #menuextras li a:before,#navbar.shadow_bottom #menuextras li a:before { + font-size:30px + } + #navbar.fixed #mainmenu li a { + height:50px; + padding:14px 0.7em + } + #navbar.fixed #mainmenu li a:hover { + border-bottom:4px solid #5caa15 + } + #navbar.fixed .navbar-toggle { + padding:13px 14px 9px + } + #navbar.fixed #menuextras li.navbar-search { + padding:0px 0 + } + #navbar.fixed #menuextras ul.menuextraslinks,#navbar.fixed #menuextras ul.menuextraslanguages { + display:none + } + #navbar.fixed .navbar-oneQt:before { + font-size:35px; + top:7px + } + #navbar.fixed #mainmenu li.current-menu-item a { + border-bottom:4px solid #80C342 } - - table td { - padding: 3px 15px 3px 20px; - border-bottom: #CCC dotted 1px; - } - - table th { - text-align: left; - padding-left: 20px; - } - - table p { - margin: 0px - } - -/* table bodless & white*/ - -.borderless { - border-radius: 0px 0px 0px 0px; - background-color: #fff; - border: 1px solid #fff; } - -.borderless td { - border: none; - border-bottom: #fff dotted 1px; - } - -.borderless tr { - background-color: #FFF; - color: #66666E; - } - -/* ------------ -List ------------ -*/ - -ul { - margin-top: 10px; +@media (max-width: 1120px) { + #navbar { + padding:0; + position:relative + } + #navbar .container { + max-width:100% + } + #navbar .menuextraslanguages { + bottom:10px !important; + right:0 + } + #navbar .menuextraslanguages li a { + color:#7fc241 !important + } + #navbar .menuextraslanguages li.active a,#navbar .menuextraslanguages li a:hover { + border-color:#7fc241 !important + } + #navbar .container { + padding:0 + } + #navbar .navbar-toggle { + display:block + } + #navbar .navbar-oneQt,#navbar.fixed .navbar-oneQt,#navbar .navbar-oneQt:hover { + margin-left:0; + height:26px; + width:22px; + padding:7px 20px 7px 15px + } + #navbar .navbar-oneQt:before { + left:20px + } + #navbar .navbar-menu { + max-height:0; + overflow:hidden; + width:100%; + border-top:1px solid #eee; + -webkit-transition:all 600ms ease-in-out; + -moz-transition:all 600ms ease-in-out; + -o-transition:all 600ms ease-in-out; + transition:all 600ms ease-in-out; + position:relative + } + #mainmenu { + float:none; + width:100%; + padding:0; + margin:0 + } + #mainmenu li { + float:none; + list-style:none + } + #mainmenu li:nth-child(odd) { + background:rgba(0,0,0,0) + } + #mainmenu li a,#navbar.fixed #mainmenu li a { + padding:10px; + border-left:3px solid #fff; + height:auto; + width:100% + } + #mainmenu li.current-menu-item a,#navbar.fixed #mainmenu li.current-menu-item a { + border-bottom:none; + border-left:3px solid #5caa15; + padding:10px + } + #mainmenu li a:hover { + border-bottom:0; + padding:10px; + border-left:3px solid #5caa15 + } + #navbar.fixed { + -moz-box-shadow:0px 0px 0px rgba(0,0,0,0); + -webkit-box-shadow:0px 0px 0px rgba(0,0,0,0); + box-shadow:0px 0px 0px rgba(0,0,0,0) + } + .lt-ie9 #navbar.fixed { + border-bottom:none + } + #menuextras li.navbar-search { + padding:5px 0 + } + .container { + padding:0 2% + } + body .main { + margin-top:0px + } } - -li { - margin-bottom: 10px; - padding-left: 8px; - list-style: outside; - list-style-type: square; - text-align: left; +.in-page-nav { + width:100%; + background:#eeeeee } - -ol { - margin: 10px; - padding: 0; +.in-page-nav ul { + margin:0 auto; + letter-spacing:-0.31em; + max-width:1180px; + text-align:center } - - ol > li { - margin-left: 30px; - padding-left: 8px; - list-style: decimal; - } - -.centerAlign { - text-align: left +.in-page-nav ul li { + display:inline-block; + letter-spacing:normal } - -.cpp { - display: block; - margin: 10px; - overflow: auto; - padding: 20px 20px 20px 20px; +.in-page-nav ul li a { + color:#26282a; + padding:25px 10px; + display:inline-block } - -.js { - display: block; - margin: 10px; - overflow: auto; - padding: 20px 20px 20px 20px; +body.qt-account #navbar .navbar-oneQt { + width:auto; + height:auto } - -.footerNavi { - width: auto; - text-align: right; - margin-top: 50px; - z-index: 1; +body.qt-account #navbar .navbar-oneQt:before { + left:0; + position:relative; + display:inline-block; + vertical-align:middle; + top:0; + margin-right:20px } - -.memItemLeft { - padding-right: 3px +body.qt-account #navbar .navbar-oneQt h2 { + margin:0; + color:#000; + display:inline-block; + vertical-align:middle } - -.memItemRight { - padding: 3px 15px 3px 0 +.landing header[role="banner"] { + background:#26282a } - -.qml { - display: block; - margin: 10px; - overflow: auto; - padding: 20px 20px 20px 20px; +.landing header[role="banner"] figure { + max-width:1180px; + margin:auto; + position:relative } - -.qmldefault { - padding-left: 5px; - float: right; - color: red; +.landing header[role="banner"] figure img { + max-width:100% } - -.qmlreadonly { - padding-left: 5px; - float: right; - color: #254117; +.landing header[role="banner"] figcaption { + color:#fff; + position:absolute; + left:0px; + width:100%; + text-align:center } - -.rightAlign { - padding: 3px 5px 3px 10px; - text-align: right; +.landing header[role="banner"] figcaption.top { + top:0 } - -.qmldoc { - margin-left: 15px +.landing header[role="banner"] figcaption.bottom { + bottom:0 } - -/* ------------ -Content table ------------ -*/ - -@media print { - .toc { - float: right; - clear: right; - padding-bottom: 10px; - padding-top: 50px; - width: 100%; - background-image: url('../images/bgrContent.png'); - background-position: top; - background-repeat: no-repeat; - } +.landing header[role="banner"] figcaption h1 { + margin:50px auto 0 auto; + max-width:70%; + font-weight:600 } - -@media screen { - .toc { - clear: both; - clear: right; - position: relative; - top: 83px; - float: right; - vertical-align: top; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - background: #FFF url('../images/bgrContent.png'); - background-position: top; - background-repeat: repeat-x; - border: 1px solid #E6E6E6; - padding-left: 5px; - padding-bottom: 10px; - height: auto; - width: 200px; - text-align: left; - margin-left: 20px; - } +.landing header[role="banner"] figcaption h3 { + margin-bottom:40px } - -.toc h3 { - text-decoration: none +.cookies_yum { + background-color:#006325; + display:none; + width:100% } - -.toc h3 { - font: 500 14px/1.2 Arial; - font-weight: 100; - padding: 0px; - margin: 0px; - padding-top: 5px; - padding-left: 5px; +.cookies_yum img { + width:25px; + top:6px; + display:inline-block; + position:absolute; + left:6px } - -.toc ul { - padding-left: 10px; - padding-right: 5px; - padding-top: 10px; +.cookies_yum div { + margin:0 auto; + max-width:1180px; + min-height:30px; + padding:6px 0px 6px 0px; + position:relative } - -.toc ul li { - margin-left: 15px; - list-style-image: url('../images/blu_dot.png'); - list-style: outside; - marker-offset: 0px; - margin-bottom: 8px; - padding-left: 0px; - } - -.toc .level1 { - border: none +.cookies_yum p { + color:white; + margin:0px; + font-size:0.79em; + display:inline-block; + line-height:1.2; + padding:0 30px 0 40px } - -.toc .level2 { - border: none; - margin-left: 25px; +.cookies_yum p a { + white-space:nowrap } - -.level3 { - border: none; - margin-left: 30px; +.cookies_yum a:hover { + color:white +} +.cookies_yum .close { + width:15px; + height:15px; + background-image:url("../images/cookiebar-x.png"); + background-size:15px 30px; + background-position:top left; + cursor:pointer; + top:6px; + right:6px; + position:absolute +} +.cookies_yum .close:hover { + background-position:bottom left +} +#bottom_header { + display:block; + position:absolute; + width:100%; + z-index:50; + padding-top:15px +} +#bottom_header .container { + overflow:visible +} +#bottom_header .left { + font-weight:bolder +} +#bottom_header a { + color:white; + transition-duration:0.3s +} +#bottom_header .left a:hover { + padding-left:10px +} +.fixed .menuextraslanguages { + opacity:0; + visibility:hidden +} +@media (max-width: 1120px) { + .fixed .menuextraslanguages { + opacity:1 !important; + visibility:visible !important + } +} +#navbar .menuextraslanguages { + position:absolute; + right:0; + bottom:-35px; + transition:all 0.2s ease-in-out; + -webkit-transition:all 0.2s ease-in-out; + -moz-transition:all 0.2s ease-in-out; + -ms-transition:all 0.2s ease-in-out; + -o-transition:all 0.2s ease-in-out +} +#navbar .menuextraslanguages li { + display:inline; + list-style:none; + margin-left:3px; + padding:0px 4px; + font-size:0.6875em +} +#navbar .menuextraslanguages li.dark a { + color:#868482 +} +#navbar .menuextraslanguages li.dark a:hover { + border:2px solid #868482 +} +#navbar .menuextraslanguages li.active.dark a { + border-color:#868482; + color:#868482 +} +#navbar .menuextraslanguages a { + color:#fff; + padding:2px 4px; + border:2px solid transparent +} +#navbar .menuextraslanguages a:hover,#navbar .menuextraslanguages li.active a { + border:2px solid #fff; + color:#fff +} +#bottom_header .dark,#bottom_header .dark.active { + color:#868482; + transition-duration:0.3s; + border-color:#868482 !important +} +#navbar .big_bar { + width:100%; + height:100px; + background-color:#80C342; + display:none; + position:relative +} +#navbar .big_bar.search { + height:auto; + overflow:hidden; + display:none +} +#navbar .big_bar ::-webkit-input-placeholder { + color:#fff +} +#navbar .big_bar :-moz-input-placeholder { + color:#fff +} +#navbar .big_bar ::-moz-input-placeholder { + color:#fff +} +#navbar .big_bar :-ms-input-placeholder { + color:#fff +} +#navbar .big_bar:hover>div .big_bar_button.account { + background-position:right bottom +} +#navbar .big_bar.account h1 { + padding-top:20px +} +#navbar .big_bar.account h1,#navbar .big_bar.account h1 a { + color:#FFF; + margin-bottom:5px +} +#navbar .big_bar.account h1 a:hover { + color:#328930 +} +#navbar .big_bar_button:hover { + background-position:left bottom; + cursor:pointer +} +#navbar .big_bar_button.account { + background-position:right top +} +#navbar .big_bar input.big_bar_search { + background:none repeat scroll 0 0 transparent; + border:medium none; + color:#fff; + display:block; + float:left; + font-size:4em; + outline:0 none; + width:70%; + line-height:1.3; + height:auto; + margin:10px 5%; + padding:0; + box-sizing:border-box; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + *behavior:url(boxsizing.htc) +} +#navbar .big_bar_button { + background-color:transparent; + border:none; + width:18%; + transition-duration:0.3s; + display:block; + float:left; + position:relative; + font-family:'QT Icons'; + font-size:3.5em; + color:#fff; + margin:15px 2% 0 0 !important; + text-align:right; + padding-right:2px !important; + transition:all 0.2s ease-in-out; + -webkit-transition:all 0.2s ease-in-out; + -moz-transition:all 0.2s ease-in-out; + -ms-transition:all 0.2s ease-in-out; + -o-transition:all 0.2s ease-in-out +} +#navbar .big_bar_button:focus,#navbar .big_bar_button:hover { + outline:0; + color:#ebebeb +} +.hero_slide>div { + width:80%; + margin:0 auto +} +.hero_slide>div:first-child>div { + width:80%; + margin:0 auto +} +.hero_slide .content { + margin-top:70px +} +.hero_bar { + padding-top:50px; + padding-bottom:18px +} +.hero_bar p { + font-size:0.875em; + text-align:center +} +.hero_bar .arrow { + bottom:65px; + display:block; + margin:0 auto; + position:relative; + right:260px; + width:230px +} +.hero_bar .comment { + margin:0 +} +#footerbar { + background:#26282a; + color:#fff +} +#footerbar.fixed { + bottom:0; + left:0; + width:100% +} +#footerbar .footer-main .footer-nav { + display:inline; + float:left +} +#footerbar .footer-main .footer-nav li { + float:left; + margin-right:1em +} +#footerbar .footer-main .footer-nav li a { + display:block; + padding:31px 10px 15px 0; + line-height:20px; + height:20px; + color:#d6d6d6 +} +#footerbar .footer-main .footer-nav li a:hover,#footerbar .footer-main .footer-nav li.current-menu-item a { + color:#eee +} +#footerbar .footer-main .footer-nav .sub-menu { + margin-left:0; + margin-bottom:0 +} +#footerbar .footer-main .footer-nav .sub-menu li { + float:none +} +#footerbar .footer-main .footer-nav .sub-menu ul { + padding:1px 1em; + font-size:0.786em; + line-height:8px; + float:none; + color:#5d5b59; + margin-bottom:0 +} +#footerbar .footer-main .footer-nav .sub-menu li a { + padding:1px 0; + font-size:0.786em; + line-height:8px; + float:none; + color:#d6d6d6 +} +#footerbar .footer-main .footer-nav .sub-menu li a:hover,#footerbar .footer-main .footer-nav .sub-menu li.current-menu-item a { + color:#eee +} +#footerbar .footer-main .footer-logo { + display:inline; + float:right; + padding:29px 0 28px 10px; + margin-left:30px; + width:56px +} +#footerbar .footer-main .footer-logo:before { + content:attr(data-icon); + font-family:'Qt Icons'; + width:100%; + line-height:1.2; + display:inline-block; + font-size:1.875em; + color:#706e6d +} +#footerbar .footer-main .footer-logo:hover { + padding:31px 0 26px 10px +} +#footerbar .footer-main .footer-social { + display:inline; + float:right; + padding-top:31px +} +#footerbar .footer-main .footer-social>div { + margin-left:0.1em; + margin-bottom:10px +} +#footerbar .disclaimer { + font-size:0.786em; + line-height:2.73; + color:#868584; + padding-top:20px; + padding-bottom:0.5% +} +#footerbar .disclaimer a { + color:#bdbebf +} +#footerbar .disclaimer a:hover { + color:#d6d6d6 +} +#footerbar .disclaimer ul li { + float:left; + vertical-align:middle; + margin-left:1.18em +} +#footerbar .disclaimer ul li:first-child { + margin-left:0 +} +#footerbar .disclaimer ul.lang-selector a { + color:#506a34; + color:rgba(128,195,66,0.3) +} +#footerbar .disclaimer ul.lang-selector a:hover { + color:#80c342; + color:rgba(128,195,66,0.7) +} +#menu-footer-menu, #menu-footer-menu ul { + margin-left:0; + margin-bottom:0 +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:300; + src:local("Open Sans Light"),local("OpenSans-Light"),url(//fonts.gstatic.com/s/opensans/v10/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:400; + src:local("Open Sans"),local("OpenSans"),url(//fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:600; + src:local("Open Sans Semibold"),local("OpenSans-Semibold"),url(//fonts.gstatic.com/s/opensans/v10/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:700; + src:local("Open Sans Bold"),local("OpenSans-Bold"),url(//fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Open Sans'; + font-style:normal; + font-weight:800; + src:local("Open Sans Extrabold"),local("OpenSans-Extrabold"),url(//fonts.gstatic.com/s/opensans/v10/EInbV5DfGHOiMmvb1Xr-honF5uFdDttMLvmWuJdhhgs.ttf) format("truetype") +} +@font-face { + font-family:'Droid Sans Mono'; + font-style:normal; + font-weight:400; + src:local("Droid Sans Mono"),local("DroidSansMono"),url(//fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format("woff") +} +@font-face { + font-family:'Qt Icons'; + src:url("../style/icomoon.eot?-tgjuoj"); + src:url("../style/icomoon.eot?#iefix-tgjuoj") format("embedded-opentype"),url("../style/icomoon.woff?-tgjuoj") format("woff"),url("../style/icomoon.ttf?-tgjuoj") format("truetype"),url("../style/icomoon.svg?-tgjuoj#icomoon") format("svg"); + font-weight:normal; + font-style:normal +} +.clearfix:before,.clearfix:after { + content:" "; + display:table +} +.clearfix:after { + clear:both } - .clearfix { - clear: both + *zoom:1 } - -/* start index box */ - -.indexbox { - width: 100%; - display: inline-block; +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { + margin:0; + padding:0; + border:0; + font-size:100% } - -.indexbox .indexIcon { - width: 11% - } - - .indexbox .indexIcon span { - display: block - } - -.indexboxcont { - display: block +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { + vertical-align:baseline } - -.indexboxcont .sectionlist { - display: inline-block; - vertical-align: top; - width: 32.5%; - padding: 0; - } - - .indexboxcont .sectionlist ul { - margin-bottom: 20px - } - - .indexboxcont .sectionlist ul li { - line-height: 1.5 - } - -.indexboxcont .indexIcon { - width: 11%; - *width: 18%; - _width: 18%; - overflow: hidden; - } - -.indexboxcont .section { - float: left - } - -.indexboxcont .section { - display: inline-block; - width: 49%; - *width: 42%; - _width: 42%; - padding: 0 2% 0 1%; - vertical-align: top; - } - - .indexboxcont .section p { - padding-top: 20px; - padding-bottom: 20px; - } - -.indexboxcont:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -/* ------------ -Landing page ------------ -*/ - -.col-group { - white-space: nowrap; - vertical-align: top; -} - -.col-1 { - display: inline-block; - white-space: normal; - width: 70%; - height: 100%; - float: left; -} - -.col-1 h1 { - margin: 20px 0 0 0 - } - -.col-2 { - display: inline-block; - white-space: normal; - width: 25%; - margin: 0 0 0 50px; -} - -.sectionlist { - width: 100% !important -} - -/* -Additions from Qt Project -*/ - body { - background: #E8E8E8; - margin: 0px; - font-family: "Open Sans",sans-serif !important; + font-family:“Open Sans”, Arial, Helvetica, sans-serif; + line-height:1.5; + font-weight:300 } - -.qt13a-twoCol { - width: 23.46939%; - float: left; - margin-right: 2.04082%; - display: inline; +h1,h2,h3,h4,h5,h6 { + font-weight:300 } - -.qt13a-fourCol { - width: 48.97959%; - float: left; - margin-right: 2.04082%; - display: inline; +.context h2,.context h3,.context h4,.context h5,.context h6 { + margin:1.5em 0 1em } - -.qt13a-sixCol { - width: 70.4898%; - float: left; - margin-right: 2.04082%; - display: inline; +.context h1 { + margin-bottom:1em; + font-size:3.125em } - -.qt13a-eightCol { - width: 100%; - float: left; - margin-right: 2.04082%; - display: inline; +.context h3.fn,.context h3.flags { + color:#26282a; + font-size:1.46em; + padding:15px 0 15px 0; + border-bottom:2px #eee solid; + word-wrap:break-word } - -.qt13a-fiveCol { - width: 17.35537%; - float: left; - margin-right: 3.30579%; - display: inline; +.context h3.fn .name, +.context h3 span.type, +.qmlname span.name { + font-weight: 400 } - -.qt13a-fiveCol:nth-child(2n) { - float: left; - margin-right: 3.30579%; +.qmlname { + font-size:1.46em } - -.qt13a-omega { - float: right; - margin-right: 0; - *margin-left: -20px; - display: inline; +.qmlproto table { + border:none; + border-bottom:2px #eee solid } - -.qt13a-last { - float: right; - margin-right: 0; - *margin-left: -20px; - display: inline; +.qmlproto table p { + max-width:100% } - -.qt13a-container { - *zoom: 1; - padding-left: 20px; - padding-right: 20px; - margin-left: auto; - margin-right: auto; - max-width: 1045px; +.qmlproto table tr { + background-color:#fff } - -.qt13a-container:after { - content: ""; - display: table; - clear: both; +.qmlname td, .qmlname th { + border:none; + text-align:left; + padding:5px 0 0 0 } - -.qt13a-container.qt13a-dynamic { - max-width: 1295px +.qmlreadonly,.qmldefault { + padding:0 5px 0 5px; + font-size:0.75em; + background-color:#eee; + float:right } - -.qt13a-no-bg-img { - background-image: none !important +.qmlreadonly { + color:#414141 } - -.qt13a-wrapper { - overflow: hidden +.qmldefault { + color:#D14141 } - -.content-view { - position: relative; - overflow: hidden; +.rightAlign { + padding:3px 5px 3px 10px; + text-align:right } - -#qt13a-header { - background: url('../images/Qt-header-bg.jpg') repeat; - min-height: 126px; - padding: 0; - margin: 0; - min-width: 1045px; - margin-bottom: 18px; +article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { + display:block } - - #qt13a-header .qt13a-nav-divider-left { - border-left: 1px solid #35322f; - padding-left: 10px; - margin-left: 5px; - font-size: 13px; - } - - #qt13a-header #qt13a-title_nav { - padding-top: 34px; - width: 87.37374%; - float: left; - margin-right: 1.0101%; - display: inline; - float: right; - margin-right: 0; - *margin-left: -20px; - display: inline; - } - - #qt13a-header .qt13a-gradient { - background: url('../images/Qt-gradient.png') repeat-x; - background-position: bottom; - margin: 0; - min-height: 126px; - padding: 0; - } - - #qt13a-header p.qt13a-title { - font-size: 24px; - margin: 0 0 0 0px; - letter-spacing: -1px; - color: #35322f; - font-weight: 600; - } - - #qt13a-header p.qt13a-title a { - font-weight: 600; - color: #35322f; - } - - #qt13a-header p.qt13a-title a:hover { - color: #35322f; - text-decoration: none; - } - - #qt13a-header #qt13a-title { - padding: 0px 0 0 0px; - padding-bottom: 0px; - } - - #qt13a-header #qt13a-logo { - float: left; - width: 11.61616%; - float: left; - margin-right: 1.0101%; - display: inline; - margin: 20px 0px 10px 0; - min-width: 50px; - } - - #qt13a-header #qt13a-logo .qt13a-site-logo { - background: url('../images/Qt-logo.png') no-repeat; - text-indent: -100em; - overflow: hidden; - display: block; - height: 90px; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - } - - #qt13a-header #qt13a-logo img { - float: left; - border: 0; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - } - - #qt13a-header .qt13a-nav { - background: none - } - - #qt13a-header .qt13a-nav .qt13a-nav-divider-left { - border-left: 1px solid #35322f; - padding-left: 20px; - } - - #qt13a-header .qt13a-nav .qt13a-nav-small a { - font-size: 13px - } - - #qt13a-header .qt13a-nav ul { - margin: 0 0 0 0px; - padding: 11px 0 0; - background: none; - } - - #qt13a-header .qt13a-nav ul li.devnet-active a { - color: #fff - } - - #qt13a-header .qt13a-nav ul li { - display: inline-block; - width: auto; - padding: 0 2.88% 0 0; - margin: 0; - border: 0; - *display: inline; - zoom: 1; - } - - #qt13a-header .qt13a-nav ul li a { - color: #35322f; - margin: 0; - padding: 0; - line-height: 18px; - font-size: 18px; - } - - #qt13a-header .qt13a-nav ul li a:hover, #qt13a-header .qt13a-nav ul li a:active, #qt13a-header .qt13a-nav ul li a.active { - color: #fff; - text-decoration: none; - } - -#qt13a-register_search { - display: block; - font-variant: 400; - float: right; +body { + line-height:1; + font-family:"Open Sans", Arial, Helvetica, sans-serif; + transition-duration:1s } - -#qt13a-register { - padding: 34px 0px 0; - float: right; - text-align: right; - color: #1e1b18; +ol,ul { + list-style:none } - - #qt13a-register .qt13a-link-divider { - padding: 0 5px - } - - #qt13a-register a { - color: #1e1b18; - font-weight: 400; - font-size: 13px; - padding-left: 13px; - } - - #qt13a-register a:visited { - color: #1e1b18 - } - - #qt13a-register a:hover { - color: #fff; - text-decoration: none; - } - -#search { - margin-top: 23px +.context ol,.context ul { + margin-top:0.75em; + margin-left:20px } - -#qt13a-footer { - background: url('../images/Qt-header-bg.jpg') repeat; - margin: 0; +.mainContent ol>li { + list-style-type:decimal } - - #qt13a-footer .qt13a-container { - padding: 36px 0 - } - - #qt13a-footer .qt13a-gradient { - background: url('../images/Qt-dark_gradient.png') repeat-x; - background-position: bottom; - margin: 0; - min-height: 126px; - padding: 0; - } - - #qt13a-footer .qt13a-shadow { - background: transparent url('../images/Qt-footer_shadow.png') repeat-x top center - } - - #qt13a-footer .qt13a-last { - float: right; - margin-right: 0; - *margin-left: -20px; - display: inline; - } - - #qt13a-footer ul { - width: 17.35537%; - float: left; - margin-right: 3.30579%; - display: inline; - padding-left: 0; - list-style-type: none; - } - - #qt13a-footer ul li a.qt13a-some-icon { - width: 32px; - height: 32px; - background-repeat: none; - text-indent: -300em; - overflow: hidden; - display: -moz-inline-stack; - display: inline-block; - vertical-align: middle; - *vertical-align: auto; - zoom: 1; - *display: inline; - } - - #qt13a-footer ul li a { - font-family: "Open Sans",sans-serif; - font-size: 13px; - color: #35322f; - padding: 0; - font-weight: 400; - } - - #qt13a-footer ul li a:hover, #qt13a-footer ul li a:active { - color: #35322f; - text-decoration: underline; - } - - #qt13a-footer .qt13a-title a, #qt13a-footer .qt13a-title { - padding: 18px 0 18px; - font-weight: 400; - letter-spacing: -0.5pt; - color: #35322f; - font-size: 18px; - margin: 0; - } - -.qt13a-copyright { - border-top: 1px solid #000; - background: url('../images/Qt-footer-bg.jpg') repeat; - margin: 0; - padding: 36px 0; - font-weight: 400; - font-size: 0.84615em; - line-height: 1.63636em; +blockquote,q { + quotes:none } - -.qt13a-copyright p { - padding: 0; - color: #aeadac; - font-size: 11px; - } - -.qt13a-copyright a { - color: #328930 - } - -.qt13a-copyright a:visited { - color: #328930 - } - -.searchbox { - display: block; - overflow: hidden; - padding: 0px 35px 0 5px; +blockquote:before,blockquote:after,q:before,q:after { + content:''; + content:none; + width:100% } - -.content-view { - position: relative; - overflow: hidden; +table { + border-collapse:collapse; + border-spacing:0; + margin-bottom:25px; + width:100% } - -p, li, p.forum-overview-title, p.forum-description, p.desc, p.forum-lastpost, div.navigationbars li, div.block-profile div { - font-size: 13px -} - -p.forum-description.desc { - font-size: 13px !important -} - -.steps li { - font-size: 16px -} - -div.license p, div.notes p { - font-size: 12px !important -} - a { - color: #44a51c; - text-decoration: none; + color:#5caa15; + text-decoration:none; + transition-duration:0.3s } - -.wrap { - padding-left: 30px -} - -a:visited { - color: #007330; - text-align: left; -} - a:hover { - color: #44a51c; - text-align: left; + color:#46a2da } - -a:visited:hover { - color: #44a51c; - text-align: left; +.main,.navbar-header,#footerbar>div { + max-width:1500px; + width:95%; + margin:0 auto } - -a:link { - color: #007330; - text-decoration: none; - text-align: left; -} - .main { - padding: 0px 30px 30px 30px + margin-top:100px +} +.main_index { + background-color:#fff +} +.sectionlist { + margin-bottom:2em +} +[class*="col-"] { + letter-spacing:normal +} +.landing,.main_index .row { + letter-spacing:-0.31em +} +.main_index .row>div { + letter-spacing:normal +} +.col-1,.context { + width:80%; + display:inline-block; + background-color:#fff; + padding:35px; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + -ms-box-sizing:border-box; + box-sizing:border-box +} +.col-1 h2 { + font-size:2.1875em; + font-weight:300; + line-height:1.1; + margin-bottom:0.83em; + margin-top:1em +} +.icons1of3 img { + display:inline-block; + float:left; + margin-right:0.75em; + margin-top:-5px; + width:2.75em +} +div.multi-column { + position:relative +} +div.multi-column div { + display:-moz-inline-box; + display:inline-block; + vertical-align:top; + margin-top:1em; + margin-right:2em; + width:16em +} +.sidebar { + display:block; + float:right; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + -ms-box-sizing:border-box; + box-sizing:border-box; + width:20%; + padding-left:30px +} +.toc,.sectionlist { + padding:35px; + background-color:#fff; + margin-bottom:2em +} +.sidebar-content:empty { + display:none; + visibility:hidden +} +.col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 { + font-weight:400; + margin-bottom:2em +} +.toc h3 a { + color:#404244 +} +.title { + font-size:3em; + font-weight:300; + letter-spacing:-1px; + line-height:1.15em; + margin-bottom:0.5em; + word-wrap:break-word +} +.navigationbar,col-1 h2 { + font-size:0.75em +} +.navigationbar h1 { + font-size:3.125em; + margin-bottom:1em; + margin-top:1em +} +.navigationbar li { + display:inline-block; + margin-right:5px; + position:relative; + padding-right:10px; + color:#585a5c +} +.navigationbar li a { + color:#58585c +} +body { + background-color:#eee; + color:#404244 +} +.sectionlist li { + margin-bottom:5px +} +dd { + padding-bottom:0.25em; + padding-left:2em +} +.col-1 ul { + margin-bottom:1.56em +} +.mainContent li { + margin-bottom:0.8em; + line-height:1.25em +} +.mainContent p { + line-height:1.56em; + margin-bottom:1.5em; + color:#404244; + max-width:85% +} +.mainContent b { + font-weight:400 +} +.context ul { + margin-bottom:1.5em +} +.mainContent ul ul { + margin-top:0.5em +} +.mainContent .naviNextPrevious { + margin-top:25px; + max-width:100% +} +.naviNextPrevious.headerNavi { + display:none +} +.nextPage { + float:right +} +.prevPage:before { + content:"< " +} +.nextPage:after { + content:" >" +} +.navigationbar li:after { + color:#404244; + content:"›"; + display:inline-block; + font-size:1.5em; + line-height:1; + position:absolute; + right:-2px; + top:-4px +} +.navigationbar ul:last li a { + color:#80c342 +} +.sub-navigation { + margin-top:10px +} +.navigationbar li:last-child:after,.sub-navigation li:after { + content:none +} +.navigationbar { + margin-bottom:10px +} +#buildversion { + font-style:italic; + font-size:small; + float:right +} +.copy-notice { + width:65%; + font-size:0.75em; + margin-top:50px; + margin-bottom:25px; + line-height:1.75em; + color:#585a5c +} +li a.active { + color:#585a5c +} +.flowList { + padding:25px +} +.alphaChar { + font-size:2em; + position:absolute +} +.flowList.odd { + background-color:#eee +} +.context ul>li,.doc-column ul>li { + list-style-image:url("list_arrow.png"); + margin-left:15px; + color:#404244; + line-height:1.16em +} +.mainContent table p { + margin:0px; + padding:0px +} +.mainContent table p { + margin:0px; + padding:0px; + min-height:2em +} +.context h4,.context h3,.context h2 { + font-size:2.1875em +} +.context p img { + margin-top:0.75em; + max-width:100% +} +.context table { + vertical-align:initial +} +table .odd { + background-color:#eee +} +table thead { + text-align:left; + padding-left:20px +} +table,table td,table th { + border:1px solid #eee +} +table td,table th { + padding:5px 20px; + line-height:1.3 +} +table.alignedsummary,table.propsummary { + width:initial +} +div.main_index .row:first-child { + border-bottom:1px solid #eee +} +div.main_index .row { + position:relative +} +div.main_index .row>div { + display:inline-block; + width:50%; + vertical-align:top; + padding:50px; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + -ms-box-sizing:border-box; + box-sizing:border-box +} +div.main_index h2 { + font-size:2.1875em; + margin-bottom:1em +} +#search_bar { + width:40%; + float:right +} +div.main_index .row:after { + content:""; + position:absolute; + top:0; + right:50%; + height:100%; + width:1px; + background-color:#eee +} +div.table { + overflow-x:auto +} +p.qt_commercial { + border:3px solid #5caa15; + margin:0 auto; + padding:15px; + width:28%; + text-align:center; + clear:both +} +h1.qt_commercial { + padding:20px; + background-color:#5caa15; + display:inline; + float:right; + font-size:1.25em; + line-height:1.25em; + height:1.25em; + color:#fff +} +div.qt_commercial { + border-top:5px solid #5caa15; + margin-bottom:50px +} +pre { + background-color:#404244; + color:#fff; + display:block; + font-family:"Droid Sans Mono"; + line-height:1.5; + overflow-x:auto; + margin-bottom:25px; + overflow-x:auto; + padding:25px; + margin-top:0.75em +} +.copy_text { + background-color:#46a2da; + color:#fff; + border:2px solid #46a2da; + padding:10px 16px; + margin-left:-10px; + margin-top:-50px; + position:absolute; + opacity:0; + cursor:pointer; + float:right +} +.copy_text:hover { + background-color:#fff; + color:#46a2da +} +code,.codelike { + font-family:"Droid Sans Mono" +} +h3.fn code { + font-size:0.75em; + float:right; + background-color:#eee; + padding:3px; + margin: 3px 0 0 20px +} +pre:hover>.copy_text { + display:inline-block; + opacity:1; + transition:0.5s ease +} +#main_title_bar { + letter-spacing:-0.31em +} +#main_title_bar .search_bar { + letter-spacing:normal; + width:50%; + display:inline-block; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + -ms-box-sizing:border-box; + box-sizing:border-box; + vertical-align:middle +} +#main_title_bar h1 { + letter-spacing:normal; + width:50%; + display:inline-block; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + -ms-box-sizing:border-box; + box-sizing:border-box; + vertical-align:middle +} +#main_title_bar .search_bar * { + letter-spacing:normal; + padding:0; + margin:0; + border:none +} +@media (max-width: 980px) { + body { + font-size:calc-em(14px) + } + #main_title_bar { + letter-spacing:-0.31em; + width:100% + } + #main_title_bar>h1,#main_title_bar .search_bar { + display:block; + width:100% + } + #main_title_bar .search_bar { + margin-bottom:15px + } + .main { + margin-top:0px + } + .main_index .row { + border:none !important + } + .title { + font-size:1.5em; + font-weight:400; + word-wrap:break-word + } + .col-1,.context,.naviNextPrevious,.sidebar { + padding:10px + } + .sidebar { + padding-top:0 + } + .search .sidebar { + display:none; + visibility:hidden + } + .col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 { + text-align:center + } + div.main_index .row:after { + content:none + } + div.main_index .row>div { + display:block !important; + width:100%; + padding:0; + margin:0 + } + .context,.sidebar,.col-1 { + width:100% + } + .main_index h2,h1 { + text-align:center + } + .context h4,.context h3,.context h2 { + text-align:center + } + .sidebar-content,.col-2,.toc { + background-color:#fff; + margin-bottom:1em; + padding:20px + } + .mainContent p { + line-height:1.56em; + margin-bottom:1em; + max-width:100% + } + table td,table th { + padding:5px 5px + } +} +[id]:target,[name]:target,[name]:target+* { + -webkit-animation:highlighter 3s; + animation:highlighter 3s +} +@-webkit-keyframes highlighter { + 25% { + background-color:#46a2da; + color:#fff + } + 75% { + background-color:#46a2da; + color:#fff + } +} +@keyframes highlighter { + 25% { + background-color:#46a2da; + color:#fff + } + 75% { + background-color:#46a2da; + color:#fff + } +} +@-webkit-keyframes copypaste { + 25% { + opacity:1 + } + 100% { + border-radius:10px; + margin-top:-50px; + opacity:1 + } +} +@keyframes copypaste { + 25% { + opacity:1 + } + 100% { + border-radius:10px; + margin-top:-50px; + opacity:1 + } +} +#footer { + clear:both +} +.menuextraslanguages { + display:none; + visibility:hidden +} +form.gsc-search-box { + font-size: 25px !important; + margin-top: 0 !important; + margin-right: 0 !important; + margin-bottom: 4px !important; + margin-left: 0 !important; + width: 100% !important; +} +table.gsc-search-box { + border-style: none !important; + border-width: 0 !important; + border-spacing: 0 0 !important; + width: 100% !important; + margin-bottom: 2px !important; } -.main-rounded { - display: inline-block; - background: none repeat scroll 0% 0% rgb(255,255,255); - width: 100%; - border: 1px solid #DADADA; - border-radius: 10px 10px 10px 10px; - box-shadow: 0 0 3px #C4C4C4; - padding-bottom: 30px; +table.gsc-search-box td { + vertical-align: middle !important; +} + +table.gsc-search-box td.gsc-input { + padding-right: 0px !important; +} +table.gsc-search-box td.gsc-input input { + background-position: 15px center !important; +} + +td.gsc-search-button { + width: 1% !important; +} + +td.gsc-clear-button { + width: 14px !important; + visibility:hidden !important; + display:none !important; +} +table.gsc-branding td, +table.gsc-branding { + margin: 0 0 0 0 !important; + padding: 0 0 0 0 !important; + border: none !important; +} + +table.gsc-branding { + border-style: none !important; + border-width: 0 !important; + border-spacing: 0 0 !important; + width: 100% !important; +} + +.gsc-branding-text { + color: #676767 !important; +} + +td.gsc-branding-text { + vertical-align: top !important; +} +td.gsc-branding-text div.gsc-branding-text { + padding-bottom: 2px !important; + text-align: right !important; + font-size: 11px !important; + margin-right: 2px !important; +} + +td.gsc-branding-img { + width: 65px !important; + vertical-align: bottom !important; +} + +img.gsc-branding-img { + padding-top: 1px !important; + margin: 0 0 0 0 !important; + padding-right: 0 !important; + padding-left: 0 !important; + padding-bottom: 0 !important; + border: none !important; + display: inline !important; +} + +input.gsc-search-button { + background-color: white !important; + height: 35px !important; + width: 35px !important; + color: transparent !important; + background-image: url("doc_search.png") !important; + background-size: 25px auto; + background-position: 0px 5px; + background-repeat: no-repeat; + margin-left: -43px !important; + overflow: hidden; + min-width: 20px !important; +} + +input.gsc-search-button:hover { + cursor: pointer; +} + +.gsc-search-box-tools .gsc-clear-button { + display: none !important; + visibility: none !important; +} + +.gsc-overflow-hidden { + overflow: hidden !important; +} + +input.gsc-input { + background-color: #fff !important; + border: 1px solid #d6d6d6 !important; + border-radius: 5px !important; + box-sizing: border-box !important; + color: #868482 !important; + outline: 0 none !important; + padding: 9px 10px 10px !important; + transition: color 0.5s ease 0s, box-shadow 0.5s ease 0s, background-color 0.5s ease 0s !important; +} + +input { + font-family: 'Open Sans', Arial, Helvetica, sans-serif !important; + line-height: 1.5 !important; + font-weight: 300 !important; + vertical-align:middle +} + +input:focus { + border-color: #46a2da; + box-shadow: 0 0 5px #46a2da; + color: #000; } From ab6d645850e88f3e351d196bf009135b6189ba8a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 26 Nov 2014 13:12:08 +0100 Subject: [PATCH 52/99] Android: Fix broken system palette When we overwrite the default palette, we have to make sure we don't overwrite default values with black for all the colors that are not retrieved from the json file. We would for instance get black as both the base color and text color which would make some components unusable. Change-Id: I1079a70a0ac7eb379ed5e8d92c6b39c2ea77ba49 Task-number: QTBUG-42812 Task-number: QTBUG-42998 Reviewed-by: BogDan Vatra Reviewed-by: J-P Nurmi --- src/plugins/platforms/android/qandroidplatformtheme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index f9f2e4a944..375096139d 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -278,7 +278,8 @@ static std::shared_ptr loadAndroidStyle(QPalette *defaultPalette) const int pt = paletteType(key); if (pt > -1 || !qtClassName.isEmpty()) { // Extract palette information - QPalette palette; + QPalette palette = *defaultPalette; + attributeIterator = item.find(QLatin1String("defaultTextColorPrimary")); if (attributeIterator != item.constEnd()) palette.setColor(QPalette::WindowText, QRgb(int(attributeIterator.value().toDouble()))); From 2ca57e39e32d056e17a1db68b6c6ef1345ecdf7c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 11 Nov 2014 12:34:13 +0100 Subject: [PATCH 53/99] Respect the size hint signal for the column and row delegates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sizeHintChanged() signal from the column and row delegates need to be connected to the doItemsLayout() slot so that the view is updated when the size hint changes. Additionally doDelayedItemsLayout() is called to ensure that this is up-to-date as the size hints may have changed when the new delegate was set on the row or column. Change-Id: I458293f05ce9ef40a03bdbcab1a6e7a10f648c89 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Kevin Puetz --- src/widgets/itemviews/qabstractitemview.cpp | 6 +++ .../tst_qabstractitemview.cpp | 44 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 16de80476f..71404c9792 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -891,6 +891,7 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de disconnect(rowDelegate, SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); disconnect(rowDelegate, SIGNAL(commitData(QWidget*)), this, SLOT(commitData(QWidget*))); + disconnect(rowDelegate, SIGNAL(sizeHintChanged(QModelIndex)), this, SLOT(doItemsLayout())); } d->rowDelegates.remove(row); } @@ -899,10 +900,12 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de connect(delegate, SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); connect(delegate, SIGNAL(commitData(QWidget*)), this, SLOT(commitData(QWidget*))); + connect(delegate, SIGNAL(sizeHintChanged(QModelIndex)), this, SLOT(doItemsLayout()), Qt::QueuedConnection); } d->rowDelegates.insert(row, delegate); } viewport()->update(); + d->doDelayedItemsLayout(); } /*! @@ -948,6 +951,7 @@ void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelega disconnect(columnDelegate, SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); disconnect(columnDelegate, SIGNAL(commitData(QWidget*)), this, SLOT(commitData(QWidget*))); + disconnect(columnDelegate, SIGNAL(sizeHintChanged(QModelIndex)), this, SLOT(doItemsLayout())); } d->columnDelegates.remove(column); } @@ -956,10 +960,12 @@ void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelega connect(delegate, SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); connect(delegate, SIGNAL(commitData(QWidget*)), this, SLOT(commitData(QWidget*))); + connect(delegate, SIGNAL(sizeHintChanged(QModelIndex)), this, SLOT(doItemsLayout()), Qt::QueuedConnection); } d->columnDelegates.insert(column, delegate); } viewport()->update(); + d->doDelayedItemsLayout(); } /*! diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 3f8b8ec067..ff910ba359 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -180,6 +180,16 @@ public: { doAutoScroll(); } }; +class GeometriesTestView : public QTableView +{ + Q_OBJECT +public: + GeometriesTestView() : QTableView(), updateGeometriesCalled(false) {} + bool updateGeometriesCalled; +protected slots: + void updateGeometries() Q_DECL_OVERRIDE { updateGeometriesCalled = true; QTableView::updateGeometries(); } +}; + class tst_QAbstractItemView : public QObject { Q_OBJECT @@ -241,6 +251,7 @@ private slots: void testFocusPolicy(); void QTBUG31411_noSelection(); void QTBUG39324_settingSameInstanceOfIndexWidget(); + void sizeHintChangeTriggersLayout(); }; class MyAbstractItemDelegate : public QAbstractItemDelegate @@ -248,7 +259,7 @@ class MyAbstractItemDelegate : public QAbstractItemDelegate public: MyAbstractItemDelegate() : QAbstractItemDelegate() { calledVirtualDtor = false; } void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const {} - QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(); } + QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return size; } QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const { openedEditor = new QWidget(parent); @@ -259,9 +270,10 @@ public: calledVirtualDtor = true; editor->deleteLater(); } - + void changeSize() { size = QSize(50, 50); emit sizeHintChanged(QModelIndex()); } mutable bool calledVirtualDtor; mutable QWidget *openedEditor; + QSize size; }; // Testing get/set functions @@ -725,6 +737,34 @@ void tst_QAbstractItemView::columnDelegate() QCOMPARE(w->metaObject()->className(), "QWidget"); } +void tst_QAbstractItemView::sizeHintChangeTriggersLayout() +{ + QStandardItemModel model(4, 4); + MyAbstractItemDelegate delegate; + MyAbstractItemDelegate rowDelegate; + MyAbstractItemDelegate columnDelegate; + + GeometriesTestView view; + view.setModel(&model); + view.setItemDelegate(&delegate); + view.setItemDelegateForRow(1, &rowDelegate); + view.setItemDelegateForColumn(2, &columnDelegate); + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + view.updateGeometriesCalled = false; + delegate.changeSize(); + QCoreApplication::sendPostedEvents(); + QVERIFY(view.updateGeometriesCalled); + view.updateGeometriesCalled = false; + rowDelegate.changeSize(); + QCoreApplication::sendPostedEvents(); + QVERIFY(view.updateGeometriesCalled); + view.updateGeometriesCalled = false; + columnDelegate.changeSize(); + QCoreApplication::sendPostedEvents(); + QVERIFY(view.updateGeometriesCalled); +} + void tst_QAbstractItemView::selectAll() { QStandardItemModel model(4,4); From c609a83426c0373bda2a8258dd3d9565502ec848 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Mon, 1 Dec 2014 12:40:15 +0200 Subject: [PATCH 54/99] ANGLE: Fix handling of shader source with fixed length This is a cherry-pick of upstream f60fab6d154f4c9bf599e92976cd8cee7f8633e0 (See https://chromium-review.googlesource.com/231612) Task-number: QTBUG-42882 Change-Id: I7b4bdc4b68a1b93ff514f09ce35dbf4e9360af9b Reviewed-by: Marko Kangas Reviewed-by: Friedemann Kleint --- src/3rdparty/angle/src/libGLESv2/Shader.cpp | 9 ++++- ...ng-of-shader-source-with-fixed-lengt.patch | 37 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/angle/patches/0019-ANGLE-Fix-handling-of-shader-source-with-fixed-lengt.patch diff --git a/src/3rdparty/angle/src/libGLESv2/Shader.cpp b/src/3rdparty/angle/src/libGLESv2/Shader.cpp index 1cc17a0501..5bca746094 100644 --- a/src/3rdparty/angle/src/libGLESv2/Shader.cpp +++ b/src/3rdparty/angle/src/libGLESv2/Shader.cpp @@ -51,7 +51,14 @@ void Shader::setSource(GLsizei count, const char *const *string, const GLint *le for (int i = 0; i < count; i++) { - stream << string[i]; + if (length == nullptr || length[i] < 0) + { + stream.write(string[i], std::strlen(string[i])); + } + else + { + stream.write(string[i], length[i]); + } } mSource = stream.str(); diff --git a/src/angle/patches/0019-ANGLE-Fix-handling-of-shader-source-with-fixed-lengt.patch b/src/angle/patches/0019-ANGLE-Fix-handling-of-shader-source-with-fixed-lengt.patch new file mode 100644 index 0000000000..5fa244c1b5 --- /dev/null +++ b/src/angle/patches/0019-ANGLE-Fix-handling-of-shader-source-with-fixed-lengt.patch @@ -0,0 +1,37 @@ +From 5e277b05a16e7be24d36c600f158f8119ee583d8 Mon Sep 17 00:00:00 2001 +From: Andrew Knight +Date: Mon, 1 Dec 2014 11:58:08 +0200 +Subject: [PATCH] ANGLE: Fix handling of shader source with fixed length + +This is a cherry-pick of upstream f60fab6d154f4c9bf599e92976cd8cee7f8633e0 +(See https://chromium-review.googlesource.com/231612) + +Task-number: QTBUG-42882 +Change-Id: I7b4bdc4b68a1b93ff514f09ce35dbf4e9360af9b +--- + src/3rdparty/angle/src/libGLESv2/Shader.cpp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libGLESv2/Shader.cpp b/src/3rdparty/angle/src/libGLESv2/Shader.cpp +index 1cc17a0..5bca746 100644 +--- a/src/3rdparty/angle/src/libGLESv2/Shader.cpp ++++ b/src/3rdparty/angle/src/libGLESv2/Shader.cpp +@@ -51,7 +51,14 @@ void Shader::setSource(GLsizei count, const char *const *string, const GLint *le + + for (int i = 0; i < count; i++) + { +- stream << string[i]; ++ if (length == nullptr || length[i] < 0) ++ { ++ stream.write(string[i], std::strlen(string[i])); ++ } ++ else ++ { ++ stream.write(string[i], length[i]); ++ } + } + + mSource = stream.str(); +-- +1.9.4.msysgit.1 + From 165b1c7da1be92e954078b55674e90d8a46137cb Mon Sep 17 00:00:00 2001 From: Jeongmin Kim Date: Tue, 2 Dec 2014 12:53:19 +0900 Subject: [PATCH 55/99] QHttpThreadDelegate : Fix QHttpThreadDelegate don't read response data about Synchronous error reply. The App might use response data of Synchronous 401 reply. (example : specific error info of code, string as json) so, Added a function to read it for Sync. Async is already OK. Sync path is different from Async path. Change-Id: I683d4b6b40f600793d2545811dcd6644515de79c Task-number:QTBUG-43030 Reviewed-by: Jeongmin Kim Reviewed-by: Frederik Gladhorn Reviewed-by: Richard J. Moore --- src/network/access/qhttpthreaddelegate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 4e1d24280b..06d62fbbcb 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -548,6 +548,8 @@ void QHttpThreadDelegate::synchronousFinishedWithErrorSlot(QNetworkReply::Networ incomingErrorCode = errorCode; incomingErrorDetail = detail; + synchronousDownloadData = httpReply->readAll(); + QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection); QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection); httpReply = 0; From b1652b869765896958ad85843d3eb5b0fc1e6ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 2 Dec 2014 18:27:48 +0100 Subject: [PATCH 56/99] Simplify GL2PaintEngine::updateTextureFilter, it doesn't need target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8b71c33adb37c166bf4fc6dc8c2e7418d60fbf81 Reviewed-by: Laszlo Agocs Reviewed-by: Tor Arne Vestbø --- src/gui/opengl/qopenglpaintengine.cpp | 25 ++++++++++++++----------- src/gui/opengl/qopenglpaintengine_p.h | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index c490726359..503e869a36 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -107,7 +107,7 @@ QOpenGL2PaintEngineExPrivate::~QOpenGL2PaintEngineExPrivate() } } -void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id) +void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum wrapMode, bool smoothPixmapTransform, GLuint id) { // funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); //### Is it always this texture unit? if (id != GLuint(-1) && id == lastTextureUsed) @@ -115,6 +115,8 @@ void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wra lastTextureUsed = id; + static const GLenum target = GL_TEXTURE_2D; + if (smoothPixmapTransform) { funcs.glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); funcs.glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -122,6 +124,7 @@ void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wra funcs.glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); funcs.glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); } + funcs.glTexParameteri(target, GL_TEXTURE_WRAP_S, wrapMode); funcs.glTexParameteri(target, GL_TEXTURE_WRAP_T, wrapMode); } @@ -185,7 +188,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, texImage); - updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); + updateTextureFilter(GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { // Gradiant brush: All the gradiants use the same texture @@ -200,11 +203,11 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glBindTexture(GL_TEXTURE_2D, texId); if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient) - updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); + updateTextureFilter(GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); else if (g->spread() == QGradient::ReflectSpread) - updateTextureFilter(GL_TEXTURE_2D, GL_MIRRORED_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); + updateTextureFilter(GL_MIRRORED_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); else - updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform); + updateTextureFilter(GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style == Qt::TexturePattern) { currentBrushImage = currentBrush.textureImage(); @@ -223,7 +226,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, currentBrushImage); - updateTextureFilter(GL_TEXTURE_2D, wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); + updateTextureFilter(wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); textureInvertedY = false; } brushTextureDirty = false; @@ -1386,7 +1389,7 @@ void QOpenGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixma bool isBitmap = pixmap.isQBitmap(); bool isOpaque = !isBitmap && !pixmap.hasAlpha(); - d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, id); d->shaderManager->setSrcPixelType(isBitmap ? QOpenGLEngineShaderManager::PatternSrc : QOpenGLEngineShaderManager::ImageSrc); @@ -1429,7 +1432,7 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); GLuint id = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, image, bindOption); - d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, id); d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel()); @@ -1476,7 +1479,7 @@ bool QOpenGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, co QOpenGLRect srcRect(src.left(), src.bottom(), src.right(), src.top()); - d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, textureId); d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); d->drawTexture(dest, srcRect, size, false); @@ -1807,7 +1810,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly funcs.glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT); funcs.glBindTexture(GL_TEXTURE_2D, cache->texture()); - updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false); + updateTextureFilter(GL_REPEAT, false); #if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO) funcs.glDrawElements(GL_TRIANGLE_STRIP, 6 * numGlyphs, GL_UNSIGNED_SHORT, 0); @@ -1957,7 +1960,7 @@ void QOpenGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFra bool isBitmap = pixmap.isQBitmap(); bool isOpaque = !isBitmap && (!pixmap.hasAlpha() || (hints & QPainter::OpaqueHint)) && allOpaque; - updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, + updateTextureFilter(GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform, id); // Setup for texture drawing diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h index 5ef0366284..a5f3cc2894 100644 --- a/src/gui/opengl/qopenglpaintengine_p.h +++ b/src/gui/opengl/qopenglpaintengine_p.h @@ -193,7 +193,7 @@ public: void updateBrushUniforms(); void updateMatrix(); void updateCompositionMode(); - void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = GLuint(-1)); + void updateTextureFilter(GLenum wrapMode, bool smoothPixmapTransform, GLuint id = GLuint(-1)); void resetGLState(); From 0f88c5c1b99336a328f9a7123903fbc006251ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 16:36:13 +0100 Subject: [PATCH 57/99] qmake: Add .qmake.stash/super to QMAKE_DISTCLEAN when owned by project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running 'make distclean' should remove all files generated by qmake, including .qmake.stash/super. These files are considered owned by a particular project (and hence a candidate for distclean), if it lives in the same directory as the output dir of the project. Task-number: QTBUG-42678 Change-Id: I224e9bac039eeacb6561e18acc7f8e867da5dab8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- qmake/generators/makefile.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index bf9a9d8343..4c501983d8 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -444,6 +444,22 @@ MakefileGenerator::init() setSystemIncludes(v["QMAKE_DEFAULT_INCDIRS"]); + const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", 0 }; + for (int i = 0; cacheKeys[i]; ++i) { + if (v[cacheKeys[i]].isEmpty()) + continue; + const ProString &file = v[cacheKeys[i]].first(); + if (file.isEmpty()) + continue; + + QFileInfo fi(fileInfo(file.toQString())); + + // If the file lives in the output dir we treat it as 'owned' by + // the current project, so it should be distcleaned by it as well. + if (fi.path() == Option::output_dir) + v["QMAKE_DISTCLEAN"].append(fi.fileName()); + } + ProStringList &quc = v["QMAKE_EXTRA_COMPILERS"]; //make sure the COMPILERS are in the correct input/output chain order From 5d8baf9056c1264434949e0176cbb2dfd2d78658 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 2 Dec 2014 15:53:02 -0800 Subject: [PATCH 58/99] Change misleading error message in QDBusReply "no signature" is misleading and even led me to re-check the code to see if it meant that the reply failed and no signature could be obtained. Saying that the signature was obtained but is empty is better. Change-Id: I1381cf53b334798125d36db0934105d15b63b84f Reviewed-by: Frederik Gladhorn --- src/dbus/qdbusreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/qdbusreply.cpp b/src/dbus/qdbusreply.cpp index c141c233a1..624a1bd3ed 100644 --- a/src/dbus/qdbusreply.cpp +++ b/src/dbus/qdbusreply.cpp @@ -219,7 +219,7 @@ void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data // error if (receivedSignature.isEmpty()) - receivedSignature = "no signature"; + receivedSignature = ""; QString errorMsg; if (receivedType) { errorMsg = QString::fromLatin1("Unexpected reply signature: got \"%1\" (%4), " From 9fb4c2c412621b63c06dbbd899f44041b2e126c2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Nov 2014 16:06:18 -0800 Subject: [PATCH 59/99] Configure: Fix detection of GCC 5 $ gcc-5 -dumpversion 5 No dots. Change-Id: I5dd547f257718c981e7be64fca3eec980136ba3e Reviewed-by: Oswald Buddenhagen --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index c668f29a97..fc2b02942b 100755 --- a/configure +++ b/configure @@ -6031,6 +6031,10 @@ s/icpc version \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\) .*$/QT_ICC_MAJOR_VERSION=\1; Q QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'` QT_GCC_PATCH_VERSION=0 ;; + *) + QT_GCC_MAJOR_VERSION=$COMPILER_VERSION + QT_GCC_MINOR_VERSION=0 + QT_GCC_PATCH_VERSION=0 esac ;; From 8e9d78e43ef6dd7a6fc3be8874fc518db8537c91 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Nov 2014 16:23:51 +0100 Subject: [PATCH 60/99] QMenuBar: fix extra indent on the right with a TopLeftCorner widget. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting a left corner widget on a QMenuBar, the first action rectangle is offset by its width and thus the width should not be added to the size hint. Use QSize::expandedTo() instead. Task-number: QTBUG-36010 Change-Id: I660e3facbd0aeb5fb84fac8923db3e0c7998309d Reviewed-by: Jan Arve Sæther --- src/widgets/widgets/qmenubar.cpp | 5 +- .../widgets/widgets/qmenubar/tst_qmenubar.cpp | 80 +++++++++++++++++++ 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 871af35159..619cb64636 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -1631,9 +1631,8 @@ QSize QMenuBar::sizeHint() const int margin = 2*vmargin + 2*fw + spaceBelowMenuBar; if(d->leftWidget) { QSize sz = d->leftWidget->sizeHint(); - ret.setWidth(ret.width() + sz.width()); - if(sz.height() + margin > ret.height()) - ret.setHeight(sz.height() + margin); + sz.rheight() += margin; + ret.expandedTo(sz); } if(d->rightWidget) { QSize sz = d->rightWidget->sizeHint(); diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index f4e2cc174e..7588950b76 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -83,6 +85,7 @@ public: private slots: void getSetCheck(); + void cleanup(); void clear(); void removeItemAt(); @@ -126,6 +129,8 @@ private slots: #endif void taskQTBUG11823_crashwithInvisibleActions(); void closeOnSecondClick(); + void cornerWidgets_data(); + void cornerWidgets(); protected slots: void onSimpleActivated( QAction*); @@ -195,6 +200,11 @@ void tst_QMenuBar::onSimpleActivated( QAction* action ) m_simpleActivatedCount++; } +void tst_QMenuBar::cleanup() +{ + QVERIFY(QApplication::topLevelWidgets().isEmpty()); +} + // Create a simple menu bar and connect its actions to onSimpleActivated(). TestMenu tst_QMenuBar::initSimpleMenuBar(QMenuBar *mb) @@ -1325,5 +1335,75 @@ void tst_QMenuBar::closeOnSecondClick() // QTBUG-32807, menu should close on 2nd QTRY_VERIFY(!fileMenu->isVisible()); } +Q_DECLARE_METATYPE(Qt::Corner) + +void tst_QMenuBar::cornerWidgets_data() +{ + QTest::addColumn("corner"); + QTest::newRow("left") << Qt::TopLeftCorner; + QTest::newRow("right") << Qt::TopRightCorner; +} + +static QByteArray msgComparison(int v1, const char *op, int v2) +{ + QString result; + QDebug(&result) << v1 << op << v2 << "failed"; + return result.toLocal8Bit(); +} + +void tst_QMenuBar::cornerWidgets() +{ + enum { cornerWidgetWidth = 100 }; + + QFETCH(Qt::Corner, corner); + +#if defined(Q_OS_OSX) || defined(Q_OS_WINCE) + QSKIP("Test interferes with native menu bars on this platform"); +#endif + + QWidget widget; + const QString dataTag = QLatin1String(QTest::currentDataTag()); + widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()) + dataTag); + QVBoxLayout *layout = new QVBoxLayout(&widget); + QMenuBar *menuBar = new QMenuBar(&widget); + layout->addWidget(menuBar); + QMenu *fileMenu = menuBar->addMenu("File"); + fileMenu->addAction("Quit"); + QMenu *editMenu =menuBar->addMenu("Edit"); + editMenu->addAction("Copy"); + centerOnScreen(&widget); + + QLabel *cornerLabel = new QLabel(dataTag); + cornerLabel->setFixedWidth(cornerWidgetWidth); + menuBar->setCornerWidget(cornerLabel, corner); + QCOMPARE(menuBar->cornerWidget(corner), cornerLabel); + widget.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + + const QRect fileMenuGeometry = menuBar->actionGeometry(fileMenu->menuAction()); + const QRect editMenuGeometry = menuBar->actionGeometry(editMenu->menuAction()); + const int menuBarWidth = menuBar->width(); + switch (corner) { // QTBUG-36010 , verify corner widget geometry is correct + case Qt::TopLeftCorner: + QVERIFY2(fileMenuGeometry.left() >= cornerWidgetWidth, + msgComparison(fileMenuGeometry.left(), ">=", cornerWidgetWidth)); + QVERIFY2(menuBarWidth - editMenuGeometry.right() < cornerWidgetWidth, + msgComparison(menuBarWidth - editMenuGeometry.right(), "<", cornerWidgetWidth)); + break; + case Qt::TopRightCorner: + QVERIFY2(fileMenuGeometry.left() < cornerWidgetWidth, + msgComparison(fileMenuGeometry.left(), "<", cornerWidgetWidth)); + QVERIFY2(menuBarWidth - editMenuGeometry.right() >= cornerWidgetWidth, + msgComparison(menuBarWidth - editMenuGeometry.right(), ">=", cornerWidgetWidth)); + break; + default: + break; + } + + menuBar->setCornerWidget(0, corner); // Don't crash. + QVERIFY(!menuBar->cornerWidget(corner)); + delete cornerLabel; +} + QTEST_MAIN(tst_QMenuBar) #include "tst_qmenubar.moc" From bd5743f1d8472e70aeeccd08858130d4781bde41 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 3 Dec 2014 12:09:50 +0100 Subject: [PATCH 61/99] Make tst_qwindow::positioning more reliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't check for absolute counts of resize events but just check if we were resized. Also use QTest::qWaitForWindowExposed instead of QTRY_COMPARE and checking for QEvent::Expose. Change-Id: Ie383493a8ce6d88cad50bd6375d432ad1578449c Reviewed-by: Jørgen Lind --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index fac16ff8a3..46b33e5d39 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -233,17 +233,11 @@ void tst_QWindow::resizeEventAfterResize() void tst_QWindow::positioning_data() { QTest::addColumn("windowflags"); - QTest::addColumn("resizecount"); - QTest::newRow("default") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint) -#if defined(Q_OS_OSX) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - << 4; -#else - << 3; -#endif + QTest::newRow("default") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint); #ifdef Q_OS_OSX - QTest::newRow("fake") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint) << 4; + QTest::newRow("fake") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); #endif } @@ -262,7 +256,6 @@ void tst_QWindow::positioning() const QRect geometry(m_availableTopLeft + QPoint(80, 80), m_testWindowSize); QFETCH(int, windowflags); - QFETCH(int, resizecount); Window window((Qt::WindowFlags)windowflags); window.setGeometry(QRect(m_availableTopLeft + QPoint(20, 20), m_testWindowSize)); window.setFramePosition(m_availableTopLeft + QPoint(40, 40)); // Move window around before show, size must not change. @@ -273,8 +266,7 @@ void tst_QWindow::positioning() window.showNormal(); QCoreApplication::processEvents(); - QTRY_COMPARE(window.received(QEvent::Resize), 1); - QTRY_VERIFY(window.received(QEvent::Expose) > 0); + QTest::qWaitForWindowExposed(&window); QMargins originalMargins = window.frameMargins(); @@ -284,25 +276,22 @@ void tst_QWindow::positioning() QPoint originalPos = window.position(); QPoint originalFramePos = window.framePosition(); + window.reset(); window.setWindowState(Qt::WindowFullScreen); QCoreApplication::processEvents(); -#if defined(Q_OS_BLACKBERRY) // "window" is the "root" window and will always be shown fullscreen - // so we only expect one resize event - Q_UNUSED(resizecount); - QTRY_COMPARE(window.received(QEvent::Resize), 1); -#else - QTRY_COMPARE(window.received(QEvent::Resize), 2); + // On BB10 the window is the root window and fullscreen, so nothing is resized. +#if !defined(Q_OS_BLACKBERRY) + QTRY_VERIFY(window.received(QEvent::Resize) > 0); #endif QTest::qWait(2000); + window.reset(); window.setWindowState(Qt::WindowNoState); QCoreApplication::processEvents(); -#if defined(Q_OS_BLACKBERRY) // "window" is the "root" window and will always be shown fullscreen - // so we only expect one resize event - QTRY_COMPARE(window.received(QEvent::Resize), 1); -#else - QTRY_COMPARE(window.received(QEvent::Resize), resizecount); + // On BB10 the window is the root window and fullscreen, so nothing is resized. +#if !defined(Q_OS_BLACKBERRY) + QTRY_VERIFY(window.received(QEvent::Resize) > 0); #endif QTRY_COMPARE(originalPos, window.position()); From 20d10d90f2715e6cee46be63c1314eb62f06bc5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 4 Dec 2014 11:31:01 +0100 Subject: [PATCH 62/99] Revert "QWidgetTextControl: Suppress drag selection for OS-synthesized mouse events." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cf0d96f4c8584a7eb9eeca304932f6ea88894b27. It broke text selection on iOS and was never tested on that platform. Task-number: QTBUG-43101 Change-Id: I9f224a3838a1f741bc9a9c24f16923ef2018ddf3 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qapplication.cpp | 26 ---------------------- src/widgets/kernel/qapplication_p.h | 1 - src/widgets/widgets/qwidgettextcontrol.cpp | 9 +------- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 82b9fec37f..269fe452c1 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -53,7 +53,6 @@ #include "qtranslator.h" #include "qvariant.h" #include "qwidget.h" -#include "qgraphicssceneevent.h" #include "private/qdnd_p.h" #include "private/qguiapplication_p.h" #include "qcolormap.h" @@ -2287,31 +2286,6 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool return w; } -Qt::MouseEventSource QApplicationPrivate::mouseEventSource(const QEvent *e) -{ - switch (e->type()) { - case QEvent::NonClientAreaMouseButtonDblClick: - case QEvent::NonClientAreaMouseButtonPress: - case QEvent::NonClientAreaMouseButtonRelease: - case QEvent::NonClientAreaMouseMove: - case QEvent::MouseButtonDblClick: - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseMove: - return static_cast(e)->source(); -#ifndef QT_NO_GRAPHICSVIEW - case QEvent::GraphicsSceneMouseDoubleClick: - case QEvent::GraphicsSceneMousePress: - case QEvent::GraphicsSceneMouseRelease: - case QEvent::GraphicsSceneMouseMove: - return static_cast(e)->source(); -#endif // !QT_NO_GRAPHICSVIEW - default: - break; - } - return Qt::MouseEventNotSynthesized; -} - /*! \fn void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, const QPointF &globalPosF) \internal diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index b24b592fbe..7d97235c66 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -168,7 +168,6 @@ public: static void setFocusWidget(QWidget *focus, Qt::FocusReason reason); static QWidget *focusNextPrevChild_helper(QWidget *toplevel, bool next, bool *wrappingOccurred = 0); - static Qt::MouseEventSource mouseEventSource(const QEvent *e); #ifndef QT_NO_GRAPHICSVIEW // Maintain a list of all scenes to ensure font and palette propagation to diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 8f017b7b87..dfec6a14d4 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1580,10 +1580,8 @@ void QWidgetTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton butto cursor.clearSelection(); } } - // Do not start selection on a mouse event synthesized from a touch event. if (!(button & Qt::LeftButton) || - !((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable)) - || QApplicationPrivate::mouseEventSource(e) != Qt::MouseEventNotSynthesized) { + !((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable))) { e->ignore(); return; } @@ -1754,11 +1752,6 @@ void QWidgetTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton but { Q_Q(QWidgetTextControl); - if (QApplicationPrivate::mouseEventSource(e) != Qt::MouseEventNotSynthesized) { - setCursorPosition(pos); // Emulate Tap to set cursor for events synthesized from touch. - return; - } - const QTextCursor oldSelection = cursor; if (sendMouseEventToInputContext( e, QEvent::MouseButtonRelease, button, pos, modifiers, buttons, globalPos)) { From fd29be6a6beafe4bfaf5a73d19a0d6a924217d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 3 Dec 2014 15:33:10 +0100 Subject: [PATCH 63/99] Revert "Use single finger pan to scroll text edits on touch screens." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ffa46054d13c639cf9f7846a74ad3ebd07b9f5c. It completely broke text selection in text edits on iOS, and wasn't even tested on that platform before landing. It's also changing behavior in a patch release for multiple platforms, from being able to both scroll and select text, to only being able to scroll, which would be considered a feature-regression and an automatic -2 on the original patch. This means QTBUG-40461, a P2 regression from Qt 4 on Windows, will have to be re-opened, so that we can fix it properly. Task-number: QTBUG-43101 Change-Id: I26a2bafb4500b1ff4dc3fb942f197d11038b630b Reviewed-by: Tor Arne Vestbø Reviewed-by: Shawn Rutledge Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qstandardgestures.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/widgets/kernel/qstandardgestures.cpp b/src/widgets/kernel/qstandardgestures.cpp index 53e5d091fa..6656903e70 100644 --- a/src/widgets/kernel/qstandardgestures.cpp +++ b/src/widgets/kernel/qstandardgestures.cpp @@ -38,7 +38,6 @@ #include "qwidget.h" #include "qabstractscrollarea.h" #include -#include #include "qdebug.h" #ifndef QT_NO_GESTURES @@ -68,26 +67,8 @@ static QPointF panOffset(const QList &touchPoints, int return result / qreal(count); } -// ### fixme: Remove this -// Use single finger pan to scroll QPlainTextEdit/QTextEdit -// by changing the number of pan points to 1 for these classes. -// This used to be Qt 4's behavior on Windows which was achieved using native -// Windows gesture recognizers for these classes. -// The other classes inheriting QScrollArea still use standard 2 finger pan. -// In the long run, they should also use single finger pan to -// scroll on touch screens, however, this requires a distinct Tap&Hold-followed-by-pan -// type gesture to avoid clashes with item view selection and DnD. - -static inline int panTouchPoints(const QTouchEvent *event, const QObject *object, - int defaultTouchPoints) -{ - return event->device()->type() == QTouchDevice::TouchScreen && object && object->parent() - && (object->parent()->inherits("QPlainTextEdit") || object->parent()->inherits("QTextEdit")) - ? 1 : defaultTouchPoints; -} - QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, - QObject *object, + QObject *, QEvent *event) { QPanGesture *q = static_cast(state); @@ -100,7 +81,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, result = QGestureRecognizer::MayBeGesture; QTouchEvent::TouchPoint p = ev->touchPoints().at(0); d->lastOffset = d->offset = QPointF(); - d->pointCount = panTouchPoints(ev, object, m_pointCount); + d->pointCount = m_pointCount; break; } case QEvent::TouchEnd: { From 36818ae9ef7eba9f93ba33c6ad21a333956c08f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 2 Dec 2014 18:31:38 +0100 Subject: [PATCH 64/99] Collate calls to updateTextureFilter in updateBrushTexture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id13d5bc122c4f9cc8f44ff82df345a50f2944118 Reviewed-by: Laszlo Agocs Reviewed-by: Tor Arne Vestbø --- src/gui/opengl/qopenglpaintengine.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 503e869a36..b18d2cc42a 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -202,12 +202,13 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); funcs.glBindTexture(GL_TEXTURE_2D, texId); + GLenum wrapMode = GL_CLAMP_TO_EDGE; if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient) - updateTextureFilter(GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); + wrapMode = GL_REPEAT; else if (g->spread() == QGradient::ReflectSpread) - updateTextureFilter(GL_MIRRORED_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); - else - updateTextureFilter(GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform); + wrapMode = GL_MIRRORED_REPEAT; + + updateTextureFilter(wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style == Qt::TexturePattern) { currentBrushImage = currentBrush.textureImage(); From 33739ccb95b5341bbf8173350a66a766277e9bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 28 Nov 2014 15:18:12 +0000 Subject: [PATCH 65/99] Windows: Bring FreeType rendering up to par with other platforms The text was very washed out, almost white on small font sizes. This ifdef was introduced to cater for GDI differences between Vista and Pre-Vista, it's GDI specific, nothing to do with FreeType. Text now looks good, and md5sum of the rendering is the same as on Linux. Task-number: QTBUG-42564 Change-Id: I2e06b83b80df093331454fe1b780d26462db597d Reviewed-by: Konstantin Ritt Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qdrawhelper.cpp | 7 +++++-- src/plugins/platforms/windows/qwindowsfontdatabase.cpp | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 6482cc50f7..9c1b2e707d 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6219,6 +6219,8 @@ static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int } #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +Q_GUI_EXPORT bool qt_needs_a8_gamma_correction = false; + static inline void grayBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uint *gamma, const uchar *invgamma) { // Do a gammacorrected gray alphablend... @@ -6266,6 +6268,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, int sb = gamma[qBlue(color)]; bool opaque_src = (qAlpha(color) == 255); + bool doGrayBlendPixel = opaque_src && qt_needs_a8_gamma_correction; #endif if (!clip) { @@ -6280,7 +6283,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, dest[i] = c; } else { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && opaque_src + if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[i]) == 255) { grayBlendPixel(dest+i, coverage, sr, sg, sb, gamma, invgamma); } else @@ -6321,7 +6324,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, dest[xp] = c; } else { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && opaque_src + if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[xp]) == 255) { grayBlendPixel(dest+xp, coverage, sr, sg, sb, gamma, invgamma); } else diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 449453cf28..f15783490e 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1062,6 +1062,9 @@ QWindowsFontEngineDataPtr sharedFontData() } #endif // QT_NO_THREAD +#ifndef Q_OS_WINCE +extern Q_GUI_EXPORT bool qt_needs_a8_gamma_correction; +#endif QWindowsFontDatabase::QWindowsFontDatabase() { // Properties accessed by QWin32PrintEngine (Qt Print Support) @@ -1075,6 +1078,9 @@ QWindowsFontDatabase::QWindowsFontDatabase() qCDebug(lcQpaFonts) << __FUNCTION__ << "Clear type: " << data->clearTypeEnabled << "gamma: " << data->fontSmoothingGamma; } +#ifndef Q_OS_WINCE + qt_needs_a8_gamma_correction = true; +#endif } QWindowsFontDatabase::~QWindowsFontDatabase() From 1edc7554deb557e3045076336e4b036109906db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Wed, 26 Nov 2014 10:12:55 +0000 Subject: [PATCH 66/99] FreeType: Fix font rendering with fonts with embedded bitmaps Only reproduced with Windows font Calibri. This font has both outline (vector) and bitmap glyphs. QFontEngine_FT has an hack to get metrics from EBLC table, but this might fail, resulting in a 0 ascender and descender, meaning QFontMetrics::height() will be 0, meaning totally broken text. This patch checks for that failure, and fallbacks to the outline metrics instead of the bitmap ones. Task-number: QTBUG-42898 Change-Id: If33fc3404d0c7f84557f8c4a5ae71b30f78d60a7 Reviewed-by: Konstantin Ritt Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index e2c8f905b9..0a8be67e43 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -762,8 +762,10 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, face->face_flags &= ~FT_FACE_FLAG_SCALABLE; FT_Select_Size(face, i); - metrics.ascender = face->size->metrics.ascender; - metrics.descender = face->size->metrics.descender; + if (face->size->metrics.ascender + face->size->metrics.descender > 0) { + metrics.ascender = face->size->metrics.ascender; + metrics.descender = face->size->metrics.descender; + } FT_Set_Char_Size(face, xsize, ysize, 0, 0); face->face_flags |= FT_FACE_FLAG_SCALABLE; From 247607a1af0253576b3330075fdcbb3d5c4cca00 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 26 Nov 2014 23:12:01 +0100 Subject: [PATCH 67/99] Don't make invalid assumptions about memcmp() In qtranslator.cpp match() Task-number: QTBUG-39757 Change-Id: I49e3ccc0ce900564bbe14609bfda47688382d5f3 Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qtranslator.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index dc56ad88a1..22bf8fdc21 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -86,13 +86,13 @@ static const uchar magic[MagicLength] = { 0xcd, 0x21, 0x1c, 0xbf, 0x60, 0xa1, 0xbd, 0xdd }; -static bool match(const uchar* found, const char* target, uint len) +static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen) { // catch the case if \a found has a zero-terminating symbol and \a len includes it. // (normalize it to be without the zero-terminating symbol) - if (len > 0 && found[len-1] == '\0') - --len; - return (memcmp(found, target, len) == 0 && target[len] == '\0'); + if (foundLen > 0 && found[foundLen-1] == '\0') + --foundLen; + return ((targetLen == foundLen) && memcmp(found, target, foundLen) == 0); } static void elfHash_continue(const char *name, uint &h) @@ -877,6 +877,9 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context, { const uchar *tn = 0; uint tn_length = 0; + const uint sourceTextLen = strlen(sourceText); + const uint contextLen = strlen(context); + const uint commentLen = strlen(comment); for (;;) { uchar tag = 0; @@ -903,7 +906,7 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context, case Tag_SourceText: { quint32 len = read32(m); m += 4; - if (!match(m, sourceText, len)) + if (!match(m, len, sourceText, sourceTextLen)) return QString(); m += len; } @@ -911,7 +914,7 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context, case Tag_Context: { quint32 len = read32(m); m += 4; - if (!match(m, context, len)) + if (!match(m, len, context, contextLen)) return QString(); m += len; } @@ -919,7 +922,7 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context, case Tag_Comment: { quint32 len = read32(m); m += 4; - if (*m && !match(m, comment, len)) + if (*m && !match(m, len, comment, commentLen)) return QString(); m += len; } @@ -969,11 +972,12 @@ QString QTranslatorPrivate::do_translate(const char *context, const char *source return QString(); c = contextArray + (2 + (hTableSize << 1) + (off << 1)); + const int contextLen = strlen(context); for (;;) { quint8 len = read8(c++); if (len == 0) return QString(); - if (match(c, context, len)) + if (match(c, len, context, contextLen)) break; c += len; } From 50d29a695adc783a49de2c980d55663e27e9da35 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 2 Dec 2014 14:19:02 +0100 Subject: [PATCH 68/99] Windows: Handle WM_WINDOWPOSCHANGING during window creation. Fix warnings: QWindowsContext::windowsProc: No Qt Window found for event 0x46 (WM_WINDOWPOSCHANGING), hwnd=0x0xde0408. occurring when using Active X controls. Factor out message handling to a static function which can be used during window creation when QWindowsWindow does not yet exist. Task-number: QTBUG-36318 Change-Id: I3ce56fd377e3392b0dd22d3d26a7048065380f13 Reviewed-by: Oliver Wolff --- .../platforms/windows/qwindowscontext.cpp | 3 +++ src/plugins/platforms/windows/qwindowswindow.cpp | 16 ++++++++++------ src/plugins/platforms/windows/qwindowswindow.h | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 4f1a1a375f..13a3d044a0 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -952,6 +952,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, return true; case QtWindows::CalculateSize: return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result); + case QtWindows::GeometryChangingEvent: + return QWindowsWindow::handleGeometryChangingMessage(&msg, d->m_creationContext->window, + d->m_creationContext->margins + d->m_creationContext->customMargins); default: break; } diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 0b4bb9b09d..48ffd84f98 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -801,7 +801,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, const QRect &geometry, const QMargins &cm, DWORD style_, DWORD exStyle_) : - geometryHint(w, cm), style(style_), exStyle(exStyle_), + geometryHint(w, cm), window(w), style(style_), exStyle(exStyle_), requestedGeometry(geometry), obtainedGeometry(geometry), margins(QWindowsGeometryHint::frame(style, exStyle)), customMargins(cm), frameX(CW_USEDEFAULT), frameY(CW_USEDEFAULT), @@ -1783,16 +1783,14 @@ void QWindowsWindow::propagateSizeHints() qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); } -bool QWindowsWindow::handleGeometryChanging(MSG *message) const +bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp) { #ifndef Q_OS_WINCE - QWindow *qWin = window(); - if (!qWin->isTopLevel()) + if (!qWindow->isTopLevel()) // Implement hasHeightForWidth(). return false; WINDOWPOS *windowPos = reinterpret_cast(message->lParam); if ((windowPos->flags & (SWP_NOCOPYBITS | SWP_NOSIZE))) return false; - const QMargins marginsDp = frameMarginsDp(); const QRect suggestedFrameGeometryDp(windowPos->x, windowPos->y, windowPos->cx, windowPos->cy); const qreal factor = QWindowsScaling::factor(); @@ -1800,7 +1798,7 @@ bool QWindowsWindow::handleGeometryChanging(MSG *message) const const QRectF suggestedGeometry = QRectF(QPointF(suggestedGeometryDp.topLeft()) / factor, QSizeF(suggestedGeometryDp.size()) / factor); const QRectF correctedGeometryF = - qt_window_private(qWin)->closestAcceptableGeometry(suggestedGeometry); + qt_window_private(const_cast(qWindow))->closestAcceptableGeometry(suggestedGeometry); if (!correctedGeometryF.isValid()) return false; const QRect correctedFrameGeometryDp @@ -1820,6 +1818,12 @@ bool QWindowsWindow::handleGeometryChanging(MSG *message) const #endif } +bool QWindowsWindow::handleGeometryChanging(MSG *message) const +{ + const QMargins marginsDp = window()->isTopLevel() ? frameMarginsDp() : QMargins(); + return QWindowsWindow::handleGeometryChangingMessage(message, window(), marginsDp); +} + QMargins QWindowsWindow::frameMarginsDp() const { // Frames are invalidated by style changes (window state, flags). diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index a63a9f56e3..9822ebce45 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -84,6 +84,7 @@ struct QWindowCreationContext #endif QWindowsGeometryHint geometryHint; + const QWindow *window; DWORD style; DWORD exStyle; QRect requestedGeometry; @@ -183,6 +184,7 @@ public: void windowEvent(QEvent *event); void propagateSizeHints() Q_DECL_OVERRIDE; + static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp); bool handleGeometryChanging(MSG *message) const; QMargins frameMarginsDp() const; QMargins frameMargins() const Q_DECL_OVERRIDE { return frameMarginsDp() / QWindowsScaling::factor(); } From 8860522d7e8d76c6b59a593a329a6bfa754cb432 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 1 Dec 2014 10:05:42 +0100 Subject: [PATCH 69/99] QDockWidget: Prevent repetitive unplugging of floating dock widgets. When calling QDockWidget::setTitleBarWidget() from within signal QDockWidget::topLevelChanged(), a nested call of QDockWidgetPrivate::setWindowState(unplug=true) is triggered, leaving it with Qt::X11BypassWindowManagerHint set and thus invisible/off screen. Force the unplug parameter to false if the widget is already in floating state. Task-number: QTBUG-42818 Task-number: QTBUG-38964 Change-Id: I6aff61e4ee1501f5db281566b66db66c19351410 Reviewed-by: Gatis Paeglis --- src/widgets/widgets/qdockwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 4be133e277..93e6131ab9 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1009,6 +1009,8 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect } bool wasFloating = q->isFloating(); + if (wasFloating) // Prevent repetitive unplugging from nested invocations (QTBUG-42818) + unplug = false; bool hidden = q->isHidden(); if (q->isVisible()) From 82d54a6593321d5aaae223ed8aba34847725c942 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 3 Dec 2014 09:41:10 +0100 Subject: [PATCH 70/99] Stabilize tst_QWindowContainer. Fix window/widget leaks, observe available geometry. Change-Id: I19784d34a62c6e05dbc403852364cfb5e4d12dd5 Reviewed-by: Oliver Wolff --- .../qwindowcontainer/tst_qwindowcontainer.cpp | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp index 61ec15a135..1be3f8a4ef 100644 --- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp +++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include class Window : public QWindow @@ -65,6 +67,10 @@ public: class tst_QWindowContainer: public QObject { Q_OBJECT + +public: + tst_QWindowContainer() : m_availableGeometry(QGuiApplication::primaryScreen()->availableGeometry()) {} + private slots: void testShow(); void testPositionAndSize(); @@ -75,14 +81,22 @@ private slots: void testActivation(); void testAncestorChange(); void testDockWidget(); + void cleanup(); + +private: + const QRect m_availableGeometry; }; - +void tst_QWindowContainer::cleanup() +{ + QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); +} void tst_QWindowContainer::testShow() { QWidget root; - root.setGeometry(100, 100, 400, 400); + root.setWindowTitle(QTest::currentTestFunction()); + root.setGeometry(m_availableGeometry.x() + 100, m_availableGeometry.y() + 100, 400, 400); Window *window = new Window(); QWidget *container = QWidget::createWindowContainer(window, &root); @@ -99,14 +113,15 @@ void tst_QWindowContainer::testShow() void tst_QWindowContainer::testPositionAndSize() { QWindow *window = new QWindow(); - window->setGeometry(300, 400, 500, 600); + window->setGeometry(m_availableGeometry.x() + 300, m_availableGeometry.y() + 400, 500, 600); - QWidget *container = QWidget::createWindowContainer(window); + QScopedPointer container(QWidget::createWindowContainer(window)); + container->setWindowTitle(QTest::currentTestFunction()); container->setGeometry(50, 50, 200, 200); container->show(); - QVERIFY(QTest::qWaitForWindowExposed(container)); + QVERIFY(QTest::qWaitForWindowExposed(container.data())); QCOMPARE(window->x(), 0); QCOMPARE(window->y(), 0); @@ -120,11 +135,12 @@ void tst_QWindowContainer::testExposeObscure() { Window *window = new Window(); - QWidget *container = QWidget::createWindowContainer(window); - container->setGeometry(50, 50, 200, 200); + QScopedPointer container(QWidget::createWindowContainer(window)); + container->setWindowTitle(QTest::currentTestFunction()); + container->setGeometry(m_availableGeometry.x() + 50, m_availableGeometry.y() + 50, 200, 200); container->show(); - QVERIFY(QTest::qWaitForWindowExposed(container)); + QVERIFY(QTest::qWaitForWindowExposed(container.data())); QVERIFY(QTest::qWaitForWindowExposed(window)); QVERIFY(window->numberOfExposes > 0); @@ -173,12 +189,13 @@ void tst_QWindowContainer::testBehindTheScenesDeletion() void tst_QWindowContainer::testActivation() { QWidget root; + root.setWindowTitle(QTest::currentTestFunction()); QWindow *window = new QWindow(); QWidget *container = QWidget::createWindowContainer(window, &root); container->setGeometry(100, 100, 200, 100); - root.setGeometry(100, 100, 400, 300); + root.setGeometry(m_availableGeometry.x() + 100, m_availableGeometry.y() + 100, 400, 300); root.show(); root.activateWindow(); @@ -212,14 +229,15 @@ void tst_QWindowContainer::testActivation() void tst_QWindowContainer::testUnparenting() { QWindow *window = new QWindow(); - QWidget *container = QWidget::createWindowContainer(window); - container->setGeometry(100, 100, 200, 100); + QScopedPointer container(QWidget::createWindowContainer(window)); + container->setWindowTitle(QTest::currentTestFunction()); + container->setGeometry(m_availableGeometry.x() + 100, m_availableGeometry.y() + 100, 200, 100); window->setParent(0); container->show(); - QVERIFY(QTest::qWaitForWindowExposed(container)); + QVERIFY(QTest::qWaitForWindowExposed(container.data())); // Window should not be made visible by container.. QVERIFY(!window->isVisible()); @@ -228,10 +246,12 @@ void tst_QWindowContainer::testUnparenting() void tst_QWindowContainer::testAncestorChange() { QWidget root; + root.setWindowTitle(QStringLiteral("Root ") + QTest::currentTestFunction()); QWidget *left = new QWidget(&root); QWidget *right = new QWidget(&root); - root.setGeometry(0, 0, 200, 100); + + root.setGeometry(m_availableGeometry.x() + 50, m_availableGeometry.y() + 50, 200, 100); left->setGeometry(0, 0, 100, 100); right->setGeometry(100, 0, 100, 100); @@ -257,6 +277,7 @@ void tst_QWindowContainer::testAncestorChange() QCOMPARE(window->geometry(), QRect(100, 0, 100, 100)); QWidget *newRoot = new QWidget(&root); + newRoot->setWindowTitle(QStringLiteral("newRoot ") + QTest::currentTestFunction()); newRoot->setGeometry(50, 50, 200, 200); right->setParent(newRoot); // Root @@ -270,7 +291,8 @@ void tst_QWindowContainer::testAncestorChange() QCOMPARE(window->geometry(), QRect(100, 0, 100, 100)); newRoot->setParent(0); - newRoot->setGeometry(100, 100, 200, 200); + QScopedPointer newRootGuard(newRoot); + newRoot->setGeometry(m_availableGeometry.x() + 100, m_availableGeometry.y() + 100, 200, 200); newRoot->show(); QVERIFY(QTest::qWaitForWindowExposed(newRoot)); QCOMPARE(newRoot->windowHandle(), window->parent()); @@ -285,9 +307,11 @@ void tst_QWindowContainer::testAncestorChange() void tst_QWindowContainer::testDockWidget() { QMainWindow mainWindow; + mainWindow.setWindowTitle(QTest::currentTestFunction()); mainWindow.resize(200, 200); + mainWindow.move(m_availableGeometry.center() - QPoint(100, 100)); - QDockWidget *dock = new QDockWidget(); + QDockWidget *dock = new QDockWidget(QStringLiteral("Dock ") + QTest::currentTestFunction()); QWindow *window = new QWindow(); QWidget *container = QWidget::createWindowContainer(window); dock->setWidget(container); From 30772c7270aeae784bebe20fe68fad93ea332fb0 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Dec 2014 17:20:48 +0100 Subject: [PATCH 71/99] Fix loading of web fonts with broken hinting bytecode The Fira Sans font by the Mozilla Foundation has bytecode that goes into an infinite loop. Fortunately FreeType catches the case, but we fail to render any glyphs and spends too long trying the bytecode on every glyph. This patch instead switches the font to auto-hinting when this error is encountered. Task-number: QTBUG-41034 Change-Id: Icd044b41396a06fb435bc189cdbd71d703107de6 Reviewed-by: Konstantin Ritt Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft.cpp | 7 +++++++ src/gui/text/qfontengine_ft_p.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 0a8be67e43..8b6c9a192c 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -891,6 +891,13 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, // this is an error in the bytecode interpreter, just try to run without it load_flags |= FT_LOAD_FORCE_AUTOHINT; err = FT_Load_Glyph(face, glyph, load_flags); + } else if (err == FT_Err_Execution_Too_Long) { + // This is an error in the bytecode, probably a web font made by someone who + // didn't test bytecode hinting at all so disable for it for all glyphs. + qWarning("load glyph failed due to broken hinting bytecode in font, switching to auto hinting"); + default_load_flags |= FT_LOAD_FORCE_AUTOHINT; + load_flags |= FT_LOAD_FORCE_AUTOHINT; + err = FT_Load_Glyph(face, glyph, load_flags); } if (err != FT_Err_Ok) { qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph); diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 1894d25d70..5b397e0034 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -293,7 +293,7 @@ private: protected: QFreetypeFace *freetype; - int default_load_flags; + mutable int default_load_flags; HintStyle default_hint_style; bool antialias; bool transform; From 5367fa356233da4c0f28172a8f817791525f5457 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 4 Dec 2014 15:21:28 +0200 Subject: [PATCH 72/99] winrt: Fix window resize The fixed-size EGL display must be updated on PC as well as Windows Phone. Task-number: QTBUG-43112 Change-Id: I0ba90370b67e8c065843e5754579e341b647266d Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 612a50f6b7..37a3ff3d63 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -1081,12 +1081,14 @@ HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs * d->logicalSize = logicalSize; if (d->eglDisplay) { const QRect newGeometry = geometry(); -#ifdef Q_OS_WINPHONE // Resize the EGL window - const int width = newGeometry.width() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation ? -1 : 1); - const int height = newGeometry.height() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation ? -1 : 1); + int width = newGeometry.width(); + int height = newGeometry.height(); +#ifdef Q_OS_WINPHONE // Windows Phone can pass in a negative size to provide orientation information + width *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation) ? -1 : 1; + height *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation) ? -1 : 1; +#endif eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_WIDTH, width); eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_HEIGHT, height); -#endif QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry); QPlatformScreen::resizeMaximizedWindows(); handleExpose(); From 2df293267ee3cdc111191dad2f3551d9fa05c88d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 27 Nov 2014 12:02:41 +0100 Subject: [PATCH 73/99] Windows: Skip calculating margins for Qt::FramelessWindowHint. Always skip calculating style-dependent margins for windows claimed to be frameless by Qt. This allows users to remove the margins by handling WM_NCCALCSIZE with WS_THICKFRAME set to ensure Areo snap still works. Task-number: QTBUG-40578 Change-Id: Ice7771df8fbf59b370568219d10c12ce04e99628 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 48ffd84f98..5768800947 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1831,7 +1831,12 @@ QMargins QWindowsWindow::frameMarginsDp() const // event sequences, introduce a dirty flag mechanism to be able // to cache results. if (testFlag(FrameDirty)) { - m_data.frame = QWindowsGeometryHint::frame(style(), exStyle()); + // Always skip calculating style-dependent margins for windows claimed to be frameless. + // This allows users to remove the margins by handling WM_NCCALCSIZE with WS_THICKFRAME set + // to ensure Areo snap still works (QTBUG-40578). + m_data.frame = window()->flags() & Qt::FramelessWindowHint + ? QMargins(0, 0, 0, 0) + : QWindowsGeometryHint::frame(style(), exStyle()); clearFlag(FrameDirty); } return m_data.frame + m_data.customMargins; From e682ea6f782d3bb4caa4f2bd0e3be47cbe064f4f Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 5 Nov 2014 11:44:00 +0100 Subject: [PATCH 74/99] Draw the accessibility focus rectangle properly Previously, the accessibility focus rectangle was only visible when it overlapped with the m_editText View of QtActivityDelegate. The reason for this is not completely verified, but this is the most likely reason: * The SurfaceView and QtLayout (ViewGroup) does not do any drawing themselves. Due to this their default value of the View::willNotDraw property is true. Because of this Android might assume there is no content for the focus indicator to surround. (This was verified with setting the willNotDraw property to false on the accessibility view); * Another possible reason could be that overlays does not work for SurfaceView. It is documented that overlays does not work for SurfaceViews, so therefore it tried to use the overlay of another view. For some reason it picked the m_editText overlay instead of the QtLayout overlay. See here about overlay: http://developer.android.com/reference/android/view/View.html#getOverlay() The solution is to add another View that covers the whole screen, which will be used solely by android to draw the accessibility focus indicator. In addition, we change the QtAccessibilityDelegate to no longer have the SurfaceView as a host, but have the m_accView as a host (the host can be freely changed, since all accessibility nodes are virtualized through the delegate anyway) For the record, this will be the current ordering of views in QtLayout: (back-to-front order): Qty Default Qty * Surface View(s) >= 1 1 * Accessibility View == 1 1 * Native View(s) >= 0 1 * m_editText View == 1 1 where the m_editText migth be interleaved among the Native Views. [ChangeLog][Android][Accessibility] Fixed an issue where the accessibility focus rectangle was not drawn properly Task-number: QTBUG-38869 Change-Id: I64d6b6ec45b27d0d93ac9dd840de764c18c55d04 Reviewed-by: Christian Stromme --- .../qt5/android/QtActivityDelegate.java | 45 +++++++++++++++++-- .../org/qtproject/qt5/android/QtSurface.java | 20 --------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 3af8a7aa5d..97a632972b 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -80,6 +80,7 @@ import java.io.File; import java.io.FileWriter; import java.io.InputStreamReader; import java.io.IOException; +import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; @@ -126,6 +127,7 @@ public class QtActivityDelegate private boolean m_quitApp = true; private Process m_debuggerProcess = null; // debugger process private View m_dummyView = null; + private View m_accView = null; private boolean m_keyboardIsVisible = false; public boolean m_backKeyPressedSent = false; private long m_showHideTimeStamp = System.nanoTime(); @@ -1178,10 +1180,48 @@ public class QtActivityDelegate // Native views are always inserted in the end of the stack (i.e., on top). // All other views are stacked based on the order they are created. - final int index = getSurfaceCount(); - m_layout.addView(surface, index); + final int surfaceCount = getSurfaceCount(); + m_layout.addView(surface, surfaceCount); m_surfaces.put(id, surface); + + // Initialize Accessibility + // The accessibility code depends on android API level 16, so dynamically resolve it + if (android.os.Build.VERSION.SDK_INT >= 16) { + if (m_accView == null) { + try { + View accView = new View(m_activity); + accView.setId(View.NO_ID); + + // ### Keep this for debugging for a while. It allows us to visually see that our View + // ### is on top of the surface(s) + // ColorDrawable color = new ColorDrawable(0x80ff8080); //0xAARRGGBB + // accView.setBackground(color); + + final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; + Class qtDelegateClass = Class.forName(a11yDelegateClassName); + Constructor constructor = qtDelegateClass.getConstructor(Class.forName("android.view.View")); + Object accessibilityDelegate = constructor.newInstance(accView); + + Class a11yDelegateClass = Class.forName("android.view.View$AccessibilityDelegate"); + Method setDelegateMethod = accView.getClass().getMethod("setAccessibilityDelegate", a11yDelegateClass); + setDelegateMethod.invoke(accView, accessibilityDelegate); + + // if all is fine, add it to the layout + m_layout.addView(accView, surfaceCount + 1, + new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + + m_accView = accView; + } catch (ClassNotFoundException e) { + // Class not found is fine since we are compatible with Android API < 16, but the function will + // only be available with that API level. + } catch (Exception e) { + // Unknown exception means something went wrong. + Log.w("Qt A11y", "Unknown exception: " + e.toString()); + } + } + } + } public void setSurfaceGeometry(int id, int x, int y, int w, int h) { @@ -1225,7 +1265,6 @@ public class QtActivityDelegate return m_surfaces.size(); } - public void bringChildToFront(int id) { View view = m_surfaces.get(id); diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java index ca3f20f11b..34fc31b222 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java @@ -88,26 +88,6 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback public void surfaceCreated(SurfaceHolder holder) { QtNative.setSurface(getId(), holder.getSurface(), getWidth(), getHeight()); - // Initialize Accessibility - // The accessibility code depends on android API level 16, so dynamically resolve it - if (android.os.Build.VERSION.SDK_INT >= 16) { - try { - final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; - Class qtDelegateClass = Class.forName(a11yDelegateClassName); - Constructor constructor = qtDelegateClass.getConstructor(Class.forName("android.view.View")); - m_accessibilityDelegate = constructor.newInstance(this); - - Class a11yDelegateClass = Class.forName("android.view.View$AccessibilityDelegate"); - Method setDelegateMethod = this.getClass().getMethod("setAccessibilityDelegate", a11yDelegateClass); - setDelegateMethod.invoke(this, m_accessibilityDelegate); - } catch (ClassNotFoundException e) { - // Class not found is fine since we are compatible with Android API < 16, but the function will - // only be available with that API level. - } catch (Exception e) { - // Unknown exception means something went wrong. - Log.w("Qt A11y", "Unknown exception: " + e.toString()); - } - } } @Override From c9f9eddc0f595b0382b070e3113122398c13876e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 4 Dec 2014 13:50:46 +0100 Subject: [PATCH 75/99] Add missing documentation for some variables Task-number: QTBUG-5109 Change-Id: I38e12b957cad099d2f815a0d192cf3ab9fee52e5 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/doc/src/qmake-manual.qdoc | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index cdac770c9d..ed76e9cc61 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1195,6 +1195,12 @@ Please see \l{Setting the Application Icon}{the application icon documentation} for more information. + \target IDLSOURCES + \section1 IDLSOURCES + + This variable is used only on Windows for the Visual Studio project generation to + put the specified files in the Generated Files folder. + \target INCLUDEPATH \section1 INCLUDEPATH @@ -1304,6 +1310,12 @@ handled internally by qmake and rarely needs to be modified. + \target MSVCPROJ_* + \section1 MSVCPROJ_* + + These variables are handled internally by qmake and should not be modified + or utilized. + \target MOC_DIR \section1 MOC_DIR @@ -2110,6 +2122,38 @@ variable is typically handled by qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \target QMAKE_TARGET_COMPANY + \section1 QMAKE_TARGET_COMPANY + + Windows only. Specifies the company for the project target, this is used where + applicable for putting the company name in the application's properties. This is + only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE + variables are not set. + + \target QMAKE_TARGET_DESCRIPTION + \section1 QMAKE_TARGET_DESCRIPTION + + Windows only. Specifies the description for the project target, this is used where + applicable for putting the description in the application's properties. This is only + utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables + are not set. + + \target QMAKE_TARGET_COPYRIGHT + \section1 QMAKE_TARGET_COPYRIGHT + + Windows only. Specifies the copyright information for the project target, this is used where + applicable for putting the copyright information in the application's properties. This is only + utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables + are not set. + + \target QMAKE_TARGET_PRODUCT + \section1 QMAKE_TARGET_PRODUCT + + Windows only. Specifies the product for the project target, this is used where + applicable for putting the product in the application's properties. This is only utilized if + the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables + are not set. + \section1 QT Specifies the Qt modules that are used by your project. @@ -2209,6 +2253,26 @@ qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \target RC_CODEPAGE + \section1 RC_CODEPAGE + + Windows only. Specifies the codepage that should be specified in a generated rc file. This is + only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables + are not set. + + \target RC_ICONS + \section1 RC_ICONS + + Windows only. Specifies the icons that should be included into a generated rc file, this + is only utilized if the RC_FILE and RES_FILE variable are not set. + + \target RC_LANG + \section1 RC_LANG + + Windows only. Specifies the language that should be specified in a generated rc file. This is + only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables + are not set. + \section1 RC_INCLUDEPATH Specifies include paths that are passed to the Windows Resource Compiler. From 8920200c97f0a514397e039ba74588127163c2b9 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 3 Dec 2014 15:02:34 +0100 Subject: [PATCH 76/99] QColumnView: don't set an invalid index as the current one When any item in a QColumnView gets selected, the next column gets normally set to show the children of that index. When we are on a leaf of a tree model, the next column will have an invalid root index, yet we set that root index as the "current index" for the current column. Due to the special handling for invalid indexes in QAbstractItemView::setCurrentIndex, this ends up breaking the current item AND the current selection in that column. Further clicks inside the column for instance trigger the entire column (up to the clicked index) to get selected, because of that broken first setCurrentIndex. The simple fix is to stop doing that when the next column has an invalid root index. Task-number: QTBUG-2329 Change-Id: Icd10c0b958e25cd868536e1315561787977b68bd Reviewed-by: David Faure Reviewed-by: Joerg Bornemann --- src/widgets/itemviews/qcolumnview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp index 1c60d50922..3234e1e832 100644 --- a/src/widgets/itemviews/qcolumnview.cpp +++ b/src/widgets/itemviews/qcolumnview.cpp @@ -976,8 +976,11 @@ void QColumnViewPrivate::_q_changeCurrentColumn() QAbstractItemView *view = columns.at(i); view->setSelectionModel(replacementSelectionModel); view->setFocusPolicy(Qt::NoFocus); - if (columns.size() > i + 1) - view->setCurrentIndex(columns.at(i+1)->rootIndex()); + if (columns.size() > i + 1) { + const QModelIndex newRootIndex = columns.at(i + 1)->rootIndex(); + if (newRootIndex.isValid()) + view->setCurrentIndex(newRootIndex); + } break; } } From 451668d2524a62845f84cfa8f7297037657972a8 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 7 Nov 2014 15:13:09 +0100 Subject: [PATCH 77/99] WinRT: Only set keepalive socket option in certain socket states The keepalive socket can only be set if the socket is not connected (see http://msdn.microsoft.com/en-us/library/ie/windows.networking.sockets.streamsocketcontrol.keepalive) Task-number: QTBUG-38623 Change-Id: Ia40dc66f071a8109538e4be7a8f420de81d5be8d Reviewed-by: Alex Trotsenko Reviewed-by: Leena Miettinen Reviewed-by: Andrew Knight --- src/network/socket/qabstractsocket.cpp | 3 +++ src/network/socket/qnativesocketengine_winrt.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index e843597a96..604214ce8e 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1882,6 +1882,9 @@ bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState \since 4.6 Sets the given \a option to the value described by \a value. + \note On Windows Runtime, QAbstractSocket::KeepAliveOption must be set + before the socket is connected. + \sa socketOption() */ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index cacfe11fea..e60840d651 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -998,7 +998,8 @@ bool QNativeSocketEnginePrivate::setOption(QAbstractSocketEngine::SocketOption o return true; } case QAbstractSocketEngine::KeepAliveOption: { - if (socketType == QAbstractSocket::UdpSocket) + if (socketType == QAbstractSocket::UdpSocket + || socketState != QAbstractSocket::UnconnectedState) return false; boolean keepAlive = v; From 0fa5310425665394e0d4ff4b6747b1290dcef7d5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 4 Dec 2014 12:38:08 +0100 Subject: [PATCH 78/99] Android: Enable -fno-builtin-memmove in arm builds On some devices, a miscompilation of libc.so has caused it to return the wrong value. Instead of returning the dest pointer, it returns dest + n. When compiling with optimizations turned on, gcc may use this return value for subsequent accesses to dest after the memmove() call, causing memory corruption. This caused problems e.g. in QVector::prepend() which would overwrite the whole vector with the new value. Setting -fno-builtin-memmove disables the optimization and works around this bug with very little risk or impact. More information in: http://code.google.com/p/android/issues/detail?id=81692 [ChangeLog][Android] Fixed device-specific crash on Samsung Galaxy Tab 3 Lite 7" and some other devices. Task-number: QTBUG-34984 Change-Id: I0c1347149eb5fe1c298758fe7de81aca4137f652 Reviewed-by: Simon Hausmann --- mkspecs/android-g++/qmake.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index e510c2d93c..b0fea50206 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -102,9 +102,9 @@ ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_ QMAKE_CC = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-gcc equals(ANDROID_TARGET_ARCH, armeabi-v7a): \ - QMAKE_CFLAGS = -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack + QMAKE_CFLAGS = -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove else: equals(ANDROID_TARGET_ARCH, armeabi): \ - QMAKE_CFLAGS = -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack + QMAKE_CFLAGS = -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove else: equals(ANDROID_TARGET_ARCH, x86): \ QMAKE_CFLAGS = -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack else: equals(ANDROID_TARGET_ARCH, mips): \ From 3f1cb33d35ef36814ffb757905ba670e770b64bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 2 Dec 2014 18:38:06 +0100 Subject: [PATCH 79/99] Reformat QOpenGL2PaintEngineExPrivate a bit to make it easier to refactor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I99f7192008ae8ea3a16f5300e5e4ebdde50847af Reviewed-by: Laszlo Agocs Reviewed-by: Tor Arne Vestbø --- src/gui/opengl/qopenglpaintengine.cpp | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index b18d2cc42a..834aed9142 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -199,15 +199,14 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() // for opacity to the cache. GLuint texId = QOpenGL2GradientCache::cacheForContext(ctx)->getBuffer(*g, 1.0); - funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); - funcs.glBindTexture(GL_TEXTURE_2D, texId); - GLenum wrapMode = GL_CLAMP_TO_EDGE; if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient) wrapMode = GL_REPEAT; else if (g->spread() == QGradient::ReflectSpread) wrapMode = GL_MIRRORED_REPEAT; + funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); + funcs.glBindTexture(GL_TEXTURE_2D, texId); updateTextureFilter(wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style == Qt::TexturePattern) { @@ -228,6 +227,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, currentBrushImage); updateTextureFilter(wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); + textureInvertedY = false; } brushTextureDirty = false; @@ -1384,16 +1384,14 @@ void QOpenGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixma d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); GLuint id = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, pixmap); - - QOpenGLRect srcRect(src.left(), src.top(), src.right(), src.bottom()); + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, id); bool isBitmap = pixmap.isQBitmap(); bool isOpaque = !isBitmap && !pixmap.hasAlpha(); - d->updateTextureFilter(GL_CLAMP_TO_EDGE, - state()->renderHints & QPainter::SmoothPixmapTransform, id); - d->shaderManager->setSrcPixelType(isBitmap ? QOpenGLEngineShaderManager::PatternSrc : QOpenGLEngineShaderManager::ImageSrc); + + QOpenGLRect srcRect(src.left(), src.top(), src.right(), src.bottom()); d->drawTexture(dest, srcRect, pixmap.size(), isOpaque, isBitmap); } @@ -1432,9 +1430,7 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); GLuint id = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, image, bindOption); - - d->updateTextureFilter(GL_CLAMP_TO_EDGE, - state()->renderHints & QPainter::SmoothPixmapTransform, id); + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, id); d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel()); } @@ -1477,13 +1473,13 @@ bool QOpenGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, co d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); d->funcs.glBindTexture(GL_TEXTURE_2D, textureId); + d->updateTextureFilter(GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, textureId); + + d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); QOpenGLRect srcRect(src.left(), src.bottom(), src.right(), src.top()); - - d->updateTextureFilter(GL_CLAMP_TO_EDGE, - state()->renderHints & QPainter::SmoothPixmapTransform, textureId); - d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); d->drawTexture(dest, srcRect, size, false); + return true; } @@ -1954,16 +1950,15 @@ void QOpenGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFra allOpaque &= (opacity >= 0.99f); } + transferMode(ImageOpacityArrayDrawingMode); + funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); GLuint id = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, pixmap); - transferMode(ImageOpacityArrayDrawingMode); + updateTextureFilter(GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform, id); bool isBitmap = pixmap.isQBitmap(); bool isOpaque = !isBitmap && (!pixmap.hasAlpha() || (hints & QPainter::OpaqueHint)) && allOpaque; - updateTextureFilter(GL_CLAMP_TO_EDGE, - q->state()->renderHints & QPainter::SmoothPixmapTransform, id); - // Setup for texture drawing currentBrush = noBrush; shaderManager->setSrcPixelType(isBitmap ? QOpenGLEngineShaderManager::PatternSrc From a43684c0da78e7187fd2f4fc05791064174da9de Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 4 Dec 2014 15:24:25 +0100 Subject: [PATCH 80/99] QMacStyle: Fix 32-bit build Again one of those CGRect vs. NSRect issues. Change-Id: Ia933cd6f002585e21247d2f9f85d2451db6dbaa0 Reviewed-by: Jake Petroules Reviewed-by: Timur Pocheptsov --- src/widgets/styles/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 00112a5c6d..5c17cdf489 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -5572,7 +5572,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex CGContextTranslateCTM(ctx, 0, rect.size.height); CGContextScaleCTM(ctx, 1, -1); } - [sl.cell drawBarInside:tdi.bounds flipped:NO]; + [sl.cell drawBarInside:NSRectFromCGRect(tdi.bounds) flipped:NO]; // No need to restore the CTM later, the context has been saved // and will be restored at the end of drawNSViewInRect() }); From 8015ffef1ea1f2745d6554b2bc57d150439292b3 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 26 Nov 2014 15:40:47 +0100 Subject: [PATCH 81/99] Fix QOpenGLWidget/QQuickWidget GUI freeze A window with a renderToTexture child uses the OpenGL path, but when we open a popup or dialog, that uses the raster compositor, which opens a separate surface. This patch fixes two issues when combining GL rendering with the raster compositor: 1. GL-rendered widgets were counted as part of the raster-rendered region, meaning that we did not punch a hole in the raster surface. 2. We did not destroy the surface when no longer needed. Task-number: QTBUG-41467 Change-Id: I2a2a0e860cce065b330df1c864d51fd02103aa1b Reviewed-by: Christian Stromme Reviewed-by: BogDan Vatra Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Laszlo Agocs --- .../platforms/android/qandroidplatformscreen.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp index 684ae64703..b70f936be1 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp @@ -284,9 +284,9 @@ void QAndroidPlatformScreen::doRedraw() if (m_dirtyRect.isEmpty()) return; - // Stop if there no visible raster windows. This is important because if we only have - // RasterGLSurface windows that have renderToTexture children (i.e. they need the - // OpenGL path) then we must bail out right now. + // Stop if there are no visible raster windows. If we only have RasterGLSurface + // windows that have renderToTexture children (i.e. they need the OpenGL path) then + // we do not need an overlay surface. bool hasVisibleRasterWindows = false; foreach (QAndroidPlatformWindow *window, m_windowStack) { if (window->window()->isVisible() && window->isRaster() && !qt_window_private(window->window())->compositing) { @@ -294,9 +294,13 @@ void QAndroidPlatformScreen::doRedraw() break; } } - if (!hasVisibleRasterWindows) + if (!hasVisibleRasterWindows) { + if (m_id != -1) { + QtAndroid::destroySurface(m_id); + m_id = -1; + } return; - + } QMutexLocker lock(&m_surfaceMutex); if (m_id == -1 && m_rasterSurfaces) { m_id = QtAndroid::createSurface(this, m_availableGeometry, true, m_depth); @@ -339,6 +343,7 @@ void QAndroidPlatformScreen::doRedraw() QRegion visibleRegion(m_dirtyRect); foreach (QAndroidPlatformWindow *window, m_windowStack) { if (!window->window()->isVisible() + || qt_window_private(window->window())->compositing || !window->isRaster()) continue; From c43133c81ea9abc10b42f1bd46c756167cad35d3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 3 Dec 2014 11:18:16 +0100 Subject: [PATCH 82/99] Make no_debug_info also strip out -gstabs Since QtWebKit started using stabs on some platforms to reducing memory pressure during linking, the tricks to strip out debug-info in the internals no longer worked because no-debug-info doesn't strip the -gstabs compiler and linker flags. Change-Id: I151088f29058b8fe50cba9aa3ec8ecd84b85d7d8 Reviewed-by: Jocelyn Turcotte Reviewed-by: Oswald Buddenhagen --- mkspecs/features/no_debug_info.prf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/no_debug_info.prf b/mkspecs/features/no_debug_info.prf index e05410d491..1307679a39 100644 --- a/mkspecs/features/no_debug_info.prf +++ b/mkspecs/features/no_debug_info.prf @@ -7,8 +7,8 @@ win32-msvc2*|wince*msvc* { QMAKE_CXXFLAGS_DEBUG -= -Zi QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zi } else { - QMAKE_CFLAGS -= -g -ggdb3 - QMAKE_CXXFLAGS -= -g -ggdb3 - QMAKE_LFLAGS -= -g -ggdb3 - QMAKE_LIBFLAGS -= -g -ggdb3 + QMAKE_CFLAGS -= -g -ggdb3 -gstabs + QMAKE_CXXFLAGS -= -g -ggdb3 -gstabs + QMAKE_LFLAGS -= -g -ggdb3 -gstabs + QMAKE_LIBFLAGS -= -g -ggdb3 -gstabs } From 0a91f1587830348bacd724a36650b62bbb366b63 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Dec 2014 11:30:56 +0100 Subject: [PATCH 83/99] Diaglib: Fix another typo in .pri file. Change-Id: I2888c4fb9947d61285a8a570661a29e61b10bbce Reviewed-by: Oliver Wolff --- tests/manual/diaglib/diaglib.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri index 05ecaf1444..e162d5f105 100644 --- a/tests/manual/diaglib/diaglib.pri +++ b/tests/manual/diaglib/diaglib.pri @@ -19,7 +19,7 @@ greaterThan(QT_MAJOR_VERSION, 4) { QT += gui-private core-private contains(QT, widgets) { HEADERS += \ - $$PWD/$$PWD/qwidgetdump.h + $$PWD/qwidgetdump.h SOURCES += \ $$PWD/qwidgetdump.cpp From b74e046174fa22399b9a2c944ccac56c49564ed6 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 2 Dec 2014 15:12:41 +0100 Subject: [PATCH 84/99] Doc: corrected autolink issues qalgorithms.qdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-40362 Change-Id: Ia609b68b52472342d791a032974a3d866e8d3266 Reviewed-by: Topi Reiniö --- src/corelib/tools/qalgorithms.qdoc | 88 +++++++++++++++--------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index 5e5a2b42e2..226a63ccae 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -168,43 +168,43 @@ \li STL function \row \li qBinaryFind - \li std::binary_search or std::lower_bound + \li \c std::binary_search or \c std::lower_bound \row \li qCopy - \li std::copy + \li \c std::copy \row \li qCopyBackward - \li std::copy_backward + \li \c std::copy_backward \row \li qEqual - \li std::equal + \li \c std::equal \row \li qFill - \li std::fill + \li \c std::fill \row \li qFind - \li std::find + \li \c std::find \row \li qCount - \li std::count + \li \c std::count \row \li qSort - \li std::sort + \li \c std::sort \row \li qStableSort - \li std::stable_sort + \li \c std::stable_sort \row \li qLowerBound - \li std::lower_bound + \li \c std::lower_bound \row \li qUpperBound - \li std::upper_bound + \li \c std::upper_bound \row \li qLess - \li std::less + \li \c std::less \row \li qGreater - \li std::greater + \li \c std::greater \endtable @@ -223,7 +223,7 @@ Instead, since it's not possible to pass a custom swapper functor to STL functions, the only workaround for a template specialization for qSwap() is - providing the same specialization for std::swap(). + providing the same specialization for \c std::swap(). \sa {container classes}, */ @@ -232,7 +232,7 @@ \relates \deprecated - Use std::copy instead. + Use \c std::copy instead. Copies the items from range [\a begin1, \a end1) to range [\a begin2, ...), in the order in which they appear. @@ -251,7 +251,7 @@ \relates \deprecated - Use std::copy_backward instead. + Use \c std::copy_backward instead. Copies the items from range [\a begin1, \a end1) to range [..., \a end2). @@ -270,7 +270,7 @@ \relates \deprecated - Use std::equal instead. + Use \c std::equal instead. Compares the items in the range [\a begin1, \a end1) with the items in the range [\a begin2, ...). Returns \c true if all the @@ -289,7 +289,7 @@ \relates \deprecated - Use std::fill instead. + Use \c std::fill instead. Fills the range [\a begin, \a end) with \a value. @@ -304,7 +304,7 @@ \deprecated \overload - Use std::fill instead. + Use \c std::fill instead. This is the same as qFill(\a{container}.begin(), \a{container}.end(), \a value); */ @@ -313,7 +313,7 @@ \relates \deprecated - Use std::find instead. + Use \c std::find instead. Returns an iterator to the first occurrence of \a value in a container in the range [\a begin, \a end). Returns \a end if \a @@ -337,16 +337,16 @@ \deprecated \overload - Use std::find instead. + Use \c std::find instead. - This is the same as qFind(\a{container}.constBegin(), \a{container}.constEnd(), value); + This is the same as qFind(\a{container}.constBegin(), \a{container}.constEnd(), \a value); */ /*! \fn void qCount(InputIterator begin, InputIterator end, const T &value, Size &n) \relates \deprecated - Use std::count instead. + Use \c std::count instead. Returns the number of occurrences of \a value in the range [\a begin, \a end), which is returned in \a n. \a n is never initialized, the count is added to \a n. @@ -367,7 +367,7 @@ \deprecated \overload - Use std::count instead. + Use \c std::count instead. Instead of operating on iterators, as in the other overload, this function operates on the specified \a container to obtain the number of instances @@ -378,7 +378,7 @@ \relates \deprecated - Use std::swap instead. + Use \c std::swap instead. Exchanges the values of variables \a var1 and \a var2. @@ -390,7 +390,7 @@ \relates \deprecated - Use std::sort instead. + Use \c std::sort instead. Sorts the items in range [\a begin, \a end) in ascending order using the quicksort algorithm. @@ -416,7 +416,7 @@ \deprecated \overload - Use std::sort instead. + Use \c std::sort instead. Uses the \a lessThan function instead of \c operator<() to compare the items. @@ -452,7 +452,7 @@ \deprecated \overload - Use std::sort instead. + Use \c std::sort instead. This is the same as qSort(\a{container}.begin(), \a{container}.end()); */ @@ -462,7 +462,7 @@ \relates \deprecated - Use std::stable_sort instead. + Use \c std::stable_sort instead. Sorts the items in range [\a begin, \a end) in ascending order using a stable sorting algorithm. @@ -490,7 +490,7 @@ \deprecated \overload - Use std::stable_sort instead. + Use \c std::stable_sort instead. Uses the \a lessThan function instead of \c operator<() to compare the items. @@ -522,7 +522,7 @@ \deprecated \overload - Use std::stable_sort instead. + Use \c std::stable_sort instead. This is the same as qStableSort(\a{container}.begin(), \a{container}.end()); */ @@ -531,7 +531,7 @@ \relates \deprecated - Use std::lower_bound instead. + Use \c std::lower_bound instead. Performs a binary search of the range [\a begin, \a end) and returns the position of the first occurrence of \a value. If no @@ -561,7 +561,7 @@ \deprecated \overload - Use std::lower_bound instead. + Use \c std::lower_bound instead. Uses the \a lessThan function instead of \c operator<() to compare the items. @@ -576,7 +576,7 @@ \deprecated \overload - Use std::lower_bound instead. + Use \c std::lower_bound instead. For read-only iteration over containers, this function is broadly equivalent to qLowerBound(\a{container}.begin(), \a{container}.end(), value). However, since it @@ -588,7 +588,7 @@ \relates \deprecated - Use std::upper_bound instead. + Use \c std::upper_bound instead. Performs a binary search of the range [\a begin, \a end) and returns the position of the one-past-the-last occurrence of \a @@ -618,7 +618,7 @@ \deprecated \overload - Use std::upper_bound instead. + Use \c std::upper_bound instead. Uses the \a lessThan function instead of \c operator<() to compare the items. @@ -633,9 +633,9 @@ \deprecated \overload - Use std::upper_bound instead. + Use \c std::upper_bound instead. - This is the same as qUpperBound(\a{container}.begin(), \a{container}.end(), value); + This is the same as qUpperBound(\a{container}.begin(), \a{container}.end(), \a value); */ @@ -643,7 +643,7 @@ \relates \deprecated - Use std::binary_search or std::lower_bound instead. + Use \c std::binary_search or \c std::lower_bound instead. Performs a binary search of the range [\a begin, \a end) and returns the position of an occurrence of \a value. If there are @@ -670,7 +670,7 @@ \deprecated \overload - Use std::binary_search or std::lower_bound instead. + Use \c std::binary_search or \c std::lower_bound instead. Uses the \a lessThan function instead of \c operator<() to compare the items. @@ -685,9 +685,9 @@ \deprecated \overload - Use std::binary_search or std::lower_bound instead. + Use \c std::binary_search or \c std::lower_bound instead. - This is the same as qBinaryFind(\a{container}.begin(), \a{container}.end(), value); + This is the same as qBinaryFind(\a{container}.begin(), \a{container}.end(), \a value); */ @@ -727,7 +727,7 @@ \relates \deprecated - Use std::less instead. + Use \c std::less instead. Returns a functional object, or functor, that can be passed to qSort() or qStableSort(). @@ -743,7 +743,7 @@ \relates \deprecated - Use std::greater instead. + Use \c std::greater instead. Returns a functional object, or functor, that can be passed to qSort() or qStableSort(). From 05ad2fc2f4267defd4b9b7f0b8706d2624f10d12 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Dec 2014 08:30:12 +0100 Subject: [PATCH 85/99] Fix warnings by MSVC 64 in qtranslator.cpp. kernel\qtranslator.cpp(880) : warning C4267: 'initializing' : conversion from 'size_t' to 'const uint', possible loss of data kernel\qtranslator.cpp(881) : warning C4267: 'initializing' : conversion from 'size_t' to 'const uint', possible loss of data kernel\qtranslator.cpp(882) : warning C4267: 'initializing' : conversion from 'size_t' to 'const uint', possible loss of data kernel\qtranslator.cpp(975) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data Task-number: QTBUG-39757 Change-Id: I54f130e1d83ecc1623ab3c7b9b4fb14de6351625 Reviewed-by: Albert Astals Cid Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qtranslator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 22bf8fdc21..c2d8397ae0 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -877,9 +877,9 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context, { const uchar *tn = 0; uint tn_length = 0; - const uint sourceTextLen = strlen(sourceText); - const uint contextLen = strlen(context); - const uint commentLen = strlen(comment); + const uint sourceTextLen = uint(strlen(sourceText)); + const uint contextLen = uint(strlen(context)); + const uint commentLen = uint(strlen(comment)); for (;;) { uchar tag = 0; @@ -972,7 +972,7 @@ QString QTranslatorPrivate::do_translate(const char *context, const char *source return QString(); c = contextArray + (2 + (hTableSize << 1) + (off << 1)); - const int contextLen = strlen(context); + const uint contextLen = uint(strlen(context)); for (;;) { quint8 len = read8(c++); if (len == 0) From 8ee7aa78afd3d3dee6e333953d51aa72cb227441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 5 Dec 2014 15:14:45 +0100 Subject: [PATCH 86/99] qt_mac_loadMenuNib: Prevent stale NIB files by diffing file size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we're changing the contents of the nib files in Qt, we need to overwrite the nib files that we write to /tmp, as QFile::copy() does not overwrite files. This also catches the case where the files in /tmp are empty due to a possible broken qrc-run, where re-runs of qrc to fix the resources would still leave the corrupt nib in /tmp, resulting in: -[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver? And as a consequence: qt_mac_loadMenuNib: could not instantiate nib ASSERT: "mainMenu" in file qcocoamenuloader.mm, line 154 Change-Id: I2907a32d1a56c23a27343c81839a06b65a529372 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoamenuloader.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index 9340e945fb..0075dea805 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -87,7 +87,11 @@ void qt_mac_loadMenuNib(QCocoaMenuLoader *qtMenuLoader) return; } foreach (const QFileInfo &file, nibResource.entryInfoList()) { - QFile::copy(file.absoluteFilePath(), nibDir + QLatin1String("/") + file.fileName()); + QFileInfo destinationFile(nibDir + QLatin1String("/") + file.fileName()); + if (destinationFile.exists() && destinationFile.size() != file.size()) + QFile::remove(destinationFile.absoluteFilePath()); + + QFile::copy(file.absoluteFilePath(), destinationFile.absoluteFilePath()); } // Load and instantiate nib file from temp From aca0fb17862875209a234f0384b981efe831f4b6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Dec 2014 09:06:33 +0100 Subject: [PATCH 87/99] Update window flags from QToolBarPrivate::endDrag(). Activate previously #ifdef'ed code which cleared the Qt::X11BypassWindowManager hint. With the hint set, the tool bar stays on top and does not get deactivated along with the application by the WM. Task-number: QTBUG-41189 Change-Id: I6f3f334860e46dd4867f5942f15e5a090340f2d7 Reviewed-by: Andy Shaw --- src/widgets/widgets/qtoolbar.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 17e64be4f4..77119a0d7d 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -220,10 +220,8 @@ void QToolBarPrivate::endDrag() if (!layout->plug(state->widgetItem)) { if (q->isFloatable()) { layout->restore(); -#if defined(Q_WS_X11) || defined(Q_WS_MAC) setWindowState(true); // gets rid of the X11BypassWindowManager window flag // and activates the resizer -#endif q->activateWindow(); } else { layout->revert(state->widgetItem); From 370d421495a200860c9fb583b526dcf8bf8145fb Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Nov 2014 11:47:50 +0100 Subject: [PATCH 88/99] Widgets: be more careful when setting focus on touch release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An application might choose to change focus when receiving mouse/touch press/move events. This is in conflict with Qt assigning focus on touch release (QPlatformIntegration::SetFocusOnTouchRelease), since Qt might then reassign focus to something else. An example of this is seen with the "frozencolumn" example. Here, when the user double clicks on a cell, the application creates an 'edit' widget inside the cell that gets focus. But at soon as the last release is sent, Qt will change focus to the focus proxy of QScrollArea instead. This patch will introduce an exception to setting focus on release, so that we only set focus if we detect that focus didn't change (by the app) while processing press/move events. Task-number: QTBUG-39390 Change-Id: I7b398b59e3175265afd2fcd938e11f88155abc89 Reviewed-by: Laszlo Agocs Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qapplication.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 269fe452c1..b7d0869289 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -4172,11 +4172,13 @@ void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, QEven { const bool setFocusOnRelease = QGuiApplication::styleHints()->setFocusOnTouchRelease(); Qt::FocusPolicy focusPolicy = Qt::ClickFocus; + static QPointer focusedWidgetOnTouchBegin = 0; switch (event->type()) { case QEvent::MouseButtonPress: case QEvent::MouseButtonDblClick: case QEvent::TouchBegin: + focusedWidgetOnTouchBegin = QApplication::focusWidget(); if (setFocusOnRelease) return; break; @@ -4184,6 +4186,11 @@ void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, QEven case QEvent::TouchEnd: if (!setFocusOnRelease) return; + if (focusedWidgetOnTouchBegin != QApplication::focusWidget()) { + // Focus widget was changed while delivering press/move events. + // To not interfere with application logic, we leave focus as-is + return; + } break; case QEvent::Wheel: focusPolicy = Qt::WheelFocus; From d52ea19862461c7f6f49f8233594d83e1c00cde8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 2 Dec 2014 16:59:53 +0100 Subject: [PATCH 89/99] Take ShareOpenGLContexts into account in QOpenGLWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While the attribute was originally intended for widgets (QOpenGLWidget, QQuickWidget) only, we need a way to get multiple QOpenGLWindow instances whose contexts share with each other. Change-Id: Ib983c9c2815b0a3911bc504ffad8d8dddad192aa Reviewed-by: Jørgen Lind --- src/gui/kernel/qopenglwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp index 158fb248dc..c37974c429 100644 --- a/src/gui/kernel/qopenglwindow.cpp +++ b/src/gui/kernel/qopenglwindow.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,10 @@ QT_BEGIN_NAMESPACE this way they do not have to redraw the entire window content on each paintGL() call. + Similarly to QOpenGLWidget, QOpenGLWindow supports the Qt::AA_ShareOpenGLContexts + attribute. When enabled, the OpenGL contexts of all QOpenGLWindow instances will share + with each other. This allows accessing each other's shareable OpenGL resources. + For more information on graphics in Qt, see \l {Graphics}. */ @@ -196,6 +201,7 @@ public: if (!context) { context.reset(new QOpenGLContext); + context->setShareContext(qt_gl_global_share_context()); context->setFormat(q->requestedFormat()); if (!context->create()) qWarning("QOpenGLWindow::beginPaint: Failed to create context"); From 1d61e3267da7ff4a2c437ed7c6a591e13eb92076 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Fri, 5 Dec 2014 19:46:01 +0100 Subject: [PATCH 90/99] doc: Clarify \inqmlmodule usage The \inqmlmodule command only accepts one parameter: the name of the module. This was producing some confusion, since in qtdeclarative there were some wrong import statements and it wasn't obvious which command was producing them. Change-Id: Idb41f12f20f05757942b0957c512d195ec8500b3 Reviewed-by: Mitch Curtis --- src/tools/qdoc/doc/examples/componentset/ProgressBar.qml | 2 +- src/tools/qdoc/doc/examples/componentset/Switch.qml | 2 +- src/tools/qdoc/doc/examples/componentset/TabWidget.qml | 2 +- src/tools/qdoc/doc/examples/qml.qdoc.sample | 2 +- src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc | 7 ++++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml b/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml index 72e0815d19..f7aeb29865 100644 --- a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml +++ b/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml @@ -42,7 +42,7 @@ import QtQuick 1.0 /*! \qmltype ProgressBar - \inqmlmodule UIComponents 1.0 + \inqmlmodule UIComponents \brief A component that shows the progress of an event A ProgressBar shows the linear progress of an event as its \l value. diff --git a/src/tools/qdoc/doc/examples/componentset/Switch.qml b/src/tools/qdoc/doc/examples/componentset/Switch.qml index ae760e566e..7dee33eb3c 100644 --- a/src/tools/qdoc/doc/examples/componentset/Switch.qml +++ b/src/tools/qdoc/doc/examples/componentset/Switch.qml @@ -42,7 +42,7 @@ import QtQuick 1.0 /*! \qmltype ToggleSwitch - \inqmlmodule UIComponents 1.0 + \inqmlmodule UIComponents \brief A component that can be turned on or off A toggle switch has two states: an \c on and an \c off state. The \c off diff --git a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml b/src/tools/qdoc/doc/examples/componentset/TabWidget.qml index 337f23fdad..0fbac1604e 100644 --- a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml +++ b/src/tools/qdoc/doc/examples/componentset/TabWidget.qml @@ -42,7 +42,7 @@ import QtQuick 1.0 /*! \qmltype TabWidget - \inqmlmodule UIComponents 1.0 + \inqmlmodule UIComponents \brief A widget that places its children as tabs A TabWidget places its children as tabs in a view. Selecting diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample index d913c6f164..11713b4e4d 100644 --- a/src/tools/qdoc/doc/examples/qml.qdoc.sample +++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample @@ -28,7 +28,7 @@ //![qmltype] \qmltype TextEdit \instantiates QQuickTextEdit - \inqmlmodule QtQuick 2 + \inqmlmodule QtQuick \ingroup qtquick-visual \ingroup qtquick-input \inherits Item diff --git a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc index b50a343a22..1d78eff386 100644 --- a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc @@ -1376,9 +1376,10 @@ \section1 \\inqmlmodule A QML class may belong to a \l{qmlmodule-command}{QML module} by inserting - the \l{inqmlmodule-command}{\\inqmlmodule} command as a topic command. - Every member of a group must be linked to using the module name and two - colons (\c{::}). + the \l{inqmlmodule-command}{\\inqmlmodule} command as a topic command, with + the module name (without a version number) as the only argument. Every + member of a group must be linked to using the module name and two colons + (\c{::}). \code \qmltype ClickableButton From 1b548faa773a2346a63c018dcd6f6756742a2f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Tue, 28 Oct 2014 01:29:14 +0100 Subject: [PATCH 91/99] Added support for CTRL key modifier to Android builds. Change-Id: Ib3eddb33348c54cec6cee62abdf69104059affb0 Reviewed-by: Christian Stromme --- .../platforms/android/androidjniinput.cpp | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 595892c1d1..3a80f9437a 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -638,6 +638,25 @@ namespace QtAndroidInput } } + static Qt::KeyboardModifiers mapAndroidModifiers(jint modifiers) + { + Qt::KeyboardModifiers qmodifiers; + + if (modifiers & 0x00000001) // META_SHIFT_ON + qmodifiers |= Qt::ShiftModifier; + + if (modifiers & 0x00000002) // META_ALT_ON + qmodifiers |= Qt::AltModifier; + + if (modifiers & 0x00000004) // META_SYM_ON + qmodifiers |= Qt::MetaModifier; + + if (modifiers & 0x00001000) // META_CTRL_ON + qmodifiers |= Qt::ControlModifier; + + return qmodifiers; + } + // maps 0 to the empty string, and anything else to a single-character string static inline QString toString(jint unicode) { @@ -646,40 +665,20 @@ namespace QtAndroidInput static void keyDown(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier) { - Qt::KeyboardModifiers modifiers; - if (modifier & 1) - modifiers |= Qt::ShiftModifier; - - if (modifier & 2) - modifiers |= Qt::AltModifier; - - if (modifier & 4) - modifiers |= Qt::MetaModifier; - QWindowSystemInterface::handleKeyEvent(0, QEvent::KeyPress, mapAndroidKey(key), - modifiers, + mapAndroidModifiers(modifier), toString(unicode), false); } static void keyUp(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier) { - Qt::KeyboardModifiers modifiers; - if (modifier & 1) - modifiers |= Qt::ShiftModifier; - - if (modifier & 2) - modifiers |= Qt::AltModifier; - - if (modifier & 4) - modifiers |= Qt::MetaModifier; - QWindowSystemInterface::handleKeyEvent(0, QEvent::KeyRelease, mapAndroidKey(key), - modifiers, + mapAndroidModifiers(modifier), toString(unicode), false); } From b5f8502c129c20b3aa3234a3e1c251102d36cdba Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 14 Nov 2014 17:37:34 +0100 Subject: [PATCH 92/99] Styles: improve SH_Header_ArrowAlignment handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs were wrong, and the returned values from some styles did not match reality, so fix that. Again, this style hint was not used at all within QWidgets... Task-number: QTBUG-629 Change-Id: Ie6ff80fd09bc3292ba3d787ccca4d6f4c0056e89 Reviewed-by: Friedemann Kleint Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/styles/qcommonstyle.cpp | 5 ++++- src/widgets/styles/qstyle.cpp | 3 ++- src/widgets/styles/qwindowsvistastyle.cpp | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 1c5dcf5f0a..aeffa6195d 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4907,10 +4907,13 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_TabBar_Alignment: - case SH_Header_ArrowAlignment: ret = Qt::AlignLeft; break; + case SH_Header_ArrowAlignment: + ret = Qt::AlignRight | Qt::AlignVCenter; + break; + case SH_TitleBar_AutoRaise: ret = false; break; diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 856ec271fb..ba5bd717b6 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1663,7 +1663,8 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_Header_ArrowAlignment The placement of the sorting indicator may appear in list or table headers. Possible values - are Qt::Left or Qt::Right. + are Qt::Alignment values (that is, an OR combination of + Qt::AlignmentFlag flags). \value SH_Slider_SnapToValue Sliders snap to values while moving, as they do on Windows. diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 463b120e04..42a85e8f64 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2112,6 +2112,9 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co else ret = -1; break; + case SH_Header_ArrowAlignment: + ret = Qt::AlignTop | Qt::AlignHCenter; + break; default: ret = QWindowsXPStyle::styleHint(hint, option, widget, returnData); break; From b39bbc95f685e59744fd282b006d3fa7b247ed36 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 12 Nov 2014 14:13:13 +0100 Subject: [PATCH 93/99] QHeaderView: take the sort indicator into account when eliding text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By adding PM_HeaderMarkSize to the margins if the section is showing a sort indicator. Turns out that that particular enum was actually unused in QtWidgets (!), so tune the value to match reality. Task-number: QTBUG-629 Change-Id: I8bc70451656d634a064c8b5014e449977c55aa9d Reviewed-by: Cristian Oneț Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Friedemann Kleint --- src/widgets/itemviews/qheaderview.cpp | 11 +++++++++-- src/widgets/styles/qcommonstyle.cpp | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index b609134322..beade16339 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -1550,7 +1550,7 @@ int QHeaderView::minimumSectionSize() const Q_D(const QHeaderView); if (d->minimumSectionSize == -1) { QSize strut = QApplication::globalStrut(); - int margin = style()->pixelMetric(QStyle::PM_HeaderMargin, 0, this); + int margin = 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, 0, this); if (d->orientation == Qt::Horizontal) return qMax(strut.width(), (fontMetrics().maxWidth() + margin)); return qMax(strut.height(), (fontMetrics().height() + margin)); @@ -2663,7 +2663,14 @@ void QHeaderView::paintSection(QPainter *painter, const QRect &rect, int logical opt.iconAlignment = Qt::AlignVCenter; opt.text = d->model->headerData(logicalIndex, d->orientation, Qt::DisplayRole).toString(); - const int margin = 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, 0, this); + + int margin = 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, 0, this); + + const Qt::Alignment headerArrowAlignment = static_cast(style()->styleHint(QStyle::SH_Header_ArrowAlignment, 0, this)); + const bool isHeaderArrowOnTheSide = headerArrowAlignment & Qt::AlignVCenter; + if (isSortIndicatorShown() && sortIndicatorSection() == logicalIndex && isHeaderArrowOnTheSide) + margin += style()->pixelMetric(QStyle::PM_HeaderMarkSize, 0, this); + if (d->textElideMode != Qt::ElideNone) opt.text = opt.fontMetrics.elidedText(opt.text, d->textElideMode , rect.width() - margin); diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index aeffa6195d..c688462794 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4587,7 +4587,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid ret = int(QStyleHelper::dpiScaled(4.)); break; case PM_HeaderMarkSize: - ret = int(QStyleHelper::dpiScaled(32.)); + ret = int(QStyleHelper::dpiScaled(16.)); break; case PM_HeaderGripMargin: ret = int(QStyleHelper::dpiScaled(4.)); From 66e48d2c2fad494504cad0b699300c750fa28383 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 8 Dec 2014 16:14:15 +0100 Subject: [PATCH 94/99] Support vertical sliders on Android There is no such thing as a vertical slider in the native Android style. Therefore, we need to rotate the painter in order to draw one. Task-number: QTBUG-41992 Change-Id: Ibe2bf1d7fa27756aad0b8469c8752d6d3e848527 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/widgets/styles/qandroidstyle.cpp | 32 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index 5b4b346da9..a5a75dae02 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -1719,28 +1719,43 @@ void QAndroidStyle::AndroidSeekBarControl::drawControl(const QStyleOption *optio qstyleoption_cast(option)) { double factor = double(styleOption->sliderPosition - styleOption->minimum) / double(styleOption->maximum - styleOption->minimum); + + // Android does not have a vertical slider. To support the vertical orientation, we rotate + // the painter and pretend that we are horizontal. + if (styleOption->orientation == Qt::Vertical) + factor = 1 - factor; + if (m_progressDrawable->type() == QAndroidStyle::Layer) { QAndroidStyle::AndroidDrawable *clipDrawable = static_cast(m_progressDrawable)->layer(m_progressId); if (clipDrawable->type() == QAndroidStyle::Clip) - static_cast(clipDrawable)->setFactor(factor, styleOption->orientation); + static_cast(clipDrawable)->setFactor(factor, Qt::Horizontal); else - static_cast(m_progressDrawable)->setFactor(m_progressId, factor, styleOption->orientation); + static_cast(m_progressDrawable)->setFactor(m_progressId, factor, Qt::Horizontal); } const AndroidDrawable *drawable = m_seekBarThumb; if (drawable->type() == State) drawable = static_cast(m_seekBarThumb)->bestAndroidStateMatch(option); QStyleOption copy(*option); + + p->save(); + + if (styleOption->orientation == Qt::Vertical) { + // rotate the painter, and transform the rectangle to match + p->rotate(90); + copy.rect = QRect(copy.rect.y(), copy.rect.x() - copy.rect.width(), copy.rect.height(), copy.rect.width()); + } + copy.rect.setHeight(m_progressDrawable->size().height()); copy.rect.setWidth(copy.rect.width() - drawable->size().width()); const int yTranslate = abs(drawable->size().height() - copy.rect.height()) / 2; copy.rect.translate(drawable->size().width() / 2, yTranslate); m_progressDrawable->draw(p, ©); - if (styleOption->orientation == Qt::Vertical) - qCritical() << "Vertical slider are not supported"; int pos = copy.rect.width() * factor - drawable->size().width() / 2; copy.rect.translate(pos, -yTranslate); copy.rect.setSize(drawable->size()); m_seekBarThumb->draw(p, ©); + + p->restore(); } } @@ -1772,8 +1787,13 @@ QRect QAndroidStyle::AndroidSeekBarControl::subControlRect(const QStyleOptionCom QRect r(option->rect); double factor = double(styleOption->sliderPosition - styleOption->minimum) / (styleOption->maximum - styleOption->minimum); - int pos = option->rect.width() * factor - double(drawable->size().width() / 2); - r.setX(r.x() + pos); + if (styleOption->orientation == Qt::Vertical) { + int pos = option->rect.height() * (1 - factor) - double(drawable->size().height() / 2); + r.setY(r.y() + pos); + } else { + int pos = option->rect.width() * factor - double(drawable->size().width() / 2); + r.setX(r.x() + pos); + } r.setSize(drawable->size()); return r; } From 9ccd359be8a3fa1a050f839f99ce5f00aa2c9ea6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 9 Dec 2014 10:46:20 +0100 Subject: [PATCH 95/99] Attempt to make the positioning test of QWindow more reliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The part of the test that verifies that setFramePosition moves the window successfully appears to be very unreliable in the CI system. The "tested" frame position is calculated to be at (40, 40) relative to the top left of the available screen geometry, which can be non-zero due to task bars and similar system ui elements. However that position appears to be unreliable in the sense that the window manager doesn't seem to always respect that. So instead let's try placing the window (by frame position) in the center of the screen instead. Change-Id: I96fe6c37e748fc18262632b5effe5a9e90dc0028 Reviewed-by: Jørgen Lind --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 46b33e5d39..2b28f0a1d4 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -301,7 +301,7 @@ void tst_QWindow::positioning() // if our positioning is actually fully respected by the window manager // test whether it correctly handles frame positioning as well if (originalPos == geometry.topLeft() && (originalMargins.top() != 0 || originalMargins.left() != 0)) { - QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().topLeft() + QPoint(40, 40); + QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center(); window.reset(); window.setFramePosition(framePos); From a6436ff5592332d5d06c6ee1806dc132306d5f3e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 Dec 2014 13:58:13 +0100 Subject: [PATCH 96/99] Windows: Limit cursor cache. Prevent the cursor cache from growing indefinitely hitting GDI resource limits if new pixmap cursors are created repetitively by purging out all-noncurrent pixmap cursors. Change-Id: I4a3bbd6235af13e306ca84ac6fea3fcd69d53279 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowscursor.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index f5d6c140bf..d10c7fdb20 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -570,8 +570,21 @@ QWindowsWindowCursor QWindowsCursor::pixmapWindowCursor(const QCursor &c) { const QWindowsCursorCacheKey cacheKey(c); CursorCache::iterator it = m_cursorCache.find(cacheKey); - if (it == m_cursorCache.end()) + if (it == m_cursorCache.end()) { + if (m_cursorCache.size() > 50) { + // Prevent the cursor cache from growing indefinitely hitting GDI resource + // limits if new pixmap cursors are created repetitively by purging out + // all-noncurrent pixmap cursors (QTBUG-43515) + const HCURSOR currentCursor = GetCursor(); + for (it = m_cursorCache.begin(); it != m_cursorCache.end() ; ) { + if (it.key().bitmapCacheKey && it.value().handle() != currentCursor) + it = m_cursorCache.erase(it); + else + ++it; + } + } it = m_cursorCache.insert(cacheKey, QWindowsWindowCursor(c)); + } return it.value(); } From 5a6735316aad213f9156eb32d56eb65271b16910 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 5 Dec 2014 10:24:09 +0100 Subject: [PATCH 97/99] Do not initialize accessibility code by default on startup. Instead listen for if the accessibility service is running or not by implementing AccessibilityStateChangeListener. This seems to work smoothly when turning on or off TalkBack. This should also improve startup time. Change-Id: I3eb7d6cb9c9c1618afbb59675e4e089c9159019c Reviewed-by: Christian Stromme --- src/android/accessibility/jar/jar.pri | 3 +- .../QtAccessibilityDelegate.java | 74 +++++++++++++++++-- src/android/android.pro | 1 + .../qt5/android/QtActivityDelegate.java | 55 ++++---------- 4 files changed, 86 insertions(+), 47 deletions(-) diff --git a/src/android/accessibility/jar/jar.pri b/src/android/accessibility/jar/jar.pri index 23b3ff7087..3ae9fed59d 100644 --- a/src/android/accessibility/jar/jar.pri +++ b/src/android/accessibility/jar/jar.pri @@ -4,7 +4,8 @@ API_VERSION = android-16 PATHPREFIX = $$PWD/src/org/qtproject/qt5/android/accessibility -JAVACLASSPATH += $$PWD/src/ +JAVACLASSPATH += $$PWD/src/ \ + $$DESTDIR/QtAndroid-bundled.jar JAVASOURCES += \ $$PATHPREFIX/QtAccessibilityDelegate.java \ $$PATHPREFIX/QtNativeAccessibility.java diff --git a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java index a4626b9bb1..cc2aba7937 100644 --- a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java +++ b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java @@ -43,6 +43,7 @@ package org.qtproject.qt5.android.accessibility; import android.accessibilityservice.AccessibilityService; +import android.app.Activity; import android.graphics.Rect; import android.os.Bundle; import android.util.Log; @@ -60,6 +61,8 @@ import android.content.Context; import java.util.LinkedList; import java.util.List; +import org.qtproject.qt5.android.QtActivityDelegate; + public class QtAccessibilityDelegate extends View.AccessibilityDelegate { private static final String TAG = "Qt A11Y"; @@ -72,8 +75,11 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate // Pretend to be an inner class of the QtSurface. private static final String DEFAULT_CLASS_NAME = "$VirtualChild"; - private final View m_view; - private final AccessibilityManager m_manager; + private View m_view = null; + private AccessibilityManager m_manager; + private QtActivityDelegate m_activityDelegate; + private Activity m_activity; + private ViewGroup m_layout; // The accessible object that currently has the "accessibility focus" // usually indicated by a yellow rectangle on screen. @@ -95,17 +101,71 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate } } - public QtAccessibilityDelegate(View host) + public QtAccessibilityDelegate(Activity activity, ViewGroup layout, QtActivityDelegate activityDelegate) { - m_view = host; - m_view.setOnHoverListener(new HoverEventListener()); - m_manager = (AccessibilityManager) host.getContext() - .getSystemService(Context.ACCESSIBILITY_SERVICE); + m_activity = activity; + m_layout = layout; + m_activityDelegate = activityDelegate; + + m_manager = (AccessibilityManager) m_activity.getSystemService(Context.ACCESSIBILITY_SERVICE); + if (m_manager != null) { + AccessibilityManagerListener accServiceListener = new AccessibilityManagerListener(); + if (!m_manager.addAccessibilityStateChangeListener(accServiceListener)) + Log.w("Qt A11y", "Could not register a11y state change listener"); + if (m_manager.isEnabled()) + accServiceListener.onAccessibilityStateChanged(true); + } + // Enable Qt Accessibility so that notifications are enabled QtNativeAccessibility.setActive(true); } + private class AccessibilityManagerListener implements AccessibilityManager.AccessibilityStateChangeListener + { + @Override + public void onAccessibilityStateChanged(boolean enabled) + { + if (enabled) { + // The accessibility code depends on android API level 16, so dynamically resolve it + if (android.os.Build.VERSION.SDK_INT >= 16) { + try { + View view = m_view; + if (view == null) { + view = new View(m_activity); + view.setId(View.NO_ID); + } + + // ### Keep this for debugging for a while. It allows us to visually see that our View + // ### is on top of the surface(s) + // ColorDrawable color = new ColorDrawable(0x80ff8080); //0xAARRGGBB + // view.setBackground(color); + view.setAccessibilityDelegate(QtAccessibilityDelegate.this); + + // if all is fine, add it to the layout + if (m_view == null) { + //m_layout.addAccessibilityView(view); + m_layout.addView(view, m_activityDelegate.getSurfaceCount(), + new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + } + m_view = view; + + m_view.setOnHoverListener(new HoverEventListener()); + } catch (Exception e) { + // Unknown exception means something went wrong. + Log.w("Qt A11y", "Unknown exception: " + e.toString()); + } + } + } else { + if (m_view != null) { + m_layout.removeView(m_view); + m_view = null; + } + } + } + } + + @Override public AccessibilityNodeProvider getAccessibilityNodeProvider(View host) { diff --git a/src/android/android.pro b/src/android/android.pro index 55a94a2c06..b17dd15cd4 100644 --- a/src/android/android.pro +++ b/src/android/android.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs +CONFIG += ordered SUBDIRS = jar java templates accessibility diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 97a632972b..4d16d7e13f 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -127,7 +127,6 @@ public class QtActivityDelegate private boolean m_quitApp = true; private Process m_debuggerProcess = null; // debugger process private View m_dummyView = null; - private View m_accView = null; private boolean m_keyboardIsVisible = false; public boolean m_backKeyPressedSent = false; private long m_showHideTimeStamp = System.nanoTime(); @@ -804,6 +803,22 @@ public class QtActivityDelegate m_nativeViews = new HashMap(); m_activity.registerForContextMenu(m_layout); + // Initialize accessibility + try { + final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; + Class qtDelegateClass = Class.forName(a11yDelegateClassName); + Constructor constructor = qtDelegateClass.getConstructor(android.app.Activity.class, + android.view.ViewGroup.class, + this.getClass()); + Object accessibilityDelegate = constructor.newInstance(m_activity, m_layout, this); + } catch (ClassNotFoundException e) { + // Class not found is fine since we are compatible with Android API < 16, but the function will + // only be available with that API level. + } catch (Exception e) { + // Unknown exception means something went wrong. + Log.w("Qt A11y", "Unknown exception: " + e.toString()); + } + m_activity.setContentView(m_layout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); @@ -1184,44 +1199,6 @@ public class QtActivityDelegate m_layout.addView(surface, surfaceCount); m_surfaces.put(id, surface); - - // Initialize Accessibility - // The accessibility code depends on android API level 16, so dynamically resolve it - if (android.os.Build.VERSION.SDK_INT >= 16) { - if (m_accView == null) { - try { - View accView = new View(m_activity); - accView.setId(View.NO_ID); - - // ### Keep this for debugging for a while. It allows us to visually see that our View - // ### is on top of the surface(s) - // ColorDrawable color = new ColorDrawable(0x80ff8080); //0xAARRGGBB - // accView.setBackground(color); - - final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; - Class qtDelegateClass = Class.forName(a11yDelegateClassName); - Constructor constructor = qtDelegateClass.getConstructor(Class.forName("android.view.View")); - Object accessibilityDelegate = constructor.newInstance(accView); - - Class a11yDelegateClass = Class.forName("android.view.View$AccessibilityDelegate"); - Method setDelegateMethod = accView.getClass().getMethod("setAccessibilityDelegate", a11yDelegateClass); - setDelegateMethod.invoke(accView, accessibilityDelegate); - - // if all is fine, add it to the layout - m_layout.addView(accView, surfaceCount + 1, - new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - - m_accView = accView; - } catch (ClassNotFoundException e) { - // Class not found is fine since we are compatible with Android API < 16, but the function will - // only be available with that API level. - } catch (Exception e) { - // Unknown exception means something went wrong. - Log.w("Qt A11y", "Unknown exception: " + e.toString()); - } - } - } - } public void setSurfaceGeometry(int id, int x, int y, int w, int h) { From 404f4281fda764cafdaa5635db995dabc4f1de8c Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Tue, 9 Dec 2014 09:27:53 +0300 Subject: [PATCH 98/99] qimage_conversions.cpp: Fix build on big endian systems Change-Id: I8149eb2deaa101daf85a957ff48c3a7140c43bbc Reviewed-by: Timo Jyrinki Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qimage_conversions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 17563b19c3..858a0d9f21 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -2252,7 +2252,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat convert_ARGB_to_ARGB_PM, #else 0, - 0 + 0, #endif 0, 0, 0, 0 }, // Format_RGBA8888 @@ -2281,7 +2281,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat #else 0, 0, - 0 + 0, #endif 0, 0, 0, 0 }, // Format_RGBA8888_Premultiplied From b9547af45ea2bbbc634722c1ef41afdb54216ce2 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 9 Dec 2014 17:32:59 +0100 Subject: [PATCH 99/99] Android: Make cursor keys work again On Android, we disable mouse selection, since that does not work well with touch screens. In change a03a69efb9ed89cd4a90878eda20, we accidentally disabled keyboard selection as well. Unfortunately, disabling keyboard selection will disable all keyboard movement. This change re-enables TextSelectableByKeyboard. Task-number: QTBUG-42991 Change-Id: Ie63ed3d88a0abcb72f04e0ec60a5b91c0b14a47e Reviewed-by: Christian Stromme --- src/widgets/widgets/qwidgettextcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index dfec6a14d4..8c48533a03 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -110,7 +110,7 @@ QWidgetTextControlPrivate::QWidgetTextControlPrivate() #ifndef Q_OS_ANDROID interactionFlags(Qt::TextEditorInteraction), #else - interactionFlags(Qt::TextEditable), + interactionFlags(Qt::TextEditable | Qt::TextSelectableByKeyboard), #endif dragEnabled(true), #ifndef QT_NO_DRAGANDDROP